/* =============================================================
   hr-shell.css — GLBY HR Portal Design System
   Aligned with Jimeat ERP shell.css token namespace
   Brand: Jimeat HR (#A41D2B) — swap --brand for other tenants
   Built: 2026-06-20
   ============================================================= */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }

/* ── Design Tokens ───────────────────────────────────────────── */
:root {
  /* Brand (single-token tenant swap) */
  --brand:        #A41D2B;
  --brand-dark:   #7a1520;
  --brand-light:  #fde8ea;
  --brand-subtle: #fdf5f5;

  /* Ink */
  --ink:          #111827;
  --ink-muted:    #6B7280;
  --ink-faint:    #9CA3AF;

  /* Surface */
  --surface:      #FFFFFF;
  --surface-2:    #F9FAFB;
  --surface-3:    #F3F4F6;

  /* Border */
  --border:       #E5E7EB;
  --border-strong:#D1D5DB;

  /* Semantic — success */
  --success:      #065F46;
  --success-bg:   #D1FAE5;
  --success-text: #047857;

  /* Semantic — warning */
  --warning:      #92400E;
  --warning-bg:   #FEF3C7;
  --warning-text: #B45309;

  /* Semantic — danger */
  --danger:       #991B1B;
  --danger-bg:    #FEE2E2;
  --danger-text:  #DC2626;

  /* Semantic — info */
  --info:         #1E40AF;
  --info-bg:      #DBEAFE;
  --info-text:    #2563EB;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w:    240px;
  --topbar-h:     56px;
  --appbar-h:     56px;
  --bottomnav-h:  64px;

  /* Radius */
  --radius-xs:    4px;
  --radius:       6px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-pill:  9999px;

  /* Spacing (8px grid) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
}

/* ── Font load ───────────────────────────────────────────────── */
/* Pages import Google Fonts in <head>; this is a reminder comment only */

/* ── Base typography ─────────────────────────────────────────── */
html, body { font-family: var(--font); font-size: 14px; color: var(--ink); }

/* ─────────────────────────────────────────────────────────────
   BUTTONS
   ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; font-weight: 600; }

.btn-primary   { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover   { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost     { background: transparent; color: var(--ink-muted); border-color: transparent; }
.btn-ghost:hover     { background: var(--surface-3); color: var(--ink); }
.btn-danger    { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #FCA5A5; }
.btn-danger:hover    { background: #fee2e2cc; }

/* Mobile full-width CTA (clock, leave submit) */
.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────
   FORM INPUTS
   ──────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 5px;
}
.form-group { margin-bottom: 14px; }
.form-hint  { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.form-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--ink-faint); }
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(164,29,43,.12);
}
/* Mobile inputs: taller + larger radius */
.form-input-mobile {
  height: 52px;
  font-size: 15px;
  border-radius: 10px;
}
/* Mono inputs (IDs, amounts, PINs) */
.form-input-mono {
  font-family: var(--mono);
  font-size: 13px;
}
/* PIN input */
.form-input-pin {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: 600;
}
/* Select chevron */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}
/* Editable table cell */
.editable-input {
  width: 80px;
  height: 30px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: #FFFBF0;
  outline: none;
  color: var(--ink);
}
.editable-input:focus { border-color: var(--brand); }

/* ─────────────────────────────────────────────────────────────
   STATUS BADGES
   ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

/* Employment status */
.badge-active     { background: var(--success-bg);  color: var(--success-text); }
.badge-active .badge-dot    { background: var(--success-text); }
.badge-probation  { background: var(--warning-bg);  color: var(--warning-text); }
.badge-probation .badge-dot { background: var(--warning-text); }
.badge-resigned   { background: var(--surface-3);   color: var(--ink-faint); }
.badge-resigned .badge-dot  { background: var(--ink-faint); }

/* Leave status */
.badge-approved { background: var(--success-bg); color: var(--success-text); }
.badge-pending  { background: var(--warning-bg); color: var(--warning-text); }
.badge-rejected { background: var(--danger-bg);  color: var(--danger-text); }

/* Payroll status */
.badge-saved    { background: var(--success-bg); color: var(--success-text); }
.badge-unsaved  { background: var(--warning-bg); color: var(--warning-text); }
.badge-locked   { background: var(--surface-3);  color: var(--ink-faint); }

/* ─────────────────────────────────────────────────────────────
   DATA TABLES
   ──────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.table-wrap-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead tr { background: var(--surface-2); }
.tbl th {
  height: 40px;
  padding: 0 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl th.right { text-align: right; }
.tbl td {
  height: 48px;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.tbl td.right { text-align: right; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr { transition: background 0.08s; }

/* Table cell variants */
.tbl td.mono-col { font-family: var(--mono); font-size: 12.5px; color: var(--ink-muted); }
.tbl td.amount   { font-family: var(--mono); text-align: right; }
.tbl td.net      { font-family: var(--mono); font-weight: 700; color: var(--success-text); text-align: right; }
.tbl td.deduct   { font-family: var(--mono); font-size: 12.5px; color: var(--danger-text); text-align: right; }

.name-cell     { font-weight: 600; color: var(--ink); }
.empno-cell    { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); display: block; margin-top: 1px; }

/* Row actions (hover-reveal) */
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.1s; }
.tbl tbody tr:hover .row-actions { opacity: 1; }
.row-btn {
  width: 28px; height: 28px;
  border: none;
  background: var(--surface-3);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-muted);
  transition: background 0.1s, color 0.1s;
}
.row-btn:hover               { background: var(--brand-light); color: var(--brand); }
.row-btn.danger:hover        { background: var(--danger-bg);   color: var(--danger-text); }

/* Table footer */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────────────────
   CARDS
   ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.card-elevated {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.stat-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat-val.red   { color: var(--danger-text); }
.stat-val.green { color: var(--success-text); }

/* Panel card (two-column layouts: allowances, deductions) */
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.panel-sub   { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

/* ─────────────────────────────────────────────────────────────
   SECTION LABEL (mobile content sections)
   ──────────────────────────────────────────────────────────── */
.sec-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}

/* ─────────────────────────────────────────────────────────────
   RIGHT-SLIDE PANEL (payslip, edit employee, edit allowance)
   ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.5);
  z-index: 500;
  align-items: flex-start;
  justify-content: flex-end;
}
.modal-overlay.open { display: flex; }
.modal-panel {
  width: 480px;
  height: 100vh;
  background: var(--surface);
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease;
}
.modal-panel-wide { width: 520px; } /* payslip */
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 12px;
}
.modal-title-group { flex: 1; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.modal-sub   { font-size: 12.5px; color: var(--ink-muted); font-family: var(--mono); }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--surface-3);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-muted);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger-text); }
.modal-body   { flex: 1; overflow-y: auto; padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* ─────────────────────────────────────────────────────────────
   MOBILE SHELL — APPBAR
   ──────────────────────────────────────────────────────────── */

/* Mobile-lock: staff (m/) pages render as a fixed mobile-width column,
   centred on a neutral backdrop (like Thai Geng /m/). Admin pages unaffected
   (scoped to body.m-app). On phones (<=480px) this is just full width. */
:root { --m-app-w: 460px; }
html:has(body.m-app) { background: var(--surface-3); }
body.m-app {
  max-width: var(--m-app-w);
  margin: 0 auto;
  position: relative;
  background: var(--surface);
  min-height: 100dvh;
  box-shadow: 0 0 24px rgba(0,0,0,.06);
}
body.m-app .bottom-nav {        /* fixed nav constrained to the mobile column */
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--m-app-w);
}

.appbar {
  position: sticky;
  top: 0;
  height: var(--appbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 200;
}
.appbar-logo {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.appbar-title-wrap { flex: 1; min-width: 0; }
.appbar-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.appbar-sub   { font-size: 11px; color: var(--ink-faint); }
.icon-btn {
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-3); }
.back-btn {
  width: 36px; height: 36px;
  border: none;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────────────────
   MOBILE SHELL — SCREEN CONTENT
   ──────────────────────────────────────────────────────────── */
.screen {
  padding-bottom: calc(var(--bottomnav-h) + 20px + env(safe-area-inset-bottom, 0px));
  min-height: calc(100dvh - var(--appbar-h));
}
.content-pad { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ─────────────────────────────────────────────────────────────
   MOBILE SHELL — BOTTOM NAV
   ──────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 200;
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  cursor: pointer;
  color: var(--ink-faint);
  text-decoration: none;
  min-height: 44px;
  transition: color 0.1s;
}
.nav-tab.active { color: var(--brand); }
.nav-tab-icon   { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.nav-tab-label  { font-size: 10px; font-weight: 500; }

/* ─────────────────────────────────────────────────────────────
   MOBILE — CLOCK CTA BUTTON
   ──────────────────────────────────────────────────────────── */
.clock-btn {
  width: 160px; height: 160px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font);
  color: white;
  background: var(--brand);
  box-shadow: 0 8px 32px rgba(164,29,43,.35), 0 0 0 8px var(--brand-light);
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 24px;
}
.clock-btn:active { transform: scale(0.94); box-shadow: 0 4px 16px rgba(164,29,43,.3); }
.clock-btn.out-mode {
  background: #1D4ED8;
  box-shadow: 0 8px 32px rgba(29,78,216,.3), 0 0 0 8px #DBEAFE;
}
.clock-btn-icon  { font-size: 36px; line-height: 1; }
.clock-btn-label { font-size: 17px; font-weight: 700; }
.clock-btn-sub   { font-size: 12px; opacity: 0.85; }

/* GPS Pill */
.gps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 12.5px;
  font-weight: 500;
}
.gps-pill.out { background: var(--warning-bg); color: var(--warning-text); }
.gps-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success-text); }
.gps-pill.out .gps-dot { background: var(--warning-text); }

/* ─────────────────────────────────────────────────────────────
   MOBILE — LOGIN HERO
   ──────────────────────────────────────────────────────────── */
.login-hero {
  background: var(--brand);
  padding: 48px 24px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hero-logo {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.15);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.hero-title { font-size: 22px; font-weight: 700; color: white; text-align: center; letter-spacing: -0.3px; }
.hero-sub   { font-size: 14px; color: rgba(255,255,255,.75); text-align: center; }

/* Login card (overlaps hero) */
.login-card {
  background: var(--surface);
  margin: -16px 16px 0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  position: relative;
  z-index: 1;
}
.tenant-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-faint);
}
.tenant-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ─────────────────────────────────────────────────────────────
   MOBILE — GREETING HERO
   ──────────────────────────────────────────────────────────── */
.greeting-hero {
  background: var(--brand);
  padding: 20px 16px 40px;
}
.greeting-day  { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 2px; }
.greeting-name { font-size: 20px; font-weight: 700; color: white; margin-bottom: 2px; }
.greeting-role { font-size: 13px; color: rgba(255,255,255,.7); }

/* Clock CTA card (overlaps greeting hero) */
.clock-cta-card {
  background: var(--surface);
  margin: -20px 16px 0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  position: relative;
  z-index: 1;
}
.clock-cta-row { display: flex; align-items: center; gap: 12px; }
.clock-status-indicator {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.clock-cta-info { flex: 1; }
.clock-cta-label  { font-size: 12px; color: var(--ink-muted); margin-bottom: 2px; }
.clock-cta-status { font-size: 15px; font-weight: 600; color: var(--success); }
.clock-cta-time   { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }
.btn-clock-cta {
  height: 40px; padding: 0 16px;
  background: var(--brand); color: white;
  border: none; border-radius: var(--radius-md);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE — LEAVE BALANCE HERO
   ──────────────────────────────────────────────────────────── */
.balance-section {
  background: var(--brand);
  padding: 20px 16px 28px;
}
.balance-label {
  font-size: 12px; color: rgba(255,255,255,.7);
  margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
}
.balance-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.balance-tile {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.balance-tile-val   { font-family: var(--mono); font-size: 28px; font-weight: 700; color: white; line-height: 1; margin-bottom: 4px; }
.balance-tile-label { font-size: 11px; color: rgba(255,255,255,.75); }

/* Form card (overlaps leave hero) */
.form-card {
  background: var(--surface);
  margin: -16px 16px 0;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  padding: 18px;
  position: relative; z-index: 1;
}
.form-card-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* Leave item card */
.leave-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 14px;
}
.leave-item-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 8px;
}
.leave-dates  { font-size: 13px; color: var(--ink); font-weight: 500; }
.leave-days   { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.leave-reason { font-size: 12.5px; color: var(--ink-muted); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* Leave type pills */
.leave-type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.badge-al { background: var(--brand-light); color: var(--brand); }
.badge-mc { background: var(--info-bg);     color: var(--info-text); }

/* ─────────────────────────────────────────────────────────────
   MOBILE — LEAVE BALANCE TILES (home page)
   ──────────────────────────────────────────────────────────── */
.leave-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.leave-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 6px;
  border-radius: 10px; background: var(--surface-2);
}
.leave-tile-val   { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--ink); }
.leave-tile-label { font-size: 11px; color: var(--ink-muted); text-align: center; }
.leave-tile.al .leave-tile-val { color: var(--brand); }
.leave-tile.mc .leave-tile-val { color: #2563EB; }
.leave-tile.el .leave-tile-val { color: var(--success-text); }

/* ─────────────────────────────────────────────────────────────
   MOBILE — QUICK LINKS
   ──────────────────────────────────────────────────────────── */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; text-decoration: none; color: inherit;
  transition: border-color 0.1s;
}
.quick-link:active { background: var(--surface-2); }
.quick-link-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-link-label { font-size: 13px; font-weight: 500; color: var(--ink); }
.quick-link-sub   { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }

/* ─────────────────────────────────────────────────────────────
   MOBILE — CLOCK PAGE SPECIFIC
   ──────────────────────────────────────────────────────────── */
.clock-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 24px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.live-clock {
  font-family: var(--mono);
  font-size: 44px; font-weight: 600;
  color: var(--ink); letter-spacing: -1px;
  margin-bottom: 4px;
}
.live-date { font-size: 14px; color: var(--ink-muted); margin-bottom: 28px; }
.status-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 14px 16px;
}
.status-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: none; }
.status-key { font-size: 13px; color: var(--ink-muted); }
.status-val { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 500; }
.status-val.green { color: var(--success-text); }
.status-val.amber { color: var(--warning-text); }
.ot-card {
  background: var(--brand-subtle);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.ot-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ot-info { flex: 1; }
.ot-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 2px; }
.ot-val   { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--brand); }
.ot-sub   { font-size: 11px; color: var(--ink-faint); }

/* ─────────────────────────────────────────────────────────────
   DESKTOP SHELL — TOPBAR
   ──────────────────────────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  width: var(--sidebar-w);
  height: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-logo {
  width: 30px; height: 30px;
  background: var(--brand);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-text    { display: flex; flex-direction: column; }
.brand-name    { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; }
.brand-tag     { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.5px; }

.topbar-center {
  flex: 1;
  display: flex; align-items: center;
  padding: 0 24px; gap: 6px;
}
.bc-item { font-size: 13.5px; color: var(--ink-muted); text-decoration: none; transition: color 0.1s; }
.bc-item:hover { color: var(--brand); }
.bc-sep  { font-size: 13px; color: var(--ink-faint); }
.bc-item.current { color: var(--ink); font-weight: 500; }

.topbar-right {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; flex-shrink: 0;
}
.topbar-date { font-size: 12.5px; color: var(--ink-faint); }
.notif-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-muted);
  position: relative;
  transition: background 0.1s;
}
.notif-btn:hover { background: var(--surface-3); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--brand); border-radius: 50%;
  border: 2px solid var(--surface);
}
.topbar-avatar {
  width: 30px; height: 30px;
  background: var(--brand); border-radius: 50%;
  color: white; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────
   DESKTOP SHELL — SIDEBAR (WHITE)
   ──────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section { padding: 0 12px; margin-bottom: 4px; }
.nav-label {
  font-size: 10px; font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 8px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer; color: var(--ink-muted);
  font-size: 13.5px; font-weight: 400;
  transition: all 0.1s;
  text-decoration: none;
  margin-bottom: 1px; min-height: 36px;
  position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.sidebar-avatar {
  width: 28px; height: 28px;
  background: var(--brand); border-radius: 50%;
  color: white; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-info .name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.sidebar-user-info .role { font-size: 11px; color: var(--ink-faint); }

/* ─────────────────────────────────────────────────────────────
   DESKTOP SHELL — MAIN CONTENT AREA
   ──────────────────────────────────────────────────────────── */
.main { overflow-y: auto; }
.content { padding: 24px 28px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.4px; }
.page-sub   { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

/* Desktop layout: grid sidebar + main */
.desktop-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  min-height: 100dvh;
  background: var(--surface-2);
}

/* Control bar / filter bar */
.control-bar,
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ctrl-label  { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.ctrl-sep    { width: 1px; height: 20px; background: var(--border); }
.ctrl-status { font-size: 12px; color: var(--ink-faint); margin-left: auto; }
.ctrl-input {
  height: 36px; padding: 0 12px;
  font-family: var(--font); font-size: 13px;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color 0.15s;
}
.ctrl-input:focus { border-color: var(--brand); }
.ctrl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink-muted);
  transition: background 0.1s;
}
.ctrl-btn:hover        { background: var(--surface-3); }
.ctrl-btn.primary      { background: var(--brand); color: white; border-color: var(--brand); }
.ctrl-btn.primary:hover{ background: var(--brand-dark); }
.ctrl-btn.ghost-save   { background: var(--success-bg); color: var(--success-text); border-color: #A7F3D0; }

/* Search */
.search-wrap { position: relative; display: flex; align-items: center; flex: 1; max-width: 280px; }
.search-icon { position: absolute; left: 10px; color: var(--ink-faint); }
.search-input {
  width: 100%; height: 36px;
  padding: 0 12px 0 34px;
  font-family: var(--font); font-size: 13.5px; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--brand); }
.filter-select {
  height: 36px; padding: 0 28px 0 10px;
  font-family: var(--font); font-size: 13px; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-sep  { width: 1px; height: 20px; background: var(--border); }
.filter-btn  {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink-muted);
  transition: background 0.1s;
}
.filter-btn:hover          { background: var(--surface-3); }
.filter-btn.primary        { background: var(--brand); color: white; border-color: var(--brand); }
.filter-btn.primary:hover  { background: var(--brand-dark); }
.filter-meta { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }

/* Staff avatar in table */
.staff-cell  { display: flex; align-items: center; gap: 10px; }
.staff-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--brand);
}

/* Pagination */
.pagination  { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; color: var(--ink-muted);
  transition: background 0.1s;
}
.page-btn:hover          { background: var(--surface-3); }
.page-btn.active         { background: var(--brand); color: white; border-color: var(--brand); font-weight: 600; }

/* Two-panel layout (allowances, deductions) */
.two-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* Allowance flags */
.flag-group { display: flex; gap: 4px; }
.flag-chip  {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: var(--radius-xs);
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.flag-on  { background: var(--success-bg); color: var(--success-text); }
.flag-off { background: var(--surface-3);  color: var(--ink-faint); text-decoration: line-through; }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  background: var(--brand); border-radius: 10px;
  position: relative; cursor: pointer; border: none; flex-shrink: 0;
}
.toggle.off  { background: var(--border-strong); }
.toggle-knob {
  position: absolute; width: 14px; height: 14px;
  background: white; border-radius: 50%;
  top: 3px; right: 3px; transition: right 0.15s;
}
.toggle.off .toggle-knob { right: auto; left: 3px; }
.toggle-wrap  { display: flex; align-items: center; gap: 6px; }
.toggle-label { font-size: 12px; color: var(--ink-muted); }

/* Amount input (allowances table) */
.amount-input {
  width: 90px; height: 30px; padding: 0 8px;
  font-family: var(--mono); font-size: 12.5px;
  text-align: right;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  outline: none; color: var(--ink); background: var(--surface-2);
}
.amount-input:focus { border-color: var(--brand); background: var(--surface); }

/* Info callout */
.info-box {
  background: var(--info-bg);
  border-left: 3px solid var(--info-text);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 14px;
  font-size: 12.5px; color: var(--info-text);
  margin: 0 16px 14px;
  line-height: 1.5;
}

/* Admin modal form sections */
.modal-section       { margin-bottom: 20px; }
.modal-section-title {
  font-size: 11px; font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group-col      { display: flex; flex-direction: column; gap: 5px; }
.form-group-col.full { grid-column: 1 / -1; }

/* Desktop login card */
.admin-login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  padding: 24px;
}
.admin-login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
}
.admin-login-logo {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.admin-logo-icon {
  width: 48px; height: 48px;
  background: var(--brand); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.admin-login-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.admin-login-sub   { font-size: 13px; color: var(--ink-muted); margin-top: 2px; text-align: center; }

/* Payslip preview */
.payslip      { font-size: 12px; }
.ps-head      { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: 12px; margin-bottom: 14px; }
.ps-company   { font-size: 15px; font-weight: 700; color: var(--brand); }
.ps-company-sub { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.ps-title-block { text-align: right; }
.ps-title-block h2 { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.ps-title-block p  { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.ps-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--surface-2); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.ps-field-label { font-size: 10px; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.ps-field-val   { font-size: 12px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.ps-section     { margin-bottom: 12px; }
.ps-section-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-muted); border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 8px; }
.ps-row         { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.ps-subtotal    { display: flex; justify-content: space-between; padding: 5px 0; font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; }
.ps-net         { display: flex; justify-content: space-between; background: var(--brand); color: white; border-radius: var(--radius); padding: 10px 14px; margin-top: 14px; font-weight: 700; font-size: 14px; }
.ps-employer    { margin-top: 14px; background: var(--success-bg); border-radius: var(--radius); padding: 10px 12px; font-size: 11.5px; }
.ps-employer-title { font-size: 10.5px; font-weight: 700; color: var(--success); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.ps-employer-row { display: flex; justify-content: space-between; }

/* Toast notification */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: white;
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500;
  z-index: 9999; opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }
