  :root {
    --blue-dark: #1e3a8a;
    --blue-mid: #2563eb;
    --blue-light: #3b82f6;
    --blue-pale: #eff6ff;
    --blue-border: #bfdbfe;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --red: #ef4444;
    --red-light: #fef2f2;
    --green: #10b981;
    --green-light: #ecfdf5;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --white: #ffffff;
    --font: 'Plus Jakarta Sans', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(30,58,138,.06);
    --shadow-lg: 0 8px 32px rgba(30,58,138,.12);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
  }

  /* ─── SIDEBAR ─── */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 240px;
    background: linear-gradient(170deg, var(--blue-dark) 0%, #1d4ed8 100%);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
  }

  .sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }

  .logo-badge {
    display: flex; align-items: center; gap: 10px;
  }

  .logo-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
  }

  .logo-text { color: white; }
  .logo-text .brand { font-size: 13px; font-weight: 500; opacity: .7; }
  .logo-text .product { font-size: 16px; font-weight: 700; }

  .school-chip {
    margin: 14px 20px 0;
    background: rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 8px;
  }

  .school-chip .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    flex-shrink: 0;
  }

  .school-chip .name {
    color: white; font-size: 12px; font-weight: 600;
    line-height: 1.3;
  }

  .school-chip .sub { color: rgba(255,255,255,.5); font-size: 11px; }

  .sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
  }

  .nav-label {
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    color: rgba(255,255,255,.35);
    padding: 8px 8px 4px;
    text-transform: uppercase;
  }

  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: rgba(255,255,255,.65);
    font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
    border: none; background: none; width: 100%; text-align: left;
  }

  .nav-item:hover { background: rgba(255,255,255,.1); color: white; }
  .nav-item.active { background: rgba(255,255,255,.15); color: white; font-weight: 600; }

  .nav-item .icon { font-size: 16px; flex-shrink: 0; }

  .nav-item .badge {
    margin-left: auto;
    background: var(--amber);
    color: white;
    font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 20px;
  }

  .sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .user-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
  }

  .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
  }

  .user-info .uname { color: white; font-size: 13px; font-weight: 600; }
  .user-info .urole { color: rgba(255,255,255,.45); font-size: 11px; }

  /* ─── MAIN ─── */
  .main {
    margin-left: 240px;
    min-height: 100vh;
    display: flex; flex-direction: column;
  }

  .topbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 28px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
  }

  .topbar-left { display: flex; align-items: center; gap: 12px; }
  .menu-btn { display: none; background: none; border: none; cursor: pointer; font-size: 20px; }

  .page-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
  .page-sub { font-size: 12px; color: var(--gray-400); }

  .topbar-right { display: flex; align-items: center; gap: 12px; }

  .clock-badge {
    background: var(--blue-pale);
    border: 1px solid var(--blue-border);
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--mono);
    font-size: 14px; font-weight: 500;
    color: var(--blue-dark);
    letter-spacing: .04em;
  }

  .status-pill {
    display: flex; align-items: center; gap: 6px;
    background: var(--green-light);
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px; font-weight: 600; color: #065f46;
  }

  .status-pill .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
  }

  .content { padding: 28px; flex: 1; }

  /* ─── TABS ─── */
  .tabs {
    display: flex; gap: 4px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
  }

  .tab {
    padding: 8px 20px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; background: none;
    color: var(--gray-600);
    transition: all .15s;
    display: flex; align-items: center; gap: 6px;
  }

  .tab:hover { background: var(--gray-100); }

  .tab.active {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
  }

  /* ─── GRID ─── */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }

  /* ─── STAT CARDS ─── */
  .stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
  }

  .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
  }

  .stat-icon.blue { background: var(--blue-pale); }
  .stat-icon.amber { background: var(--amber-light); }
  .stat-icon.red { background: var(--red-light); }

  .stat-num { font-size: 28px; font-weight: 800; line-height: 1; }
  .stat-label { font-size: 12px; color: var(--gray-400); font-weight: 500; margin-top: 2px; }
  .stat-delta { font-size: 11px; color: var(--green); font-weight: 600; }

  /* ─── CARDS ─── */
  .card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
  }

  .card-title { font-size: 14px; font-weight: 700; }
  .card-sub { font-size: 12px; color: var(--gray-400); margin-top: 1px; }

  .card-body { padding: 20px; }

  /* ─── FORM ELEMENTS ─── */
  .field { margin-bottom: 16px; }

  .field label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    letter-spacing: .02em;
  }

  .field label .req { color: var(--blue-light); margin-left: 2px; }

  .input-wrap { position: relative; }

  .input-wrap .input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 15px; color: var(--gray-400);
    pointer-events: none;
  }

  select, input[type="text"], input[type="date"], textarea {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--gray-800);
    background: white;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
  }

  select:focus, input:focus, textarea:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  }

  textarea { padding-left: 12px; resize: vertical; min-height: 80px; }

  .select-arrow {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--gray-400); font-size: 12px;
  }

  /* ─── STUDENT CARD ─── */
  .student-preview {
    background: var(--blue-pale);
    border: 1.5px solid var(--blue-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: none;
  }

  .student-preview.visible { display: flex; gap: 14px; align-items: flex-start; }

  .student-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: white;
    flex-shrink: 0;
  }

  .student-info .sname { font-size: 15px; font-weight: 700; color: var(--blue-dark); }
  .student-info .scourse { font-size: 12px; color: var(--blue-mid); font-weight: 600; }
  .student-info .smeta { font-size: 12px; color: var(--gray-600); margin-top: 4px; }

  /* ─── RESPONSIBLE LIST ─── */
  .resp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

  .resp-item {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: all .15s;
    display: flex; align-items: center; justify-content: space-between;
  }

  .resp-item:hover { border-color: var(--blue-light); background: var(--blue-pale); }
  .resp-item.selected { border-color: var(--blue-light); background: var(--blue-pale); }

  .resp-item .resp-name { font-size: 14px; font-weight: 600; }
  .resp-item .resp-rel { font-size: 11px; color: var(--gray-400); }
  .resp-item .resp-phone {
    font-family: var(--mono);
    font-size: 12px; color: var(--blue-mid); font-weight: 500;
  }

  .resp-radio {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--gray-200);
    flex-shrink: 0;
    transition: all .15s;
  }

  .resp-item.selected .resp-radio {
    border-color: var(--blue-light);
    background: var(--blue-light);
    box-shadow: inset 0 0 0 3px white;
  }

  /* ─── BUTTONS ─── */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all .15s;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
    width: 100%;
  }

  .btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.35); }

  .btn-amber {
    background: linear-gradient(135deg, #d97706, var(--amber));
    color: white;
    box-shadow: 0 2px 8px rgba(245,158,11,.3);
    width: 100%;
  }

  .btn-amber:hover { opacity: .9; transform: translateY(-1px); }

  .btn-ghost {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
  }

  .btn-ghost:hover { background: var(--gray-200); }

  /* ─── TABLE ─── */
  .table-wrap { overflow-x: auto; }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }

  thead th {
    padding: 10px 14px;
    background: var(--gray-50);
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--gray-400);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
  }

  tbody tr { border-bottom: 1px solid var(--gray-100); transition: background .1s; }
  tbody tr:hover { background: var(--gray-50); }
  tbody td { padding: 12px 14px; }

  .chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700;
  }

  .chip.late { background: var(--amber-light); color: #92400e; }
  .chip.pickup { background: var(--blue-pale); color: var(--blue-dark); }
  .chip.green { background: var(--green-light); color: #065f46; }

  .student-row { display: flex; align-items: center; gap: 8px; }

  .mini-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: white;
    flex-shrink: 0;
  }

  .s-name { font-weight: 600; font-size: 13px; }
  .s-course { font-size: 11px; color: var(--gray-400); }

  /* ─── DASHBOARD ─── */
  .chart-bar-wrap { padding: 8px 0; }

  .chart-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
  }

  .chart-label { font-size: 11px; color: var(--gray-600); font-weight: 600; width: 36px; text-align: right; flex-shrink: 0; }

  .chart-track { flex: 1; background: var(--gray-100); border-radius: 4px; height: 20px; overflow: hidden; }

  .chart-fill {
    height: 100%; border-radius: 4px;
    display: flex; align-items: center; padding-left: 8px;
    font-size: 10px; font-weight: 700; color: white;
    transition: width .8s cubic-bezier(.4,0,.2,1);
  }

  .chart-fill.blue { background: linear-gradient(90deg, var(--blue-dark), var(--blue-light)); }
  .chart-fill.amber { background: linear-gradient(90deg, #d97706, var(--amber)); }

  .chart-count { font-size: 12px; font-weight: 700; color: var(--gray-800); width: 24px; }

  /* ─── MINI CALENDAR HEATMAP ─── */
  .heatmap { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }

  .hm-cell {
    width: 14px; height: 14px; border-radius: 3px;
    background: var(--gray-200);
  }

  .hm-cell.l1 { background: #bfdbfe; }
  .hm-cell.l2 { background: #93c5fd; }
  .hm-cell.l3 { background: var(--blue-light); }
  .hm-cell.l4 { background: var(--blue-dark); }

  /* ─── PANEL OVERLAY STATE ─── */
  .panel-state { display: none; }
  .panel-state.active { display: block; }

  /* ─── RESPONSIVE ─── */
  @media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
  }

  @media (max-width: 768px) {
    .sidebar {
      transform: translateX(-100%);
    }

    .sidebar.open {
      transform: translateX(0);
    }

    .main { margin-left: 0; }
    .menu-btn { display: block; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .content { padding: 16px; }
    .tabs { width: 100%; }
    .tab { flex: 1; justify-content: center; padding: 8px 12px; }
    .clock-badge { display: none; }
  }

  @media (max-width: 480px) {
    .grid-3 { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
  }

  /* ─── OVERLAY ─── */
  .overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 90;
  }

  .overlay.active { display: block; }

  /* ─── EMPTY STATE ─── */
  .empty {
    text-align: center; padding: 40px 20px;
    color: var(--gray-400);
  }

  .empty .empty-icon { font-size: 40px; margin-bottom: 10px; }
  .empty .empty-text { font-size: 14px; font-weight: 500; }
  .empty .empty-sub { font-size: 12px; margin-top: 4px; }

  /* ─── SEARCH BAR ─── */
  .search-bar {
    display: flex; gap: 10px; margin-bottom: 16px;
  }

  .search-input-wrap { flex: 1; position: relative; }

  .search-input {
    width: 100%;
    padding: 9px 12px 9px 36px !important;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
  }

  .search-input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
  }

  .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 14px;
  }

  .filter-chip {
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    background: white; font-size: 12px; font-weight: 600;
    cursor: pointer; color: var(--gray-600);
    transition: all .15s;
  }

  .filter-chip.active {
    border-color: var(--blue-light);
    background: var(--blue-pale);
    color: var(--blue-dark);
  }

  .divider { height: 1px; background: var(--gray-100); margin: 16px 0; }

  .time-stamp {
    font-family: var(--mono);
    font-size: 12px; color: var(--gray-400);
  }

  /* Toast notification */
  .toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--gray-800);
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    z-index: 200;
    display: flex; align-items: center; gap: 8px;
  }

  .toast.show { transform: translateY(0); opacity: 1; }