  :root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --brand: #1e3a8a;          /* deep navy */
    --brand-2: #1e40af;
    --brand-soft: #eff6ff;
    --accent: #d97706;         /* amber accent */
    --accent-soft: #fef3c7;
    --ok: #047857;
    --ok-soft: #d1fae5;
    --warn: #b45309;
    --warn-soft: #fef3c7;
    --err: #b91c1c;
    --err-soft: #fee2e2;
    --line: #e2e8f0;
    --line-2: #cbd5e1;
    --row: #f8fafc;
  }
  /* Dark mode */
  html[data-theme="dark"] {
    --bg: #0f172a;
    --panel: #1e293b;
    --ink: #f1f5f9;
    --ink-2: #cbd5e1;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --brand: #60a5fa;
    --brand-2: #3b82f6;
    --brand-soft: #1e3a5f;
    --accent: #fbbf24;
    --ok: #34d399;
    --warn: #fbbf24;
    --err: #f87171;
    --line: #334155;
    --line-2: #475569;
    --row: #273449;
  }
  html[data-theme="dark"] header { background: var(--panel); }
  html[data-theme="dark"] nav.tabs { background: var(--panel); }
  html[data-theme="dark"] .field input,
  html[data-theme="dark"] .field select,
  html[data-theme="dark"] .field textarea {
    background: var(--row);
    color: var(--ink);
    border-color: var(--line);
  }
  html[data-theme="dark"] .modal { background: var(--panel); }
  html[data-theme="dark"] .stat { background: var(--panel); }
  html[data-theme="dark"] table th { background: var(--row); }
  html[data-theme="dark"] .note { background: #3a2f1a; color: #fde68a; border-color: #78350f; }
  html[data-theme="dark"] .err-banner { background: #3a1a1a; color: #fca5a5; border-color: #7f1d1d; }
  html[data-theme="dark"] .warn-banner { background: #3a2f1a; color: #fde68a; border-color: #78350f; }
  html[data-theme="dark"] .login-overlay { background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #450a0a 100%); }
  html[data-theme="dark"] .login-box { background: var(--panel); }
  :root {
    /* Sentinel close — declarations continue below */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
  }
  * { box-sizing: border-box; }
  html { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }
  body {
    margin: 0;
    font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  header {
    background: white;
    color: var(--ink);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  header .brand { display: flex; align-items: center; gap: 12px; }
  header .brand-logo {
    width: 48px; height: 48px;
    background: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  header .brand-logo img {
    width: 100%; height: 100%; object-fit: contain; display: block;
  }
  header h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
  header .sub { font-size: 11px; color: var(--muted); margin-top: 1px; font-weight: 500; }
  header .right { display: flex; gap: 14px; align-items: center; }
  header .user {
    font-size: 12px;
    text-align: right;
    display: flex; align-items: center; gap: 10px;
  }
  header .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
  }
  header .user .name { font-weight: 600; color: var(--ink); }
  header .user .role { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 1px; }
  header .actions { display: flex; gap: 6px; }
  header .actions button {
    background: white;
    border: 1px solid var(--line);
    color: var(--ink-2);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
  }
  header .actions button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
  nav.tabs {
    background: white;
    border-bottom: 1px solid var(--line);
    padding: 0 28px;
    display: flex;
    gap: 2px;
    overflow: visible;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
  }
  nav.tabs button {
    background: none;
    border: none;
    padding: 13px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
    margin-bottom: -1px;
  }
  nav.tabs button:hover { color: var(--ink); background: var(--row); }
  nav.tabs button.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
  }
  nav.tabs .nav-divider {
    width: 1px;
    height: 22px;
    background: var(--line);
    margin: 0 6px;
    align-self: center;
  }
  /* Dropdown nav groups */
  nav.tabs .nav-group { position: relative; display: inline-block; }
  nav.tabs .nav-group-trigger {
    background: none;
    border: none;
    padding: 13px 14px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s;
    margin-bottom: -1px;
  }
  nav.tabs .nav-group-trigger:hover { color: var(--ink); background: var(--row); }
  nav.tabs .nav-group .caret { font-size: 10px; margin-left: 2px; opacity: 0.6; transition: transform 0.15s; }
  nav.tabs .nav-group.open .nav-group-trigger,
  nav.tabs .nav-group.has-active .nav-group-trigger {
    color: var(--brand);
    font-weight: 600;
  }
  nav.tabs .nav-group.has-active .nav-group-trigger {
    border-bottom-color: var(--brand);
  }
  nav.tabs .nav-group.open .caret { transform: rotate(180deg); opacity: 1; }
  nav.tabs .nav-menu {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    display: none;
    z-index: 50;
  }
  nav.tabs .nav-group.open .nav-menu { display: block; }
  nav.tabs .nav-menu .tab-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    color: var(--ink-2);
    border-radius: var(--radius-sm);
    border-bottom: none;
    margin-bottom: 0;
    font-weight: 500;
    transition: all 0.1s;
  }
  nav.tabs .nav-menu .tab-btn:hover { background: var(--brand-soft); color: var(--brand); }
  nav.tabs .nav-menu .tab-btn.active {
    background: var(--brand);
    color: white;
    font-weight: 600;
  }
  main { padding: 24px 28px; max-width: 1500px; margin: 0 auto; }
  .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
  }
  .panel h2 { margin: 0 0 16px 0; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.1px; }
  .panel h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th {
    text-align: left;
    padding: 10px 12px;
    background: var(--row);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  tr:hover td { background: var(--row); }
  tr:last-child td { border-bottom: none; }
  .num { text-align: right; font-variant-numeric: tabular-nums; }
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
  .field { display: flex; flex-direction: column; gap: 4px; }
  .field label { font-size: 12px; color: var(--muted); font-weight: 500; }
  .field input, .field select, .field textarea {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: white;
    color: var(--ink);
    transition: all 0.15s;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    outline: 3px solid var(--brand-soft);
    outline-offset: 0;
    border-color: var(--brand);
  }
  .field input[readonly], .field input:disabled, .field select:disabled { background: var(--row); color: var(--muted); cursor: not-allowed; }
  .btn {
    padding: 8px 14px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
  }
  .btn:hover { background: var(--brand-2); border-color: var(--brand-2); box-shadow: var(--shadow); transform: translateY(-1px); }
  .btn:active { transform: translateY(0); }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
  .btn.ghost { background: white; color: var(--brand); }
  .btn.ghost:hover { background: var(--brand-soft); }
  .btn.danger { background: var(--err); border-color: var(--err); }
  .btn.danger:hover { background: #991b1b; border-color: #991b1b; }
  .btn.small { padding: 5px 10px; font-size: 12px; }
  .actions-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
  }
  .badge.regular { background: #dbeafe; color: #1e40af; }
  .badge.probationary { background: #e0e7ff; color: #3730a3; }
  .badge.suspended { background: #fef3c7; color: #92400e; }
  .badge.resigned { background: #e5e7eb; color: #374151; }
  .badge.terminated { background: #fee2e2; color: #991b1b; }
  .badge.casual { background: #fef3c7; color: #92400e; }
  .badge.jo { background: #f3e8ff; color: #6b21a8; }
  .badge.fixed { background: #d1fae5; color: #065f46; }
  .badge.admin { background: var(--err-soft); color: #991b1b; }
  .badge.hr { background: var(--brand-soft); color: var(--brand); }
  .summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
  }
  .stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
  }
  .stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
  .stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--brand);
  }
  .stat.accent::before { background: var(--accent); }
  .stat.success::before { background: var(--ok); }
  .stat.warning::before { background: var(--warn); }
  .stat.danger::before { background: var(--err); }
  .stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
  .stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
  .stat .sub { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 500; }
  .stat .icon { position: absolute; top: 14px; right: 14px; opacity: 0.15; font-size: 32px; }
  .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
  .row:last-child { border-bottom: none; }
  .row.total { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 10px 0; font-weight: 700; margin-top: 8px; }
  .row .lbl { color: var(--muted); }
  .row .val { font-variant-numeric: tabular-nums; }
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }
  .modal-backdrop.show { display: flex; }
  .modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 900px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .modal h2 { margin-top: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
  .form-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .form-section:last-of-type { border-bottom: none; }
  .toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
  .toolbar .spacer { flex: 1; }
  .empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-style: italic;
  }
  .pill {
    display: inline-block;
    padding: 2px 8px;
    background: var(--row);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
  }
  .note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #78350f;
    margin: 10px 0;
  }
  /* Data Issues — reconciliation surfaced on the dashboard so HR act on it
     instead of it living in someone's head. Colours come from the theme vars
     so the panel follows light/dark like everything else. */
  .issues-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
  .issues-head h3 { margin:0; font-size:15px; }
  .issues-count { background:var(--err-soft); color:var(--err); border-radius:999px;
                  padding:2px 10px; font-size:12px; font-weight:600; }
  .issue-grp { border:1px solid var(--line); border-radius:8px; margin-bottom:10px; overflow:hidden; }
  .issue-grp > summary { cursor:pointer; padding:10px 14px; display:flex; align-items:center;
                         gap:10px; font-size:13px; font-weight:600; list-style:none; }
  .issue-grp > summary::-webkit-details-marker { display:none; }
  .issue-grp > summary::before { content:'▸'; color:var(--muted); font-size:11px; }
  .issue-grp[open] > summary::before { content:'▾'; }
  .issue-grp > summary .n { margin-left:auto; font-weight:700; font-size:12px;
                            padding:1px 8px; border-radius:999px; }
  .issue-grp.sev-high  > summary { background:var(--err-soft); color:var(--err); }
  .issue-grp.sev-high  > summary .n { background:var(--err); color:#fff; }
  .issue-grp.sev-med   > summary { background:var(--warn-soft); color:var(--warn); }
  .issue-grp.sev-med   > summary .n { background:var(--warn); color:#fff; }
  .issue-grp.sev-low   > summary { background:var(--bg); color:var(--muted); }
  .issue-grp.sev-low   > summary .n { background:var(--muted); color:#fff; }
  .issue-why { padding:8px 14px; font-size:12px; color:var(--muted); border-top:1px solid var(--line); }
  .issue-list { margin:0; padding:0 14px 12px; font-size:12.5px; list-style:none; }
  .issue-list li { padding:5px 0; border-bottom:1px dashed var(--line); display:flex;
                   gap:10px; flex-wrap:wrap; align-items:baseline; }
  .issue-list li:last-child { border-bottom:none; }
  .issue-list .who { font-weight:600; }
  .issue-list .meta { color:var(--muted); font-size:11.5px; }
  .issues-ok { color:var(--ok); font-size:13px; padding:4px 0; }

  .err-banner {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
  }
  .warn-banner {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
  }
  .payslip {
    font-family: "Times New Roman", serif;
    background: white;
    padding: 20px 30px;
    color: black;
    max-width: 700px;
    margin: 0 auto;
    font-size: 12px;
  }
  .payslip .ph-head { text-align: center; margin-bottom: 16px; }
  .payslip .ph-head h1 { font-size: 18px; margin: 0; letter-spacing: 1px; }
  .payslip .ph-head .ph-sub { font-size: 12px; }
  .payslip .ph-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 12px 0; border-top: 1px solid #999; border-bottom: 1px solid #999; padding: 8px 0; }
  .payslip .ph-meta div { display: flex; }
  .payslip .ph-meta .k { font-weight: bold; width: 110px; }
  .payslip .ph-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .payslip .ph-col h4 { margin: 8px 0 4px; padding-bottom: 4px; border-bottom: 1px solid #333; font-size: 13px; }
  .payslip .ph-row { display: flex; justify-content: space-between; padding: 2px 0; }
  .payslip .ph-row.total { border-top: 1px solid #333; padding-top: 4px; margin-top: 4px; font-weight: bold; }
  .payslip .ph-net { margin-top: 16px; padding: 10px; background: #f0f0f0; border: 2px solid #333; display: flex; justify-content: space-between; font-size: 14px; font-weight: bold; }
  .payslip .ph-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
  .payslip .ph-sign div { border-top: 1px solid #333; padding-top: 4px; text-align: center; font-size: 11px; }
  @media print {
    header, nav.tabs, .no-print, .modal-backdrop > .modal > .no-print { display: none !important; }
    body { background: white; }
    main { padding: 0; }
    .panel { border: none; padding: 0; }
    .modal-backdrop { position: static; background: none; }
    .modal { box-shadow: none; max-height: none; width: 100%; padding: 0; }
  }
  .help { font-size: 11px; color: var(--muted); margin-top: 2px; }
  details { margin-top: 8px; }
  details summary { cursor: pointer; color: var(--brand); font-size: 12px; font-weight: 500; }

  /* Login overlay */
  .login-overlay {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #7f1d1d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
  }
  .login-overlay.hidden { display: none; }
  .login-box {
    background: white;
    padding: 32px 28px;
    border-radius: 10px;
    max-width: 380px;
    width: 92%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  }
  .login-box h1 { margin: 0 0 4px; text-align: center; color: var(--brand); font-size: 22px; }
  .login-box .sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
  .login-box .err { color: var(--err); font-size: 12px; margin-top: 8px; text-align: center; min-height: 16px; }
  .login-box .api-info { font-size: 10px; color: var(--muted); text-align: center; margin-top: 14px; word-break: break-all; }
  .toast {
    position: fixed;
    bottom: 20px; right: 20px;
    background: var(--ink);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 300;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
  }
  .toast.show { display: block; }
  .toast.err { background: var(--err); }
  .toast.ok { background: var(--ok); }
  .toast.warn { background: var(--warn); }
  .loading {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 250;
    font-size: 14px;
    color: var(--brand);
  }
  .loading.show { display: flex; }
  .loading::after {
    content: '';
    width: 32px; height: 32px;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ===== MOBILE RESPONSIVE (max-width: 768px) ===== */
  @media (max-width: 768px) {
    header {
      padding: 10px 14px;
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
    }
    header .brand { gap: 10px; }
    header .brand-logo { width: 38px; height: 38px; }
    header h1 { font-size: 14px; }
    header .sub { font-size: 10px; }
    header .right { justify-content: space-between; }
    header .user { font-size: 11px; gap: 6px; }
    header .user-avatar { width: 30px; height: 30px; font-size: 12px; }
    header .actions { gap: 4px; flex-wrap: wrap; }
    header .actions button { padding: 5px 8px; font-size: 11px; }

    nav.tabs {
      padding: 0 10px;
      gap: 0;
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    nav.tabs button, nav.tabs .nav-group-trigger {
      padding: 11px 10px;
      font-size: 12px;
      flex-shrink: 0;
    }
    nav.tabs .nav-divider { display: none; }
    nav.tabs .nav-menu {
      min-width: 180px;
      left: 0;
      right: auto;
    }
    nav.tabs #navDoleLink { padding: 11px 8px; font-size: 10px; }

    main { padding: 14px 12px; }
    .panel { padding: 14px; margin-bottom: 12px; border-radius: 6px; }
    .panel h2 { font-size: 14px; margin-bottom: 12px; }

    .summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat { padding: 12px; }
    .stat .value { font-size: 18px; }
    .stat .icon { font-size: 24px; top: 10px; right: 10px; }

    .toolbar {
      gap: 6px;
      flex-wrap: wrap;
    }
    .toolbar h2 { width: 100%; margin-bottom: 4px; }
    .toolbar input, .toolbar select { font-size: 13px; }

    /* Tables — make them horizontally scrollable */
    .panel table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
      -webkit-overflow-scrolling: touch;
    }
    .panel table th, .panel table td {
      padding: 8px 10px;
      font-size: 12px;
    }

    /* Modals full-width on mobile */
    .modal {
      padding: 18px;
      width: 96%;
      max-height: 92vh;
      border-radius: 8px;
    }
    .modal h2 { font-size: 16px; }

    /* Forms stack vertically */
    .grid { grid-template-columns: 1fr !important; }
    .field input, .field select, .field textarea { font-size: 16px; /* prevents iOS zoom on focus */ }

    /* Dashboard grid stacks */
    main > section > div[style*="grid-template-columns"] {
      grid-template-columns: 1fr !important;
    }

    /* Notification dropdown full-width */
    #notifDropdown {
      right: 10px !important;
      left: 10px !important;
      min-width: auto !important;
      max-width: calc(100% - 20px) !important;
    }

    /* Hide less-critical columns in employee table on phones */
    .hide-mobile { display: none !important; }

    /* Employee photo card grid - smaller cells */
    .stat .label { font-size: 10px; }

    /* Login screen */
    .login-box { padding: 22px 18px; }

    /* Buttons more tappable */
    .btn { padding: 9px 14px; min-height: 38px; }
    .btn.small { padding: 6px 10px; min-height: 32px; }
  }

  @media (max-width: 480px) {
    .summary { grid-template-columns: 1fr; }
    nav.tabs button, nav.tabs .nav-group-trigger { padding: 10px 8px; font-size: 11px; }
    .panel h2 { font-size: 13px; }
    header .actions button { font-size: 10px; padding: 4px 6px; }
  }
