        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body { 
            font-family: 'Manrope', sans-serif; 
            background: linear-gradient(135deg, var(--sch-primary) 0%, var(--sch-primary-dark) 100%); 
            min-height: 100vh;
            overflow-x: hidden;
        }

        .font-headline {
            font-family: 'Manrope', sans-serif;
        }

        .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
            line-height: 1;
            vertical-align: middle;
        }
        
        .container { 
            max-width: none; 
            margin: 0 auto; 
            padding: 0;
            animation: fadeInUp 0.6s ease-out;
        }
        
        /* Smooth Animations */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        @keyframes slideInRight {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }
        
        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        /* Login Styles */
        .login-container { 
            display: flex; 
            justify-content: center; 
            align-items: center; 
            min-height: 100vh;
            animation: fadeInUp 0.8s ease-out;
        }
        
        .login-card { 
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            padding: 50px;
            border-radius: 25px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.15);
            width: 100%;
            max-width: 450px;
            text-align: center;
            border: 1px solid rgba(255,255,255,0.2);
            animation: scaleIn 0.6s ease-out;
        }
        
        .login-card h1 {
            font-size: 32px;
            margin-bottom: 30px;
            background: linear-gradient(135deg, var(--sch-primary), var(--sch-primary-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .form-group { 
            margin-bottom: 25px; 
            text-align: left;
            position: relative;
        }
        
        .form-group label { 
            display: block; 
            margin-bottom: 10px; 
            color: #555; 
            font-weight: 600;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .form-group input,
        .form-group select { 
            width: 100%; 
            padding: 15px 20px; 
            border: 2px solid #e1e5e9; 
            border-radius: 15px; 
            font-size: 16px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: rgba(255,255,255,0.9);
            box-shadow: 0 2px 6px rgba(0,0,0,0.05);
        }
        
        .form-group input:hover,
        .form-group select:hover {
            border-color: rgba(102, 126, 234, 0.4);
            background: rgba(255,255,255,0.95);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
            transform: translateY(-1px);
        }
        
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--sch-primary);
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 6px 20px rgba(102, 126, 234, 0.15);
            transform: translateY(-3px);
            background: rgba(255,255,255,1);
        }
        
        .btn { 
            background: linear-gradient(135deg, var(--sch-primary) 0%, var(--sch-primary-dark) 100%); 
            color: white; 
            border: none; 
            padding: 12px 24px; 
            border-radius: 12px; 
            cursor: pointer; 
            font-size: 14px; 
            font-weight: 600; 
            width: auto;
            min-width: 120px;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }
        
        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(102, 126, 234, 0.45), 0 4px 12px rgba(118, 75, 162, 0.3);
            background: linear-gradient(135deg, var(--sch-primary) 0%, var(--sch-primary-dark) 100%);
            filter: brightness(0.95);
        }
        
        .btn:active {
            transform: translateY(-1px);
            box-shadow: 0 6px 15px rgba(102, 126, 234, 0.35);
        }
        
        .btn-sm:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
            background: linear-gradient(135deg, var(--sch-primary) 0%, var(--sch-primary-dark) 100%);
        }
        
        /* Dashboard Styles */
        .dashboard { 
            display: none; 
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            min-height: 100vh;
            animation: fadeInUp 0.6s ease-out;
        }
        
        .header { 
            background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(20px);
            padding: 18px 0; 
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            margin-bottom: 0;
            border-bottom: 1px solid rgba(255,255,255,0.2);
            position: sticky;
            top: 0;
            z-index: 4000;
            overflow: visible;
        }
        
        .header-content { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            max-width: none; 
            margin: 0 auto; 
            padding: 0 18px;
            gap: 12px;
            overflow: visible;
            position: relative;
            z-index: 4001;
        }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
            position: relative;
            z-index: 4002;
            overflow: visible;
        }
        
        .header h1 {
            font-size: 28px;
            background: linear-gradient(135deg, var(--sch-primary), var(--sch-primary-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        /* Navigation Tabs */
        .nav-tabs { 
            display: flex; 
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 20px; 
            padding: 8px; 
            margin-bottom: 30px; 
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
            border: 1px solid rgba(255,255,255,0.2);
        }
        
        .nav-tab { 
            flex: 1; 
            padding: 18px 25px; 
            text-align: center; 
            cursor: pointer; 
            border-radius: 15px; 
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            font-weight: 500;
            position: relative;
            overflow: hidden;
        }
        
        .nav-tab:hover {
            background: rgba(102, 126, 234, 0.1);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
        }
        
        .nav-tab.active { 
            background: linear-gradient(135deg, var(--sch-primary) 0%, var(--sch-primary-dark) 100%); 
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
        }
        
        .nav-tab span {
            position: relative;
            z-index: 1;
        }

        /* Collapsible “More” nav — primary tabs always visible */
        .nav-more-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            margin-top: 4px;
            padding: 10px 14px;
            border: 1px dashed #cbd5e1;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.6);
            color: #64748b;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            font-family: inherit;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
        }
        .nav-more-toggle:hover {
            background: rgba(255, 255, 255, 0.95);
            border-color: #94a3b8;
            color: #475569;
        }
        .nav-more-toggle .nav-more-chevron {
            font-size: 11px;
            transition: transform 0.22s ease;
        }
        #primaryNav.nav-more-open .nav-more-toggle {
            border-style: solid;
            border-color: #dbe4ea;
            background: #ffffff;
            color: #334155;
        }
        #primaryNav.nav-more-open .nav-more-toggle .nav-more-chevron {
            transform: rotate(180deg);
        }
        .nav-more-group {
            display: none;
            width: 100%;
            flex-direction: column;
            gap: 4px;
            margin-top: 4px;
            padding-top: 4px;
            border-top: 1px solid rgba(148, 163, 184, 0.35);
        }
        #primaryNav.nav-more-open .nav-more-group {
            display: flex;
        }
        .nav-tab-more {
            flex: none;
        }
        .dashboard.supervisor .nav-more-toggle,
        .dashboard.admin .nav-more-toggle {
            margin-top: 6px;
        }
        .dashboard.supervisor .nav-more-group,
        .dashboard.admin .nav-more-group {
            gap: 2px;
            margin-top: 6px;
            padding-top: 6px;
        }
        /* Horizontal nav (non-sidebar): more items wrap on second row */
        .dashboard:not(.admin):not(.supervisor) .nav-tabs {
            flex-wrap: wrap;
        }
        .dashboard:not(.admin):not(.supervisor) .nav-more-group {
            flex-direction: row;
            flex-wrap: wrap;
            gap: 8px;
        }
        .dashboard:not(.admin):not(.supervisor) .nav-tab-more {
            flex: 1 1 auto;
            min-width: 140px;
        }
        
        /* Content Sections */
        .content-section { 
            display: none !important; 
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 20px; 
            padding: 35px; 
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
            border: 1px solid rgba(255,255,255,0.2);
            animation: slideInRight 0.5s ease-out;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .content-section:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 30px rgba(0,0,0,0.15);
        }
        
        .content-section.active { 
            display: block !important;
        }

        .dashboard-main {
            min-width: 0;
        }
        
        .content-section h2 {
            font-size: 24px;
            margin-bottom: 25px;
            color: #333;
            font-weight: 700;
        }

        .section-subtitle {
            margin: -14px 0 22px 0;
            font-size: 14px;
            line-height: 1.5;
            color: #64748b;
            font-weight: 500;
        }
        
        /* Tables */
        .table-container { 
            overflow-x: auto; 
            border-radius: 12px; 
            box-shadow: 0 6px 20px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
            border: 1px solid rgba(0,0,0,0.08);
            background: rgba(255, 255, 255, 0.95);
            margin: 15px 0;
            transition: all 0.3s ease;
        }
        
        .table-container:hover {
            box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 3px 8px rgba(0,0,0,0.08);
        }
        
        table { 
            width: 100%; 
            border-collapse: collapse; 
            background: rgba(255, 255, 255, 0.98);
        }
        
        th, td { 
            padding: 18px 20px; 
            text-align: left; 
            border-bottom: 1px solid #f1f3f4;
            transition: all 0.2s ease;
        }

        /* Schedules overview stats */
        .schedule-stats-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 14px;
        }
        .schedule-stat-card {
            min-width: 120px;
            padding: 10px 14px;
            border-radius: 10px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            box-shadow: 0 2px 6px rgba(15,23,42,0.05);
            font-size: 12px;
        }
        .schedule-stat-label {
            text-transform: uppercase;
            letter-spacing: .5px;
            color: #64748b;
            font-weight: 600;
        }
        .schedule-stat-value {
            margin-top: 4px;
            font-size: 18px;
            font-weight: 800;
            color: #0f172a;
        }
        .schedule-stat-sub {
            margin-top: 2px;
            font-size: 11px;
            color: #6b7280;
        }

        /* Training-now pharmacy map (Student Schedules page) */
        .training-now-map-panel {
            margin: 0 0 18px 0;
            background: #fff;
            border: 1px solid #d9e2ea;
            border-radius: 14px;
            overflow: hidden;
            box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
        }
        .training-now-map-header {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            justify-content: space-between;
            gap: 8px 16px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
            border-bottom: 1px solid #dcfce7;
        }
        .training-now-map-title {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 800;
            color: #166534;
        }
        .training-now-map-title .material-symbols-outlined {
            font-size: 20px;
            color: #16a34a;
        }
        .training-now-map-count {
            font-size: 12px;
            font-weight: 700;
            color: #15803d;
            background: rgba(22, 163, 74, 0.12);
            border-radius: 999px;
            padding: 2px 10px;
        }
        .training-now-map-note {
            margin: 0;
            font-size: 12px;
            color: #4b5563;
            font-weight: 500;
        }
        .training-now-map {
            height: 360px;
            width: 100%;
            background: #e8eef2;
            z-index: 1;
            position: relative;
        }
        .training-now-map-empty {
            height: 100%;
            min-height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            text-align: center;
            color: #64748b;
            font-size: 13px;
            font-weight: 600;
            background: #f8fafc;
        }
        .tn-pharm-marker {
            background: transparent;
            border: none;
        }
        .tn-pharm-marker-inner {
            width: 36px;
            height: 36px;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg);
            background: #00364c;
            border: 2px solid #fff;
            box-shadow: 0 4px 12px rgba(0, 54, 76, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .tn-pharm-marker-inner .material-symbols-outlined {
            transform: rotate(45deg);
            font-size: 18px;
            color: #fff;
        }
        .tn-popup { min-width: 160px; }
        .tn-popup-name { font-size: 13px; font-weight: 800; color: #00364c; margin-bottom: 2px; }
        .tn-popup-addr { font-size: 11px; color: #64748b; margin-bottom: 6px; }
        .tn-popup-meta { font-size: 11px; font-weight: 700; color: #15803d; margin-bottom: 6px; }
        .tn-popup-students { margin: 0; padding-left: 16px; font-size: 12px; color: #1b2733; }
        .tn-popup-students li { margin: 2px 0; }
        .tn-popup-num { color: #64748b; font-weight: 500; font-size: 11px; }

        @media (max-width: 640px) {
            .training-now-map { height: 280px; }
        }
        
        th { 
            background: linear-gradient(135deg, #f8f9fa, #e9ecef);
            font-weight: 600; 
            color: #495057;
            font-size: 14px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        tr {
            transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
            background: rgba(255, 255, 255, 0.6);
        }
        
        tr:hover {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
            transform: translateX(2px);
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
            border-left: 3px solid rgba(102, 126, 234, 0.4);
        }
        
        tr:nth-child(even) {
            background: rgba(248, 249, 250, 0.8);
        }
        
        tr:nth-child(even):hover {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
        }
        
        /* Buttons */
        .btn-group { 
            display: flex; 
            gap: 12px; 
            flex-wrap: wrap;
            margin-bottom: 20px;
        }
        
        .btn-sm { 
            padding: 8px 16px; 
            font-size: 12px;
            border-radius: 8px;
            width: auto;
            min-width: 80px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }
        
        .btn-sm:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        
        .btn-danger { 
            background: linear-gradient(135deg, #dc3545, #c82333);
        }
        
        .btn-success { 
            background: linear-gradient(135deg, #28a745, #20c997);
        }
        
        .btn-warning { 
            background: linear-gradient(135deg, #ffc107, #fd7e14);
            color: #333;
        }
        
        /* Alerts */
        .alert { 
            padding: 18px 25px; 
            border-radius: 15px; 
            margin-bottom: 20px; 
            border-left: 4px solid;
            animation: slideInRight 0.4s ease-out;
            backdrop-filter: blur(10px);
        }
        
        .alert-success { 
            background: rgba(212, 237, 218, 0.9);
            border-color: #28a745;
            color: #155724;
        }
        
        .alert-error { 
            background: rgba(248, 215, 218, 0.9);
            border-color: #dc3545;
            color: #721c24;
        }

        .alert-info {
            background: rgba(209, 236, 241, 0.9);
            border-color: #17a2b8;
            color: #0c5460;
        }

        .alert-warning {
            background: rgba(255, 243, 205, 0.95);
            border-color: #ffc107;
            color: #856404;
        }

        /* Alerts shown inside open modals (via showAlert) */
        .modal .modal-inline-alert {
            margin: 0 0 16px 0;
            padding: 12px 16px;
            font-size: 13px;
            line-height: 1.45;
            border-radius: 12px;
            animation: slideInRight 0.25s ease-out;
            position: relative;
            z-index: 2;
        }

        .pharmacy-modal-content > .modal-inline-alert,
        #assignStudentsModal .modal-inline-alert,
        #pharmImportModal .modal-inline-alert {
            margin: 16px 28px 0;
        }

        #addScheduleModal .modal-inline-alert,
        #editScheduleModal .modal-inline-alert {
            margin: 0 0 14px 0;
        }

        /* Disk space warning — fixed below header for admins/supervisors */
        .disk-space-alert {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin: 0;
            padding: 14px 20px;
            background: linear-gradient(90deg, #fff4e5 0%, #ffe8cc 100%);
            border-bottom: 2px solid #f59e0b;
            color: #7c2d12;
            font-size: 14px;
            line-height: 1.45;
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
        }

        .disk-space-alert[hidden] {
            display: none !important;
        }

        .disk-space-alert i {
            color: #d97706;
            font-size: 18px;
            margin-top: 2px;
            flex-shrink: 0;
        }

        .disk-space-alert strong {
            display: block;
            font-weight: 800;
            margin-bottom: 4px;
            color: #9a3412;
        }

        .notif-bell-wrap {
            position: relative;
            z-index: 5000;
            overflow: visible;
        }

        .notif-bell {
            position: relative;
            background: #f8fafc;
            border: 1px solid #dbe4ec;
            border-radius: 10px;
            width: 44px;
            height: 44px;
            cursor: pointer;
            color: #64748b;
            font-size: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: none;
            transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
        }

        .notif-bell:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
            color: #475569;
        }

        .notif-bell.has-unread {
            background: #fff7ed;
            border: 2px solid #f59e0b;
            color: #9a3412;
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
        }

        .notif-bell.has-unread:hover,
        .notif-bell.has-unread[aria-expanded="true"] {
            background: #ffedd5;
            border-color: #ea580c;
        }

        .notif-bell[aria-expanded="true"]:not(.has-unread) {
            background: #eef2f7;
            border-color: #94a3b8;
            color: #334155;
        }

        .notif-badge {
            position: absolute;
            top: -6px;
            right: -6px;
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            border-radius: 999px;
            background: #dc2626;
            color: #fff;
            font-size: 11px;
            font-weight: 800;
            line-height: 20px;
            text-align: center;
            box-shadow: 0 0 0 2px #fff;
        }

        .notif-badge[hidden] {
            display: none !important;
        }

        .notif-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.28);
            z-index: 9990;
        }

        .notif-backdrop[hidden] {
            display: none !important;
        }

        .notif-panel {
            position: fixed;
            top: 72px;
            right: 16px;
            width: min(420px, calc(100vw - 24px));
            max-height: min(70vh, 520px);
            overflow: auto;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
            z-index: 10000;
            padding: 0;
        }

        .notif-panel[hidden] {
            display: none !important;
        }

        .notif-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 14px 16px;
            border-bottom: 1px solid #e2e8f0;
            font-weight: 800;
            color: #0f172a;
            position: sticky;
            top: 0;
            background: #fff;
            z-index: 1;
        }

        .notif-panel-header button {
            border: none;
            background: transparent;
            color: #2563eb;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }

        .notif-item {
            padding: 14px 16px;
            border-bottom: 1px solid #f1f5f9;
            cursor: pointer;
        }

        .notif-item:hover {
            background: #f8fafc;
        }

        .notif-item.unread {
            background: #fff7ed;
            border-left: 4px solid #f59e0b;
        }

        .notif-item-title {
            font-weight: 800;
            font-size: 13px;
            color: #9a3412;
            margin-bottom: 4px;
        }

        .notif-item-body {
            font-size: 12px;
            color: #475569;
            line-height: 1.45;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .notif-item-time {
            font-size: 11px;
            color: #94a3b8;
            margin-top: 6px;
        }

        .notif-empty {
            padding: 28px 16px;
            text-align: center;
            color: #94a3b8;
            font-size: 13px;
        }

        .dashboard > .container {
            margin-top: 24px;
            position: relative;
            z-index: 1;
        }
        
        /* Modals */
        .modal { 
            display: none; 
            position: fixed; 
            z-index: 15000; 
            left: 0; 
            top: 0; 
            width: 100%; 
            height: 100%; 
            background-color: rgba(0,0,0,0.6);
            backdrop-filter: blur(5px);
            animation: fadeInUp 0.3s ease-out;
        }
        
        .modal-content { 
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            margin: 5% auto; 
            padding: 35px; 
            border-radius: 20px; 
            width: 90%; 
            max-width: 550px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.2);
            animation: scaleIn 0.4s ease-out;
        }
        
        .modal-content-scroll {
            max-height: 85vh;
            overflow-y: auto;
        }
        .modal-content-wide {
            max-width: min(960px, 96vw);
            width: 95%;
        }

        /* Confirm must sit above any other open modal (add/edit/bulk) */
        #confirmModal {
            z-index: 15100;
        }

        /* Themed confirm modal */
        #confirmModal .modal-content {
            max-width: 460px;
            border-radius: 16px;
            padding: 24px;
            border: 1px solid rgba(26, 77, 102, 0.12);
            box-shadow: 0 20px 40px rgba(0, 30, 45, 0.16);
        }
        #confirmModalTitle {
            margin: 0 0 10px 0;
            font-size: 20px;
            color: #1a4d66;
            font-weight: 800;
            letter-spacing: -0.01em;
        }
        #confirmModalMessage {
            margin: 0 0 20px 0;
            color: #334155;
            font-size: 14px;
            line-height: 1.55;
        }
        #confirmModal .btn-group {
            justify-content: flex-end;
            gap: 10px;
        }
        #confirmCancelBtn {
            background: #f8fafc;
            color: #334155;
            border: 1px solid #dbe4ec;
            box-shadow: none;
        }
        #confirmOkBtn {
            background: #1a4d66;
            color: #ffffff;
            box-shadow: 0 8px 20px rgba(26, 77, 102, 0.2);
        }

        /* Excel Review (Step 2) enhancements */
        #excelImportModal .modal-content {
            max-width: 1280px !important;
            width: 98vw !important;
            padding: 26px 28px;
        }

        /* Pharmacy sites Excel import — restore padding (modal shell uses padding:0) */
        #pharmImportModal .modal-content {
            max-width: 1100px;
            width: 96vw;
            padding: 26px 28px 28px;
            overflow-y: auto;
            max-height: min(88vh, 900px);
        }
        #pharmImportModal #pharmImportStep1 > h2,
        #pharmImportModal #pharmImportStep2 > h2,
        #pharmImportModal #pharmImportStep3 > h2 {
            font-size: var(--fs-h2, 20px);
            font-weight: 800;
            color: var(--sch-primary-deeper, #00364c);
            margin: 0 0 8px 0;
            letter-spacing: -0.02em;
        }
        #pharmImportModal .btn-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        /* Excel import — step 1 guide */
        .excel-import-guide {
            margin-top: 18px;
            margin-bottom: 0;
        }
        .excel-import-ai-note {
            margin: 16px 0 12px 0;
            padding: 10px 12px;
            background: #f5f0ff;
            border: 1px solid rgba(111, 66, 193, 0.25);
            border-radius: 8px;
            font-size: 12px;
            line-height: 1.5;
            color: #4c1d95;
        }
        .excel-import-ai-note i {
            margin-right: 6px;
            color: #6f42c1;
        }
        .excel-import-collapse {
            margin-top: 4px;
            border: 1px solid rgba(111, 66, 193, 0.22);
            border-radius: 12px;
            background: linear-gradient(135deg, rgba(111, 66, 193, 0.06), rgba(26, 77, 102, 0.04));
            overflow: hidden;
        }
        .excel-import-collapse-summary {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 14px;
            cursor: pointer;
            list-style: none;
            font-size: 13px;
            font-weight: 800;
            color: #1e293b;
            user-select: none;
        }
        .excel-import-collapse-summary::-webkit-details-marker {
            display: none;
        }
        .excel-import-collapse-summary > i:first-child {
            color: #6f42c1;
            font-size: 12px;
        }
        .excel-import-collapse-summary > span {
            flex: 1;
        }
        .excel-import-collapse-chevron {
            color: #6f42c1;
            font-size: 12px;
            transition: transform 0.2s ease;
        }
        .excel-import-collapse[open] .excel-import-collapse-chevron {
            transform: rotate(180deg);
        }
        .excel-import-collapse-body {
            padding: 0 14px 14px;
            border-top: 1px solid rgba(111, 66, 193, 0.12);
        }
        .excel-import-collapse-body .excel-import-guide-text {
            margin-top: 12px;
        }
        .excel-import-guide-block {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 14px 16px;
        }
        .excel-import-guide-preferred {
            background: linear-gradient(135deg, rgba(111, 66, 193, 0.06), rgba(26, 77, 102, 0.04));
            border-color: rgba(111, 66, 193, 0.22);
        }
        .excel-import-guide-flex {
            grid-column: 1 / -1;
        }
        .excel-import-guide-title {
            margin: 0 0 8px 0;
            font-size: 13px;
            font-weight: 800;
            color: #1e293b;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .excel-import-guide-title i {
            color: #6f42c1;
            font-size: 12px;
        }
        .excel-import-guide-text {
            margin: 0 0 12px 0;
            font-size: 13px;
            line-height: 1.5;
            color: #475569;
        }
        .excel-import-formats {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .excel-import-format-item {
            border: 1px solid #dbe4ec;
            border-radius: 10px;
            background: #fff;
            overflow: hidden;
        }
        .excel-import-format-label {
            display: block;
            padding: 6px 12px;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #6f42c1;
            background: rgba(111, 66, 193, 0.08);
            border-bottom: 1px solid #e8edf2;
        }
        .excel-import-format-desc {
            margin: 0;
            padding: 8px 12px 0;
            font-size: 12px;
            line-height: 1.45;
            color: #64748b;
        }
        .excel-import-format-item .excel-import-sample-wrap {
            margin: 8px 12px 12px;
            border: none;
            border-radius: 8px;
            box-shadow: inset 0 0 0 1px #eef2f7;
        }
        .excel-import-format-wide .excel-import-sample-table {
            min-width: 420px;
        }
        .excel-import-row-tip {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 10px 12px;
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            border-radius: 8px;
            margin-bottom: 12px !important;
        }
        .excel-import-row-tip i {
            color: #2563eb;
            margin-top: 2px;
            flex-shrink: 0;
        }
        .excel-import-steps,
        .excel-import-rules,
        .excel-import-flex-list {
            margin: 0;
            padding-left: 18px;
            font-size: 13px;
            line-height: 1.55;
            color: #475569;
        }
        .excel-import-steps li,
        .excel-import-rules li,
        .excel-import-flex-list li {
            margin-bottom: 6px;
        }
        .excel-import-rules li:last-child,
        .excel-import-flex-list li:last-child {
            margin-bottom: 0;
        }
        .excel-import-sample-wrap {
            overflow-x: auto;
            margin: 0 0 12px 0;
            border: 1px solid #dbe4ec;
            border-radius: 10px;
            background: #ffffff;
        }
        .excel-import-sample-table {
            width: 100%;
            min-width: 520px;
            border-collapse: collapse;
            font-size: 12px;
        }
        .excel-import-sample-table thead th {
            background: #1a4d66;
            color: #ffffff;
            text-align: left;
            padding: 8px 10px;
            font-weight: 700;
            white-space: nowrap;
        }
        .excel-import-sample-table tbody td {
            padding: 8px 10px;
            border-bottom: 1px solid #eef2f7;
            color: #334155;
        }
        .excel-import-sample-table tbody tr:last-child td {
            border-bottom: none;
        }
        .excel-import-guide-note {
            margin: 10px 0 0 0;
            padding: 10px 12px;
            background: #fffbeb;
            border: 1px solid #fde68a;
            border-radius: 8px;
            font-size: 12px;
            line-height: 1.5;
            color: #92400e;
        }
        .excel-import-guide-note i {
            margin-right: 6px;
        }
        .excel-import-rules code,
        .excel-import-flex-list code {
            font-size: 11px;
            background: rgba(15, 23, 42, 0.06);
            padding: 1px 5px;
            border-radius: 4px;
        }
        @media (max-width: 640px) {
            .excel-import-guide-preferred,
            .excel-import-guide-flex {
                grid-column: auto;
            }
        }

        #excelStep2 .table-container {
            max-height: 62vh !important;
            border: 1px solid #dbe4ec;
            border-radius: 12px;
            background: #ffffff;
        }

        #excelPreviewTable {
            font-size: 14px !important;
            min-width: 1320px;
            width: 100%;
            border-collapse: collapse;
        }

        #excelPreviewTable thead th {
            position: sticky;
            top: 0;
            z-index: 2;
            background: #1a4d66;
            color: #ffffff;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.04em;
            padding: 10px 12px;
        }

        #excelPreviewTable tbody td {
            padding: 10px 12px;
            vertical-align: middle;
            border-bottom: 1px solid #eef2f7;
        }

        #excelPreviewTable .excel-cell-input {
            width: 100%;
            min-height: 40px;
            padding: 8px 10px;
            border: 1px solid #cfd9e3;
            border-radius: 8px;
            font-size: 14px;
            line-height: 1.3;
            background: #ffffff;
            color: #0f172a;
        }

        #excelPreviewTable .excel-cell-input:focus {
            outline: none;
            border-color: #1a4d66;
            box-shadow: 0 0 0 3px rgba(26, 77, 102, 0.12);
        }

        #excelPreviewTable .excel-name { min-width: 230px; }
        #excelPreviewTable .excel-phone { min-width: 170px; }
        #excelPreviewTable .excel-day { min-width: 150px; }
        #excelPreviewTable .excel-start,
        #excelPreviewTable .excel-end { min-width: 120px; }
        #excelPreviewTable .excel-section { min-width: 110px; }

        #excelPreviewTable .excel-status-cell {
            min-width: 280px;
            font-size: 13px;
            line-height: 1.35;
            white-space: normal;
            word-break: break-word;
        }

        #excelStep2 .excel-action-btn {
            height: 42px;
            padding: 0 16px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 700;
            border: 1px solid transparent;
            box-shadow: none;
        }

        #excelStep2 .excel-action-btn.primary {
            background: #1a4d66;
            color: #ffffff;
        }

        #excelStep2 .excel-action-btn.primary:hover { background: #153e52; }
        #excelStep2 .excel-action-btn.ghost {
            background: #f8fafc;
            color: #334155;
            border-color: #dbe4ec;
        }
        #excelStep2 .excel-action-btn.ghost:hover { background: #eef2f7; }

        #excelStep2 .excel-delete-btn {
            height: 36px;
            min-width: 36px;
            padding: 0 12px;
            border-radius: 9px;
            border: 1px solid #fecaca;
            background: #fff5f5;
            color: #b91c1c;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: none;
        }

        #excelStep2 .excel-delete-btn:hover {
            background: #fee2e2;
            border-color: #fca5a5;
            color: #991b1b;
        }

        /* Edit Schedule modal enhancements */
        #editScheduleModal .modal-content {
            max-width: 820px;
            width: 95%;
            padding: 0;
            overflow: hidden;
        }
        #editScheduleModal .modal-header {
            padding: 22px 28px 16px 28px;
            border-bottom: 1px solid rgba(0,0,0,0.08);
            background: linear-gradient(135deg, rgba(102,126,234,0.10), rgba(118,75,162,0.06));
        }
        #editScheduleModal .modal-header h2 {
            margin: 0;
            font-size: 22px;
            color: #1f2937;
            font-weight: 800;
        }
        #editScheduleModal .modal-header p {
            margin: 8px 0 0 0;
            font-size: 13px;
            color: #4b5563;
        }
        #editScheduleModal .modal-body {
            padding: 22px 28px 8px 28px;
            max-height: 72vh;
            overflow-y: auto;
        }
        #editScheduleModal .form-section-title {
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #6b7280;
            margin: 6px 0 14px 0;
        }
        #editScheduleModal .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding: 16px 28px 22px 28px;
            border-top: 1px solid rgba(0,0,0,0.08);
            background: rgba(255,255,255,0.92);
            backdrop-filter: blur(20px);
        }
        #editScheduleModal .modal-footer .btn {
            min-width: 150px;
        }

        /* Legacy weekly-call UI (hidden when using hour-by-hour monitoring) */
        .legacy-call-ui {
            display: none !important;
        }

        /* Add Schedule modal — aligned with Edit Schedule polish */
        #addScheduleModal .modal-content {
            max-width: 820px;
            width: 95%;
            padding: 0;
            overflow: hidden;
        }
        #addScheduleModal .modal-header {
            padding: 22px 28px 16px 28px;
            border-bottom: 1px solid rgba(0,0,0,0.08);
            background: linear-gradient(135deg, rgba(102,126,234,0.10), rgba(118,75,162,0.06));
        }
        #addScheduleModal .modal-header h2 {
            margin: 0;
            font-size: 22px;
            color: #1f2937;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        #addScheduleModal .modal-header h2 i {
            color: var(--sch-primary);
            font-size: 20px;
        }
        #addScheduleModal .modal-header p {
            margin: 8px 0 0 0;
            font-size: 13px;
            color: #4b5563;
            line-height: 1.5;
        }
        #addScheduleModal .modal-body {
            padding: 22px 28px 12px 28px;
            max-height: 72vh;
            overflow-y: auto;
        }
        #addScheduleModal .form-section-title {
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #6b7280;
            margin: 4px 0 14px 0;
        }
        #addScheduleModal .form-row {
            gap: 16px;
            margin-bottom: 22px;
        }
        #addScheduleModal .form-group {
            margin-bottom: 0;
        }
        #addScheduleModal .form-group label {
            font-size: 12px;
            margin-bottom: 8px;
            letter-spacing: 0.04em;
        }
        #addScheduleModal .form-group input,
        #addScheduleModal .form-group select {
            padding: 11px 14px;
            font-size: 14px;
            border-radius: 10px;
            border-width: 1px;
        }
        #addScheduleModal .form-group input:focus,
        #addScheduleModal .form-group select:focus {
            transform: none;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
        }
        #addScheduleModal .schedule-days-section {
            margin-bottom: 24px;
        }
        #addScheduleModal .schedule-days-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 4px;
        }
        #addScheduleModal .schedule-days-header .form-section-title {
            margin-bottom: 0;
        }
        #addScheduleModal .schedule-day-row {
            display: grid;
            grid-template-columns: minmax(140px, 1.4fr) minmax(110px, 1fr) minmax(110px, 1fr) 44px;
            gap: 12px;
            align-items: end;
            margin-bottom: 10px;
            padding: 14px 16px;
            background: #f8fafc;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        #addScheduleModal .schedule-day-row:hover {
            border-color: #cbd5e1;
            box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
        }
        #addScheduleModal .schedule-day-row .form-group {
            margin-bottom: 0;
        }
        #addScheduleModal .schedule-day-row .day-row-label {
            grid-column: 1 / -1;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #64748b;
            margin: 0 0 2px 0;
        }
        #addScheduleModal .schedule-remove-day-btn {
            width: 44px;
            height: 44px;
            min-width: 44px;
            padding: 0;
            border-radius: 10px;
            border: 1px solid #fecaca;
            background: #fff;
            color: #dc2626;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all 0.2s ease;
            box-shadow: none;
        }
        #addScheduleModal .schedule-remove-day-btn:hover:not(:disabled) {
            background: #fef2f2;
            border-color: #f87171;
            transform: translateY(-1px);
        }
        #addScheduleModal .schedule-remove-day-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
            border-color: #e2e8f0;
            color: #94a3b8;
        }
        #addScheduleModal .btn-add-day {
            width: 100%;
            margin-top: 4px;
            padding: 12px 16px;
            border-radius: 12px;
            border: 2px dashed #cbd5e1;
            background: #fff;
            color: #475569;
            font-size: 14px;
            font-weight: 600;
            box-shadow: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: unset;
        }
        #addScheduleModal .btn-add-day:hover {
            border-color: var(--sch-primary);
            color: var(--sch-primary);
            background: rgba(102, 126, 234, 0.06);
            transform: none;
            box-shadow: none;
        }
        #addScheduleModal .form-row-call-strategy {
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            align-items: end;
        }
        #addScheduleModal .checkbox-field label {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin: 0;
            padding: 12px 14px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            text-transform: none;
            font-size: 14px;
            font-weight: 500;
            letter-spacing: 0;
            color: #334155;
            cursor: pointer;
            line-height: 1.45;
            min-height: 44px;
        }
        #addScheduleModal .checkbox-field input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin: 2px 0 0 0;
            flex-shrink: 0;
            accent-color: var(--sch-primary);
            cursor: pointer;
        }
        #addScheduleModal .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding: 16px 28px 22px 28px;
            border-top: 1px solid rgba(0,0,0,0.08);
            background: rgba(255,255,255,0.92);
            backdrop-filter: blur(20px);
        }
        #addScheduleModal .modal-footer .btn {
            min-width: 148px;
            padding: 12px 22px;
            font-size: 14px;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        #addScheduleModal .modal-footer .btn-cancel {
            background: #f8fafc;
            color: #334155;
            border: 1px solid #dbe4ec;
            box-shadow: none;
        }
        #addScheduleModal .modal-footer .btn-cancel:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
        }
        #addScheduleModal .modal-footer .btn-success {
            min-width: 168px;
        }
        @media (max-width: 640px) {
            #addScheduleModal .schedule-day-row {
                grid-template-columns: 1fr 1fr;
            }
            #addScheduleModal .schedule-day-row .form-group:first-of-type {
                grid-column: 1 / -1;
            }
            #addScheduleModal .schedule-remove-day-btn {
                grid-column: 2;
                justify-self: end;
            }
            #addScheduleModal .modal-footer {
                flex-direction: column-reverse;
            }
            #addScheduleModal .modal-footer .btn {
                width: 100%;
                min-width: unset;
            }
        }
        
        .form-row { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
            gap: 20px; 
            margin-bottom: 25px;
        }
        
        /* Stats Grid */
        .stats-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
            gap: 25px; 
            margin-bottom: 35px;
        }
        
        .stat-card { 
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            padding: 30px; 
            border-radius: 20px; 
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
            text-align: center;
            border: 1px solid rgba(255,255,255,0.2);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0,0,0,0.15);
        }
        
        .stat-number { 
            font-size: 42px; 
            font-weight: 800; 
            background: linear-gradient(135deg, var(--sch-primary), var(--sch-primary-dark));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
        }
        
        .stat-label { 
            color: #6c757d; 
            font-size: 14px; 
            text-transform: uppercase; 
            letter-spacing: 1px;
            font-weight: 600;
        }
        
        /* Loading Animation */
        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(102, 126, 234, 0.3);
            border-radius: 50%;
            border-top-color: var(--sch-primary);
            animation: spin 1s ease-in-out infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* Enhanced focus states */
        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--sch-primary);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
            transform: translateY(-2px);
        }
        
        /* Smooth scrolling */
        html {
            scroll-behavior: smooth;
        }
        
        /* Hide admin-only elements for non-admin users */
        .admin-only {
            display: block;
        }
        
        .non-admin .admin-only {
            display: none !important;
        }
        
        /* Touch-friendly improvements */
        @media (hover: none) and (pointer: coarse) {
            .btn, .btn-sm, .nav-tab {
                min-height: 44px; /* Apple's recommended minimum touch target */
            }
            
            .form-group input,
            .form-group select {
                min-height: 44px;
            }
            
            /* Increase touch targets on mobile */
            th, td {
                padding: 12px 15px;
            }
        }
        
        /* Mobile Responsive Design */
        @media (max-width: 768px) {
            .container {
                padding: 10px;
            }
            
            .login-card {
                padding: 30px 20px;
                margin: 20px;
                border-radius: 20px;
            }
            
            .login-card h1 {
                font-size: 24px;
            }
            
            .form-group input {
                padding: 12px 15px;
                font-size: 16px; /* Prevents zoom on iOS */
            }
            
            .btn {
                padding: 12px 20px;
                font-size: 16px;
            }
            
            .header {
                padding: 15px 0;
            }
            
            .header-content {
                flex-direction: column;
                gap: 15px;
                text-align: center;
            }
            
            .header h1 {
                font-size: 20px;
            }
            
            .nav-tabs {
                flex-direction: column;
                gap: 5px;
                padding: 10px;
            }
            
            .nav-tab {
                padding: 12px 15px;
                font-size: 14px;
            }
            
            .content-section {
                padding: 20px 15px;
                margin: 0 10px;
            }
            
            .content-section h2 {
                font-size: 20px;
                margin-bottom: 20px;
            }
            
            .btn-group {
                flex-direction: row;
                flex-wrap: wrap;
                gap: 8px;
                justify-content: flex-start;
            }
            
            .btn-sm {
                padding: 8px 15px;
                font-size: 13px;
                width: auto;
                min-width: 70px;
            }
            
            .form-row {
                grid-template-columns: 1fr;
                gap: 15px;
            }
            
            .stats-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }
            
            .stat-card {
                padding: 20px;
            }
            
            .stat-number {
                font-size: 32px;
            }
            
            .table-container {
                border-radius: 10px;
                overflow-x: auto;
            }
            
            table {
                min-width: 600px; /* Ensures table scrolls on mobile */
            }
            
            th, td {
                padding: 10px 12px;
                font-size: 13px;
            }
            
            .modal-content {
                margin: 10% auto;
                padding: 25px 20px;
                width: 95%;
                max-width: none;
            }
            
            /* Mobile-specific button sizes */
            .btn {
                padding: 10px 18px;
                font-size: 14px;
                border-radius: 12px;
                width: auto;
                min-width: 100px;
            }
            
            .btn-sm {
                padding: 8px 12px;
                font-size: 12px;
                border-radius: 8px;
                width: auto;
                min-width: 70px;
            }
            
            /* Mobile navigation improvements */
            .nav-tab i {
                margin-right: 5px;
            }
            
            /* Mobile table improvements */
            .table-container {
                margin: 0 -15px;
                border-radius: 0;
            }
            
            /* Mobile form improvements */
            .form-group label {
                font-size: 13px;
                margin-bottom: 8px;
            }
            
            .form-group input,
            .form-group select {
                font-size: 16px; /* Prevents zoom on iOS */
                padding: 12px 15px;
            }
        }
        
        /* Extra small devices */
        @media (max-width: 480px) {
            .container {
                padding: 5px;
            }
            
            .login-card {
                padding: 25px 15px;
                margin: 10px;
            }
            
            .header-content {
                padding: 0 10px;
            }
            
            .content-section {
                padding: 15px 10px;
                margin: 0 5px;
            }
            
            .btn-sm {
                padding: 6px 10px;
                font-size: 11px;
            }
            
            .stat-card {
                padding: 15px;
            }
            
            .stat-number {
                font-size: 28px;
            }
            
            .modal-content {
                padding: 20px 15px;
                margin: 5% auto;
            }
        }
        
        /* Landscape orientation for mobile */
        @media (max-width: 768px) and (orientation: landscape) {
            .nav-tabs {
                flex-direction: row;
                overflow-x: auto;
                padding: 5px;
            }
            
            .nav-tab {
                min-width: 120px;
                white-space: nowrap;
            }
        }
        
        /* Collapsible Sections */
        .collapsible-section {
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(20px);
            border-radius: 18px;
            margin-bottom: 25px;
            box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
            border: 1px solid rgba(255,255,255,0.3);
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .collapsible-section:hover {
            box-shadow: 0 12px 35px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1);
            transform: translateY(-2px);
        }
        
        .collapsible-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 22px 28px;
            cursor: pointer;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            border-bottom: 2px solid transparent;
        }
        
        .collapsible-header:hover {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.35) 0%, rgba(118, 75, 162, 0.35) 100%);
            border-bottom-color: rgba(102, 126, 234, 0.3);
            transform: translateX(3px);
        }
        
        .collapsible-header:active {
            transform: translateX(1px);
        }
        
        .collapsible-header h2,
        .collapsible-header h3 {
            color: #2d3748;
            font-weight: 700;
            letter-spacing: -0.3px;
            text-shadow: 0 1px 2px rgba(255,255,255,0.8);
        }
        
        .collapse-btn {
            background: rgba(102, 126, 234, 0.15);
            border: 1px solid rgba(102, 126, 234, 0.2);
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 10px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            color: var(--sch-primary);
            font-size: 16px;
            box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
        }
        
        .collapse-btn:hover {
            background: rgba(102, 126, 234, 0.35);
            border-color: rgba(102, 126, 234, 0.4);
            transform: scale(1.15) rotate(5deg);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
            color: var(--sch-primary);
        }
        
        .collapse-btn:active {
            transform: scale(1.05) rotate(0deg);
        }
        
        .collapse-icon {
            display: inline-block;
            transition: all 0.3s ease;
            font-size: 14px;
            min-width: 14px;
            text-align: center;
        }
        
        .collapsible-content {
            padding: 25px;
            max-height: 10000px;
            overflow: hidden;
            transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
            opacity: 1;
        }
        
        .collapsible-section.collapsed .collapsible-content {
            max-height: 0;
            padding: 0 25px;
            opacity: 0;
        }
        
        /* Coverage Subsections (Nested Collapsible) */
        .coverage-subsection {
            background: rgba(255, 255, 255, 0.85);
            border-radius: 12px;
            margin-bottom: 18px;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
            border: 1px solid rgba(0,0,0,0.06);
        }
        
        .coverage-subsection:hover {
            box-shadow: 0 6px 18px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
            transform: translateY(-1px);
        }
        
        .coverage-subsection-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 22px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            background: rgba(0, 0, 0, 0.02);
            border-bottom: 2px solid transparent;
        }
        
        .coverage-subsection-header:hover {
            background: rgba(0, 0, 0, 0.12);
            border-bottom-color: rgba(0, 0, 0, 0.15);
            transform: translateX(4px);
            box-shadow: inset 0 2px 8px rgba(0,0,0,0.08);
        }
        
        .coverage-subsection-header:active {
            transform: translateX(2px);
            background: rgba(0, 0, 0, 0.15);
        }
        
        .coverage-subsection-header h4 {
            transition: all 0.3s ease;
        }
        
        .coverage-subsection-header:hover h4 {
            transform: translateX(2px);
        }
        
        .coverage-subsection-content {
            max-height: 10000px;
            overflow: hidden;
            transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
            opacity: 1;
            padding: 0 20px 20px 20px;
        }
        
        .coverage-subsection.collapsed .coverage-subsection-content {
            max-height: 0;
            padding: 0 20px;
            opacity: 0;
        }
        
        .coverage-subsection .collapse-icon {
            font-size: 12px;
            transition: all 0.3s ease;
        }
        
        .coverage-subsection .collapse-btn {
            background: rgba(0, 0, 0, 0.08);
            border: 1px solid rgba(0, 0, 0, 0.1);
            padding: 6px 10px;
            border-radius: 8px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .coverage-subsection .collapse-btn:hover {
            background: rgba(0, 0, 0, 0.2);
            border-color: rgba(0, 0, 0, 0.25);
            transform: scale(1.2) rotate(5deg);
            box-shadow: 0 3px 8px rgba(0,0,0,0.15);
        }
        
        /* Enhanced content area styling */
        .collapsible-content {
            background: rgba(255, 255, 255, 0.5);
        }
        
        .coverage-subsection-content {
            background: rgba(255, 255, 255, 0.4);
        }

        /* ---------------------------------------------------------
           Main dashboard theme: scholar/medical clean style
        --------------------------------------------------------- */
        :root {
            /* Brand */
            --sch-bg: #fcfdfe;
            --sch-surface: #ffffff;
            --sch-surface-muted: #f2f4f5;
            --sch-primary: #1a4d66;
            --sch-primary-dark: #153e52;
            --sch-primary-deeper: #00364c;
            --sch-primary-tint: #c4e7ff;
            --sch-on-primary: #ffffff;
            --sch-text: #1e293b;
            --sch-text-strong: #0f172a;
            --sch-muted: #64748b;
            --sch-muted-2: #71787d;
            --sch-border: rgba(26, 77, 102, 0.10);
            --sch-border-strong: #dbe4ec;

            /* Semantic */
            --sch-success: #0f766e;
            --sch-success-dark: #0d6b64;
            --sch-warning: #d97706;
            --sch-danger: #dc2626;
            --sch-danger-dark: #b91c1c;
            --sch-info: #0284c7;

            /* Space / radius / shadow */
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --space-7: 28px;
            --space-8: 32px;
            --radius-sm: 8px;
            --radius-md: 10px;
            --radius-lg: 12px;
            --radius-xl: 16px;
            --radius-2xl: 20px;
            --sch-shadow: 0 1px 3px 0 rgba(26, 77, 102, 0.06), 0 1px 2px -1px rgba(26, 77, 102, 0.06), 0 6px 24px -4px rgba(26, 77, 102, 0.06);
            --sch-shadow-md: 0 4px 14px rgba(26, 77, 102, 0.12);
            --sch-shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.18);
            --focus-ring: 0 0 0 3px rgba(26, 77, 102, 0.18);

            /* Type scale */
            --fs-h1: 22px;
            --fs-h2: 20px;
            --fs-h3: 16px;
            --fs-body: 14px;
            --fs-sm: 13px;
            --fs-caption: 12px;
            --fs-label: 11px;
            --lh-tight: 1.25;
            --lh-body: 1.5;
            --fw-medium: 500;
            --fw-semibold: 600;
            --fw-bold: 700;
            --fw-extrabold: 800;
        }

        body {
            font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--sch-bg);
            color: var(--sch-text);
        }

        .dashboard {
            background: var(--sch-bg);
            color: var(--sch-text);
        }

        .header {
            background: rgba(255, 255, 255, 0.98);
            border-bottom: 1px solid var(--sch-border);
            box-shadow: var(--sch-shadow);
            margin-bottom: 24px;
            padding: 16px 0;
        }

        .header h1 {
            font-size: 22px;
            font-weight: 800;
            background: none;
            -webkit-text-fill-color: initial;
            color: var(--sch-primary);
            letter-spacing: -0.02em;
        }

        .nav-tabs {
            background: var(--sch-surface);
            border: 1px solid var(--sch-border);
            box-shadow: var(--sch-shadow);
            border-radius: 12px;
            padding: 6px;
            gap: 6px;
        }

        .nav-tab {
            border-radius: 10px;
            font-weight: 700;
            color: #475569;
            padding: 14px;
        }

        .nav-tab:hover {
            background: #f8fafc;
            transform: none;
            box-shadow: none;
            color: var(--sch-primary);
        }

        .nav-tab.active {
            background: var(--sch-primary);
            color: var(--sch-on-primary);
            box-shadow: 0 8px 20px rgba(26, 77, 102, 0.20);
            transform: none;
        }

        .content-section {
            background: var(--sch-surface);
            border: 1px solid var(--sch-border);
            box-shadow: var(--sch-shadow);
            border-radius: 16px;
            padding: 30px;
        }

        .content-section:hover {
            transform: none;
            box-shadow: var(--sch-shadow);
        }

        .content-section h2 {
            color: #0f172a;
            font-size: 28px;
            font-weight: 800;
            letter-spacing: -0.02em;
            margin-bottom: 18px;
        }

        .btn {
            background: var(--sch-primary);
            color: var(--sch-on-primary);
            border-radius: 10px;
            min-width: 118px;
            font-weight: 700;
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        }

        .btn:hover {
            background: var(--sch-primary-dark);
            box-shadow: 0 8px 18px rgba(26, 77, 102, 0.20);
            transform: translateY(-1px);
            filter: none;
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn-success {
            background: #0f766e;
        }
        .btn-success:hover {
            background: #0d6b64;
        }
        .btn-warning {
            background: #d97706;
            color: #fff;
        }
        .btn-danger {
            background: #dc2626;
        }

        .table-container {
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            overflow: auto;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
        }

        table thead th {
            background: #f8fafc;
            color: #475569;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 800;
            border-bottom: 1px solid #e2e8f0;
        }

        table tbody td {
            border-bottom: 1px solid #f1f5f9;
            color: #0f172a;
        }

        .form-group label {
            color: #64748b;
            font-size: 11px;
            letter-spacing: 0.12em;
            font-weight: 800;
            text-transform: uppercase;
        }

        .form-group input,
        .form-group select {
            border-radius: 12px;
            border: 1px solid #dbe4ec;
            box-shadow: none;
            background: #fbfdff;
        }

        .form-group input:focus,
        .form-group select:focus {
            border-color: #8db6cc;
            box-shadow: 0 0 0 4px rgba(26, 77, 102, 0.10);
            transform: none;
        }

        /* Main schedules toolbar: tighter, uniform button system */
        .toolbar-main {
            gap: 10px;
            margin-bottom: 22px;
            align-items: center;
            flex-wrap: wrap;
        }

        .toolbar-main .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            height: 40px;
            min-width: auto;
            padding: 0 16px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0;
            line-height: 1;
            white-space: nowrap;
            border: 1px solid transparent;
            box-shadow: none;
            transform: none;
        }

        .toolbar-main .btn.btn-sm {
            padding: 0 16px;
            min-width: auto;
            font-size: 14px;
            font-weight: 700;
        }

        .toolbar-main .btn i,
        .toolbar-main .btn .material-symbols-outlined {
            font-size: 18px;
            line-height: 1;
        }

        #schedulesSection .process-overview {
            font-size: 12px !important;
        }

        #schedulesSection .process-overview strong {
            font-size: 12px;
            font-weight: 700;
        }

        #schedulesSection .process-overview li {
            font-size: 12px;
            line-height: 1.45;
        }

        .toolbar-main .btn:hover {
            transform: none;
            filter: none;
            box-shadow: none;
        }

        .toolbar-main .btn.toolbar-btn-refresh {
            background: #f1f5f9;
            color: #374151;
        }

        .toolbar-main .btn.toolbar-btn-refresh:hover {
            background: #e2e8f0;
        }

        .toolbar-main .btn.toolbar-btn-add {
            background: #1a4d66;
            color: #ffffff;
            box-shadow: 0 1px 4px rgba(26, 77, 102, 0.2);
        }

        .toolbar-main .btn.toolbar-btn-add:hover {
            background: #153e52;
        }

        .toolbar-main .btn.toolbar-btn-import {
            background: #5e7d8a;
            color: #ffffff;
        }

        .toolbar-main .btn.toolbar-btn-import:hover {
            background: #4d6671;
        }

        .toolbar-main .btn.toolbar-btn-download {
            background: #ffffff;
            color: #374151;
            border-color: #e5e7eb;
        }

        .toolbar-main .btn.toolbar-btn-download:hover {
            background: #f8fafc;
        }

        .toolbar-main .btn.toolbar-btn-force {
            background: #0891b2;
            color: #ffffff;
        }

        .toolbar-main .btn.toolbar-btn-force:hover {
            background: #0e7490;
        }

        .toolbar-main .btn.toolbar-btn-delete-all {
            background: #dc2626;
            color: #ffffff;
        }

        .toolbar-main .btn.toolbar-btn-delete-all:hover {
            background: #b91c1c;
        }

        .duplicate-checker {
            margin: -6px 0 14px 0;
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            font-size: 13px;
            color: #334155;
        }

        .duplicate-checker strong {
            color: #0f172a;
        }

        .duplicate-checker ul {
            margin: 8px 0 0 18px;
            padding: 0;
        }

        /* Telegram broadcast modal list */
        #telegramBroadcastModal .broadcast-list {
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            overflow: hidden;
            background: #ffffff;
        }

        #telegramBroadcastModal .broadcast-list-header {
            position: sticky;
            top: 0;
            z-index: 2;
            background: #f8fafc;
            border-bottom: 1px solid #e2e8f0;
            padding: 8px 10px;
            font-size: 12px;
            font-weight: 700;
            color: #475569;
            display: grid;
            grid-template-columns: 24px 1fr 170px 110px 80px;
            gap: 10px;
            align-items: center;
        }

        #telegramBroadcastModal .broadcast-row {
            display: grid;
            grid-template-columns: 24px 1fr 170px 110px 80px;
            gap: 10px;
            align-items: center;
            padding: 10px 10px;
            border-bottom: 1px solid #f1f5f9;
        }

        #telegramBroadcastModal .broadcast-row:last-child {
            border-bottom: none;
        }

        #telegramBroadcastModal .broadcast-name {
            font-weight: 800;
            color: #0f172a;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #telegramBroadcastModal .broadcast-sub {
            font-size: 12px;
            color: #64748b;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #telegramBroadcastModal .broadcast-meta {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        @media (max-width: 768px) {
            #telegramBroadcastModal .broadcast-list-header,
            #telegramBroadcastModal .broadcast-row {
                grid-template-columns: 24px 1fr;
                gap: 8px;
                align-items: start;
            }
        }

        /* Logs section toolbar buttons */
        #logsSection .btn-group {
            gap: 10px;
            align-items: center;
            margin-bottom: 14px;
        }

        #logsSection .logs-toolbar-btn {
            height: 38px;
            padding: 0 14px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            border: 1px solid transparent;
            box-shadow: none;
        }

        #logsSection .logs-toolbar-btn.refresh {
            background: #eef2f7;
            color: #334155;
        }

        #logsSection .logs-toolbar-btn.refresh:hover {
            background: #e2e8f0;
        }

        #logsSection .logs-toolbar-btn.system {
            background: #f59e0b;
            color: #ffffff;
        }

        #logsSection .logs-toolbar-btn.system:hover {
            background: #d97706;
        }

        /* System Health styles */
        .sh-panel{border:1px solid #e9ecef;border-radius:12px;margin-bottom:10px;overflow:hidden;transition:box-shadow .2s;}
        .sh-panel:hover{box-shadow:0 2px 10px rgba(0,0,0,.06);}
        .sh-panel-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;cursor:pointer;background:#f8f9fa;font-weight:600;font-size:14px;user-select:none;}
        .sh-panel-head:hover{background:#eef1f7;}
        .sh-panel-body{padding:14px 18px;background:#fff;max-height:400px;overflow:auto;}
        .sh-panel.open .sh-chevron{transform:rotate(180deg);}
        .sh-chevron{transition:transform .25s;color:#888;font-size:12px;}
        .sh-badge{display:inline-block;min-width:22px;text-align:center;padding:2px 8px;border-radius:12px;font-size:11px;font-weight:700;background:#e74c3c;color:#fff;margin-left:6px;}
        .sh-badge.green{background:#28a745;} .sh-badge.amber{background:#f39c12;} .sh-badge.grey{background:#95a5a6;}
        .sh-stat{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:110px;padding:14px 16px;border-radius:14px;background:#f8f9fa;box-shadow:0 2px 8px rgba(0,0,0,.07);}
        .sh-stat-num{font-size:26px;font-weight:800;line-height:1.1;}
        .sh-stat-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.4px;margin-top:4px;color:#6c757d;}
        .sh-table{width:100%;border-collapse:collapse;font-size:13px;}
        .sh-table th,.sh-table td{padding:8px 10px;text-align:left;border-bottom:1px solid #f0f0f0;}
        .sh-table th{background:#f8f9fa;font-weight:600;color:#495057;font-size:11px;text-transform:uppercase;letter-spacing:.4px;position:sticky;top:0;z-index:1;}
        .sh-table tr:hover td{background:#f7f9ff;}

        /* Weekly Monitor cards */
        .wm-card {
            display:flex;flex-direction:column;align-items:center;justify-content:center;
            min-width:100px;padding:14px 18px;border-radius:14px;
            background:#f8f9fa;box-shadow:0 2px 8px rgba(0,0,0,.07);
            transition:transform .2s,box-shadow .2s;
        }
        .wm-card:hover{transform:translateY(-2px);box-shadow:0 4px 14px rgba(0,0,0,.12);}
        .wm-card-num{font-size:28px;font-weight:800;line-height:1.1;}
        .wm-card-label{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;color:#6c757d;}
        .wm-card-total  .wm-card-num{color:#495057;}
        .wm-card-called .wm-card-num{color:#28a745;}
        .wm-card-failed .wm-card-num{color:#e53935;}
        .wm-card-pending .wm-card-num{color:#f0ad4e;}
        .wm-card-missed .wm-card-num{color:#dc3545;}
        .wm-card-called{border-left:4px solid #28a745;}
        .wm-card-failed{border-left:4px solid #e53935;}
        .wm-card-pending{border-left:4px solid #f0ad4e;}
        .wm-card-missed{border-left:4px solid #dc3545;}

        /* Weekly monitor table */
        .wm-table{width:100%;border-collapse:collapse;font-size:13px;}
        .wm-table th,.wm-table td{padding:10px 12px;text-align:center;border-bottom:1px solid #eee;}
        .wm-table th{background:linear-gradient(135deg,#f8f9fa,#e9ecef);font-weight:600;color:#495057;font-size:12px;text-transform:uppercase;letter-spacing:.4px;position:sticky;top:0;z-index:2;}
        .wm-table td:first-child,.wm-table th:first-child{text-align:left;position:sticky;left:0;background:#fff;z-index:1;}
        .wm-table th:first-child{z-index:3;background:linear-gradient(135deg,#f8f9fa,#e9ecef);}
        .wm-table tr:hover td{background:#f0f4ff;}
        .wm-badge{display:inline-block;padding:3px 10px;border-radius:20px;font-size:11px;font-weight:700;letter-spacing:.3px;}
        .wm-badge-called{background:#d4edda;color:#155724;}
        .wm-badge-failed{background:#f8d7da;color:#721c24;}
        .wm-badge-pending{background:#fff3cd;color:#856404;}
        .wm-badge-missed{background:#f5c6cb;color:#721c24;}

        /* Schedules table visual style (inspired by provided reference) */
        .schedule-table-wrap {
            border-radius: 14px;
            overflow-x: auto;
            overflow-y: visible;
            -webkit-overflow-scrolling: touch;
            border: 1px solid #d9e2ea;
            background: #ffffff;
            box-shadow: 0 18px 36px rgba(0, 30, 45, 0.06);
        }

        .schedule-table {
            width: 100%;
            min-width: 720px;
            border-collapse: collapse;
        }

        .schedule-table > thead > tr,
        .schedule-table > thead > tr > th {
            background: #1a4d66 !important;
        }

        .schedule-table > thead > tr > th {
            color: #ffffff !important;
            font-size: 15px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            font-weight: 800;
            padding: 16px 18px;
            border-bottom: none;
        }

        .schedule-table tbody td {
            padding: 18px 18px;
            border-bottom: 1px solid #edf2f7;
            color: #0f172a;
            vertical-align: middle;
            font-size: 14px;
        }

        .schedule-table tbody tr.schedule-row {
            background: #ffffff;
            transition: background-color 0.2s ease;
        }

        .schedule-table tbody tr.schedule-row:hover {
            background: #f5f9fc;
        }

        .schedule-table tbody tr.schedule-row.chat-focus-row {
            background: #e9f5ff;
            box-shadow: inset 3px 0 0 #4ea3d8;
        }

        .schedule-table tbody tr.schedule-row.chat-focus-row:hover {
            background: #deeffc;
        }

        .schedule-table .schedule-index {
            color: #64748b;
            font-weight: 700;
        }

        .schedule-table .schedule-name-main {
            color: #1a4d66;
            font-weight: 700;
            line-height: 1.2;
        }

        .schedule-table .schedule-name-link {
            background: none;
            border: none;
            padding: 0;
            margin: 0;
            font: inherit;
            font-weight: 700;
            font-size: inherit;
            color: #1a4d66;
            cursor: pointer;
            text-align: left;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .schedule-table .schedule-name-link::after {
            content: "\f105";
            font-family: "Font Awesome 6 Free";
            font-weight: 900;
            font-size: 11px;
            opacity: 0;
            transform: translateX(-3px);
            transition: all .15s ease;
            color: #4a86a8;
        }

        .schedule-table .schedule-name-link:hover {
            color: #00364c;
            text-decoration: underline;
            text-underline-offset: 3px;
        }

        .schedule-table .schedule-name-link:hover::after {
            opacity: 1;
            transform: translateX(0);
        }

        .schedule-table .schedule-phone {
            font-variant-numeric: tabular-nums;
            color: #475569;
        }

        .schedule-table .schedule-days-sub {
            display: block;
            margin-top: 3px;
            font-size: 11px;
            color: #64748b;
            font-weight: 600;
        }

        .schedule-table .schedule-supervisor {
            font-weight: 600;
            color: #334155;
        }

        .schedule-action-group {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
            opacity: 0.45;
            transition: opacity 0.2s ease;
        }

        .schedule-row:hover .schedule-action-group {
            opacity: 1;
        }

        .schedule-action-btn {
            width: 34px;
            height: 34px;
            border-radius: 9px;
            border: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            color: #475569;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .schedule-action-btn:hover {
            background: #dff0fb;
            color: #1a4d66;
        }

        .schedule-action-btn.danger:hover {
            background: #fee2e2;
            color: #b91c1c;
        }

        .schedule-action-btn.call:hover {
            background: #dcfce7;
            color: #15803d;
        }

        .schedule-action-btn.report-pdf { color: #b23b2e; }
        .schedule-action-btn.report-pdf:hover {
            background: #fdecea;
            color: #9a271b;
        }

        .schedule-action-btn.report-doc { color: #1a4d66; }
        .schedule-action-btn.report-doc:hover {
            background: #e3f0f8;
            color: #00364c;
        }

        /* ── Student profile modal ─────────────────────────────── */
        body.modal-scroll-lock { overflow: hidden; }
        .student-profile-modal { padding: 0 !important; max-width: 860px; width: 92%; overflow: hidden; position: relative; }
        .student-profile-modal #studentProfileBody {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
        }
        .student-profile-modal .modal-close-btn {
            position: absolute;
            top: 14px;
            right: 14px;
            z-index: 3;
            width: 34px;
            height: 34px;
            border-radius: 10px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: background .15s ease;
        }
        .student-profile-modal .modal-close-btn:hover { background: rgba(255, 255, 255, 0.32); }
        .student-profile-loading, .student-profile-error {
            display: flex; align-items: center; gap: 10px;
            padding: 60px 30px; justify-content: center;
            color: #6b7680; font-size: 14px; font-weight: 600;
        }
        .student-profile-error { color: #b3261e; }
        .student-profile-loading .spin { animation: spin 1s linear infinite; }

        .sp-hero {
            background: linear-gradient(135deg, #00364c 0%, #0a5c74 100%);
            color: #fff; padding: 22px 28px; display: flex; align-items: center; gap: 18px;
        }
        .sp-avatar {
            width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0;
            background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.35);
            display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 800;
        }
        .sp-hero-id { flex: 1; min-width: 0; }
        .sp-hero-name { font-size: 22px; font-weight: 800; line-height: 1.1; }
        .sp-hero-chips { margin-top: 8px; display: flex; gap: 7px; flex-wrap: wrap; }
        .sp-chip {
            display: inline-flex; align-items: center; gap: 5px;
            background: rgba(255,255,255,.16); color: #fff; border-radius: 20px;
            padding: 4px 11px; font-size: 11.5px; font-weight: 600;
        }
        .sp-chip .material-symbols-outlined { font-size: 14px; }
        .sp-chip-soft { background: #eef4f6; color: #1a4d66; }
        .sp-hero-period { text-align: right; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
        .sp-hero-period-lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; opacity: .75; font-weight: 700; }
        .sp-hero-period-val { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
        .sp-hero-period-sub { font-size: 11px; opacity: .8; }

        .sp-body { padding: 22px 28px; background: #f6f9fa; }
        .sp-section-title, .sp-card-title {
            font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
            color: #00364c; font-weight: 800; margin-bottom: 12px;
        }
        .sp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
        .sp-kpi { background: #fff; border: 1px solid #e6ebee; border-radius: 12px; padding: 14px; text-align: center; }
        .sp-kpi-n { font-size: 23px; font-weight: 800; color: #00364c; }
        .sp-kpi-t { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #75818b; font-weight: 700; margin-top: 3px; }

        .sp-comp { margin: 16px 0 4px; }
        .sp-comp-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: #1b2733; }
        .sp-track { height: 9px; border-radius: 20px; background: #e7edf0; overflow: hidden; }
        .sp-fill { height: 100%; border-radius: 20px; transition: width .3s; }

        .sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
        .sp-card { background: #fff; border: 1px solid #e6ebee; border-radius: 14px; padding: 16px 18px; }

        .sp-eng { display: flex; align-items: center; gap: 18px; }
        .sp-ring { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
        .sp-ring-inner { width: 70px; height: 70px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .sp-ring-score { font-size: 20px; font-weight: 800; line-height: 1; }
        .sp-ring-band { font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; margin-top: 3px; }
        .sp-metrics { flex: 1; display: flex; flex-direction: column; gap: 11px; }
        .sp-mbar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
        .sp-mbar-lbl { font-size: 12px; font-weight: 700; color: #1b2733; }
        .sp-mbar-val { font-size: 12px; font-weight: 800; }
        .sp-mbar-sub { font-size: 10px; color: #75818b; font-weight: 600; margin-left: 6px; }

        .sp-daychips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
        .sp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .sp-table th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; color: #4a5b66; background: #f4f8f9; padding: 7px 10px; font-weight: 800; }
        .sp-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #eef2f4; }
        .sp-table tbody tr:last-child td { border-bottom: none; }
        .sp-mono { font-variant-numeric: tabular-nums; }
        .sp-muted { color: #8b959c; }
        .sp-daydot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #00364c; margin-right: 8px; vertical-align: middle; }
        .sp-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
        .sp-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); display: inline-block; }
        .sp-empty, .sp-empty-card { color: #9aa1a5; font-style: italic; }
        .sp-empty { text-align: center; padding: 12px; }
        .sp-empty-card { padding: 14px; text-align: center; background: #f6f9fa; border-radius: 10px; }

        .sp-pharm { display: flex; gap: 12px; align-items: center; }
        .sp-pharm-icon { width: 42px; height: 42px; border-radius: 11px; background: #e4eff3; color: #00364c; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .sp-pharm-name { font-size: 14px; font-weight: 800; color: #1b2733; }
        .sp-pharm-meta { font-size: 11.5px; color: #75818b; margin-top: 1px; }
        .sp-pharm-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
        .sp-tag { font-size: 11px; background: #eef4f6; color: #33586a; border-radius: 8px; padding: 2px 9px; font-weight: 600; }

        .sp-footer {
            display: flex; justify-content: flex-end; gap: 10px;
            padding: 16px 28px; background: #fff; border-top: 1px solid #e6ebee;
        }

        @media (max-width: 720px) {
            .sp-hero { flex-wrap: wrap; }
            .sp-hero-period { text-align: left; }
            .sp-kpis { grid-template-columns: repeat(2, 1fr); }
            .sp-grid2 { grid-template-columns: 1fr; }
            .sp-eng { flex-direction: column; align-items: flex-start; }
            .sp-metrics { width: 100%; }
        }

        tr.lt-row.chat-focus-row {
            background: #e9f5ff !important;
            box-shadow: inset 3px 0 0 #4ea3d8;
        }

        .inline-days-row td {
            background: #f8fbfe;
            border-bottom: 1px solid #e2e8f0;
            padding: 0;
        }

        .inline-days-wrap {
            padding: 14px 16px 16px 16px;
        }

        .inline-days-note {
            color: #475569;
            font-size: 12px;
            margin-bottom: 10px;
        }

        .inline-days-table {
            width: 100%;
            border-collapse: collapse;
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            overflow: hidden;
        }

        .inline-days-table > thead > tr > th {
            background: #1a4d66 !important;
            color: #ffffff !important;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 700;
            padding: 10px 12px;
        }

        .inline-days-table td {
            padding: 10px 12px;
            font-size: 13px;
            color: #1e293b;
            border-bottom: 1px solid #eef2f7;
            vertical-align: middle;
        }

        .inline-days-table tr:last-child td {
            border-bottom: none;
        }

        .inline-days-actions {
            display: flex;
            gap: 6px;
        }

        .inline-day-call-badge {
            display: inline-block;
            background: #1a4d66;
            color: #fff;
            padding: 3px 9px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
        }

        /* Reuse schedules table look in logs/coverage tables */
        .logs-themed-table.schedule-table tbody tr {
            background: #ffffff;
            transition: background-color 0.2s ease;
        }

        .logs-themed-table.schedule-table tbody tr:hover {
            background: #f5f9fc;
        }

        .inline-call-day-btn {
            border: 1px solid #c8d7e3;
            background: #ffffff;
            color: #1a4d66;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 700;
            padding: 4px 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .inline-call-day-btn:hover {
            background: #eaf2f8;
            border-color: #9cb8cc;
        }

        /* Supervisor: move main tabs to left sidebar */
        .dashboard.supervisor .container,
        .dashboard.admin .container {
            display: grid;
            grid-template-columns: 260px minmax(0, 1fr);
            gap: 22px;
            align-items: start;
        }

        .dashboard.supervisor .nav-tabs,
        .dashboard.admin .nav-tabs {
            position: sticky;
            top: 18px;
            flex-direction: column;
            border-radius: 16px;
            padding: 10px;
            margin-bottom: 0;
            background: #f2f4f5;
            border: 1px solid #dbe4ea;
            box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
        }

        .dashboard.supervisor .nav-tab,
        .dashboard.admin .nav-tab {
            flex: none;
            text-align: left;
            padding: 14px 14px;
            border-radius: 12px;
            color: #3d4b56;
            transform: none;
            box-shadow: none;
        }

        .dashboard.supervisor .nav-tab:hover,
        .dashboard.admin .nav-tab:hover {
            background: #e6eaee;
            transform: none;
            box-shadow: none;
        }

        .dashboard.supervisor .nav-tab.active,
        .dashboard.admin .nav-tab.active {
            background: #ffffff;
            color: #00364c;
            box-shadow: 0 2px 8px rgba(0, 54, 76, 0.08);
            transform: none;
        }

        .dashboard.supervisor .dashboard-main,
        .dashboard.admin .dashboard-main {
            grid-column: 2;
            min-width: 0;
        }

        @media (max-width: 1024px) {
            .dashboard.supervisor .container,
            .dashboard.admin .container {
                display: block;
            }

            .dashboard.supervisor .nav-tabs,
            .dashboard.admin .nav-tabs {
                position: static;
                margin-bottom: 18px;
            }

            .dashboard.supervisor .dashboard-main,
            .dashboard.admin .dashboard-main {
                grid-column: auto;
            }
        }

        /* ── Mobile / tablet: slide-in nav (hamburger) + backdrop ───────── */
        .nav-drawer-backdrop {
            display: none;
        }

        .nav-drawer-toggle {
            display: none;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            margin-right: 12px;
            border-radius: 10px;
            border: 1px solid var(--sch-border, #dbe4ea);
            background: #ffffff;
            color: var(--sch-primary, #1a4d66);
            cursor: pointer;
            flex-shrink: 0;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
        }

        .nav-drawer-toggle:hover {
            background: #f8fafc;
        }

        .nav-drawer-toggle .material-symbols-outlined {
            font-size: 26px;
        }

        .header-title-cluster {
            display: flex;
            align-items: center;
            flex: 1;
            min-width: 0;
        }

        .header-title-cluster h1 {
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        @media (max-width: 1024px) {
            .nav-drawer-toggle {
                display: inline-flex;
            }

            .nav-drawer-backdrop {
                display: none;
                position: fixed;
                inset: 0;
                z-index: 2990;
                background: rgba(15, 23, 42, 0.5);
                backdrop-filter: blur(2px);
            }

            .dashboard.nav-drawer-open .nav-drawer-backdrop {
                display: block;
            }

            .dashboard .nav-tabs#primaryNav {
                position: fixed;
                top: 0;
                left: 0;
                height: 100vh;
                height: 100dvh;
                width: min(300px, 88vw);
                max-width: 100%;
                margin: 0 0 18px 0;
                z-index: 3000;
                flex-direction: column;
                align-items: stretch;
                gap: 6px;
                border-radius: 0 16px 16px 0;
                transform: translateX(-105%);
                transition: transform 0.28s ease;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                box-shadow: 8px 0 40px rgba(0, 30, 45, 0.18);
            }

            .dashboard.nav-drawer-open .nav-tabs#primaryNav {
                transform: translateX(0);
            }

            .dashboard .nav-tabs#primaryNav .nav-tab {
                flex: 0 0 auto;
                text-align: left;
                width: 100%;
            }

            .toolbar-main {
                gap: 8px;
            }

            .toolbar-main .btn {
                flex: 1 1 calc(50% - 6px);
                min-width: 140px;
                white-space: normal;
                line-height: 1.25;
                height: auto;
                min-height: 44px;
                padding: 10px 12px;
            }

            .content-section {
                padding: 22px 16px;
            }
        }

        @media (max-width: 768px) {
            .toolbar-main .btn {
                flex: 1 1 100%;
            }
        }

        /* Desktop-ish but not huge: avoid horizontal squeeze in header */
        @media (max-width: 1366px) {
            .header-content {
                padding: 0 14px;
            }
        }

        @media (max-width: 600px) {
            #excelPreviewTable {
                min-width: 640px;
            }
            #excelImportModal .table-container {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
        }

        /* Entry page redesign */
        .login-container {
            position: relative;
            min-height: 100vh;
            padding: 90px 24px 90px 24px;
            background: radial-gradient(circle at top right, #1a4d66 0%, #00364c 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .login-topbar {
            position: absolute;
            top: 24px;
            left: 32px;
            right: 32px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 3;
        }

        .login-brand {
            color: rgba(255, 255, 255, 0.92);
            font-size: 30px;
            font-weight: 800;
            letter-spacing: -0.03em;
        }

        .login-help {
            color: rgba(255, 255, 255, 0.72);
            font-size: 18px;
        }

        .login-card {
            position: relative;
            z-index: 2;
            width: 100%;
            max-width: 520px;
            background: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: 16px;
            padding: 40px;
            box-shadow: 0 22px 42px rgba(0, 30, 45, 0.16);
            text-align: left;
            animation: scaleIn 0.45s ease-out;
        }

        .login-card h1 {
            margin: 0 0 8px 0;
            font-size: 38px;
            font-weight: 800;
            line-height: 1.1;
            background: none;
            -webkit-text-fill-color: initial;
            color: #111827;
        }

        .login-subtitle {
            color: #64748b;
            font-size: 14px;
            margin-bottom: 28px;
            line-height: 1.5;
        }

        #loginFormElement .form-group label {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.11em;
            text-transform: uppercase;
            color: #64748b;
            margin-bottom: 9px;
        }

        #loginFormElement .form-group input {
            width: 100%;
            height: 54px;
            border-radius: 10px;
            border: 1px solid #d7e0e8;
            background: #f8fbfd;
            padding: 0 16px;
            font-size: 15px;
            box-shadow: none;
            transform: none;
        }

        #loginFormElement .form-group input:hover {
            border-color: #c8d7e3;
            background: #f6fafc;
            box-shadow: none;
            transform: none;
        }

        #loginFormElement .form-group input:focus {
            border-color: #8db6cc;
            box-shadow: 0 0 0 4px rgba(26, 77, 102, 0.12);
            transform: none;
            background: #ffffff;
        }

        .login-submit {
            width: 100%;
            height: 54px;
            border-radius: 10px;
            border: none;
            margin-top: 6px;
            background: linear-gradient(135deg, #00364c 0%, #1a4d66 100%);
            color: #ffffff;
            font-size: 16px;
            font-weight: 800;
            letter-spacing: 0.01em;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 10px 24px rgba(0, 54, 76, 0.28);
            transition: all 0.25s ease;
        }

        .login-submit:hover {
            transform: translateY(-1px);
            filter: brightness(1.04);
        }

        .login-divider {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 20px 0 10px 0;
        }

        .login-divider span {
            color: #9aa4af;
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.13em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .login-divider:before,
        .login-divider:after {
            content: "";
            flex: 1;
            height: 1px;
            background: #e2e8f0;
        }

        .login-note {
            color: #64748b;
            font-size: 12px;
            line-height: 1.5;
            text-align: center;
        }

        /* Pharmacy Add/Edit Site modal */
        .pharmacy-modal-content {
            max-width: 560px;
            width: 95vw;
            border-radius: 20px;
            padding: 0;
            overflow: hidden;
        }
        .pharmacy-modal-header {
            padding: 24px 28px 0;
        }
        .pharmacy-modal-subtitle {
            color: #41484d;
            font-size: 13px;
            margin: 0 0 16px 0;
        }
        .pharmacy-modal-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: #c4e7ff;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .pharmacy-modal-body {
            padding: 0 28px 8px;
            max-height: min(72vh, 640px);
            overflow-y: auto;
        }
        .pharmacy-form-group {
            margin-bottom: 18px;
        }
        .pharmacy-form-group > label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            color: #41484d;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 6px;
        }
        .pharmacy-field-hint {
            margin: 0 0 8px 0;
            font-size: 12px;
            line-height: 1.45;
            color: #71787d;
        }
        .pharmacy-input {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid rgba(113, 120, 125, 0.15);
            border-radius: 12px;
            font-size: 14px;
            background: #f8fafb;
            outline: none;
            transition: border-color 0.15s;
        }
        .pharmacy-input:focus {
            border-color: #00364c;
        }
        .pharmacy-input-mono {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            direction: ltr;
        }
        .pharmacy-map-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin: 8px 0;
            flex-wrap: wrap;
        }
        .pharmacy-link-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            border-radius: 8px;
            border: 1px solid #dbe4ec;
            background: #fff;
            color: #00364c;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }
        .pharmacy-link-btn:hover {
            background: #f0f7ff;
        }
        .pharmacy-map-hint {
            font-size: 11px;
            color: #71787d;
        }
        .pharmacy-site-map {
            height: 220px;
            border-radius: 12px;
            border: 1px solid rgba(113, 120, 125, 0.2);
            overflow: hidden;
            background: #eef2f7;
        }
        .pharmacy-student-section {
            margin-bottom: 8px;
            padding-top: 4px;
            border-top: 1px solid #eceeef;
        }
        .pharmacy-student-section > label {
            display: block;
            font-size: 12px;
            font-weight: 700;
            color: #41484d;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin: 14px 0 6px 0;
        }
        .pharmacy-student-search {
            display: flex;
            align-items: center;
            gap: 6px;
            background: #f2f4f5;
            border-radius: 12px;
            height: 42px;
            padding: 0 14px;
            margin-bottom: 10px;
        }
        .pharmacy-student-search input {
            border: none;
            outline: none;
            font-size: 13px;
            font-weight: 500;
            width: 100%;
            background: transparent;
            color: #191c1d;
        }
        .pharmacy-student-list {
            max-height: 220px;
            overflow-y: auto;
            border: 1px solid #eceeef;
            border-radius: 12px;
            background: #fff;
        }
        .pharmacy-student-empty {
            color: #71787d;
            padding: 20px;
            text-align: center;
            font-size: 13px;
            margin: 0;
        }
        .pharmacy-student-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border-bottom: 1px solid #eceeef;
            cursor: pointer;
            transition: background 0.12s;
        }
        .pharmacy-student-row:last-child {
            border-bottom: none;
        }
        .pharmacy-student-row:hover {
            background: rgba(242, 244, 245, 0.6);
        }
        .pharmacy-modal-footer {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            padding: 16px 28px 24px;
            background: #f2f4f5;
            margin-top: 8px;
        }
        .pharmacy-btn-secondary,
        .pharmacy-btn-primary {
            padding: 10px 20px;
            border-radius: 12px;
            font-weight: 700;
            font-size: 13px;
            cursor: pointer;
        }
        .pharmacy-btn-secondary {
            border: 1px solid rgba(113, 120, 125, 0.15);
            background: #fff;
            color: #41484d;
        }
        .pharmacy-btn-primary {
            border: none;
            background: #00364c;
            color: #fff;
            box-shadow: 0 4px 12px rgba(0, 54, 76, 0.15);
        }

        /* =========================================================
           Frontend polish pass — buttons, modals, type, packages
           ========================================================= */

        /* --- Typography --- */
        body {
            font-size: var(--fs-body);
            line-height: var(--lh-body);
            -webkit-font-smoothing: antialiased;
        }
        .content-section h2,
        .modal-header h2,
        .modal-title {
            font-family: "Manrope", sans-serif;
            font-weight: var(--fw-extrabold);
            letter-spacing: -0.02em;
            color: var(--sch-primary-deeper);
            line-height: var(--lh-tight);
        }
        .section-subtitle,
        .modal-subtitle {
            font-size: var(--fs-sm);
            line-height: var(--lh-body);
            color: var(--sch-muted);
            font-weight: var(--fw-medium);
        }
        .form-group label,
        .pharmacy-form-group > label,
        .modal-label {
            font-size: var(--fs-label);
            letter-spacing: 0.08em;
            font-weight: var(--fw-extrabold);
            text-transform: uppercase;
            color: var(--sch-muted);
        }
        table thead th,
        .schedule-stat-value,
        .stat-value,
        .tnum {
            font-variant-numeric: tabular-nums;
            font-feature-settings: "tnum" 1;
        }

        /* --- Unified button system --- */
        .btn,
        .btn-secondary,
        .btn-ghost,
        .btn-success,
        .btn-warning,
        .btn-danger,
        .pharmacy-btn-primary,
        .pharmacy-btn-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-family: inherit;
            font-size: var(--fs-sm);
            font-weight: var(--fw-bold);
            line-height: 1.2;
            border-radius: var(--radius-lg);
            padding: 10px 18px;
            min-width: 0;
            cursor: pointer;
            border: 1px solid transparent;
            transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease, border-color 0.15s ease, color 0.15s ease;
            text-decoration: none;
            white-space: nowrap;
        }
        .btn {
            background: var(--sch-primary);
            color: var(--sch-on-primary);
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(26, 77, 102, 0.12);
        }
        .btn:hover {
            background: var(--sch-primary-dark);
            box-shadow: var(--sch-shadow-md);
            transform: translateY(-1px);
            filter: none;
        }
        .btn:active {
            transform: translateY(0);
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
        }
        .btn:focus-visible,
        .btn-secondary:focus-visible,
        .btn-ghost:focus-visible,
        .btn-success:focus-visible,
        .btn-warning:focus-visible,
        .btn-danger:focus-visible,
        .pharmacy-btn-primary:focus-visible,
        .pharmacy-btn-secondary:focus-visible {
            outline: none;
            box-shadow: var(--focus-ring), var(--sch-shadow-md);
        }
        .btn:disabled,
        .btn.is-loading,
        .btn[disabled],
        .pharmacy-btn-primary:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
            pointer-events: none;
        }
        .btn.is-loading::before {
            content: "";
            width: 14px;
            height: 14px;
            border: 2px solid rgba(255,255,255,0.35);
            border-top-color: #fff;
            border-radius: 50%;
            animation: sch-spin 0.7s linear infinite;
            flex-shrink: 0;
        }
        @keyframes sch-spin {
            to { transform: rotate(360deg); }
        }

        .btn-secondary,
        .pharmacy-btn-secondary {
            background: #fff;
            color: var(--sch-text);
            border-color: var(--sch-border-strong);
            box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        }
        .btn-secondary:hover,
        .pharmacy-btn-secondary:hover {
            background: #f8fafc;
            border-color: #c5d4de;
            color: var(--sch-primary-deeper);
            transform: translateY(-1px);
        }
        .btn-ghost {
            background: transparent;
            color: var(--sch-muted);
            box-shadow: none;
            border-color: transparent;
        }
        .btn-ghost:hover {
            background: rgba(26, 77, 102, 0.06);
            color: var(--sch-primary);
            transform: none;
        }
        .btn-success {
            background: var(--sch-success);
            color: #fff;
            box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
        }
        .btn-success:hover {
            background: var(--sch-success-dark);
            transform: translateY(-1px);
        }
        .btn-warning {
            background: var(--sch-warning);
            color: #fff;
        }
        .btn-warning:hover {
            background: #b45309;
            transform: translateY(-1px);
        }
        .btn-danger {
            background: var(--sch-danger);
            color: #fff;
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
        }
        .btn-danger:hover {
            background: var(--sch-danger-dark);
            transform: translateY(-1px);
        }
        .btn-sm {
            padding: 7px 12px;
            font-size: var(--fs-caption);
            border-radius: var(--radius-md);
            min-width: 0;
        }
        .btn-lg {
            padding: 12px 22px;
            font-size: var(--fs-body);
            border-radius: var(--radius-xl);
        }
        .btn-icon {
            width: 36px;
            height: 36px;
            min-width: 36px;
            padding: 0;
            border-radius: var(--radius-md);
        }
        .pharmacy-btn-primary {
            background: var(--sch-primary-deeper);
            color: #fff;
            border: none;
            box-shadow: 0 4px 12px rgba(0, 54, 76, 0.15);
        }
        .pharmacy-btn-primary:hover {
            background: var(--sch-primary);
            transform: translateY(-1px);
        }

        /* Toolbar action buttons */
        .toolbar-action-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 18px;
            border-radius: var(--radius-lg);
            font-weight: var(--fw-bold);
            font-size: var(--fs-sm);
            cursor: pointer;
            font-family: inherit;
            transition: background 0.15s, box-shadow 0.15s, transform 0.12s, border-color 0.15s;
        }
        .toolbar-action-btn.primary {
            background: var(--sch-primary-deeper);
            border: none;
            color: #fff;
            box-shadow: 0 4px 12px rgba(0, 54, 76, 0.15);
        }
        .toolbar-action-btn.primary:hover {
            background: var(--sch-primary);
            transform: translateY(-1px);
        }
        .toolbar-action-btn.outline {
            background: #fff;
            border: 1px solid rgba(113, 120, 125, 0.15);
            color: var(--sch-primary-deeper);
            box-shadow: 0 1px 4px rgba(0, 30, 45, 0.04);
        }
        .toolbar-action-btn.outline:hover {
            background: #f8fafc;
            border-color: #c5d4de;
        }
        .toolbar-action-btn.danger-outline {
            background: #fff;
            border: 1px solid rgba(186, 26, 26, 0.35);
            color: #ba1a1a;
            box-shadow: 0 1px 4px rgba(0, 30, 45, 0.04);
        }
        .toolbar-action-btn.danger-outline:hover {
            background: #fff5f5;
        }

        /* --- Shared modal shell --- */
        .modal {
            display: none;
            position: fixed;
            inset: 0;
            /* Above sticky header (4000) and notification panels (≤10000) */
            z-index: 15000;
            align-items: center;
            justify-content: center;
            padding: 24px 16px;
            background: rgba(15, 23, 42, 0.48);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            animation: sch-modal-fade 0.2s ease-out;
        }
        .modal[style*="display: flex"],
        .modal[style*="display:flex"],
        .modal[style*="display: block"],
        .modal[style*="display:block"] {
            display: flex !important;
        }
        @keyframes sch-modal-fade {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes sch-modal-scale {
            from { opacity: 0; transform: translateY(10px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .modal-content {
            background: var(--sch-surface);
            border-radius: var(--radius-2xl);
            width: 100%;
            max-width: 560px;
            max-height: min(88vh, 860px);
            margin: 0 auto;
            padding: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: var(--sch-shadow-lg);
            border: 1px solid rgba(255,255,255,0.5);
            animation: sch-modal-scale 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        }
        .modal-content-wide {
            max-width: min(960px, 96vw);
        }
        .modal-content-scroll {
            overflow: hidden;
        }
        .modal-header {
            padding: 22px 28px 0;
            flex-shrink: 0;
        }
        .modal-header-row {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 6px;
        }
        .modal-icon-chip {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-md);
            background: var(--sch-primary-tint);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: var(--sch-primary-deeper);
        }
        .modal-icon-chip.teal { background: #cce8e9; color: #324b4c; }
        .modal-icon-chip.warn { background: #fff3cd; color: #856404; }
        .modal-icon-chip.danger { background: #fee2e2; color: #b91c1c; }
        .modal-icon-chip.purple { background: #f3e8ff; color: #6f42c1; }
        .modal-title {
            font-size: var(--fs-h2);
            margin: 0;
        }
        .modal-subtitle {
            margin: 0 0 14px 0;
        }
        .modal-body {
            padding: 8px 28px 12px;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }
        .modal-footer {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            align-items: center;
            padding: 14px 28px 22px;
            background: var(--sch-surface-muted);
            border-top: 1px solid var(--sch-border);
            flex-shrink: 0;
            margin-top: auto;
        }
        .modal-close-btn {
            width: 34px;
            height: 34px;
            border-radius: var(--radius-md);
            border: none;
            background: #fff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
            color: var(--sch-muted);
            margin-left: auto;
            flex-shrink: 0;
        }
        .modal-close-btn:hover {
            background: #f8fafc;
            color: var(--sch-text);
        }
        .modal .modal-inline-alert {
            margin: 12px 28px 0;
            padding: 12px 16px;
            font-size: var(--fs-sm);
            line-height: 1.45;
            border-radius: var(--radius-lg);
        }

        /* Confirm modal (elevated) */
        #confirmModal {
            z-index: 15100;
        }
        #confirmModal .modal-content {
            max-width: 420px;
            padding: 0;
        }
        #confirmModal .confirm-body {
            padding: 24px 28px 8px;
            text-align: left;
        }
        #confirmModal #confirmModalTitle {
            font-size: var(--fs-h2);
            font-weight: var(--fw-extrabold);
            color: var(--sch-primary-deeper);
            margin: 0 0 8px 0;
        }
        #confirmModal #confirmModalMessage {
            font-size: var(--fs-sm);
            color: var(--sch-muted);
            line-height: 1.5;
            margin: 0;
        }

        /* Align pharmacy-specific pieces with shell */
        .pharmacy-modal-content {
            max-width: 560px;
            padding: 0;
        }
        .pharmacy-modal-header { padding: 22px 28px 0; }
        .pharmacy-modal-body { padding: 0 28px 8px; }
        .pharmacy-modal-footer {
            background: var(--sch-surface-muted);
            border-top: 1px solid var(--sch-border);
        }

        /* Schedule modals — use shared tokens */
        #addScheduleModal .modal-header h2 i,
        #editScheduleModal .modal-header h2 i {
            color: var(--sch-primary);
        }
        #addScheduleModal .btn-add-day:hover {
            border-color: var(--sch-primary);
            color: var(--sch-primary);
        }
        #addScheduleModal .modal-footer .btn-cancel {
            background: #fff;
            color: var(--sch-text);
            border: 1px solid var(--sch-border-strong);
        }
        #addScheduleModal .modal-footer .btn-success {
            background: var(--sch-success);
        }

        /* Excel import accents → brand */
        #excelImportModal .excel-import-collapse,
        #pharmImportModal .excel-import-collapse {
            border-color: rgba(26, 77, 102, 0.18);
            background: linear-gradient(135deg, rgba(26, 77, 102, 0.05), rgba(196, 231, 255, 0.25));
        }
        .excel-import-format-label {
            color: var(--sch-primary);
            background: rgba(26, 77, 102, 0.07);
        }
        .excel-import-ai-note {
            color: var(--sch-primary-deeper);
            background: rgba(196, 231, 255, 0.45);
            border-color: rgba(26, 77, 102, 0.2);
        }
        .excel-import-ai-note i { color: var(--sch-primary); }
        .excel-import-collapse-summary > i:first-child,
        .excel-import-collapse-chevron { color: var(--sch-primary); }

        /* Toastify theming */
        .toastify {
            font-family: "Manrope", sans-serif !important;
            font-size: var(--fs-sm) !important;
            font-weight: var(--fw-semibold) !important;
            border-radius: var(--radius-lg) !important;
            box-shadow: var(--sch-shadow-md) !important;
            padding: 12px 18px !important;
            max-width: min(420px, 92vw) !important;
        }
        .toastify.sch-toast-success {
            background: linear-gradient(135deg, #0f766e, #0d9488) !important;
        }
        .toastify.sch-toast-info {
            background: linear-gradient(135deg, #1a4d66, #0284c7) !important;
        }
        .toastify.sch-toast-error {
            background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
        }
        .toastify.sch-toast-warning {
            background: linear-gradient(135deg, #d97706, #b45309) !important;
        }

        /* Tippy theming */
        .tippy-box[data-theme~='sch'] {
            background: var(--sch-primary-deeper);
            color: #fff;
            font-family: "Manrope", sans-serif;
            font-size: 12px;
            font-weight: 600;
            border-radius: 8px;
            box-shadow: var(--sch-shadow-md);
        }
        .tippy-box[data-theme~='sch'][data-placement^='top'] > .tippy-arrow::before {
            border-top-color: var(--sch-primary-deeper);
        }
        .tippy-box[data-theme~='sch'][data-placement^='bottom'] > .tippy-arrow::before {
            border-bottom-color: var(--sch-primary-deeper);
        }

        /* --- Semester Archives --- */
        .archive-page-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }
        .archive-page-header h2 {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 0 0 6px;
        }
        .archive-live-card { margin-bottom: 18px; }
        .archive-live-inner {
            display: flex;
            justify-content: space-between;
            gap: 16px;
            align-items: center;
            flex-wrap: wrap;
            background: #fff;
            border: 1px solid rgba(113, 120, 125, 0.12);
            border-radius: 16px;
            padding: 18px 20px;
            box-shadow: 0 8px 24px rgba(0, 30, 45, 0.04);
        }
        .archive-live-inner.is-empty {
            border-color: rgba(46, 125, 50, 0.25);
            background: linear-gradient(180deg, #f7fbf7 0%, #fff 100%);
        }
        .archive-live-title {
            font-family: "Manrope", sans-serif;
            font-size: 16px;
            font-weight: 800;
            color: #00364c;
            margin-bottom: 4px;
        }
        .archive-live-sub {
            font-size: 13px;
            color: #6c757d;
            margin-bottom: 10px;
        }
        .archive-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .archive-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #f2f4f5;
            color: #00364c;
            border-radius: 999px;
            padding: 5px 10px;
            font-size: 12px;
            font-weight: 600;
        }
        .archive-chip strong { font-weight: 800; }
        .archive-chip-warn { background: #fff4e5; color: #9a5b00; }
        .archive-status-pill {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 5px 10px;
            font-size: 12px;
            font-weight: 700;
            background: #eef1f3;
            color: #41484d;
            text-transform: capitalize;
        }
        .archive-status-pill.ok { background: #e8f5e9; color: #1b5e20; }
        .archive-status-pill.busy { background: #fff3e0; color: #e65100; }
        .archive-table-card,
        .archive-detail-card {
            background: #fff;
            border: 1px solid rgba(113, 120, 125, 0.12);
            border-radius: 16px;
            padding: 16px 18px;
            box-shadow: 0 8px 24px rgba(0, 30, 45, 0.04);
        }
        .archive-detail-wrap { margin-top: 18px; }
        .archive-table-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }
        .archive-table-head h3 {
            margin: 0;
            font-size: 16px;
            color: #00364c;
        }
        .archive-search {
            min-width: 220px;
            height: 38px;
            border-radius: 10px;
            border: 1px solid rgba(113, 120, 125, 0.18);
            padding: 0 12px;
            font-size: 13px;
        }
        .archive-table { width: 100%; border-collapse: collapse; }
        .archive-table th {
            text-align: left;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: #71787d;
            padding: 10px 8px;
            border-bottom: 1px solid rgba(113, 120, 125, 0.12);
        }
        .archive-table td {
            padding: 12px 8px;
            border-bottom: 1px solid rgba(113, 120, 125, 0.08);
            vertical-align: top;
            font-size: 13px;
            color: #00364c;
        }
        .archive-row { cursor: pointer; }
        .archive-row:hover,
        .archive-row.is-selected { background: #f7fafc; }
        .archive-title-cell { font-weight: 800; }
        .archive-meta-cell { font-size: 12px; color: #71787d; margin-top: 2px; }
        .archive-actions-cell {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            white-space: nowrap;
        }
        .archive-detail-top {
            display: flex;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .archive-detail-top h3 {
            margin: 8px 0 4px;
            font-size: 20px;
            color: #00364c;
        }
        .archive-kpi-row {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
            margin-bottom: 14px;
        }
        .archive-kpi {
            background: #f2f4f5;
            border-radius: 14px;
            padding: 14px;
        }
        .archive-kpi-n {
            font-family: "Manrope", sans-serif;
            font-size: 22px;
            font-weight: 800;
            color: #00364c;
        }
        .archive-kpi-t {
            font-size: 12px;
            color: #71787d;
            font-weight: 600;
            margin-top: 2px;
        }
        .archive-raw-block {
            margin-bottom: 12px;
            padding: 12px;
            border-radius: 12px;
            background: #fafbfc;
            border: 1px dashed rgba(113, 120, 125, 0.2);
        }
        .archive-student-link {
            background: none;
            border: none;
            padding: 0;
            color: var(--sch-primary, #0b6e99);
            font-weight: 800;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 2px;
        }
        .archive-modal { max-width: 640px; }
        .archive-preview-box {
            background: #f7f9fa;
            border: 1px solid rgba(113, 120, 125, 0.12);
            border-radius: 12px;
            padding: 12px 14px;
            margin-bottom: 14px;
        }
        .archive-count-list {
            margin: 0;
            padding-left: 18px;
            columns: 2;
            font-size: 12px;
            color: #41484d;
        }
        .archive-warning {
            margin: 8px 0 0;
            padding: 10px 12px;
            border-radius: 10px;
            background: #fff4e5;
            color: #8a4b00;
            font-size: 13px;
            line-height: 1.45;
        }
        .modal-inline-alert-error {
            background: #fdecea;
            color: #b71c1c;
            border: 1px solid rgba(183, 28, 28, 0.15);
            border-radius: 10px;
            padding: 10px 12px;
            margin-bottom: 12px;
            font-size: 13px;
        }
        .modal-inline-alert-success {
            background: #e8f5e9;
            color: #1b5e20;
            border: 1px solid rgba(27, 94, 32, 0.15);
            border-radius: 10px;
            padding: 10px 12px;
            margin-bottom: 12px;
            font-size: 13px;
        }
        @media (max-width: 900px) {
            .archive-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .archive-count-list { columns: 1; }
        }

        @media (max-width: 640px) {
            .modal {
                padding: 0;
                align-items: flex-end;
            }
            .modal-content {
                max-width: 100%;
                max-height: 94vh;
                border-radius: 20px 20px 0 0;
                width: 100%;
            }
            .modal-header,
            .modal-body,
            .modal-footer,
            .pharmacy-modal-header,
            .pharmacy-modal-body,
            .pharmacy-modal-footer {
                padding-left: 18px;
                padding-right: 18px;
            }
            .btn, .btn-secondary {
                flex: 1 1 auto;
            }
        }
