/* ==========================================================================
   Factory Payroll - design system
   Blue + white brand. Semantic colours: green = present/success,
   red = absent/error, amber = late/warning, sky blue = leave/info,
   purple = overtime, grey = weekly off/neutral.
   Local only (no web fonts / CDN) - works offline on the factory LAN.
   ========================================================================== */
:root {
  --brand-950: #081a42;
  --brand-900: #0b2559;
  --brand-800: #103179;
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-200: #bfdbfe;
  --brand-100: #dbeafe;
  --brand-50:  #eff6ff;

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5d6b82;  /* was #64748b (4.39:1 on the page background); now >= 4.7:1 on every light surface */

  --success: #15803d; --success-bg: #dcfce7; --success-bd: #bbf7d0;
  --danger:  #b91c1c; --danger-bg:  #fee2e2; --danger-bd:  #fecaca;
  --warning: #b45309; --warning-bg: #fef3c7; --warning-bd: #fde68a;
  --info:    #0369a1; --info-bg:    #e0f2fe; --info-bd:    #bae6fd;
  --ot:      #6d28d9; --ot-bg:      #ede9fe; --ot-bd:      #ddd6fe;
  --neutral: #475569; --neutral-bg: #f1f5f9; --neutral-bd: #e2e8f0;

  /* semantic aliases - new rules use these rather than raw colours */
  --primary: var(--brand-600); --primary-hover: var(--brand-700); --primary-soft: var(--brand-50);
  --secondary: var(--text-2);

  /* spacing scale (4px base) and type scale */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-7: 32px;
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --control-h: 38px;     /* inputs, selects and normal buttons share one height */
  --control-h-sm: 30px;  /* small buttons and button-like summaries */
  --ring: 0 0 0 3px rgba(37, 99, 235, .28);
  /* restrained gloss: a 1px top highlight plus a near-white vertical sheen */
  --gloss: inset 0 1px 0 rgba(255, 255, 255, .7);
  --surface-sheen: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 24px -12px rgba(15, 23, 42, .16);
  --shadow-lg: 0 20px 44px -14px rgba(8, 26, 66, .30);
  --sidebar-w: 252px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  /* clean light canvas with a faint brand tint at the top of the page */
  background-color: var(--bg);
  background-image: radial-gradient(1100px 420px at 85% -140px, rgba(59, 130, 246, .09), transparent 70%),
                    linear-gradient(180deg, #f7f9fd 0, var(--bg) 380px);
  background-repeat: no-repeat;
  color: var(--text);
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
h1, h2, h3 { color: var(--text); letter-spacing: -.01em; line-height: 1.3; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 650; margin: 18px 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.right-align { text-align: right; }
.mt-0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- icons */
.ico { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ico-sm { width: 15px; height: 15px; vertical-align: -3px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- app shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: radial-gradient(420px 260px at 0 0, rgba(59, 130, 246, .20), transparent 70%),
              linear-gradient(180deg, var(--brand-900) 0%, var(--brand-950) 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
  color: #cbd5f5; display: flex; flex-direction: column; z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand > div:last-child { min-width: 0; overflow-wrap: anywhere; }
/* The brand mark is the same factory glyph as favicon.svg: one square tile, fixed size, never stretched */
.brand-mark { width: 38px; height: 38px; aspect-ratio: 1; border-radius: 10px; background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(37, 99, 235, .40); flex: 0 0 auto; }
.brand-mark svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { color: #fff; font-weight: 650; font-size: 14.5px; line-height: 1.25; }
.brand-sub { color: #9fb2de; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.nav-group { padding: 14px 12px 4px; }
.nav-label { color: #8a9dcc; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; padding: 0 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 1px 0; border-radius: 9px; color: #d6def5; font-weight: 500; font-size: 13.5px; transition: background-color .12s, color .12s; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-link.active { background: linear-gradient(180deg, #3572ee 0%, var(--brand-600) 100%); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 14px -4px rgba(37, 99, 235, .55); }
.sidebar .nav-link:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.nav-link .ico { opacity: .9; }
.sidebar-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #7f93c4; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 28px;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 18px -16px rgba(15, 23, 42, .35);
}
.topbar > div:nth-child(2) { min-width: 0; }  /* the title block may shrink instead of pushing the user area off screen */
.topbar-title { font-size: var(--fs-lg); font-weight: 650; margin: 0; color: var(--text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.menu-toggle { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0; cursor: pointer; color: var(--text-2); box-shadow: var(--shadow-sm); }
.menu-toggle:hover { background: var(--surface-2); color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-sheen); box-shadow: var(--shadow-sm), var(--gloss); flex: 0 0 auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; flex: 0 0 auto; }
.user-meta { line-height: 1.15; padding-right: 4px; }
.user-name { font-weight: 600; font-size: 13px; }
.content { padding: 24px 28px 40px; max-width: 1360px; width: 100%; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-intro h1 { font-size: 22px; margin: 0; font-weight: 700; }
.page-intro p { margin: 4px 0 0; color: var(--muted); }

/* legacy layout wrapper (auth pages / wizard) */
.wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); background-image: var(--surface-sheen); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm), var(--gloss); }
.card h2 { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-header h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-header .ico-tile { width: 30px; height: 30px; border-radius: 8px; }
.card-sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-header { padding: 16px 20px 0; }
.card-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* icon tiles (semantic) */
.ico-tile { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.tone-brand   { background: var(--brand-50);   color: var(--brand-700); }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-danger  { background: var(--danger-bg);  color: var(--danger); }
.tone-warning { background: var(--warning-bg); color: var(--warning); }
.tone-info    { background: var(--info-bg);    color: var(--info); }
.tone-ot      { background: var(--ot-bg);      color: var(--ot); }
.tone-neutral { background: var(--neutral-bg); color: var(--neutral); }

/* KPI cards */
/* auto-fit: 4 or 5 cards share the full row instead of leaving empty tracks on the right */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--kpi-accent, var(--brand-600)) 6%, #fff) 0%, #fff 60%);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm), var(--gloss);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; align-items: start; align-content: start;
  position: relative; overflow: hidden; color: inherit; container-type: inline-size;
  transition: border-color .12s, box-shadow .12s;
}
a.kpi:hover { text-decoration: none; border-color: var(--brand-200); box-shadow: var(--shadow), var(--gloss); }
/* thin accent along the top edge (follows the rounded corners, unlike a side bar) */
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--kpi-accent, var(--brand-600)), color-mix(in srgb, var(--kpi-accent, var(--brand-600)) 35%, #fff)); }
/* Narrow cards (e.g. six across on a laptop): icon above the text so labels don't wrap into 3 lines */
@container (max-width: 175px) { .kpi > * { grid-column: 1 / -1; } .kpi > .ico-tile { width: 36px; height: 36px; } }
.kpi.success { --kpi-accent: #16a34a; } .kpi.danger { --kpi-accent: #dc2626; } .kpi.warning { --kpi-accent: #d97706; }
.kpi.info { --kpi-accent: #0284c7; } .kpi.ot { --kpi-accent: #7c3aed; } .kpi.neutral { --kpi-accent: #64748b; }
.kpi-value { font-size: 26px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.kpi-value.sm { font-size: 18px; }
.kpi-label { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 3px; }
.kpi-hint { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

/* legacy stat */
.stat .num { font-size: 26px; font-weight: 750; }
.stat .label { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--control-h);
  /* primary: brand blue with a restrained top-to-bottom sheen (white text >= 5:1 across the gradient) */
  background: var(--brand-600); background-image: linear-gradient(180deg, #2e6cee 0%, #1f5ae3 100%);
  color: #fff; border: 1px solid #1d55d6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(29, 78, 216, .28);
  padding: 7px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; line-height: 1.3; white-space: nowrap; text-decoration: none; position: relative;
  transition: background-color .12s, border-color .12s, box-shadow .12s, filter .12s;
}
.btn:hover { background-color: var(--brand-700); background-image: linear-gradient(180deg, #2560e6 0%, var(--brand-700) 100%); border-color: var(--brand-800); color: #fff; text-decoration: none; }
.btn:active { box-shadow: inset 0 1px 2px rgba(15, 23, 42, .18); }
.btn:focus-visible, .nav-link:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .40); outline-offset: 1px; }
.btn.secondary { background: var(--surface); background-image: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%); color: var(--text-2); border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(15, 23, 42, .05), var(--gloss); }
.btn.secondary:hover { background: var(--surface-2); background-image: none; color: var(--text); border-color: #94a3b8; }
.btn.ghost { background: transparent; background-image: none; color: var(--brand-700); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--brand-50); color: var(--brand-800); }
.btn.danger { background: #dc2626; background-image: linear-gradient(180deg, #dc2626 0%, #c81e1e 100%); border-color: #b91c1c; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(185, 28, 28, .28); }
.btn.danger:hover { background: #b91c1c; background-image: none; border-color: #991b1b; }
.btn.danger.outline { background: var(--surface); background-image: none; color: var(--danger); border-color: var(--danger-bd); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.btn.danger.outline:hover { background: var(--danger-bg); }
/* success uses the darker green: #16a34a with white text is only 3.3:1 */
.btn.success { background: #15803d; background-image: linear-gradient(180deg, #15803d 0%, #13733a 100%); border-color: #116631; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(21, 128, 61, .28); }
.btn.success:hover { background: #166534; background-image: none; border-color: #14532d; }
.btn.small { min-height: var(--control-h-sm); padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn .ico { width: 16px; height: 16px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.55); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.secondary.is-loading::after, .btn.ghost.is-loading::after { border-color: var(--border-strong); border-top-color: var(--brand-600); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; text-transform: capitalize; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.no-case { text-transform: none; }
.badge.present, .badge.finalized, .badge.approved, .badge.online, .badge.success { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge.absent, .badge.rejected, .badge.offline, .badge.danger, .badge.missing_punch { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.badge.half_day, .badge.late, .badge.draft, .badge.pending, .badge.warning, .badge.unknown { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.badge.paid_leave, .badge.leave, .badge.info, .badge[class*="_leave"] { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.badge.ot { background: var(--ot-bg); color: var(--ot); border-color: var(--ot-bd); }
.badge.weekly_off, .badge.holiday, .badge.neutral, .badge.inactive { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.badge.holiday { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }
.badge.brand, .badge.role { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-100); text-transform: none; }
.badge.role-super_admin { background: #1e1b4b; color: #e0e7ff; border-color: #1e1b4b; }
.badge.role-hr_manager { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-100); }
.badge.role-payroll_manager { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.badge.role-attendance_operator { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-bd); }
.badge.role-viewer { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-bd); }
.flags { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- flash / alerts */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; box-shadow: var(--shadow-sm), var(--gloss); overflow-wrap: anywhere; }
.flash > div, .flash > span { min-width: 0; }  /* long messages wrap inside the alert */
.flash .ico { margin-top: 1px; }
.flash.ok { background: var(--success-bg); color: #14532d; border-color: var(--success-bd); }
.flash.err { background: var(--danger-bg); color: #7f1d1d; border-color: var(--danger-bd); }
.flash.warn { background: var(--warning-bg); color: #78350f; border-color: var(--warning-bd); }
.flash.info { background: var(--info-bg); color: #0c4a6e; border-color: var(--info-bd); }
.flash a { color: inherit; font-weight: 650; text-decoration: underline; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash li { margin: 2px 0; }
.secret-box { background: #fff; border: 1px dashed var(--success); border-radius: 8px; padding: 4px 10px; color: var(--text); }
#session-warning-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 999; box-shadow: var(--shadow-lg); align-items: center; width: max-content; max-width: calc(100vw - 24px); }

/* ---------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { position: sticky; top: 0; background: var(--surface-2); background-image: linear-gradient(180deg, #f9fafc 0%, #f2f5f9 100%); color: var(--muted); font-weight: 650; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #f4f8ff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 650; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 12px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 34px; height: 34px; font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.net { font-weight: 750; color: var(--success); }
.money.ded { color: var(--danger); }
.money.gross { font-weight: 650; }
.breakdown { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin-top: 2px; }
.punch { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.punch-in { color: var(--success); }
.punch-out { color: var(--brand-700); }
/* attendance detail: IN / OUT columns (cells stay plain <td>HH:MM</td>) */
table.att-days td:nth-child(2) { font-family: var(--mono); font-weight: 650; color: var(--success); }
table.att-days td:nth-child(3) { font-family: var(--mono); font-weight: 650; color: var(--brand-700); }
table.att-days td:nth-child(4) { font-variant-numeric: tabular-nums; }
tr.row-weekend td { background: #fafbfd; }
tr.row-manual td:first-child { box-shadow: inset 3px 0 0 var(--brand-500); }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; min-height: var(--control-h); padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); outline: none; }
input::placeholder, textarea::placeholder { color: #6b778c; }
/* browser-native validity, shown only after the user has edited the field (visual only) */
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--danger); }
input:user-invalid:focus, select:user-invalid:focus, textarea:user-invalid:focus { box-shadow: 0 0 0 3px rgba(185, 28, 28, .18); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; box-shadow: none; accent-color: var(--brand-600); flex: 0 0 auto; }
input[type="file"] { min-height: 0; padding: 6px; background: var(--surface-2); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1 1 180px; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 16px; }
.form-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px 18px; margin-bottom: 16px; background: var(--surface); }
.form-section > h3 { margin: 16px 0 4px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-section > .muted { margin: 0 0 4px; }
.check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500 !important; color: var(--text-2); margin: 10px 18px 0 0 !important; }
.checks { display: flex; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.help { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 120px; }
.toolbar .search { position: relative; }
.toolbar .search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar .search input { padding-left: 34px; min-width: 290px; }
details.inline-edit > summary { list-style: none; cursor: pointer; color: var(--brand-600); font-weight: 600; font-size: 12.5px; display: inline-flex; gap: 5px; align-items: center; }
details.inline-edit > summary::-webkit-details-marker { display: none; }
details.inline-edit[open] > summary { color: var(--brand-800); }
/* In a row of action buttons a "Details"/"Edit" summary gets the same height as the small buttons beside it */
.btn-row > details.inline-edit > summary { min-height: var(--control-h-sm); padding: 0 8px; border-radius: 7px; }
.btn-row > details.inline-edit > summary:hover { background: var(--brand-50); }
/* Table action cells may wrap on narrower screens (keeps tables within their card); equal-height
   items and a row gap keep a wrapped second row tidy */
td > .btn-row { row-gap: 6px; }
.popover { margin-top: 8px; padding: 12px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.popover input, .popover select { margin-top: 6px; }
.popover label:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- empty state */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ico-tile { margin: 0 auto 10px; width: 48px; height: 48px; }
.empty-title { color: var(--text-2); font-weight: 650; font-size: 14px; }

/* ---------------------------------------------------------------- charts (CSS only) */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { --p: 0; --a: 0; --l: 0; width: 148px; height: 148px; border-radius: 50%; position: relative; flex: 0 0 auto;
  background: conic-gradient(#16a34a 0 calc(var(--p) * 1%), #dc2626 0 calc((var(--p) + var(--a)) * 1%), #cbd5e1 0 100%); }
.donut::after { content: ""; position: absolute; inset: 20px; background: var(--surface); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut-center b { display: block; font-size: 24px; line-height: 1; }
.donut-center span { font-size: 11px; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.stackbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--neutral-bg); min-width: 120px; }
.stackbar span { display: block; height: 100%; }
.seg-present { background: #16a34a; } .seg-half { background: #f59e0b; } .seg-absent { background: #dc2626; }
.seg-off { background: #94a3b8; } .seg-holiday { background: #6366f1; } .seg-leave { background: #0284c7; }
.meter { height: 6px; background: var(--neutral-bg); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand-600); border-radius: 999px; }

/* ---------------------------------------------------------------- feed / timeline */
.feed-table td:nth-child(3) { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.feed-table td:nth-child(2) { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand-50); border: 2px solid var(--brand-500); }
.audit-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.audit-values div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); max-height: 84px; overflow: auto; word-break: break-all; }
.audit-values span { display: block; font-family: var(--font); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }

/* ---------------------------------------------------------------- machine cards */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.machine { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); background-image: var(--surface-sheen); box-shadow: var(--shadow-sm), var(--gloss); display: flex; flex-direction: column; gap: 10px; position: relative; }
.machine.is-online { border-top: 3px solid #16a34a; }
.machine.is-offline { border-top: 3px solid #dc2626; }
.machine.is-pending { border-top: 3px solid #d97706; }
.machine.is-unknown { border-top: 3px solid #94a3b8; }
.machine-head { display: flex; gap: 12px; align-items: flex-start; }
.machine-name { font-weight: 650; font-size: 14.5px; }
.machine-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12.5px; margin: 0; }
.machine-meta dt { color: var(--muted); }
.machine-meta dd { margin: 0; font-weight: 550; color: var(--text-2); word-break: break-word; }
.machine-error { background: var(--danger-bg); color: #7f1d1d; border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.machine-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); }

/* ---------------------------------------------------------------- reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.report-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); background-image: var(--surface-sheen); box-shadow: var(--shadow-sm), var(--gloss); transition: border-color .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 10px; }
.report-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow), var(--gloss); }
.report-card h3 { margin: 0; font-size: 14px; }
.report-card p { margin: 0; color: var(--muted); font-size: 12.5px; flex: 1; }

/* ---------------------------------------------------------------- settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 84px; background: var(--surface); background-image: var(--surface-sheen); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm), var(--gloss); }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 550; }
.settings-nav a:hover { background: var(--brand-50); color: var(--brand-800); text-decoration: none; }
.settings-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.settings-section { scroll-margin-top: 84px; }
.subcard { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }

/* ---------------------------------------------------------------- payslip-ish hierarchy */
.pay-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.anomalies { border: 1px solid var(--warning-bd); background: var(--warning-bg); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; color: #78350f; }
.anomalies h3 { margin: 0 0 6px; color: #78350f; display: flex; align-items: center; gap: 8px; }
.anomalies ul { margin: 0; padding-left: 20px; }
.anomalies li { margin: 3px 0; }
.status-strip { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- leave */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.balance-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); background-image: var(--surface-sheen); box-shadow: var(--shadow-sm), var(--gloss); }
.balance-card .big { font-size: 28px; font-weight: 750; color: var(--info); line-height: 1.1; }
.balance-card dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 10px 0 0; font-size: 12.5px; }
.balance-card dt { color: var(--muted); } .balance-card dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; background: var(--neutral-bg); padding: 4px; border-radius: 10px; width: fit-content; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.tabs a:hover { text-decoration: none; background: rgba(255,255,255,.7); }
.tabs a.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- auth pages */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); background: var(--surface); }
.auth-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--brand-800) 0%, var(--brand-950) 100%); color: #e0e7ff; padding: 44px 48px; display: flex; flex-direction: column; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; }
.auth-hero > * { position: relative; }
.auth-hero .sidebar-brand { padding: 0; border: 0; }
.auth-hero h1 { color: #fff; font-size: 30px; line-height: 1.2; margin: 34px 0 10px; max-width: 480px; }
.auth-hero p { color: #b8c6ec; max-width: 460px; margin: 0; }
.auth-hero img { width: 100%; max-width: 560px; margin-top: auto; align-self: center; filter: drop-shadow(0 20px 30px rgba(0,0,0,.25)); }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; color: #d6def5; font-size: 13.5px; }
.auth-points li { display: flex; gap: 9px; align-items: center; }
.auth-points .ico { color: #86efac; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: var(--bg); background-image: radial-gradient(700px 360px at 50% 0, rgba(59, 130, 246, .08), transparent 70%); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); background-image: var(--surface-sheen); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 28px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 28px 56px -28px rgba(15, 23, 42, .30), var(--gloss); }
.auth-card h2 { font-size: 22px; margin: 0 0 4px; }
.auth-card .muted { margin: 0 0 18px; }
.pw-field { position: relative; }
.pw-field input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--brand-700); background: var(--brand-50); }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.error-card { max-width: 520px; margin: 12vh auto 40px; text-align: center; padding: 32px 28px; }
.error-code { font-size: 44px; font-weight: 800; color: var(--brand-700); letter-spacing: -.03em; margin: 6px 0 0; }

/* legacy login classes (kept for compatibility) */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; }

/* wizard */
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 18px; }
.wizard-steps span { font-size: 11px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); text-transform: capitalize; }
.wizard-steps span.done { background: var(--success-bg); color: var(--success); }
.wizard-steps span.current { background: var(--brand-600); color: #fff; }
.progress { height: 6px; background: var(--neutral-bg); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); border-radius: 999px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 2px; }
  .settings-group-label { display: none; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(8, 26, 66, .45); z-index: 25; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 32px; }
  .user-meta { display: none; }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 28px 24px; }
  .auth-hero img, .auth-points { display: none; }
  .auth-hero h1 { font-size: 22px; margin-top: 18px; }
}
@media (max-width: 600px) {
  .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .toolbar .search input { min-width: 0; width: 100%; }
  .toolbar .search { width: 100%; }
  .audit-values { grid-template-columns: minmax(0, 1fr); }
  .topbar-sub { display: none; }
  .topbar { gap: 10px; }
  /* no subtitle here, so a long title may use two lines instead of being cut off */
  .topbar-title { font-size: var(--fs-md); white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .page-intro h1 { font-size: 20px; }
}
@media (max-width: 480px) {
  /* phones: the logout button keeps its icon; its text stays available to screen readers */
  .topbar .btn.small > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar .btn.small { padding: 4px 8px; }
  .user-chip { padding: 3px; }
}
@media (min-width: 961px) { .scrim { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .no-print, .btn, form.toolbar { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  body, .card, .kpi { background: #fff; background-image: none; }
}

/* ---------------------------------------------------------------- audit table */
.audit-table td { vertical-align: top; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.audit-val { display: inline-block; max-width: 260px; max-height: 64px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.45; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; }
.audit-val.new { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.audit-reason { display: inline-block; max-width: 240px; color: var(--text-2); font-size: 12.5px; }

/* ---------------------------------------------------------------- payroll breakdown */
.pay-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pay-col { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); display: flex; flex-direction: column; }
.pay-col-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.dot-ind { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); }
.pay-col.earn .dot-ind { background: #16a34a; } .pay-col.ded .dot-ind { background: #dc2626; } .pay-col.net .dot-ind { background: var(--brand-600); }
.pay-col dl, .line-breakdown dl { margin: 0; }
.pay-col dl > div, .line-breakdown dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.pay-col dt, .line-breakdown dt { color: var(--text-2); }
.pay-col dd, .line-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.pay-total, .lb-total { display: flex; justify-content: space-between; margin-top: auto; padding-top: 9px; font-size: 13.5px; }
.pay-total strong, .lb-total strong { font-variant-numeric: tabular-nums; }
.pay-col.earn .pay-total strong { color: var(--text); } .pay-col.ded .pay-total strong { color: var(--danger); }
.pay-net { background: var(--success-bg); border: 1px solid var(--success-bd); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.pay-net span { display: block; font-size: 12px; color: var(--success); font-weight: 600; }
.pay-net strong { font-size: 22px; color: var(--success); font-variant-numeric: tabular-nums; }
details.anomalies > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 700; color: #78350f; }
details.anomalies > summary::-webkit-details-marker { display: none; }
details.anomalies > summary::after { content: "Show"; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--warning); }
details.anomalies[open] > summary::after { content: "Hide"; }
details.anomalies[open] > summary { margin-bottom: 6px; }
/* Two columns via grid, NOT css columns: columns inside a max-height box overflow sideways,
   which hid about half of a long list (e.g. 17 of 37 checks) out of reach of the scroll wheel. */
details.anomalies ul { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); column-gap: 28px; }
details.inline-edit:has(.line-breakdown) { position: relative; }
.line-breakdown { position: absolute; right: 0; z-index: 20; width: 400px; text-align: left; }
.lb-head { font-weight: 700; margin-bottom: 8px; }
.lb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lb-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.lb-title.earn { color: var(--success); } .lb-title.ded { color: var(--danger); }
.lb-net { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 8px 10px; background: var(--success-bg); border-radius: 8px; color: var(--success); }
.lb-net strong { font-size: 16px; font-variant-numeric: tabular-nums; }
@media (max-width: 1180px) { .pay-flow { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .line-breakdown { width: 300px; } .lb-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- final polish */
/* Attendance overview: compact enough for all columns at ~1440px; still
   scrolls sideways inside its own card (never the page) on narrower screens. */
table.att-overview th, table.att-overview td { padding: 9px 8px; }
table.att-overview th.num { white-space: normal; line-height: 1.25; min-width: 50px; }
table.att-overview th.glance { min-width: 112px; }
table.att-overview .stackbar { min-width: 100px; }
table.att-overview .person { gap: 8px; }
table.att-overview .person .avatar { width: 30px; height: 30px; }
table.att-overview td:first-child { min-width: 150px; }
table.att-overview td:last-child { white-space: nowrap; }
.table-wrap { max-width: 100%; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
/* Status badges keep the normal UI font even inside the monospace IN/OUT columns */
table.att-days td .badge { font-family: var(--font); font-weight: 650; }
/* Tables that share the row with a side form (Leave, Users) are narrower -
   slightly tighter cell padding lets them fit at 1366-1440px without a
   sideways scrollbar. They still scroll inside their card below that. */
.split table th, .split table td { padding-left: 9px; padding-right: 9px; }
/* Disabled controls must LOOK inactive (e.g. Settings for view-only roles) */
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; filter: grayscale(.35); }
.btn:disabled:hover, .btn[disabled]:hover { transform: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
/* A <fieldset> used only to switch a whole form to read-only - no visual frame */
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Caption for a GROUP of fields (each field has its own <label>) - looks like a label */
.caption-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 5px; }
