/* ==========================================================================
   WINGS MODEL COLLEGE & SCHOOL  ·  Admin Design System  ·  "DAFTAR"
   --------------------------------------------------------------------------
   Ye system school ke daftar se liya gaya hai -- hazri register, challan
   book, aur neeli mohar. Is liye:

     · Koi gradient nahi, koi glow nahi, koi dhundli orb nahi.
       Rang sirf MAANI rakhta hai: neela = amal, laal = kami, sabz = jama.
     · Har surface safed kaghaz hai, ek baal jitni lakeer ke saath.
     · SIGNATURE = PERFORATION -- challan ki phaarne wali dotted lakeer.
       Card ke header ke neeche, topbar ke neeche, sidebar ke groups ke beech.
     · Numbers register ki tarah: tabular, tight, upar mono ka chhota label.
     · Radius chhota (6px) -- kaghaz ka kona, plastic ka bubble nahi.

   Type : Archivo (sar-nama + adad) · Public Sans (matn, sarkari form ka face)
          IBM Plex Mono (serial, label, waqt)
   Dark : <html data-theme="dark"> -- sirf tokens badalte hain.
   ========================================================================== */

:root {
    /* ---- Type ---- */
    --font-display: 'Archivo', system-ui, -apple-system, sans-serif;
    --font-body:    'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* ---- Siyahi / ink ---- */
    --ink:       #0D1B2E;
    --ink-2:     #4B5C77;
    --ink-3:     #8494AC;

    --indigo:    #1F3A6E;
    --indigo-2:  #2E5296;
    --sky:       #0B7FD4;   /* sarkari neeli siyahi -- amal ka rang */
    --sky-deep:  #075FA1;
    --tint:      #E4F0FA;   /* carbon-copy ki halki neeli chhaap */

    --red-ink:   #C8384A;   /* laal qalam -- kami, ghair-hazri */
    --green-ink: #0E7A5F;   /* jama, hazir */
    --ochre:     #B87400;   /* mohar -- intezar */
    --violet:    #5B4BC4;

    /* ---- Kaghaz ---- */
    --canvas:    #EDF0F5;
    --surface:   #FFFFFF;
    --surface-2: #F5F7FB;
    --line:      #D6DDE9;
    --line-soft: #E7ECF4;

    /* ---- Purane naam, naye rang: 400+ pages bina chhue theek ---- */
    --bg:          var(--surface);
    --panel:       var(--canvas);
    --border:      var(--line);
    --navy:        var(--indigo);
    --navy-soft:   var(--indigo-2);
    --gold:        var(--sky);
    --gold-soft:   rgba(11, 127, 212, 0.11);
    --gold-light:  rgba(11, 127, 212, 0.06);
    --text-bright: var(--ink);
    --text-muted:  var(--ink-2);
    --text-light:  var(--ink-3);
    --danger:      var(--red-ink);
    --success:     var(--green-ink);
    --warning:     var(--ochre);
    --purple:      var(--violet);
    --teal:        var(--green-ink);
    --coral:       var(--red-ink);
    --blue:        var(--sky);

    --sidebar-width: 268px;

    /* Radius: kaghaz ka kona */
    --radius:    6px;
    --radius-lg: 8px;
    --radius-sm: 4px;

    /* Sirf urhne wali cheezon ke liye saya. Card par koi saya nahi. */
    --shadow:       none;
    --shadow-hover: none;
    --shadow-pop:   0 10px 34px rgba(13, 27, 46, .16), 0 2px 6px rgba(13, 27, 46, .08);
    --shadow-ring:  0 0 0 3px rgba(11, 127, 212, .16);

    /* SIGNATURE: challan ki phaarne wali lakeer */
    --perf: repeating-linear-gradient(to right,
              var(--line) 0 4px, transparent 4px 9px);
    --perf-strong: repeating-linear-gradient(to right,
              var(--sky) 0 5px, transparent 5px 11px);

    --transition: all .16s ease;
    --transition-slow: all .24s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-body);
    background: var(--panel);
    color: var(--text-bright);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--panel); }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border);
    margin-bottom: 20px; flex-shrink: 0;
}
.sidebar-brand .crest {
    width: 38px; height: 38px; border-radius: 8px; 
   background: #fff;
   display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    padding: 3px; overflow: hidden;
} 
.sidebar-brand .crest svg { width: 20px; height: 20px; }
.crest img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.sidebar-brand .brand-text { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.2; }
.sidebar-brand .brand-text .sub {
    display: block; font-family: var(--font-body); font-weight: 500; font-size: 9px;
    color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-right: 4px; }
.sidebar-nav .nav-label {
    font-family: var(--font-mono); font-size: 9px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; padding: 12px 12px 6px; opacity: 0.5;
}
.sidebar-nav .nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); text-decoration: none; font-size: 12.5px; font-weight: 500;
    transition: var(--transition); cursor: pointer; position: relative;
}
.sidebar-nav .nav-item:hover { background: var(--gold-light); color: var(--text-bright); }
.sidebar-nav .nav-item.active { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.sidebar-nav .nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.sidebar-nav .nav-item .badge {
    margin-left: auto; background: var(--gold-soft); color: var(--gold); font-size: 9px; font-weight: 600;
    padding: 1px 8px; border-radius: 10px; font-family: var(--font-mono);
}

.sidebar-nav .nav-group { margin-bottom: 2px; }
.sidebar-nav .nav-group summary {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 12.5px; font-weight: 500; cursor: pointer; list-style: none; transition: var(--transition);
}
.sidebar-nav .nav-group summary:hover { background: var(--gold-light); color: var(--text-bright); }
.sidebar-nav .nav-group summary::-webkit-details-marker { display: none; }
.sidebar-nav .nav-group summary .icon { width: 18px; height: 18px; flex-shrink: 0; color: currentColor; }
.sidebar-nav .nav-group summary .chevron { margin-left: auto; transition: transform 0.2s ease; width: 14px; height: 14px; }
.sidebar-nav .nav-group[open] summary .chevron { transform: rotate(180deg); }
.sidebar-nav .nav-group .sub-nav { padding-left: 20px; margin-top: 2px; }
.sidebar-nav .nav-group .sub-nav .nav-item { padding: 6px 12px; font-size: 11.5px; font-weight: 400; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto; flex-shrink: 0; }
.sidebar-footer .user-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); transition: var(--transition); cursor: pointer; text-decoration: none; color: inherit; }
.sidebar-footer .user-card:hover { background: var(--gold-light); }
.sidebar-footer .user-card .avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: white;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
    font-family: var(--font-display); flex-shrink: 0; overflow: hidden;
}
.sidebar-footer .user-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-footer .user-card .user-info { flex: 1; min-width: 0; }
.sidebar-footer .user-card .user-info .name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user-card .user-info .role { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.sidebar-footer .user-card .logout-icon { width: 14px; height: 14px; color: var(--text-muted); transition: var(--transition); }
.sidebar-footer .user-card:hover .logout-icon { color: var(--gold); }

/* ============================================
   MAIN / TOPBAR / CONTENT
   ============================================ */
.main { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.topbar {
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 14px 32px;
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left .page-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.topbar-left .page-title .highlight { color: var(--gold); }
.topbar-left .session-badge {
    font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); background: var(--panel);
    padding: 3px 10px; border-radius: 16px; border: 1px solid var(--border); letter-spacing: 0.04em;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .icon-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); position: relative;
}
.topbar-right .icon-btn:hover { background: var(--gold-light); color: var(--text-bright); }
.topbar-right .icon-btn .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.topbar-right .profile-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 30px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: var(--transition); text-decoration: none; color: inherit; }
.topbar-right .profile-btn:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.topbar-right .profile-btn .avatar-sm { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: white; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; font-family: var(--font-display); overflow: hidden; }
.topbar-right .profile-btn .avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.topbar-right .profile-btn .name-sm { font-size: 11.5px; font-weight: 500; }
.topbar-right .profile-btn .chevron-sm { width: 12px; height: 12px; color: var(--text-muted); }
.topbar-right .profile-btn { font: inherit; }

/* ===== Notification bell + profile dropdowns (Student/Teacher topbar) ===== */
.notif-wrap, .profile-wrap { position: relative; }

.notif-dropdown, .profile-dropdown {
    display: none; position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
}
.notif-dropdown.open, .profile-dropdown.open { display: block; }

.notif-dropdown { width: 320px; max-width: 88vw; overflow: hidden; }
.notif-dropdown-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-size: 13px; font-weight: 600; color: var(--text-bright);
}
.notif-dropdown-head button {
    font-family: inherit; font-size: 11px; font-weight: 500; color: var(--gold);
    background: none; border: none; cursor: pointer; padding: 0;
}
.notif-dropdown-head button:hover { text-decoration: underline; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--gold-light); }
.notif-item.unread { background: var(--gold-light); }
.notif-item.unread .notif-item-title::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--danger); margin-right: 6px;
}
.notif-item-title { font-size: 12.5px; font-weight: 600; color: var(--text-bright); margin-bottom: 2px; }
.notif-item-msg { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.notif-item-time { font-size: 10.5px; color: var(--text-light); margin-top: 4px; }
.notif-empty { padding: 24px 14px; text-align: center; font-size: 12.5px; color: var(--text-muted); }

.profile-dropdown { width: 190px; padding: 6px; }
.profile-dropdown a {
    display: block; padding: 9px 10px; border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 500; color: var(--text-bright); text-decoration: none; transition: var(--transition);
}
.profile-dropdown a:hover { background: var(--gold-light); }
.profile-dropdown a.danger { color: var(--danger); }

.content { padding: 24px 32px; }

.welcome-banner { background: var(--bg); border-radius: var(--radius); padding: 24px 32px; border: 1px solid var(--border); margin-bottom: 24px; }
.welcome-banner h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.welcome-banner p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ============================================
   FORM STYLES
   ============================================ */
.form-container { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; max-width: 900px; }
.form-container.full { max-width: 100%; }
.form-header { margin-bottom: 32px; border-bottom: 1px solid var(--border); padding-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.form-header h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.form-header p { font-size: 13px; color: var(--text-muted); }
.form-section { margin-bottom: 28px; }
.form-section-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--navy); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--gold-light); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 16px; }
.form-grid .full-width { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-bright); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-group .help-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-group .field-error { font-size: 11px; color: var(--danger); margin-top: 4px; display: none; }
.form-group input, .form-group textarea, .form-group select {
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body);
    font-size: 13px; color: var(--text-bright); background: var(--bg); transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-light); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-light); }
.form-group input:disabled, .form-group select:disabled { background: var(--panel); cursor: not-allowed; }
.form-group textarea { resize: vertical; min-height: 80px; font-family: var(--font-body); }
.form-group.has-error input, .form-group.has-error select { border-color: var(--danger); }
.form-group.has-error .field-error { display: block; }

/* File upload */
.file-upload-wrapper { position: relative; }
.file-upload-label { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--panel); cursor: pointer; transition: var(--transition); text-align: center; }
.file-upload-label:hover { border-color: var(--gold); background: var(--gold-light); }
.file-upload-label.dragover { border-color: var(--gold); background: var(--gold-light); transform: scale(1.02); }
.file-upload-label input { display: none; }
.file-upload-label .upload-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; }
.file-upload-label .upload-text { font-size: 13px; color: var(--text-muted); }
.file-upload-label .upload-text .bold { color: var(--gold); font-weight: 600; }
.file-upload-label .upload-subtext { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.uploaded-files { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-badge { background: var(--gold-soft); color: var(--gold); padding: 6px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.file-badge .remove { cursor: pointer; font-weight: 700; color: var(--danger); transition: var(--transition); }
.file-badge .remove:hover { transform: scale(1.2); }

.form-actions { display: flex; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ============================================
   BUTTONS
   ============================================ */
.btn { padding: 10px 24px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--navy); box-shadow: var(--shadow-hover); }
.btn-secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--panel); color: var(--text-bright); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #a8322a; box-shadow: var(--shadow-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: #1e6348; box-shadow: var(--shadow-hover); }
.btn-sm { padding: 6px 14px; font-size: 11px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; }

.mobile-toggle { display: none; background: none; border: none; color: var(--text-bright); font-size: 20px; cursor: pointer; padding: 4px; transition: var(--transition); }
.mobile-toggle:hover { color: var(--gold); }

/* ============================================
   DASHBOARD STAT CARDS
   ============================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; align-items: center; gap: 16px; transition: var(--transition); }
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .stat-icon svg { width: 22px; height: 22px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title .see-all { font-family: var(--font-body); font-size: 11px; color: var(--gold); text-decoration: none; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================
   TABLES
   ============================================ */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.table-toolbar .search-box { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.table-toolbar .search-box input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; background: var(--panel); }
.table-toolbar .search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-muted); }
.table-toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.table-toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: var(--bg); }

.table-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
table.data-table thead th {
    text-align: left; padding: 13px 16px; background: var(--panel); color: var(--text-muted); font-size: 10.5px;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--gold-light); }
table.data-table .row-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--navy); }
table.data-table .cell-name { font-weight: 600; }
table.data-table .cell-sub { font-size: 11px; color: var(--text-muted); }
table.data-table .actions { display: flex; gap: 6px; }
table.data-table .empty-row td { text-align: center; padding: 40px; color: var(--text-muted); }

.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); flex-shrink: 0; }
.pagination .pg-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination button { border: 1px solid var(--border); background: var(--bg); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 12px; }
.pagination button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button.active { background: var(--gold); color: white; border-color: var(--gold); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-success { background: rgba(45,125,90,0.12); color: var(--success); }
.badge-danger { background: rgba(196,69,60,0.12); color: var(--danger); }
.badge-warning { background: rgba(212,137,43,0.12); color: var(--warning); }
.badge-muted { background: var(--panel); color: var(--text-muted); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-info { background: rgba(59,124,224,0.12); color: var(--blue); }

/* Leave balance tiles (teacher's own leave tracker) */
.leave-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.balance-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    background: var(--bg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.balance-tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.balance-tile::before {
    content: '';
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--gold);
}
.balance-tile.ok::before { background: var(--success); }
.balance-tile.low::before { background: var(--danger); }
.balance-tile.unlimited::before { background: var(--gold); }

.balance-tile .bt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.balance-tile .bt-type { font-size: 12.5px; font-weight: 600; color: var(--navy); letter-spacing: 0.01em; }
.balance-tile .bt-icon {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; background: var(--gold-soft); color: var(--gold); flex-shrink: 0;
}
.balance-tile.ok .bt-icon { background: rgba(45, 125, 90, 0.12); color: var(--success); }
.balance-tile.low .bt-icon { background: rgba(196, 69, 60, 0.12); color: var(--danger); }

.balance-tile .bt-remaining { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; color: var(--navy); }
.balance-tile .bt-remaining small { font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; margin-left: 5px; letter-spacing: 0.03em; }
.balance-tile.low .bt-remaining { color: var(--danger); }
.balance-tile.ok .bt-remaining { color: var(--success); }
.balance-tile.unlimited .bt-remaining { color: var(--gold); font-size: 16px; }

.balance-tile .bt-bar { height: 6px; border-radius: 4px; background: var(--panel); margin: 12px 0 8px; overflow: hidden; }
.balance-tile .bt-bar-fill { height: 100%; border-radius: 4px; background: var(--gold); transition: width 0.4s ease; }
.balance-tile.ok .bt-bar-fill { background: var(--success); }
.balance-tile.low .bt-bar-fill { background: var(--danger); }

.balance-tile .bt-sub { font-size: 11.5px; color: var(--text-muted); }
.balance-tile.awaiting { background: var(--gold-light); border-style: dashed; }
.balance-tile.awaiting::before { background: var(--gold); }
.balance-tile.awaiting .bt-remaining { color: var(--gold); }


/* ============================================
   MODAL
   ============================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(21,42,74,0.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: var(--bg); border-radius: var(--radius-lg); max-width: 480px; width: 100%; padding: 28px; box-shadow: var(--shadow-hover); max-height: 90vh; overflow-y: auto; }
.modal-box.wide { max-width: 720px; }
.modal-box h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.modal-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--navy); color: white; padding: 13px 18px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-hover); display: flex; align-items: center; gap: 10px; min-width: 260px; animation: slideIn 0.25s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ============================================
   NOTICE BOARD / TIMELINE
   ============================================ */
.notice-item { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.notice-item:last-child { border-bottom: none; }
.notice-item .notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex-shrink: 0; }
.notice-item .notice-title { font-size: 13px; font-weight: 600; }
.notice-item .notice-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notice-item .notice-time { font-size: 10.5px; color: var(--text-light); margin-top: 4px; font-family: var(--font-mono); }

.schedule-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.schedule-item:last-child { border-bottom: none; }
.schedule-item .time-block { text-align: center; min-width: 60px; }
.schedule-item .time-block .t1 { font-size: 12px; font-weight: 700; color: var(--navy); font-family: var(--font-mono); }
.schedule-item .time-block .t2 { font-size: 9px; color: var(--text-muted); }
.schedule-item .sched-info .subject { font-size: 13px; font-weight: 600; }
.schedule-item .sched-info .meta { font-size: 11px; color: var(--text-muted); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); width: 300px; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .topbar { padding: 12px 20px; }
    .content { padding: 16px 20px; }
    .mobile-toggle { display: flex !important; }
    .topbar-left .session-badge { display: none; }
    .form-container { padding: 20px; }
}
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-header h1 { font-size: 20px; }
    .topbar-left .page-title { font-size: 16px; }
    .welcome-banner { padding: 16px 20px; }
    .welcome-banner h2 { font-size: 18px; }
}
@media (max-width: 480px) {
    .topbar-right .profile-btn .name-sm { display: none; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    .content { padding: 12px 16px; }
    .topbar { padding: 10px 16px; }
}

/* Tables & pagination on small/medium screens */
@media (max-width: 768px) {
    .table-toolbar .search-box { min-width: 0; max-width: none; flex: 1 1 100%; }
    .table-toolbar .filters { width: 100%; }
    .table-toolbar .filters select,
    .table-toolbar .filters .btn { flex: 1 1 auto; }
    table.data-table { min-width: 560px; font-size: 12.5px; }
    table.data-table thead th { padding: 10px 12px; }
    table.data-table tbody td { padding: 10px 12px; }
    .pagination { justify-content: center; text-align: center; padding: 12px; }
    .pagination .pg-btns { justify-content: center; width: 100%; }
}
@media (max-width: 480px) {
    table.data-table { min-width: 480px; }
    .pagination { flex-direction: column; align-items: stretch; gap: 8px; }
    .pagination .pg-btns { flex-wrap: wrap; }
    .pagination button { padding: 6px 9px; font-size: 11.5px; }
}

/* ===== UTILITIES ===== */
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.text-center { text-align: center; } .text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; } .p-6 { padding: 24px; }
.border { border: 1px solid var(--border); } .border-top { border-top: 1px solid var(--border); }
.rounded { border-radius: var(--radius); } .rounded-sm { border-radius: var(--radius-sm); }
.bg-white { background: var(--bg); } .bg-panel { background: var(--panel); } .bg-gold-soft { background: var(--gold-soft); }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }
::selection { background: var(--gold-soft); color: var(--gold); }
::-moz-selection { background: var(--gold-soft); color: var(--gold); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.fade-in { animation: fadeIn 0.3s ease; }
.slide-in { animation: slideIn 0.3s ease; }

/* Print (used by fee challan view page) */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    body { background: white; }
}

/* ==========================================================
   Detail grid (used by profile / details pages: teacher salary,
   staff details, student details) - shared so pages don't each
   need their own local <style> block.
   ========================================================== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.detail-item .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 4px; }
.detail-item .v { font-size: 14px; font-weight: 600; }

/* ==========================================================
   Advanced Dashboard widgets (KPI hero cards, charts, mini-lists)
   ========================================================== */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 20px; }
.kpi-card { position: relative; background: linear-gradient(155deg, var(--navy) 0%, #1D3A63 100%); color: #fff; border-radius: var(--radius); padding: 20px 22px; overflow: hidden; }
.kpi-card::after { content:''; position:absolute; top:-30px; right:-30px; width:110px; height:110px; border-radius:50%; background: rgba(255,255,255,.06); }
.kpi-card .kpi-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.kpi-card .kpi-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kpi-card .kpi-trend { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.14); }
.kpi-card .kpi-trend.up { color: #8FE3B0; }
.kpi-card .kpi-trend.down { color: #F0A9A2; }
.kpi-card .kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; position: relative; z-index: 1; }
.kpi-card .kpi-label { font-size: 11.5px; color: rgba(255,255,255,.7); margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; position: relative; z-index: 1; }
.kpi-card.gold { background: linear-gradient(155deg, var(--gold) 0%, #9C6E1F 100%); }
.kpi-card.success { background: linear-gradient(155deg, var(--success) 0%, #1E5940 100%); }
.kpi-card.plain { background: var(--bg); border: 1px solid var(--border); color: var(--navy); }
.kpi-card.plain .kpi-icon { background: var(--panel); }
.kpi-card.plain .kpi-label { color: var(--text-muted); }
.kpi-card.plain .kpi-trend { background: var(--panel); }
.kpi-card.plain .kpi-trend.up { color: var(--success); }
.kpi-card.plain .kpi-trend.down { color: var(--danger); }

.widget-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 20px; }
@media (max-width: 1100px) { .widget-row { grid-template-columns: 1fr; } }
.chart-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.chart-card .card-title { margin-bottom: 4px; }
.chart-card .chart-sub { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.chart-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.chart-legend span.item { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; }

.mini-bar-list .mini-bar-row { margin-bottom: 12px; }
.mini-bar-list .mini-bar-row:last-child { margin-bottom: 0; }
.mini-bar-list .mini-bar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.mini-bar-list .mini-bar-top .name { font-weight: 600; }
.mini-bar-list .mini-bar-top .val { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.mini-bar-track { height: 7px; background: var(--panel); border-radius: 20px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--gold) 0%, var(--navy) 100%); transition: width .6s ease; }

.avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; margin-right: 8px; vertical-align: middle; flex-shrink: 0; }
.cell-with-avatar { display: flex; align-items: center; }

.today-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.today-strip .today-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-align: center; }
.today-strip .today-item .n { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--navy); }
.today-strip .today-item .l { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* Chart.js canvases need a height-bound wrapper, otherwise (with
   maintainAspectRatio:false) they can grow unbounded inside a flex/grid
   card and force a huge scroll. */
.chart-container { position: relative; width: 100%; height: 260px; }
.chart-container canvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }

/* ==========================================================
   Homework Submissions list (teacher > My Homework > Submissions)
   Desktop: clean grid rows. Mobile: stacked cards. No horizontal
   scroll on either, unlike a raw <table> squeezed into a modal.
   ========================================================== */
.sub-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sub-summary-pill { font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; }
.sub-summary-pill.success { background: rgba(45,125,90,.12); color: var(--success); }
.sub-summary-pill.danger { background: rgba(196,69,60,.12); color: var(--danger); }
.sub-summary-pill.muted { background: var(--panel); color: var(--text-muted); }

.sub-list { max-height: 55vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.sub-row {
    display: grid;
    grid-template-columns: minmax(0,1.6fr) auto minmax(0,1.1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.sub-row:last-child { border-bottom: none; }
.sub-row:hover { background: var(--panel); }
.sub-row-main { display: flex; align-items: center; min-width: 0; }
.sub-row-info { min-width: 0; }
.sub-row-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-row-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.sub-row-status { text-align: left; }
.sub-row-time { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.sub-row-action { text-align: right; }
.sub-row .sub-download { white-space: nowrap; }

@media (max-width: 700px) {
    .sub-row {
        grid-template-columns: 1fr auto;
        grid-template-areas: "main status" "time action";
        row-gap: 8px;
    }
    .sub-row-main { grid-area: main; }
    .sub-row-status { grid-area: status; text-align: right; }
    .sub-row-time { grid-area: time; }
    .sub-row-action { grid-area: action; text-align: right; }
}
@media (max-width: 480px) {
    .modal-box.wide { max-width: 100%; padding: 20px; }
    .sub-row { padding: 12px; }
    .sub-row-name { max-width: 46vw; }
}

/* ============================================
   CARD GRID + BULK SELECT  (v3 · academic pages)
   ============================================ */
.cardgrid-toolbar { display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.cardgrid-toolbar .cg-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cardgrid-search { position: relative; }
.cardgrid-search input { padding: 9px 14px 9px 34px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px; min-width: 220px; background: var(--bg);
    color: var(--text-bright); font-family: var(--font-body); }
.cardgrid-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; color: var(--text-light); }
.cardgrid-filter select { padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px; background: var(--bg); color: var(--text-bright); }

.cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .cg-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
@media (max-width: 420px) { .cg-grid { grid-template-columns: 1fr; } }

.cg-card { position: relative; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 16px 14px; transition: var(--transition);
    cursor: pointer; overflow: hidden; }
.cg-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: var(--gold); }
.cg-card.selected { border-color: var(--gold); background: var(--gold-light);
    box-shadow: 0 0 0 1px var(--gold) inset; }
.cg-card .cg-check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px;
    border: 1.5px solid var(--border); border-radius: 5px; display: flex; align-items: center;
    justify-content: center; background: var(--bg); transition: var(--transition); }
.cg-card.selected .cg-check { background: var(--gold); border-color: var(--gold); }
.cg-card .cg-check svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.cg-card.selected .cg-check svg { opacity: 1; }
.cg-card .cg-title { font-family: var(--font-display); font-size: 16px; font-weight: 600;
    color: var(--text-bright); margin: 2px 34px 8px 0; line-height: 1.25; }
.cg-card .cg-meta { display: flex; flex-direction: column; gap: 5px; }
.cg-card .cg-line { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.cg-card .cg-line strong { color: var(--text-bright); font-weight: 600; }
.cg-card .cg-pill { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; background: var(--gold-soft); color: var(--gold);
    letter-spacing: 0.03em; text-transform: uppercase; }
.cg-card .cg-actions { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; }
.cg-card .cg-actions .btn { flex: 1; }

.cg-bulkbar { display: none; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--indigo); color: #fff; padding: 11px 16px; border-radius: var(--radius);
    margin-bottom: 16px; animation: slideDown .18s ease; flex-wrap: wrap; }
.cg-bulkbar.show { display: flex; }
.cg-bulkbar .cg-bulk-count { font-size: 13px; font-weight: 600; }
.cg-bulkbar .cg-bulk-actions { display: flex; gap: 8px; }
.cg-bulkbar button { border: none; cursor: pointer; padding: 7px 14px; border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 600; font-family: var(--font-body); }
.cg-bulkbar .cg-del { background: var(--danger, #C0392B); color: #fff; }
.cg-bulkbar .cg-clear { background: rgba(255,255,255,0.15); color: #fff; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.cg-pagination { display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 22px; flex-wrap: wrap; }
.cg-pagination button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--border);
    background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
    color: var(--text-bright); transition: var(--transition); }
.cg-pagination button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.cg-pagination button.active { background: var(--gold); color: #fff; border-color: var(--gold); }
.cg-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.cg-pagination .cg-page-info { font-size: 12px; color: var(--text-muted); margin: 0 8px; }

.cg-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.cg-empty svg { width: 42px; height: 42px; opacity: 0.3; margin-bottom: 12px; }

.cg-selectall { display: flex; align-items: center; gap: 7px; font-size: 12.5px;
    color: var(--text-muted); cursor: pointer; user-select: none; }
.cg-selectall input { width: 15px; height: 15px; accent-color: var(--gold); cursor: pointer; }

/* ==========================================================
   Legacy gradient tokens -> ab flat siyahi.
   Purane pages jo var(--grad-*) maangte hain unhe theek rang mile.
   ========================================================== */
:root {
    --grad-navy:   var(--indigo);
    --grad-gold:   var(--sky);
    --grad-purple: var(--violet);
    --grad-teal:   var(--green-ink);
    --grad-coral:  var(--red-ink);
    --grad-amber:  var(--ochre);
    --grad-horizon: var(--sky);

    --shadow-glow-gold:  none;
    --shadow-glow-navy:  none;
    --shadow-glow-teal:  none;
    --shadow-glow-coral: none;
}

/* ---------- Page-load fade (subtle, not jarring) ---------- */
body { animation: pageFade .35s ease; }
@keyframes pageFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Reveal-on-load utility (driven by main.js) ----------
   main.js sets inline opacity/transform itself (not via a CSS class
   that defaults to hidden), so content never disappears if JS is
   slow/blocked — CSS here only supplies the easing reference. */
.card, .kpi-card, .stat-card, .cg-card, .balance-tile, .today-item, .chart-card {
    transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .25s ease;
}

/* ---------- Cards: gradient top accent + lift on hover ---------- */
.card { position: relative; overflow: hidden; }
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--grad-gold); opacity: .85;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* ---------- Buttons: gradient fills + glow + press feedback ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary { background: var(--grad-gold); box-shadow: 0 2px 10px rgba(184,137,43,.25); }
.btn-primary:hover:not(:disabled) { background: var(--grad-gold); box-shadow: var(--shadow-glow-gold); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn-danger { background: var(--grad-coral); }
.btn-danger:hover:not(:disabled) { box-shadow: var(--shadow-glow-coral); transform: translateY(-1px); }
.btn-success { background: var(--grad-teal); }
.btn-success:hover:not(:disabled) { box-shadow: var(--shadow-glow-teal); transform: translateY(-1px); }
.btn-secondary:hover { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(.97); }

/* ---------- KPI / stat cards: extra colour options + hover pop ---------- */
.kpi-card.purple { background: var(--grad-purple); }
.kpi-card.teal { background: var(--grad-teal); }
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow-navy); }
.kpi-card.gold:hover { box-shadow: var(--shadow-glow-gold); }
.kpi-card.success:hover { box-shadow: var(--shadow-glow-teal); }
.kpi-card .kpi-icon, .stat-card .stat-icon { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.kpi-card:hover .kpi-icon { transform: scale(1.15) rotate(-6deg); }
.stat-card:hover .stat-icon { transform: scale(1.15) rotate(6deg); background: var(--grad-gold); color: #fff; }

/* ---------- Badges: soft glow, optional pulse ---------- */
.badge.pulse { animation: softPulse 2s infinite; }
@keyframes softPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184,137,43,.35); }
    50% { box-shadow: 0 0 0 6px rgba(184,137,43,0); }
}

/* ---------- Table rows: gentle motion on hover ---------- */
table.data-table tbody tr { transition: background .18s ease, transform .18s ease; }
table.data-table tbody tr:hover { transform: translateX(2px); }

/* ---------- Modal: pop-in animation + soft blur backdrop ---------- */
.modal-overlay.open { animation: overlayFade .2s ease; backdrop-filter: blur(3px); }
.modal-box { animation: modalPop .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes overlayFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---------- Toast notifications v2: icon, gradient, progress bar ---------- */
.toast {
    position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: 11px;
    min-width: 280px; max-width: 360px;
    padding: 13px 16px 15px;
    border-radius: 13px;
    box-shadow: 0 12px 30px rgba(21,42,74,.22), 0 2px 8px rgba(0,0,0,.06);
    background: var(--grad-navy);
    animation: toastIn .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.hide { animation: toastOut .28s ease forwards; }
.toast.success { background: var(--grad-teal); }
.toast.error { background: var(--grad-coral); }
.toast.warning { background: linear-gradient(135deg, #C97F2A 0%, #EBB24E 100%); }
.toast .toast-icon {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
    padding: 4px; animation: iconPop .4s ease;
}
.toast .toast-icon svg { width: 100%; height: 100%; }
.toast .toast-body { flex: 1; min-width: 0; padding-top: 1px; }
.toast .toast-msg { font-size: 12.5px; line-height: 1.45; font-weight: 500; }
.toast .toast-close {
    flex-shrink: 0; background: none; border: none; color: rgba(255,255,255,.75);
    font-size: 15px; line-height: 1; cursor: pointer; padding: 2px;
}
.toast .toast-close:hover { color: #fff; }
.toast .toast-progress {
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    background: rgba(255,255,255,.55);
    animation-name: toastProgress; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0) scale(1); } to { opacity: 0; transform: translateX(28px) scale(.95); } }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }
@keyframes iconPop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Welcome banner: vibrant gradient hero (admin/teacher/student dashboards) ---------- */
.welcome-banner {
    position: relative; overflow: hidden; border: none; color: #fff;
    background: var(--grad-navy);
}
.welcome-banner::before {
    content: ''; position: absolute; top: -50px; right: -30px; width: 180px; height: 180px;
    border-radius: 50%; background: rgba(255,255,255,.07);
}
.welcome-banner::after {
    content: ''; position: absolute; bottom: -60px; right: 90px; width: 130px; height: 130px;
    border-radius: 50%; background: var(--grad-gold); opacity: .3; filter: blur(18px);
}
.welcome-banner h2, .welcome-banner p { position: relative; z-index: 1; }
.welcome-banner p { color: rgba(255,255,255,.78); }
.welcome-banner .wave { display: inline-block; animation: wave 2.2s ease infinite; transform-origin: 70% 70%; }
@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); } 40% { transform: rotate(-8deg); }
    60% { transform: rotate(14deg); } 80% { transform: rotate(-4deg); }
}

/* ---------- Quick Action tiles (dashboard "Quick Actions" upgrade) ---------- */
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qa-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 14px; border-radius: var(--radius); text-decoration: none;
    color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3;
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(21,42,74,.12);
}
.qa-tile:hover { transform: translateY(-3px) scale(1.02); }
.qa-tile .qa-icon { font-size: 18px; }
.qa-tile.g-gold { background: var(--grad-gold); }
.qa-tile.g-navy { background: var(--grad-navy); }
.qa-tile.g-teal { background: var(--grad-teal); }
.qa-tile.g-purple { background: var(--grad-purple); }
.qa-tile.g-coral { background: var(--grad-coral); }
.qa-tile:hover.g-gold { box-shadow: var(--shadow-glow-gold); }
.qa-tile:hover.g-navy { box-shadow: var(--shadow-glow-navy); }
.qa-tile:hover.g-teal { box-shadow: var(--shadow-glow-teal); }
.qa-tile:hover.g-coral { box-shadow: var(--shadow-glow-coral); }
.qa-tile:hover.g-purple { box-shadow: 0 10px 26px rgba(124,92,252,.32); }
@media (max-width: 420px) { .qa-grid { grid-template-columns: 1fr; } }
/* =====================================================================
   PAGINATION  ·  admin-list.js ke liye
   ===================================================================== */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 14px 4px 4px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
}
.pager-info { font-size: 12.5px; color: var(--text-muted, #6b7280); font-weight: 500; }
.pager-btns { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pager-btns .btn { min-width: 34px; padding: 6px 9px; }
.pager-dots { color: var(--text-muted, #6b7280); padding: 0 3px; }
.pager-per {
    padding: 6px 9px; font-size: 12.5px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--ink); font-family: inherit;
}

/* Bulk delete ki patti */
.bulk-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 12px; margin-bottom: 12px;
    background: rgba(225, 73, 91, .07);
    border: 1px solid rgba(225, 73, 91, .24);
    border-radius: 10px;
}
.bulk-bar .bulk-text { font-size: 13px; font-weight: 600; color: var(--rose); }

/* Progress bar (certificate summary) */
.mini-bar { height: 7px; background: var(--line); border-radius: 6px; overflow: hidden; }
.mini-bar > span { display: block; height: 100%; background: var(--mint); border-radius: 6px; }
.mini-bar.warn > span { background: var(--amber); }
.mini-bar.bad  > span { background: var(--rose); }

@media (max-width: 1023.98px) {
    body.admin-app .pager { flex-direction: column; align-items: stretch; gap: 10px; }
    body.admin-app .pager-btns { justify-content: center; }
    body.admin-app .pager-per { width: 100%; }
    body.admin-app .pager-info { text-align: center; }
}

/* =====================================================================
   FEE SECTION ka navigation
   ===================================================================== */
.fee-nav {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 2px;
}
.fee-nav-item {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    font-size: 13px; font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
    white-space: nowrap;
}
.fee-nav-item:hover { border-color: var(--sky); color: var(--sky); }
.fee-nav-item.active {
    background: var(--grad-gold); color: #fff; border-color: transparent;
}
.fee-nav-item .fn-ic { font-size: 15px; }

@media (max-width: 1023.98px) {
    body.admin-app .fee-nav {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -12px 14px; padding: 0 12px 4px;
        scroll-snap-type: x proximity;
    }
    body.admin-app .fee-nav::-webkit-scrollbar { display: none; }
    body.admin-app .fee-nav-item { flex: 0 0 auto; scroll-snap-align: start; font-size: 12.5px; padding: 8px 13px; }
}


/* ==========================================================================
   DAFTAR LAYER  ·  admin ka naya roop (desktop)
   Sab se aakhir mein — yahi rules cascade jeetate hain.
   ========================================================================== */

/* ---------- Base ---------- */
body {
    font-family: var(--font-body);
    background: var(--canvas);
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.5;
    animation: none;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; }

/* Har adad register ki tarah: seedha column, barabar chaurai */
.stat-value, .kpi-value, .today-item .n, .bt-remaining,
.session-badge, .notice-time, .mini-bar-top .val, .cell-num,
table.data-table td, .pager-info {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* SIGNATURE — perforation */
.perf-rule { height: 1px; background: var(--perf); }

/* ---------- Sidebar: register ki jild ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 0;
    box-shadow: none;
}
.sidebar-brand {
    padding: 14px 16px;
    margin: 0; gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.sidebar-brand .crest {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    background: var(--indigo); padding: 4px; box-shadow: none;
}
.sidebar-brand .brand-text {
    font-family: var(--font-display); font-size: 13.5px; font-weight: 700;
    letter-spacing: -.02em; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sidebar-brand .brand-text .sub {
    font-family: var(--font-mono); font-size: 8px; font-weight: 500;
    color: var(--ink-3); letter-spacing: .18em; margin-top: 3px;
}

/* Nav filter — 70+ pages mein foran pohanch */
.nav-filter { padding: 10px 12px; border-bottom: 1px solid var(--line); position: relative; }
.nav-filter input {
    width: 100%; padding: 8px 10px 8px 30px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink);
    font-family: var(--font-body); font-size: 12.5px; outline: none;
}
.nav-filter input:focus { border-color: var(--sky); box-shadow: var(--shadow-ring); background: var(--surface); }
.nav-filter svg {
    position: absolute; left: 21px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; color: var(--ink-3); pointer-events: none;
}
.nav-filter kbd {
    position: absolute; right: 21px; top: 50%; transform: translateY(-50%);
    font-family: var(--font-mono); font-size: 9px; color: var(--ink-3);
    border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px;
    background: var(--surface); pointer-events: none;
}
.nav-filter input:focus ~ kbd { display: none; }
.nav-hidden { display: none !important; }
.nav-noresult {
    padding: 20px 14px; text-align: center;
    font-family: var(--font-mono); font-size: 10.5px;
    letter-spacing: .08em; color: var(--ink-3);
}

.sidebar-nav { padding: 6px 10px 10px; }
.sidebar-nav .nav-label {
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
    letter-spacing: .2em; color: var(--ink-3); opacity: 1;
    padding: 14px 8px 7px; margin-top: 4px;
    border-top: 1px solid transparent;
    position: relative;
}
/* groups ke darmiyan perforation */
.sidebar-nav .nav-label::before {
    content: ''; position: absolute; top: 0; left: 8px; right: 8px;
    height: 1px; background: var(--perf);
}
.sidebar-nav > .nav-label:first-child::before { display: none; }
.sidebar-nav > .nav-label:first-child { padding-top: 8px; }

.sidebar-nav .nav-item,
.sidebar-nav .nav-group summary {
    border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 500;
    padding: 7px 10px; color: var(--ink-2);
    transition: background .12s ease, color .12s ease;
}
.sidebar-nav .nav-item:hover,
.sidebar-nav .nav-group summary:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-nav .nav-item.active {
    background: var(--tint); color: var(--sky-deep); font-weight: 700;
}
/* active ka thos siyahi block — register ka tab */
.sidebar-nav .nav-item.active::before {
    content: ''; position: absolute; left: -10px; top: 3px; bottom: 3px;
    width: 3px; border-radius: 0 2px 2px 0; background: var(--sky);
}
.sidebar-nav .nav-item .badge {
    background: var(--tint); color: var(--sky-deep);
    font-family: var(--font-mono); font-weight: 600;
    border-radius: 3px; padding: 1px 6px;
}
.sidebar-nav .nav-group .sub-nav {
    padding-left: 12px; margin-left: 10px;
    border-left: 1px solid var(--line-soft);
}
.sidebar-nav .nav-group .sub-nav .nav-item { padding: 6px 10px; font-size: 12px; }

.sidebar-footer { border-top: 1px solid var(--line); padding: 10px; margin-top: auto; }
.sidebar-footer .user-card { border-radius: var(--radius-sm); padding: 8px 10px; }
.sidebar-footer .user-card:hover { background: var(--surface-2); }
.sidebar-footer .user-card .avatar {
    background: var(--indigo); border-radius: var(--radius-sm);
    font-family: var(--font-display); font-weight: 700; font-size: 11px;
}
.sidebar-footer .user-card .user-info .role {
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0 26px; height: 54px;
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* topbar ke neeche perforation */
.topbar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -3px;
    height: 1px; background: var(--perf);
}
.topbar-left { gap: 14px; }
.topbar-left .page-title {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    letter-spacing: -.02em; color: var(--ink);
}
.topbar-left .session-badge {
    font-family: var(--font-mono); font-size: 9px; font-weight: 500;
    background: transparent; border: 1px solid var(--line);
    color: var(--ink-3); letter-spacing: .1em; border-radius: 3px; padding: 3px 8px;
}
.topbar-right { gap: 6px; }
.topbar-right .icon-btn, .theme-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent; color: var(--ink-2);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.topbar-right .icon-btn:hover, .theme-btn:hover {
    background: var(--surface-2); border-color: var(--line); color: var(--sky);
}
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .ico-moon { display: none; }
html[data-theme="dark"] .theme-btn .ico-sun { display: none; }
html[data-theme="dark"] .theme-btn .ico-moon { display: block; }
.topbar-right .icon-btn .dot { background: var(--red-ink); border-color: var(--surface); }
.topbar-right .profile-btn {
    border-radius: var(--radius-sm); padding: 3px 10px 3px 3px;
    border: 1px solid var(--line); background: var(--surface);
}
.topbar-right .profile-btn:hover { border-color: var(--sky); box-shadow: none; background: var(--surface-2); }
.topbar-right .profile-btn .avatar-sm {
    border-radius: 3px; background: var(--indigo);
    font-family: var(--font-display); font-weight: 700;
}
.topbar-right .profile-btn .name-sm { font-size: 12px; font-weight: 600; }

/* Dropdowns: sirf yahan saya */
.notif-dropdown, .profile-dropdown {
    border-radius: var(--radius); border: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
}
.notif-dropdown-head { font-family: var(--font-display); font-size: 12.5px; }
.notif-dropdown-head button { color: var(--sky); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
.notif-item.unread { background: var(--tint); }
.notif-item-time { font-family: var(--font-mono); font-size: 9.5px; }

/* ---------- Content ---------- */
.content { padding: 20px 26px 56px; }

/* ---------- Page header: mohar wala sar-nama ---------- */
.sheet-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.sheet-head .sh-serial {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3);
    margin-bottom: 6px;
}
.sheet-head h1 {
    font-family: var(--font-display); font-size: 21px; font-weight: 700;
    letter-spacing: -.03em; color: var(--ink); line-height: 1.15;
}
.sheet-head p { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; }

/* ---------- Register cards ---------- */
.card, .chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    padding: 0;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color .14s ease;
}
.card::before, .chart-card::before { display: none; }
.card:hover, .chart-card:hover { transform: none; box-shadow: none; border-color: var(--line); }
/* Card ka apna padding rehta hai (mehfooz -- har page ka markup alag hai).
   Sirf header aur table kinaron tak phailte hain, negative margin se. */
.card, .chart-card { padding: 16px 18px; }
.card > .card-title, .chart-card > .card-title {
    margin: -16px -18px 14px;
    padding: 12px 18px 11px;
    font-family: var(--font-display); font-size: 12.5px; font-weight: 700;
    letter-spacing: .01em; color: var(--ink);
    border-bottom: 1px solid var(--line);
    position: relative;
}
/* SIGNATURE — header ke neeche phaarne wali lakeer */
.card > .card-title::after, .chart-card > .card-title::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -3px;
    height: 1px; background: var(--perf);
}

.card-title .see-all {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: .1em; color: var(--sky); text-transform: uppercase;
}
.chart-card .chart-sub {
    font-size: 11.5px; color: var(--ink-3); padding-top: 12px; padding-bottom: 4px;
}
.chart-legend span.item { font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; }
.chart-legend .dot { border-radius: 2px; width: 8px; height: 8px; }

/* Card ke andar table kinaron tak */
.card > .table-wrap {
    margin: 0 -18px -16px; border: none; border-radius: 0;
    border-top: 1px solid var(--line-soft);
}
.card > .card-title + .table-wrap { border-top: none; }

/* ---------- Adad: stamp block ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin-bottom: 16px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); overflow: hidden; }
.kpi-card {
    background: var(--surface); color: var(--ink);
    border: none; border-right: 1px solid var(--line);
    border-radius: 0; padding: 16px 18px 15px; box-shadow: none;
}
.kpi-row .kpi-card:last-child { border-right: none; }
.kpi-card::before, .kpi-card::after { display: none; }
.kpi-card:hover { transform: none; box-shadow: none; background: var(--surface-2); }
.kpi-card .kpi-top { margin-bottom: 12px; align-items: center; }
.kpi-card .kpi-icon {
    width: 26px; height: 26px; border-radius: var(--radius-sm);
    background: var(--tint); color: var(--sky-deep); font-size: 13px;
    border: 1px solid rgba(11,127,212,.14);
}
.kpi-card:hover .kpi-icon { transform: none; }
.kpi-card .kpi-trend {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    background: transparent; color: var(--ink-3);
    border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px;
}
.kpi-card .kpi-trend.up   { color: var(--green-ink); border-color: rgba(14,122,95,.3); }
.kpi-card .kpi-trend.down { color: var(--red-ink);   border-color: rgba(200,56,74,.3); }
.kpi-card .kpi-value {
    font-family: var(--font-display); font-size: 25px; font-weight: 700;
    letter-spacing: -.04em; color: var(--ink); line-height: 1;
}
.kpi-card .kpi-label {
    font-family: var(--font-mono); font-size: 9px; font-weight: 500;
    color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; margin-top: 8px;
}
/* Rang sirf maani ke liye */
.kpi-card.success .kpi-value { color: var(--green-ink); }
.kpi-card.success .kpi-icon  { background: rgba(14,122,95,.09); color: var(--green-ink); border-color: rgba(14,122,95,.18); }
.kpi-card.plain .kpi-value, .kpi-card.purple .kpi-value { color: var(--red-ink); }
.kpi-card.plain .kpi-icon, .kpi-card.purple .kpi-icon {
    background: rgba(200,56,74,.08); color: var(--red-ink); border-color: rgba(200,56,74,.18);
}
.kpi-card.gold, .kpi-card.success, .kpi-card.plain, .kpi-card.purple, .kpi-card.teal {
    background: var(--surface); color: var(--ink);
}
@media (max-width: 720px) { .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .kpi-card:nth-child(2n) { border-right: none; }
    .kpi-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ---------- Today strip: hazri ki qatar ---------- */
.today-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 0;
    margin-bottom: 16px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.today-strip .today-item {
    background: transparent; border: none; border-right: 1px solid var(--line-soft);
    border-radius: 0; padding: 13px 14px; text-align: left; box-shadow: none;
}
.today-strip .today-item:last-child { border-right: none; }
.today-strip .today-item:hover { transform: none; background: var(--surface-2); }
.today-strip .today-item .n {
    font-family: var(--font-display); font-size: 18px; font-weight: 700;
    color: var(--ink); letter-spacing: -.035em;
}
.today-strip .today-item .l {
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 500;
    color: var(--ink-3); letter-spacing: .12em; margin-top: 5px; text-transform: uppercase;
}

/* ---------- Buttons: flat siyahi ---------- */
.btn {
    border-radius: var(--radius-sm); font-family: var(--font-body);
    font-size: 12.5px; font-weight: 600; text-transform: none;
    letter-spacing: 0; padding: 8px 15px; border: 1px solid transparent;
    box-shadow: none; overflow: visible;
}
.btn-primary { background: var(--sky); color: #fff; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--sky-deep); box-shadow: none; transform: none; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); transform: none; }
.btn-danger  { background: var(--red-ink); }
.btn-danger:hover:not(:disabled)  { background: #A82C3C; box-shadow: none; transform: none; }
.btn-success { background: var(--green-ink); }
.btn-success:hover:not(:disabled) { background: #0A6149; box-shadow: none; transform: none; }
.btn:active:not(:disabled) { transform: none; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }
.btn-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); padding: 0; }

/* ---------- Forms: sarkari form ---------- */
.form-container {
    border-radius: var(--radius); box-shadow: none;
    border: 1px solid var(--line); padding: 24px 26px;
}
.form-header { border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 16px; }
.form-header h1 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.form-section-title {
    font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em;
    color: var(--ink-3); border-bottom: 1px solid var(--line-soft);
    padding-bottom: 7px; margin-bottom: 14px;
}
.form-group label {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: .14em; color: var(--ink-2); margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
    border-radius: var(--radius-sm); padding: 9px 11px;
    font-family: var(--font-body); font-size: 13px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--sky); box-shadow: var(--shadow-ring); background: var(--surface);
}
.form-actions { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.file-upload-label { border-radius: var(--radius); border: 1px dashed var(--line); background: var(--surface-2); }
.file-upload-label:hover, .file-upload-label.dragover { border-color: var(--sky); background: var(--tint); transform: none; }

/* ---------- Tables: hazri register ---------- */
.table-wrap {
    border-radius: var(--radius); box-shadow: none;
    border: 1px solid var(--line); background: var(--surface);
}
table.data-table { font-size: 12.5px; }
table.data-table thead th {
    background: var(--surface-2); color: var(--ink-3);
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
    letter-spacing: .14em; padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line-soft);   /* register ke column rules */
}
table.data-table thead th:last-child { border-right: none; }
table.data-table tbody td {
    padding: 9px 14px; border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
}
table.data-table tbody td:last-child { border-right: none; }
table.data-table tbody tr { transition: background .12s ease; }
table.data-table tbody tr:hover { background: var(--tint); transform: none; }
/* zebra: register ki ruling */
table.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
table.data-table tbody tr:nth-child(even):hover { background: var(--tint); }
table.data-table .cell-name { font-weight: 600; color: var(--ink); }
table.data-table .cell-sub { font-size: 11px; color: var(--ink-3); }
table.data-table .row-avatar { border-radius: var(--radius-sm); }
table.data-table .empty-row td { color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.avatar-circle {
    background: var(--indigo); color: #fff; border-radius: var(--radius-sm);
    font-family: var(--font-display); font-weight: 700; font-size: 10px;
    width: 26px; height: 26px;
}
.table-toolbar { margin-bottom: 12px; }
.table-toolbar .search-box input {
    border-radius: var(--radius-sm); background: var(--surface);
    border: 1px solid var(--line); color: var(--ink); font-family: var(--font-body); padding: 8px 12px 8px 32px;
}
.table-toolbar .search-box input:focus { outline: none; border-color: var(--sky); box-shadow: var(--shadow-ring); }
.table-toolbar select {
    border-radius: var(--radius-sm); background: var(--surface);
    color: var(--ink); border: 1px solid var(--line); font-family: var(--font-body);
}

/* ---------- Badges: mohar ---------- */
.badge {
    border-radius: 3px; font-family: var(--font-mono);
    font-size: 9px; font-weight: 600; letter-spacing: .1em; padding: 3px 7px;
    border: 1px solid transparent;
}
.badge-success { background: rgba(14,122,95,.08);  color: var(--green-ink); border-color: rgba(14,122,95,.22); }
.badge-danger  { background: rgba(200,56,74,.08);  color: var(--red-ink);   border-color: rgba(200,56,74,.22); }
.badge-warning { background: rgba(184,116,0,.09);  color: var(--ochre);     border-color: rgba(184,116,0,.24); }
.badge-gold, .badge-info { background: var(--tint); color: var(--sky-deep); border-color: rgba(11,127,212,.2); }
.badge-muted   { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }
.badge.pulse { animation: none; }

/* ---------- Mini bars / notices ---------- */
.mini-bar-track, .mini-bar { background: var(--line-soft); border-radius: 2px; height: 5px; }
.mini-bar-fill, .mini-bar > span { background: var(--sky); border-radius: 2px; }
.mini-bar-list .mini-bar-top { font-size: 12px; }
.mini-bar-list .mini-bar-top .val { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.notice-item { border-bottom: 1px solid var(--line-soft); padding: 11px 0; }
.notice-item .notice-dot { background: var(--sky); width: 5px; height: 5px; border-radius: 1px; margin-top: 7px; }
.notice-item .notice-title { font-size: 12.5px; font-weight: 700; }
.notice-item .notice-time { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: .05em; }

/* ---------- Quick actions: flat index tiles ---------- */
.qa-grid { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qa-tile {
    background: var(--surface) !important; color: var(--ink) !important;
    border-radius: 0; padding: 13px 14px; font-size: 12px; font-weight: 600;
    box-shadow: none; flex-direction: row; align-items: center; gap: 9px;
    transition: background .12s ease;
}
.qa-tile:hover { background: var(--tint) !important; transform: none; box-shadow: none !important; }
.qa-tile .qa-icon { font-size: 14px; }

/* ---------- Modal ---------- */
.modal-overlay { background: rgba(13,27,46,.5); backdrop-filter: none; }
.modal-box {
    border-radius: var(--radius-lg); border: 1px solid var(--line);
    box-shadow: var(--shadow-pop); animation: none; padding: 22px 24px;
}
.modal-box h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }

/* ---------- Toast: flat, mohar jaisa ---------- */
.toast {
    border-radius: var(--radius); background: var(--ink); color: #fff;
    box-shadow: var(--shadow-pop); animation: none; border-left: 3px solid var(--sky);
}
.toast.success { background: var(--ink); border-left-color: var(--green-ink); }
.toast.error   { background: var(--ink); border-left-color: var(--red-ink); }
.toast.warning { background: var(--ink); border-left-color: var(--ochre); }
.toast .toast-icon { background: rgba(255,255,255,.12); animation: none; }
.toast .toast-progress { background: rgba(255,255,255,.4); height: 2px; }

/* ---------- Pagination ---------- */
.pagination, .pager { border-top: 1px solid var(--line); }
.pagination button, .pager-btns .btn, .cg-pagination button {
    border-radius: var(--radius-sm); border: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 11px;
}
.pagination button.active, .cg-pagination button.active { background: var(--sky); border-color: var(--sky); color: #fff; }
.pager-info, .pagination { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; }

/* ---------- Fee nav: file tabs ---------- */
.fee-nav { gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.fee-nav-item {
    border: none; border-bottom: 2px solid transparent; border-radius: 0;
    background: transparent; font-size: 12.5px; font-weight: 600;
    color: var(--ink-2); padding: 9px 14px;
}
.fee-nav-item:hover { color: var(--ink); border-bottom-color: var(--line); background: transparent; }
.fee-nav-item.active { background: transparent; color: var(--sky-deep); border-bottom-color: var(--sky); }

/* ---------- Balance tiles ---------- */
.balance-tile { border-radius: var(--radius); box-shadow: none; border: 1px solid var(--line); }
.balance-tile:hover { transform: none; box-shadow: none; border-color: var(--sky); }
.balance-tile::before { width: 3px; background: var(--sky); }
.balance-tile .bt-remaining { font-family: var(--font-display); letter-spacing: -.04em; }
.balance-tile .bt-icon { border-radius: var(--radius-sm); }

/* ---------- Welcome banner: sar-nama sheet ---------- */
.welcome-banner {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px; color: var(--ink);
    box-shadow: none; margin-bottom: 16px; overflow: hidden;
}
.welcome-banner::before, .welcome-banner::after { display: none; }
.welcome-banner h2 {
    font-family: var(--font-display); font-size: 19px; font-weight: 700;
    letter-spacing: -.03em; color: var(--ink);
}
.welcome-banner p { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.welcome-banner .wave { animation: none; }
.welcome-banner .hero-eyebrow {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3);
    margin-bottom: 9px; display: block;
}
.welcome-banner .hero-eyebrow::before { display: none; }
.welcome-banner .hero-actions { display: flex; gap: 0; margin-top: 15px; flex-wrap: wrap; }
.welcome-banner .hero-chip {
    background: transparent; border: 1px solid var(--line);
    color: var(--ink-2); font-size: 12px; font-weight: 600;
    padding: 7px 13px; border-radius: 0; margin-right: -1px;
    display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
    transition: var(--transition);
}
.welcome-banner .hero-chip:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.welcome-banner .hero-chip:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.welcome-banner .hero-chip:hover {
    background: var(--tint); color: var(--sky-deep);
    border-color: rgba(11,127,212,.35); transform: none; position: relative; z-index: 1;
}

/* ---------- Section eyebrow ---------- */
.section-eyebrow {
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
    letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3);
    margin: 22px 0 9px; display: flex; align-items: center; gap: 10px;
}
.section-eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--perf); }

/* ---------- Detail grid ---------- */
.detail-item .k { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .14em; color: var(--ink-3); }
.detail-item .v { font-size: 13.5px; font-weight: 600; }

/* ---------- Card grid (cardgrid.js) ---------- */
.cg-bulkbar { background: var(--ink); border-radius: var(--radius); animation: none; }
.cg-bulkbar .cg-del { background: var(--red-ink); border-radius: var(--radius-sm); }

/* ---------- Navigation progress bar ---------- */
#navProgress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--sky); z-index: 3000;
    transition: width .2s ease, opacity .3s ease; opacity: 0; pointer-events: none;
}
#navProgress.on { opacity: 1; }

/* ---------- Page transitions (Chrome/Edge; baaki par khamoshi se off) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .12s ease both; }
::view-transition-new(root) { animation: vtIn .16s ease both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn  { from { opacity: 0; } }

/* ---------- Accessibility floor ---------- */
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important;
    }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

/* ==========================================================================
   DARK — raat ka daftar. Kaghaz ki jagah gehri slate, siyahi roshan.
   ========================================================================== */
html[data-theme="dark"] {
    --canvas:    #0B1220;
    --surface:   #121B2C;
    --surface-2: #172236;
    --line:      #26334A;
    --line-soft: #1D2839;
    --tint:      #14293F;

    --ink:       #E6EDF8;
    --ink-2:     #97A6BE;
    --ink-3:     #6B7B95;

    --indigo:    #2E5296;
    --indigo-2:  #4470C4;
    --sky:       #3FA3E8;
    --sky-deep:  #7EC4F5;

    --red-ink:   #E4707E;
    --green-ink: #3FBF9B;
    --ochre:     #D9A03C;
    --violet:    #8C7CF0;

    --shadow-pop:  0 12px 38px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
    --shadow-ring: 0 0 0 3px rgba(63,163,232,.22);
    --perf: repeating-linear-gradient(to right, var(--line) 0 4px, transparent 4px 9px);
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .sidebar-brand .crest { background: var(--indigo); }
html[data-theme="dark"] .toast { background: #1B2740; }
html[data-theme="dark"] .kpi-card .kpi-icon { background: rgba(63,163,232,.13); color: var(--sky-deep); border-color: rgba(63,163,232,.22); }
html[data-theme="dark"] .btn-primary { background: var(--sky); color: #06121F; }
html[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: var(--sky-deep); }
html[data-theme="dark"] table.data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
html[data-theme="dark"] .form-group input::placeholder { color: var(--ink-3); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--surface); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--line); }
html[data-theme="dark"] ::selection { background: rgba(63,163,232,.3); color: var(--ink); }

/* KPI icon ab asli SVG hai, emoji nahi */
.kpi-card .kpi-icon svg { width: 14px; height: 14px; }
