/* .dropdown-menu li {
    position: relative;
    }
    .dropdown-menu .dropdown-submenu {
    display: none;
    position: absolute;
    right: 30%;
    top: 40px;
    }
    .dropdown-menu .dropdown-submenu-left {
    right: 70%;
    left: 70%;
    }
    .dropdown-menu > li:hover > .dropdown-submenu {
    display: block;
    } */

[type='checkbox']:checked,
[type='radio']:checked,
.dark [type='checkbox']:checked,
.dark [type='radio']:checked {
    background-color: var(--site_color) !important;
}

[type='checkbox']:focus,
[type='radio']:focus {
    --tw-ring-color: none !important;
}

.invalid-feedback {
    font-size: 12px;
    font-weight: bolder;
    color: red;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

[multiple],
[type=date],
[type=datetime-local],
[type=email],
[type=month],
[type=number],
[type=password],
[type=search],
[type=tel],
[type=text],
[type=time],
[type=url],
[type=week],
select,
textarea {
    border-color: #D8D8D8 !important;
}

.select2-results__option,
.select2-selection__rendered {
    font-family: 'Fira Sans';
}

.select2-container--default .select2-selection--single {
    border: 1px solid rgb(216 216 216 / var(--tw-border-opacity)) !important;
    border-radius: 0px !important;
}

body, .patient-sidebar, .mg-main-panel, .dataTables_wrapper, table, th, td, input, select, button, textarea, .dataTables_info, .paginate_button, label {
    font-family: 'Inter', 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif !important;
}

/* Profile Dropdown */
.mg-profile-item:hover { background-color: #f8fafc !important; color: #2563eb !important; }
.mg-profile-logout:hover { background-color: #fef2f2 !important; color: #dc2626 !important; }

/* Sidebar Modern UI */
.patient-sidebar {
    background-color: #ffffff;
    border-right: 1px solid #f1f5f9;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

.mg-sidebar-menu {
    padding: 0.5rem 1rem;
}

.mg-sidebar-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem 0.5rem;
}

.mg-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.mg-sidebar-link .material-symbols-outlined {
    color: #94a3b8;
    transition: color 0.3s ease;
    font-size: 1.25rem;
}

.mg-sidebar-link:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.mg-sidebar-link:hover .material-symbols-outlined {
    color: #3b82f6;
}

.mg-sidebar-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.mg-sidebar-link.active .material-symbols-outlined {
    color: #2563eb;
}

.mg-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    color: #ef4444;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.mg-sidebar-logout:hover {
    background-color: #fef2f2;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
}

.mg-main-panel {
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid #f8fafc;
    padding: 1.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.mg-panel-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

/* Grid and Cards */
.mg-stats-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .mg-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.mg-stat-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid #f8fafc;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.mg-stat-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
    border-color: #f1f5f9;
}

.mg-stat-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mg-stat-icon.blue {
    background-color: #eff6ff;
    color: #3b82f6;
}

.mg-stat-icon.emerald {
    background-color: #ecfdf5;
    color: #10b981;
}

.mg-stat-icon.rose {
    background-color: #fff1f2;
    color: #f43f5e;
}

.mg-stat-icon.amber {
    background-color: #fffbeb;
    color: #d97706;
}

.mg-stat-icon .material-symbols-outlined {
    font-size: 2rem;
}

.mg-stat-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mg-stat-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.mg-stat-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}

/* Premium Form Cards */
.mg-card {
    background: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.mg-card-header {
    font-size: 0.95rem;
    font-weight: 800;
    color: #4f46e5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f1f5f9;
}

.mg-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
}

.mg-form-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    outline: none;
    transition: all 0.2s ease;
}

.mg-form-input:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.mg-form-input:read-only {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.mg-form-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 8l3 3 3-3' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mg-form-select:focus {
    border-color: #4f46e5;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.mg-form-select:disabled {
    background-color: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.mg-alert-success {
    padding: 16px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; 
    color: #065f46; font-size: 13px; font-weight: 600; margin-bottom: 20px;
}

.mg-info-banner {
    padding: 12px 16px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; 
    color: #065f46; font-size: 12px; font-weight: 700; margin-bottom: 28px;
}

.mg-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff; font-size: 13px; font-weight: 700;
    border: none; border-radius: 10px; cursor: pointer;
    text-decoration: none; transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.mg-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,0.4); color: #fff; }

.mg-add-more-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px; background: #eef2ff; color: #4f46e5;
    font-size: 12px; font-weight: 700; border: 1.5px dashed #c7d2fe;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.mg-add-more-btn:hover { background: #e0e7ff; text-decoration: none; color: #4f46e5; }

.mg-trash-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: #fee2e2; border: none; color: #ef4444;
    cursor: pointer; transition: all 0.2s;
}
.mg-trash-btn:hover { background: #fecaca; }

.mg-row-box {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
}

/* Select2 UI Overrides */
.select2-container--default .select2-selection--multiple {
    min-height: 42px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    padding: 4px 12px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #6366f1 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #eef2ff !important;
    border: 1px solid #c7d2fe !important;
    color: #4f46e5 !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    padding: 3px 8px 3px 24px !important;
    position: relative !important;
    margin: 0 !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #ef4444 !important;
    background: transparent !important;
    border: none !important;
    border-right: 1px solid #c7d2fe !important;
    border-top-left-radius: 5px !important;
    border-bottom-left-radius: 5px !important;
    padding: 0 6px !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: bold !important;
    margin: 0 !important;
    transition: background-color 0.2s;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

/* Single Select Overrides */
.select2-container--default .select2-selection--single {
    height: 42px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 14px !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #6366f1 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    color: #1e293b !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 10px !important;
}

/* Dropdown container */
.select2-dropdown {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.10) !important;
    overflow: hidden !important;
    z-index: 9999 !important;
    background: #fff !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    outline: none !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
    box-sizing: border-box !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}
.select2-results__option {
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background: #f5f3ff !important;
    color: #4f46e5 !important;
    font-weight: 700 !important;
}

/* Modern Tabs */
.mg-tabs-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 1.5rem !important;
    border-bottom: 1px solid #e5e7eb !important;
    margin-bottom: 1rem !important;
    list-style: none !important;
    padding: 0 !important;
}

.mg-tab-btn {
    display: block !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 0.25rem !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: #94a3b8 !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
    cursor: pointer !important;
    margin-bottom: -1px !important;
}

.mg-tab-btn:hover {
    color: #475569 !important;
    border-bottom-color: #cbd5e1 !important;
}

.mg-tab-btn[aria-selected="true"] {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    border-bottom-width: 2px !important;
}

/* DataTables Modern UI */
table.dataTable.table,
.table.datatable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: none !important;
    width: 100% !important;
    margin-top: 0.5rem !important;
}

table.dataTable thead th,
.table.datatable thead th {
    padding-right: 30px !important;
    text-align: left;
    position: relative;
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 0.75rem !important;
    color: #64748b !important;
    font-weight: 600 !important;
    background-color: #f8fafc !important;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
    padding-left: 1rem !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

table.dataTable thead th.text-right,
.table.datatable thead th.text-right {
    text-align: right !important;
}

table.dataTable thead th:last-child,
.table.datatable thead th:last-child {
    background-image: none !important;
    cursor: default !important;
    padding-right: 1rem !important;
}

table.dataTable thead th:last-child::before,
table.dataTable thead th:last-child::after,
.table.datatable thead th:last-child::before,
.table.datatable thead th:last-child::after {
    display: none !important;
}

table.dataTable tbody tr,
.table.datatable tbody tr {
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.table.datatable tbody tr:hover {
    background: #f8fafc !important;
    transform: none;
    box-shadow: none !important;
}

.table.datatable tbody td {
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 1rem 1rem !important;
    vertical-align: middle !important;
    font-weight: 500 !important;
    color: #475569 !important;
    font-size: 0.85rem !important;
}

.table.datatable tbody td:first-child {
    border-radius: 0;
}

.table.datatable tbody td:last-child {
    border-radius: 0;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: none;
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 0.4rem 0.75rem;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    outline: none;
    transition: background 0.3s;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    background: #e2e8f0;
    outline: none;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.5rem !important;
    padding: 0.25rem 0.6rem !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    color: #64748b !important;
    border: none !important;
    background: transparent !important;
    margin: 0 0.1rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #eff6ff !important;
    color: #2563eb !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_info {
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.dataTables_wrapper {
    padding-bottom: 1rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 0.375rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bg-warning-light {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #d97706 !important;
    border: none;
}

.bg-success-light {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
    border: none;
}

.bg-danger-light {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
    border: none;
}

.bg-default-light {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #2563eb !important;
    border: none;
}

/* Forms & Inputs */
.mg-form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    color: #475569;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #cbd5e1;
    appearance: none;
    border-radius: 0.75rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.mg-form-control:focus {
    color: #0f172a;
    background-color: #fff;
    border-color: #2563eb;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
}

.mg-form-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Buttons */
.mg-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background-color: #2563eb;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.mg-btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

.mg-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.mg-btn-secondary:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.mg-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background-color: #ef4444;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.mg-btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
    color: #fff;
}

/* Validation Error Styles */
.custom-error {
    color: #ef4444; /* Tailwind red-500 */
    font-size: 0.75rem; /* Tailwind text-xs */
    font-weight: 700;
    margin-top: 0.5rem;
    display: block;
}

/* Missing Booking Tailwind Classes */
.bg-slate-900 { background-color: #0f172a !important; }
.text-slate-900 { color: #0f172a !important; }
.border-slate-900 { border-color: #0f172a !important; }

.bg-blue-600 { background-color: #2563eb !important; }
.text-blue-600 { color: #2563eb !important; }
.border-blue-600 { border-color: #2563eb !important; }

.peer:checked ~ .peer-checked\:border-blue-600 { border-color: #2563eb !important; }
.peer:checked ~ .peer-checked\:bg-blue-50 { background-color: #eff6ff !important; }

.bg-sky-400 { background-color: #38bdf8 !important; }
.text-sky-400 { color: #38bdf8 !important; }