/* =========================================
       MASTER DESIGN SYSTEM (PREMIUM)
       ========================================= */
    :root {
      --fs-xs: 12px;
      --fs-sm: 13px;
      --fs-md: 14px;
      --fs-lg: 16px;
      --fs-xl: 20px;
      --fs-2xl: 24px;
      --fs-3xl: 32px;
      --primary: #4361ee;
      --primary-blue: var(--primary);
      --radius-pill: 999px;
      --primary-hover: #3a0ca3;
      --secondary: #6c757d;
      --success: #2ecc71;
      --success-light: #e8f8f5;
      --danger: #e74c3c;
      --danger-light: #fdf2f0;
      --warning: #f39c12;
      --warning-light: #fef5e7;
      --info: #00b4d8;
      --info-light: #e0fbfc;
      --bg-body: #f8f9fc;
      --bg-card: #ffffff;
      --sidebar-bg: #ffffff;
      --text-main: #2b2d42;
      --text-muted: #8d99ae;
      --border-color: #edf2f4;
      --radius-sm: 6px;
      --radius-md: 12px;
      --radius-lg: 20px;
      --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
      --shadow-md: 0 10px 25px rgba(0,0,0,0.05);
      --space-sm: 12px;
      --space-md: 20px;
      --space-lg: 30px;
      
      /* New Unified Color Palette Variables */
      --white: #ffffff;
      --gray-100: #f8f9fa;
      --gray-200: #e2e8f0;
      --gray-300: #e0e0e0;
      --gray-400: #cbd5e1;
      --gray-500: #adb5bd;
      --gray-600: #94a3b8;
      --gray-700: #64748b;
      --gray-800: #475569;
      --gray-900: #333333;
      --accent-purple: #8b5cf6;
      --whatsapp: #25d366;
      --bg-highlight: #fffcf2;
      --border-highlight: #ffeeba;
      --text-highlight: #856404;
      --bg-blue-light: #eaf0f6;
    }

    body.dark-mode { 
      /* SOFT DARK THEME — warm charcoal, kam contrast, aankhon ko aaram */
      --bg-body: #15171c; --bg-card: #1d2027; --sidebar-bg: #181b21; 
      --text-main: #e3e5ea; --text-muted: #8a909c; --border-color: #2b2f38; 
      --shadow-sm: 0 2px 6px rgba(0,0,0,0.18); --shadow-md: 0 8px 22px rgba(0,0,0,0.25);
      --primary: #7184e0; --primary-hover: #5f72cf;
      --success: #52b788; --danger: #dc7a74; --warning: #d9a45f; --info: #5db1c7;
      --gray-100: #1d2027;
      --gray-200: #2b2f38;
      --gray-300: #3a3f4a;
      --bg-highlight: #23262e;
      --border-highlight: #7a5a2e;
      --text-highlight: #e7cf9a;
      --bg-blue-light: #181b21;
      --white: #15171c;
      --success-light: rgba(82, 183, 136, 0.13);
      --danger-light: rgba(220, 122, 116, 0.13);
      --warning-light: rgba(217, 164, 95, 0.13);
      --info-light: rgba(93, 177, 199, 0.13);
    }
    body.dark-mode .swal2-popup, body.dark-mode .swal-compact-popup { background: var(--bg-card); color: var(--text-main); }
    body.dark-mode .swal2-title, body.dark-mode .swal2-html-container { color: var(--text-main) !important; }
    body.dark-mode .swal2-input, body.dark-mode .swal-compact-input { background: var(--bg-body); color: var(--text-main); border-color: var(--border-color) !important; }

    body { 
      background: var(--bg-body); 
      color: var(--text-main); 
      font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif; 
      font-feature-settings: 'cv11', 'ss01';
      -webkit-font-smoothing: antialiased;
      margin: 0; 
      padding: 0; 
    }
    
    /* Yeh style.css ke '*' selector ko override karega aur Inter font ko force karega */
    div, span, p, h1, h2, h3, h4, h5, h6, a, button, input, select, textarea, th, td, label, li { 
      font-family: inherit; 
    }
    .card { background: var(--bg-card) !important; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--space-md); margin-bottom: var(--space-md); border: 1px solid var(--border-color); }
    
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
    .btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    .btn-primary { background: var(--primary); color: white; }
    .btn-success { background: var(--success); color: white; }
    .btn-danger { background: var(--danger); color: white; }
    .btn-warning { background: var(--warning); color: var(--white); }
    .btn-info { background: var(--info); color: white; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }

    .form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; background: var(--bg-body); color: var(--text-main); transition: 0.2s; }
    .form-control:focus { border-color: var(--primary); outline: none; background: var(--bg-card); }
    
    /* SIDEBAR */
    .sidebar { border-right: 1px solid var(--border-color); }
    .sidebar h3 { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; padding: 25px 20px; margin: 0; border-bottom: 1px solid var(--border-color); color: var(--primary); }
    .sidebar-category { padding: 20px 20px 10px 20px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; cursor: pointer; display: flex; justify-content: space-between; }
    .submenu-container { max-height: 500px; overflow: hidden; transition: max-height 0.3s ease; }
    .submenu-container.collapsed { max-height: 0; }
    .tab-link { width: calc(100% - 20px); margin: 4px 10px; padding: 12px 15px; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-main); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 12px; }
    .tab-link i { font-size: 16px; color: var(--text-muted); width: 20px; text-align: center; transition: 0.2s; }
    .tab-link:hover { background: var(--bg-body); color: var(--primary); }
    .tab-link.active { background: var(--primary); color: white; font-weight: 600; box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3); }
    .tab-link.active i { color: white; }

    /* DASHBOARD PREMIUM LAYOUT */
    .dash-header-wrap { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
    .dash-greeting { font-size: 28px; font-weight: 800; color: var(--text-main); margin: 0 0 5px 0; letter-spacing: -0.5px; }
    .dash-date { font-size: 14px; color: var(--text-muted); font-weight: 500; }
    
    .top-actions { display: flex; gap: 15px; align-items: center; }
    .icon-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-main); font-size: 16px; cursor: pointer; transition: 0.2s; box-shadow: var(--shadow-sm); position: relative; }
    .icon-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
    
    .global-search-wrapper { position: relative; flex: 0 1 auto; width: 340px; max-width: 100%; margin-right: 20px; }
    #globalSearchContainer { flex-grow: 1; width: auto; }
    .global-search-wrapper i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
    .global-search-input { width: 100%; padding: 14px 20px 14px 45px; border-radius: var(--radius-pill); border: 1px solid var(--border-color); font-size: 14px; background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-sm); transition: 0.3s; }
    .global-search-wrapper input.global-search-input { width: 100%; padding: 12px 18px 12px 44px; border-radius: var(--radius-pill); border: 1px solid var(--border-color); font-size: 14px; background: var(--bg-card); color: var(--text-main); box-shadow: var(--shadow-sm); height: auto; }
    .global-search-wrapper input.global-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(67,97,238,0.1); outline: none; }
    .global-search-wrapper > i { z-index: 2; pointer-events: none; }
    .global-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(67,97,238,0.1); outline: none; }

    .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 20px; margin-bottom: 30px; }
    .kpi-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 25px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; flex-direction: column; cursor: pointer; transition: 0.3s; position: relative; }
    .kpi-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
    .kpi-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; position: absolute; top: 20px; right: 20px; flex-shrink: 0; }
    .kpi-title { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; width: calc(100% - 60px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .kpi-value { font-size: var(--fs-3xl); font-weight: 800; color: var(--text-main); margin: 0 0 10px 0; line-height: 1; }
    .kpi-trend { font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: 5px; }
    
    .attention-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
    .attention-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--border-color); border-top: 4px solid var(--border-color); box-shadow: var(--shadow-sm); transition: 0.2s; }
    .attention-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .attention-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
    .attention-text { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.6; }
    .attention-link { font-size: 13px; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
    .attention-link:hover { gap: 8px; }

    .dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 30px; }
    @media(max-width: 1024px) { .dash-row { grid-template-columns: 1fr; } }
    
    .quick-actions-row { display: flex; gap: 16px; overflow-x: auto; padding: 10px 5px 20px 5px; margin: 0 -5px; scroll-behavior: smooth; }
    .quick-actions-row::-webkit-scrollbar { height: 4px; }
    .quick-actions-row::-webkit-scrollbar-track { background: transparent; }
    .quick-actions-row::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
    
    .qa-btn { flex: 1; min-width: 150px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 22px 15px; text-align: center; color: var(--text-main); font-weight: 700; font-size: 13px; letter-spacing: 0.3px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
    .qa-btn::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; transition: 0.3s; }
    
    .qa-btn i { font-size: 26px; color: var(--primary); transition: all 0.3s ease; padding: 12px; background: var(--info-light); border-radius: 12px; }
    
    .qa-btn:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); background: var(--bg-body); color: var(--primary); }
    .qa-btn:hover::before { background: var(--primary); }
    .qa-btn:hover i { background: var(--primary); color: white; transform: scale(1.1) rotate(5deg); box-shadow: 0 8px 15px rgba(67, 97, 238, 0.3); }
    
    /* Specific Colors for Icons to make them pop */
    .qa-btn:nth-child(1) i { color: var(--success); background: var(--success-light); }
    .qa-btn:nth-child(1):hover i { background: var(--success); color: white; box-shadow: 0 8px 15px rgba(46, 204, 113, 0.3); }
    
    .qa-btn:nth-child(2) i { color: var(--primary); background: var(--info-light); }
    .qa-btn:nth-child(2):hover i { background: var(--primary); color: white; box-shadow: 0 8px 15px rgba(67, 97, 238, 0.3); }
    
    .qa-btn:nth-child(3) i { color: var(--warning); background: var(--warning-light); }
    .qa-btn:nth-child(3):hover i { background: var(--warning); color: white; box-shadow: 0 8px 15px rgba(243, 156, 18, 0.3); }
    
    .qa-btn:nth-child(5) i { color: var(--danger); background: var(--danger-light); }
    .qa-btn:nth-child(5):hover i { background: var(--danger); color: white; box-shadow: 0 8px 15px rgba(231, 76, 60, 0.3); }

    /* === 360 PROFILE STYLES === */
    .prof-tab-btn { background: transparent; border: none; padding: 10px 20px; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; transition: 0.3s; white-space: nowrap; }
    .prof-tab-btn:hover { color: var(--primary); }
    .prof-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
    .prof-info-table th { width: 140px; color: var(--text-muted); font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
    .prof-info-table td { color: var(--text-main); font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--border-color); }

    /* === GLOBAL OMNI-SEARCH === */
    .global-search-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 10px; background: var(--bg-card); border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.15); border: 1px solid var(--border-color); z-index: 10000; max-height: 450px; overflow-y: auto; overflow-x: hidden; }
    .global-search-dropdown.active { display: block; animation: slideDown 0.2s ease; }
    .gs-cat-title { padding: 10px 15px; font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); border-top: 1px solid var(--border-color); }
    .gs-cat-title:first-child { border-top: none; }
    .gs-item { padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-color); cursor: pointer; transition: 0.2s; }
    .gs-item:hover { background: var(--bg-body); }
    .gs-item:last-child { border-bottom: none; }
    .gs-item-left { display: flex; align-items: center; gap: 12px; }
    .gs-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: var(--fs-lg); flex-shrink: 0; }
    .gs-details strong { display: block; font-size: var(--fs-md); color: var(--text-main); margin-bottom: 2px; font-weight: 700; }
    .gs-details span { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
    .gs-action { font-size: var(--fs-xs); font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 5px; opacity: 0; transition: 0.2s; }
    .gs-item:hover .gs-action { opacity: 1; transform: translateX(-5px); }
    
    /* === COMMAND PALETTE EXTENSIONS === */
    .cmd-group { padding: 10px 15px; font-size: var(--fs-xs); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); border-top: 1px solid var(--border-color); }
    .cmd-group:first-child { border-top: none; }
    .cmd-item { padding: 10px 15px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: 0.2s; font-size: 13px; font-weight: 600; color: var(--text-main); }
    .cmd-item:hover { background: var(--primary); color: white; border-color: var(--primary); }
    .cmd-item i { width: 24px; text-align: center; color: var(--text-muted); transition: 0.2s; }
    .cmd-item:hover i { color: white; }
    
    /* === HEADER DATE/SESSION SELECTORS === */
    .header-context-bar { display: flex; align-items: center; gap: 15px; background: var(--bg-card); padding: 8px 15px; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
    .hc-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-main); cursor: pointer; border-right: 1px solid var(--border-color); padding-right: 15px; position: relative; }
    .hc-item:last-child { border-right: none; padding-right: 0; }
    .hc-item i { color: var(--primary); font-size: 14px; }
    .hc-input { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-main); cursor: pointer; outline: none; width: auto; }
    
    /* === SHORTCUTS MODAL === */
    .shortcut-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.6); z-index: 20000; justify-content: center; align-items: center; }
    .shortcut-content { background: var(--bg-card); width: 400px; border-radius: 12px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); overflow: hidden; animation: slideDown 0.2s ease; }
    .sc-header { padding: 15px 20px; background: var(--primary); color: white; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
    .sc-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-main); font-weight: 600; }
    .sc-key { background: var(--bg-body); border: 1px solid var(--border-color); padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--text-muted); font-family: monospace; font-weight: bold; box-shadow: 0 2px 0 var(--border-color); }

    /* === PREMIUM TOAST NOTIFICATION === */
    #toastContainer { position: fixed; bottom: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
    .toast-msg { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); border-left: 4px solid var(--success); padding: 12px 20px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 12px; font-size: var(--fs-md); font-weight: 600; animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; pointer-events: auto; min-width: 250px; }
    .toast-msg.error { border-left-color: var(--danger); }
    .toast-msg.warning { border-left-color: var(--warning); }
    .toast-msg i { font-size: 18px; }
    .toast-msg.info { border-left-color: var(--info); }
    .toast-msg.success i { color: var(--success); }
    .toast-msg.error i { color: var(--danger); }
    .toast-msg.warning i { color: var(--warning); }
    .toast-msg.info i { color: var(--info); }
    .toast-msg.fade-out { animation: slideOutRight 0.3s ease-in forwards; }
    @keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    @keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

    /* === KEBAB MENU (MORE ACTIONS) === */
    .kebab-menu { position: relative; display: inline-block; }
    .kebab-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-muted); font-size: 16px; padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
    .kebab-btn:hover { background: var(--bg-body); color: var(--text-main); }
    .kebab-dropdown { display: none; position: absolute; right: 0; top: 100%; min-width: 160px; background: var(--bg-card); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-radius: 8px; border: 1px solid var(--border-color); z-index: 1000; overflow: hidden; }
    .kebab-menu.active .kebab-dropdown { display: block; animation: slideDown 0.2s ease; }
    .kebab-dropdown.floating { display: block; position: fixed; right: auto; bottom: auto; z-index: 100000; animation: slideDown 0.2s ease; }
    .kebab-item { padding: 10px 15px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: 10px; cursor: pointer; transition: 0.2s; background: transparent; border: none; width: 100%; text-align: left; }
    .kebab-item:hover { background: var(--bg-body); }
    .kebab-item.danger { color: var(--danger); }
    .kebab-item.danger:hover { background: var(--danger-light); }

    /* === EMPTY STATE STYLES === */
    .empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .empty-state i { font-size: 40px; color: var(--border-color); margin-bottom: 15px; }
    .empty-state h4 { font-size: 16px; font-weight: 700; color: var(--text-main); margin: 0 0 5px 0; }
    .empty-state p { font-size: 13px; margin: 0; }

    /* === SKELETON LOADING === */
    .skeleton { background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
    .skeleton-text { height: 16px; margin-bottom: 8px; }
    .skeleton-card { height: 100px; border-radius: 10px; }
    .skeleton-circle { width: 50px; height: 50px; border-radius: 50%; }
    
    /* === FIX SWEETALERT Z-INDEX OVER FULL SCREEN === */
    .swal2-container { z-index: 20000 !important; }
    .swal2-popup { font-family: inherit !important; }
    
    /* === COMPACT SWEETALERT STYLING === */
    .swal-compact-popup { border-radius: 8px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; }
    .swal-compact-input { width: 100% !important; margin: 0 !important; padding: 8px 12px !important; font-size: 13px !important; border: 1px solid var(--border-color) !important; border-radius: 4px !important; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05) !important; }
    .swal-compact-input:focus { border-color: var(--primary) !important; outline: none !important; box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.25) !important; }
    .swal-compact-actions { margin-top: 15px !important; padding: 0 !important; display: flex !important; justify-content: flex-end !important; gap: 8px !important; width: 100% !important; }
    .swal-compact-actions button { margin: 0 !important; font-size: 13px !important; padding: 6px 14px !important; font-weight: 600 !important; }

    /* === PROFESSIONAL SCROLLBAR === */
    .pro-scroll { max-height: 500px; overflow-y: auto; overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-color); }
    .pro-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
    .pro-scroll::-webkit-scrollbar-track { background: var(--bg-body); border-radius: 8px; }
    .pro-scroll::-webkit-scrollbar-thumb { background: var(--gray-500); border-radius: 8px; }
    .pro-scroll::-webkit-scrollbar-thumb:hover { background: var(--secondary); }
    .pro-scroll table { width: 100%; border-collapse: collapse; margin: 0; }
    .pro-scroll thead th { position: sticky; top: 0; z-index: 10; background: var(--primary-blue); color: white; box-shadow: 0 2px 5px rgba(0,0,0,0.15); }

    /* === PREMIUM UI/UX POLISH === */
    .tab-section { display: none; animation: tabFadeIn 0.4s ease-out forwards; }
    .tab-section.active { display: block; }
    @keyframes tabFadeIn { from { opacity: 0; } to { opacity: 1; } }
    
    tbody tr { transition: background-color 0.2s ease, transform 0.1s ease; }
    tbody tr:hover { background-color: rgba(67, 97, 238, 0.04) !important; transform: translateY(-1px); }
    
    @keyframes pulse-alert { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }
    .pulse-alert { animation: pulse-alert 2s infinite; border-radius: 50%; display: inline-block; min-width: 18px; text-align: center; }
    .pulse-alert.warning { animation: pulse-warning 2s infinite; }
    @keyframes pulse-warning { 0% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(243, 156, 18, 0); } 100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); } }

    /* === CRM DRAWER STYLES === */
    .crm-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.5); z-index: 20005; display: none; opacity: 0; transition: 0.3s; }
    .crm-drawer { position: fixed; top: 0; right: -450px; width: 400px; max-width: 90vw; height: 100vh; background: var(--bg-card); box-shadow: -5px 0 25px rgba(0,0,0,0.1); z-index: 20010; transition: right 0.3s ease; display: flex; flex-direction: column; }
    .crm-drawer.open { right: 0; }
    .crm-overlay.open { display: block; opacity: 1; }
    .crm-header { padding: 20px; background: var(--primary); color: white; display: flex; justify-content: space-between; align-items: center; }
    .crm-body { padding: 20px; flex: 1; overflow-y: auto; }
    .crm-timeline { border-left: 2px solid var(--border-color); margin-left: 10px; padding-left: 20px; position: relative; margin-top: 20px; }
    .crm-timeline-item { margin-bottom: 20px; position: relative; }
    .crm-timeline-item::before { content: ''; position: absolute; left: -26px; top: 0; width: 10px; height: 10px; background: var(--primary); border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 2px var(--info-light); }

    /* === NEW ATTENDANCE UI (GRAY DEFAULT & COLOR ON CHECK) === */
    .att-radio input[type="radio"] { display: none; }
    .att-radio label {
        padding: 4px 10px; font-size: var(--fs-xs); font-weight: 700; border-radius: 4px;
        text-align: center; min-width: 25px; cursor: pointer; transition: 0.2s;
        background: var(--gray-200); color: var(--gray-800); border: 1px solid transparent;
    }
    
    /* Hover Effects */
    .att-radio input[type="radio"]:not(:checked) + label:hover { background: var(--gray-400); }
    
    /* Checked State Colors */
    .att-radio input[value="P"]:checked + label { background: var(--success-light); color: var(--success); border-color: var(--success); }
    .att-radio input[value="A"]:checked + label { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
    .att-radio input[value="L"]:checked + label { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
    .att-radio input[value="H"]:checked + label { background: var(--info-light); color: var(--info); border-color: var(--info); }
    .att-radio input[value="N"]:checked + label { background: var(--gray-600); color: var(--white); border-color: var(--gray-700); }
    
    /* Grid Cells (Monthly Attendance) */
    .reg-p { color: var(--success); font-weight: bold; }
    .reg-a { color: var(--danger); font-weight: bold; }
    .reg-l { color: var(--warning); font-weight: bold; }
    .reg-info { color: var(--info); font-weight: bold; }
    .reg-s { color: #7c3aed; font-weight: bold; }
    .reg-h { color: var(--gray-700); font-weight: bold; }

    /* === MAIN DESKTOP LAYOUT === */
    .admin-container { display: flex; align-items: flex-start; min-height: 100vh; }
    .sidebar { width: 260px; flex-shrink: 0; }
    .main-content { flex: 1; min-width: 0; padding: 24px 28px; }

    /* === SIDEBAR ALAG SCROLL (desktop) === */
    @media (min-width: 769px) {
      .admin-container { padding-left: 260px; position: relative; }
      .sidebar { position: fixed !important; top: 0; left: 0; height: 100vh !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; z-index: 900; }
      #masterRecordsTitle .global-search-wrapper { min-width: 120px; }
      #masterRecordsTitle select, #masterRecordsTitle .btn { flex-shrink: 0; }
      #masterRecordsTitle a { white-space: nowrap; }
    }
    @media (min-width: 769px) and (max-width: 1024px) { .admin-container { padding-left: 220px; } }
    .prof-info-table th { background: transparent !important; color: var(--text-muted) !important; text-align: left; }
    .prof-tab-btn { margin-bottom: -2px; }
    .prof-tab-btn.active { color: var(--primary); border-bottom: 3px solid var(--primary); background: var(--primary-light, rgba(67,97,238,0.08)); border-radius: 6px 6px 0 0; }

    /* === MOBILE & TABLET RESPONSIVE CSS === */
    @media (max-width: 1024px) {
      .sidebar { width: 220px; }
      .dash-row { grid-template-columns: 1fr; }
    }

    @media (max-width: 768px) {
      /* Sidebar Off-Canvas */
      .sidebar { position: fixed !important; top: 0; left: 0; bottom: 0; width: 260px; max-width: 82vw; transform: translateX(-100%); transition: transform .25s ease-in-out; z-index: 1000; background: var(--sidebar-bg); }
      .sidebar.open { transform: translateX(0); }
      #sidebarOverlay.active { display: block !important; }
      
      /* Main Content Spacing */
      .admin-container { flex-direction: column; }
      .main-content { padding: 60px 14px 76px; }
      
      /* Top Navbar & Toggles */
      #sidebarToggle { display: flex !important; align-items: center; justify-content: center; width: 44px; height: 44px; top: 10px !important; left: 10px !important; }
      .dash-header-wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
      .top-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
      .global-search-wrapper { max-width: 100% !important; width: 100%; margin-right: 0 !important; }
      
      /* Mobile Nav Bottom */
      #mobileNav { display: flex !important; }
      .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 12px; color: var(--secondary); font-size: var(--fs-xs); cursor: pointer; border: none; background: none; min-height: 44px; justify-content: center; transition: 0.2s; }
      .mobile-nav-item.active { color: var(--primary); font-weight: bold; }
      .mobile-nav-item i { font-size: 20px; }
      
      /* Modals, Grids & Sideways Scroll fixes */
      .swal-compact-popup, .swal2-popup, .shortcut-content, .crm-drawer { max-width: 94vw !important; }
      .form-grid, .kpi-grid, .attention-grid { grid-template-columns: 1fr; }
      .card { padding: 15px; }
      .quick-actions-row { margin: 0; padding-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; }
      .header-context-bar { flex-wrap: wrap; }
      
      /* Tables Scroll Inside Cards */
      .pro-scroll, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; display: block; }
      table { min-width: max-content; }
      
      body.sidebar-open #sidebarToggle { visibility: hidden; }
      #toastContainer { bottom: 90px; left: 10px; right: 10px; }
      .toast-msg { max-width: 100%; }
    }
    
    html, body { overflow-x: hidden; } /* Aakhiri safety net sideways scroll rokne ke liye */

/* =====================================================================
   DARK MODE FIX  (sab kuch body.dark-mode ke andar hai —
   light mode par is block ka koi asar nahi padta)
   ===================================================================== */
body.dark-mode {
  color-scheme: dark;                       /* native scrollbar, date icon, select, checkbox sab dark */
  --bg-gray: #15171c; --bg-white: #1d2027; --text-dark: #e3e5ea;
  --primary-blue: #7184e0;                  /* style.css isse navy kar deta hai — dark me readable soft blue */
  --dm-head: #242831;                       /* table header ka soft rang */
  --dm-link: #9fadee;                       /* blue text jo dark par bhi padhne layak ho */
  background: var(--bg-body) !important;
  color: var(--text-main);
}
html:has(body.dark-mode) { background: #15171c; color-scheme: dark; }
body.dark-mode #adminMainContent,
body.dark-mode .admin-container,
body.dark-mode .main-content { background: var(--bg-body); color: var(--text-main); }

/* ---------- SIDEBAR ---------- */
body.dark-mode .sidebar { background: var(--sidebar-bg) !important; border-right: 1px solid var(--border-color); box-shadow: none; }
body.dark-mode .sidebar button:not(.uk-13) { color: var(--text-main); background: transparent; }
body.dark-mode .sidebar button:not(.uk-13) i:not(.uk-13) { color: var(--text-muted); }
body.dark-mode .sidebar button:not(.uk-13):hover { background: rgba(255,255,255,0.05); color: #eef0f5; }
body.dark-mode .sidebar button:not(.uk-13):hover i:not(.uk-13) { color: var(--dm-link); }
body.dark-mode .sidebar button.uk-13:hover { background: var(--danger-light); }
body.dark-mode .sidebar button.tab-link.active { background: rgba(113,132,224,0.16); color: #eef0f5; box-shadow: none; }
body.dark-mode .sidebar button.tab-link.active i { color: var(--dm-link); }
body.dark-mode .sidebar hr { border-top-color: var(--border-color) !important; }

/* ---------- TEXT / LABELS / HEADINGS ---------- */
body.dark-mode .section-title,
body.dark-mode .section-title h2 { color: var(--text-main); }
body.dark-mode .input-group label { color: #b4b9c4; }
body.dark-mode .uk-32,
body.dark-mode [style*="color:var(--primary-blue)"]:not([style*="background"]),
body.dark-mode [style*="color: var(--primary-blue)"]:not([style*="background"]) { color: var(--dm-link) !important; }
/* white text jo coloured buttons/badges par tha (dark me --white dark ban jata hai) */
body.dark-mode .btn-warning,
body.dark-mode [style*="color:var(--white)"],
body.dark-mode [style*="color: var(--white)"] { color: #fff; }

/* ---------- FORM FIELDS ---------- */
body.dark-mode .input-group input:not([type=checkbox]):not([type=radio]):not([type=file]),
body.dark-mode .input-group select,
body.dark-mode .input-group textarea,
body.dark-mode .dash-search,
body.dark-mode .matrix-input-node,
body.dark-mode .login-box input {
  background: var(--bg-body); color: var(--text-main); border-color: var(--border-color);
}
body.dark-mode .input-group input:focus,
body.dark-mode .input-group select:focus,
body.dark-mode .input-group textarea:focus,
body.dark-mode .dash-search:focus { border-color: var(--primary); background: var(--bg-card); }
/* jin fields par apna background set nahi hai (browser default grey/white) unhe bhi theme do */
body.dark-mode select:not(.global-search-input):not(.hc-input):not(.swal2-select),
body.dark-mode textarea:not(.swal2-textarea),
body.dark-mode input:is([type=text],[type=number],[type=date],[type=month],[type=time],[type=url],[type=email],[type=tel],[type=password],[type=search]):not(.global-search-input):not(.hc-input):not(.swal2-input) {
  background-color: var(--bg-body); color: var(--text-main); border-color: var(--border-color);
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: var(--text-muted); opacity: .85; }
body.dark-mode input[readonly] { color: var(--dm-link); }
body.dark-mode .checkbox-grid { background: var(--bg-body); border-color: var(--border-color); }
body.dark-mode .checkbox-grid label { color: var(--text-main); }
body.dark-mode .dur-toggle-btn { background: var(--bg-card); color: var(--dm-link); border: 1px solid var(--border-color); }
body.dark-mode .dur-toggle-btn:hover { background: var(--primary); color: #fff; }
body.dark-mode .settings-badge { background: rgba(113,132,224,0.16); color: #c9d1f5; }

/* ---------- TABLES ---------- */
body.dark-mode td { border-bottom-color: var(--border-color); }
body.dark-mode tr:hover { background: rgba(255,255,255,0.03); }
body.dark-mode table:not(.prof-info-table) th { background: var(--dm-head) !important; color: #c9cdd6 !important; }
body.dark-mode .pro-scroll thead th { box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
body.dark-mode .prof-info-table th { background: transparent; color: var(--text-muted); }

/* ---------- PROFILE MESSAGE BOX (JS isme light rang set karta hai) ---------- */
body.dark-mode #profCurrentMsgBox { background: var(--bg-highlight) !important; border-color: var(--border-highlight) !important; }
body.dark-mode #profCurrentMsgText { color: var(--text-highlight) !important; }

/* ---------- POPUPS / LOADER ---------- */
body.dark-mode #globalLoader { background: rgba(10,11,14,0.6) !important; }
body.dark-mode .swal2-popup { border: 1px solid var(--border-color); }
body.dark-mode .swal2-html-container [style*="color:#444"],
body.dark-mode .swal2-html-container [style*="color: #444"] { color: var(--text-main) !important; }
body.dark-mode .swal2-validation-message { background: var(--bg-body); color: var(--danger); }
body.dark-mode .swal2-timer-progress-bar { background: rgba(255,255,255,0.35); }
body.dark-mode .swal2-close { color: var(--text-muted); }
body.dark-mode .swal2-close:hover { color: var(--danger); }
body.dark-mode .swal2-toast { background: var(--bg-card) !important; }
body.dark-mode .swal2-toast .swal2-title { color: var(--text-main) !important; }

  
/* ===== C1: auto-generated utility classes (replace repeated inline styles) ===== */
:root body .ui-1 { flex: 1; text-align: left; }
:root body .ui-2 { width:auto; padding:8px 12px; }
:root body .ui-3 { padding:12px 15px; }
:root body .ui-4 { width: auto; font-size: var(--fs-xs); margin-right: 8px; }
:root body .ui-5 { margin-bottom: 20px; }
:root body .ui-6 { width:80px; text-align:center; }
:root body .ui-7 { margin:0; }
:root body .ui-8 { padding:0; overflow:hidden; }
:root body .ui-9 { padding:15px; }
:root body .ui-10 { font-size:13px; font-weight:600; }
:root body .ui-11 { padding:12px 20px; }
:root body .ui-12 { padding:8px 15px; }
:root body .ui-13 { font-size:13px; }
:root body .ui-14 { width:auto; padding:10px; }
:root body .ui-15 { display:flex; flex-wrap:wrap; gap:10px; }
:root body .ui-16 { padding: 10px; }
:root body .ui-17 { display:flex; gap:10px; }
:root body .ui-18 { max-height: 400px; }
:root body .ui-19 { display:flex; gap:10px; margin-bottom:15px; }
:root body .ui-20 { display:flex; gap:5px; overflow-x:auto; }
:root body .ui-21 { resize:none; }
:root body .ui-22 { margin:0 0 20px 0; font-size:16px; }
:root body .ui-23 { display:flex; justify-content:space-between; margin-top:20px; }
:root body .ui-24 { margin:0; padding:0; overflow:hidden; }
:root body .ui-25 { margin-bottom:0; }
:root body .ui-26 { margin:0 0 15px 0; font-size:16px; font-weight:800; }
:root body .ui-27 { margin:0; min-width:200px; width:320px; }
:root body .ui-28 { grid-column: 1 / -1; }
:root body .ui-29 { grid-template-columns: repeat(5, 1fr); margin-bottom:20px; }
:root body .ui-30 { margin:0; padding:15px; text-align:center; }

/* ===== C7: accessibility ===== */
.skip-link{position:absolute;left:-9999px;top:8px;z-index:100000;background:var(--primary);color:#fff;padding:10px 16px;border-radius:8px;font-weight:600}
.skip-link:focus{left:8px}
:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
button:focus-visible,[role="button"]:focus-visible,a:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(67,97,238,.35)}
#mainContent:focus{outline:none}

/* ===== D1: pagination ===== */
.pg-hide{display:none !important}
.pager{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:12px 4px;font-size:13px;color:var(--text-muted)}
.pager .pg-btns{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pager button{min-width:34px;height:34px;padding:0 10px;border:1px solid var(--border-color);background:var(--bg-card);color:var(--text-main);border-radius:8px;cursor:pointer;font-weight:600}
.pager button:hover:not(:disabled){border-color:var(--primary);color:var(--primary)}
.pager button.active{background:var(--primary);border-color:var(--primary);color:#fff}
.pager button:disabled{opacity:.45;cursor:not-allowed}
.pager select{height:34px;border:1px solid var(--border-color);background:var(--bg-card);color:var(--text-main);border-radius:8px;padding:0 8px}

/* ===== C1 pass 2: utility classes ===== */
:root:root:root body .uk-1 { color:var(--danger); }
:root:root:root body .uk-2 { padding:12px 15px; }
:root:root:root body .uk-3 { background:var(--bg-body); border:1px solid var(--border-color); color:var(--text-main); }
:root:root:root body .uk-4 { padding:15px; border-bottom:1px solid var(--border-color); }
:root:root:root body .uk-5 { border-bottom:1px solid var(--border-color); }
:root:root:root body .uk-6 { font-size:12px; color:var(--text-muted); }
:root:root:root body .uk-7 { padding-left: 45px; font-size: var(--fs-sm); color: var(--text-muted); min-height: 35px; margin: 2px 10px; }
:root:root:root body .uk-8 { color:var(--text-muted); }
:root:root:root body .uk-9 { color: var(--primary); font-size: 24px; }
:root:root:root body .uk-10 { color:var(--success); }
:root:root:root body .uk-11 { width:100%; border-collapse:collapse; text-align:left; }
:root:root:root body .uk-12 { background:var(--bg-body); font-size:12px; color:var(--text-muted); text-transform:uppercase; }
:root:root:root body .uk-13 { color: var(--danger); }
:root:root:root body .uk-14 { color:var(--text-muted); font-size:12px; }
:root:root:root body .uk-15 { font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; }
:root:root:root body .uk-16 { color:var(--warning); }
:root:root:root body .uk-17 { color:var(--info); }
:root:root:root body .uk-18 { padding:15px; text-align:right; }
:root:root:root body .uk-19 { font-size:12px; }
:root:root:root body .uk-20 { padding: 15px; border-bottom: 1px solid var(--border-color); text-align: center; }
:root:root:root body .uk-21 { padding:15px; border-bottom:1px solid var(--border-color); text-align:right; }
:root:root:root body .uk-22 { padding:15px; }
:root:root:root body .uk-23 { margin:5px 0; border:none; border-top:1px solid var(--border-color); }
:root:root:root body .uk-24 { padding:12px 20px; }
:root:root:root body .uk-25 { padding: 15px; text-align: left; color:var(--text-muted); font-size: 12px; text-transform: uppercase; }
:root:root:root body .uk-26 { padding:15px; text-align:center; }
:root:root:root body .uk-27 { font-weight:800; color:var(--text-muted); }
:root:root:root body .uk-28 { padding: 12px 15px; border-bottom: 1px solid var(--border-color); }
:root:root:root body .uk-29 { padding:15px; margin-bottom:20px; background:var(--gray-100); }
:root:root:root body .uk-30 { display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; border-bottom:1px solid var(--border-color); padding-bottom:10px; }
:root:root:root body .uk-31 { padding:12px 15px; text-align:center; }
:root:root:root body .uk-32 { color:var(--primary-blue); margin-bottom:15px; }
:root:root:root body .uk-33 { flex:1; padding:8px; border:1px solid var(--border-color); border-radius:5px; }
:root:root:root body .uk-34 { font-size:16px; margin:0 0 15px 0; color:var(--text-main); }
:root:root:root body .uk-35 { padding:15px; color:var(--text-main); font-weight:700; }
:root:root:root body .uk-36 { padding:4px 8px; }
:root:root:root body .uk-37 { right:0; }
:root:root:root body .uk-38 { text-align:center; padding:20px; }
:root:root:root body .uk-39 { padding:15px 10px; color:var(--text-main); }
:root:root:root body .uk-40 { padding:15px 10px; text-align:right; }
:root:root:root body .uk-41 { font-size:12px; color:var(--text-muted); background:var(--bg-body); padding:4px 8px; border-radius:4px; }
:root:root:root body .uk-42 { font-size: 12px; width: auto; color: var(--text-muted); }
:root:root:root body .uk-43 { width: 100%; border-collapse: collapse; text-align: left; }
:root:root:root body .uk-44 { padding:15px; border-bottom:1px solid var(--border-color); text-align:center; }
:root:root:root body .uk-45 { border-bottom:none; }
:root:root:root body .uk-46 { margin:0; font-size:12px; color:var(--text-muted); text-transform:uppercase; }
:root:root:root body .uk-47 { padding:15px; color:var(--text-muted); }
:root:root:root body .uk-48 { padding:12px; }
:root:root:root body .uk-49 { cursor: pointer; }
:root:root:root body .uk-50 { padding: 12px 15px; }
:root:root:root body .uk-51 { padding:5px; }
:root:root:root body .uk-52 { cursor:pointer; }
:root:root:root body .uk-53 { padding:20px; text-align:center; color:var(--text-muted); font-size:13px; }
:root:root:root body .uk-54 { font-size:24px; color:var(--success); margin-bottom:10px; display:block; }
:root:root:root body .uk-55 { padding:10px; border:1px solid var(--gray-300); border-radius:5px; outline:none; }
:root:root:root body .uk-56 { padding: 8px 15px; border: 1px solid var(--gray-300); border-radius: 5px; font-size: 14px; width: 250px; outline: none; }
:root:root:root body .uk-57 { border-top:4px solid var(--primary); }
:root:root:root body .uk-58 { border-top:4px solid var(--warning); }
:root:root:root body .uk-59 { border-top:4px solid var(--success); }
:root:root:root body .uk-60 { color:var(--primary); }
:root:root:root body .uk-61 { font-size:20px; font-weight:800; color:var(--primary); }
:root:root:root body .uk-62 { margin:0; padding:15px; text-align:center; border-top:3px solid var(--success); }
:root:root:root body .uk-63 { font-size:12px; font-weight:700; color:var(--success); text-transform:uppercase; }
:root:root:root body .uk-64 { font-size:20px; font-weight:800; color:var(--success); }
:root:root:root body .uk-65 { margin:0; padding:15px; text-align:center; border-top:3px solid var(--danger); }
:root:root:root body .uk-66 { font-size:12px; font-weight:700; color:var(--danger); text-transform:uppercase; }
:root:root:root body .uk-67 { font-size:20px; font-weight:800; color:var(--danger); }
:root:root:root body .uk-68 { margin:0; padding:15px; text-align:center; border-top:3px solid var(--warning); }
:root:root:root body .uk-69 { font-size:12px; font-weight:700; color:var(--warning); text-transform:uppercase; }
:root:root:root body .uk-70 { font-size:20px; font-weight:800; color:var(--warning); }
:root:root:root body .uk-71 { width:100%; text-align:left; border-collapse:collapse; }
:root:root:root body .uk-72 { font-size:13px; color:var(--text-muted); margin-bottom:20px; }
:root:root:root body .uk-73 { padding:15px; color:var(--text-muted); font-size:12px; }
:root:root:root body .uk-74 { padding:15px; color:var(--text-main); }
:root:root:root body .uk-75 { padding:10px 15px; text-align:right; }
:root:root:root body .uk-76 { padding: 12px 15px; text-align: center; }
:root:root:root body .uk-77 { padding:10px; border-bottom:1px solid var(--border-color); }
:root:root:root body .uk-78 { text-align:center; padding:20px; color:var(--text-muted); }
:root:root:root body .uk-79 { background:var(--info-light); color:var(--info); }

/* ===== Phone fix: content must never be wider than the screen ===== */
@media (max-width: 768px) {
  .admin-container { align-items: stretch; }
  .main-content { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .dash-header-wrap, .header-context-bar { max-width: 100%; }
}

/* ===== Fixes: dashboard cards, tab bars, menus, settings, fee history ===== */
div:has(> .prof-tab-btn), .ui-20 { overflow-y: hidden !important; scrollbar-width: none; }
div:has(> .prof-tab-btn)::-webkit-scrollbar, .ui-20::-webkit-scrollbar { display: none; }
.kebab-dropdown.floating { right: auto !important; bottom: auto !important; width: max-content; min-width: 170px; max-width: 260px; }
#dynamicSettings .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
#dynamicSettings .form-grid > .card { overflow: visible; min-width: 0; }
#dynamicSettings .form-grid .ui-19 { align-items: stretch; flex-wrap: nowrap; }
#dynamicSettings .form-grid .ui-19 input { min-width: 0; }
#dynamicSettings .form-grid .ui-19 button { flex-shrink: 0; }
#dynamicSettings .form-grid .badge-container { max-height: 260px; overflow-y: auto; }
.fee-hist-btn { background: transparent; border: none; font-size: 14px; font-weight: 700; color: var(--success); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; }
.fee-hist-btn:hover { background: var(--bg-body); }
.fee-hist-btn i { font-size: 11px; color: var(--text-muted); }
.fee-pop { position: fixed; z-index: 100000; width: 310px; max-width: 92vw; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.18); overflow: hidden; text-align: left; }
.fee-pop .fh-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-main); background: var(--bg-body); }
.fee-pop .fh-head span { color: var(--success); font-weight: 800; }
.fee-pop .fh-list { max-height: 240px; overflow-y: auto; }
.fee-pop .fh-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.fee-pop .fh-sub { grid-column: 1 / -1; font-size: 11px; color: var(--text-muted); margin-top: -4px; }
.fee-pop .fh-row:last-child { border-bottom: none; }
.fee-pop .fh-row small { color: var(--text-muted); font-weight: 500; }
.fee-pop .fh-amt { font-weight: 700; }
.fee-pop .fh-act i { cursor: pointer; padding: 4px; }
.fee-pop .fh-act i + i { margin-left: 6px; }
.fee-pop .fh-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Daily Attendance toolbar: date, course, batch, search in one line */
#dailyAttTitle { align-items: center; gap: 20px; }
#dailyAttTitle > div:first-child { flex-shrink: 0; }
.att-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.att-toolbar > input[type=date], .att-toolbar > select { flex: 0 0 auto; }
.att-toolbar .global-search-wrapper { flex: 1 1 140px; width: auto; min-width: 120px; max-width: 260px; }
@media (max-width: 1100px) {
  .att-toolbar { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
  .att-toolbar .global-search-wrapper { flex: 1 1 100%; max-width: 100%; }
}


/* ---- Admin fixes: dropdown options + inline <details> (dark mode) ---- */
body.dark-mode select option, body.dark-mode select optgroup { background: var(--bg-card); color: var(--text-main); }
#adminMainContent details { background: transparent; box-shadow: none; margin: 4px 0 0; border-radius: 0; overflow: visible; }
#adminMainContent details summary { padding: 2px 0; border: 0; background: none; list-style: none; }
#adminMainContent details summary::-webkit-details-marker { display: none; }
#adminMainContent details summary::after { display: none; }
#adminMainContent details[open] summary { border-bottom: 0; }
#adminMainContent details > div { color: var(--text-main); }
