/* =====================================================================
   MAM Payroll — Design System
   Liquid glass (navigation, overlays, surfaces) + Claymorphism (KPIs,
   actions, icon tiles) on a calm enterprise palette derived from the
   MAM logo: deep navy, royal blue, teal accent, brand green arc.
   ===================================================================== */
/* Self-hosted font (no external requests) */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../vendor/fonts/plus-jakarta-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(../vendor/fonts/plus-jakarta-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(../vendor/fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../vendor/fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url(../vendor/fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); }

:root {
  --navy-950: #070F33;
  --navy-900: #0A1A4F;
  --navy-800: #12256E;
  --royal: #2A4AD4;
  --royal-600: #2340BC;
  --royal-100: #E3E9FD;
  --teal: #0E9F9A;
  --teal-600: #0B827E;
  --teal-100: #D9F4F2;
  --green: #1C9F55;
  --green-100: #DDF5E7;
  --amber: #B7791F;
  --amber-100: #FDF0D6;
  --red: #C8323C;
  --red-100: #FBE2E4;
  --ink: #1B2233;
  --ink-2: #3A4256;
  --muted: #5B6478;
  --line: rgba(20, 38, 110, 0.10);
  --bg: #EDF1F9;
  --surface: #FFFFFF;

  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 10px 34px rgba(16, 35, 107, 0.10), 0 2px 6px rgba(16, 35, 107, 0.05);
  --glass-blur: blur(22px) saturate(170%);

  --clay-bg: linear-gradient(145deg, #F8FAFF, #EEF2FB);
  --clay-shadow: 12px 12px 28px rgba(42, 74, 212, 0.13), -10px -10px 24px rgba(255, 255, 255, 0.95), inset 2px 2px 3px rgba(255, 255, 255, 0.9), inset -3px -3px 7px rgba(42, 74, 212, 0.07);
  --clay-shadow-sm: 6px 6px 14px rgba(42, 74, 212, 0.12), -5px -5px 12px rgba(255, 255, 255, 0.95), inset 1px 1px 2px rgba(255, 255, 255, 0.9), inset -2px -2px 5px rgba(42, 74, 212, 0.07);
  --clay-inset: inset 3px 3px 7px rgba(42, 74, 212, 0.10), inset -3px -3px 7px rgba(255, 255, 255, 0.95);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --sidebar-w: 268px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* Ambient mesh the glass refracts */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(42, 74, 212, 0.20), transparent 60%),
    radial-gradient(700px 520px at 100% 0%, rgba(14, 159, 154, 0.16), transparent 60%),
    radial-gradient(800px 600px at 70% 110%, rgba(28, 159, 85, 0.12), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(42, 74, 212, 0.10), transparent 60%),
    linear-gradient(180deg, #F3F6FC 0%, #EAEFF8 100%);
}
.orb { position: fixed; border-radius: 50%; filter: blur(60px); z-index: -1; opacity: .5; pointer-events: none; animation: drift 26s ease-in-out infinite alternate; }
.orb-1 { width: 380px; height: 380px; background: #9DB0F5; top: 12%; right: 8%; }
.orb-2 { width: 300px; height: 300px; background: #8FE0D8; bottom: 6%; left: 30%; animation-delay: -9s; }
@keyframes drift { to { transform: translate3d(-60px, 40px, 0) scale(1.08); } }

h1, h2, h3, h4, h5, h6 { color: var(--navy-900); font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--royal); text-decoration: none; }
a:hover { color: var(--royal-600); }
.num, .table td.num, .tabular { font-variant-numeric: tabular-nums; }
.text-muted, .muted { color: var(--muted) !important; }
.small-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ic { width: 18px; height: 18px; stroke-width: 2; vertical-align: -3px; flex-shrink: 0; }
:focus-visible { outline: 3px solid rgba(42, 74, 212, 0.45); outline-offset: 2px; border-radius: 8px; }

/* ---------------- Liquid glass primitives ---------------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  border-radius: var(--r-lg);
}
/* specular sheen — the "liquid" highlight */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0) 60%);
  mix-blend-mode: soft-light;
}
.glass > * { position: relative; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.95); }
}

/* ---------------- Clay primitives ---------------- */
.clay {
  background: var(--clay-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--clay-shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.clay-inset { background: #EEF2FA; border-radius: var(--r-md); box-shadow: var(--clay-inset); }

/* ---------------- Shell ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; top: 12px; bottom: 12px; left: 12px; width: var(--sidebar-w); z-index: 1040;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, rgba(10, 26, 79, 0.92), rgba(18, 37, 110, 0.86));
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-xl);
  box-shadow: 0 20px 50px rgba(7, 15, 51, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #DCE3FF;
  transition: transform .35s var(--ease);
  overflow: hidden;
}
.sidebar::after { /* light streak */
  content: ""; position: absolute; top: -40%; left: -60%; width: 120%; height: 80%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.10), transparent);
  transform: rotate(-20deg);
}
.sidebar-brand { padding: 22px 22px 14px; display: flex; align-items: center; gap: 12px; }
.brand-badge {
  width: 100%; background: rgba(255, 255, 255, 0.96); border-radius: 18px; padding: 10px 14px;
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(0, 0, 0, 0.18);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.brand-badge img { height: 40px; width: auto; }
.brand-badge span { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: var(--teal-600); text-transform: uppercase; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(220, 227, 255, 0.5); padding: 16px 12px 6px; }
.nav-link-x {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0;
  color: #C9D3FA; border-radius: 14px; font-weight: 500; font-size: 14.5px; min-height: 44px;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav-link-x:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link-x.active {
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 6px 16px rgba(0, 0, 0, 0.18);
}
.nav-link-x.active .ic { color: #6FE3D9; }
.nav-link-x .count { margin-left: auto; background: #E9A23B; color: #2B1A00; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: rgba(220, 227, 255, .6); }

.main { flex: 1; margin-left: calc(var(--sidebar-w) + 24px); padding: 12px 20px 40px 0; min-width: 0; }
.topbar {
  position: sticky; top: 12px; z-index: 1030; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 18px; margin-bottom: 22px;
}
.topbar .page-title { font-size: 18px; font-weight: 700; color: var(--navy-900); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.search-box { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search-box input { padding-left: 40px; border-radius: 99px !important; background: rgba(255, 255, 255, 0.7) !important; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 8px; display: none; max-height: 420px; overflow: auto; }
.search-results.show { display: block; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--royal-100); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; position: relative;
  background: var(--clay-bg); box-shadow: var(--clay-shadow-sm); border: 1px solid rgba(255, 255, 255, .8); color: var(--navy-800);
  transition: transform .2s var(--ease-spring);
}
.icon-btn:hover { transform: translateY(-1px); color: var(--royal); }
.icon-btn:active { transform: scale(.96); box-shadow: var(--clay-inset); }
.icon-btn .dot-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px #F3F6FC; }
.avatar { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--royal), var(--teal)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px rgba(42,74,212,.28); flex-shrink: 0; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 16px; color: var(--ink); }
.user-chip:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.user-chip .meta { line-height: 1.2; }
.user-chip .meta b { display: block; font-size: 13.5px; }
.user-chip .meta small { color: var(--muted); font-size: 12px; }

.mobile-toggle { display: none; }
.sidebar-backdrop { display: none; }

/* ---------------- Page header ---------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------- Cards ---------------- */
.card-x { padding: 22px; margin-bottom: 22px; }
.card-x.p-0 { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { font-size: 16.5px; margin: 0; display: flex; align-items: center; gap: 10px; }
.card-head .sub { font-size: 13px; color: var(--muted); }

/* KPI — claymorphic tiles */
.kpi {
  padding: 18px 18px 16px; height: 100%; display: flex; flex-direction: column; gap: 10px;
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease);
}
.kpi:hover { transform: translateY(-3px); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .kpi-value { font-size: 26px; font-weight: 800; color: var(--navy-900); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .kpi-foot { font-size: 12.5px; color: var(--muted); }
.tile {
  width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, .45), inset -3px -3px 6px rgba(0, 0, 0, .14), 0 8px 16px rgba(42, 74, 212, .22);
}
.tile.royal { background: linear-gradient(145deg, #4B67E6, #2340BC); }
.tile.teal { background: linear-gradient(145deg, #23B9B2, #0B827E); box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -3px -3px 6px rgba(0,0,0,.14), 0 8px 16px rgba(14,159,154,.25); }
.tile.navy { background: linear-gradient(145deg, #2A3D8F, #0A1A4F); }
.tile.green { background: linear-gradient(145deg, #34C072, #178A48); box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -3px -3px 6px rgba(0,0,0,.14), 0 8px 16px rgba(28,159,85,.25); }
.tile.amber { background: linear-gradient(145deg, #F0B556, #C27D17); box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -3px -3px 6px rgba(0,0,0,.14), 0 8px 16px rgba(194,125,23,.25); }
.tile.red { background: linear-gradient(145deg, #E65F67, #B4232D); box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -3px -3px 6px rgba(0,0,0,.14), 0 8px 16px rgba(200,50,60,.25); }
.tile.sm { width: 36px; height: 36px; border-radius: 12px; }
.tile .ic { width: 20px; height: 20px; }

/* ---------------- Buttons (clay) ---------------- */
.btn { font-weight: 600; border-radius: 14px; padding: 10px 18px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14.5px; transition: transform .18s var(--ease-spring), box-shadow .2s var(--ease), background .2s; border: 0; }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 11px; }
.btn-primary {
  color: #fff; background: linear-gradient(145deg, #3D5BE0, #2340BC);
  box-shadow: 0 8px 18px rgba(42, 74, 212, .30), inset 1px 1px 2px rgba(255, 255, 255, .35), inset -2px -2px 5px rgba(0, 0, 0, .15);
}
.btn-primary:hover, .btn-primary:focus { color: #fff; background: linear-gradient(145deg, #4664E8, #2340BC); box-shadow: 0 12px 24px rgba(42, 74, 212, .36), inset 1px 1px 2px rgba(255, 255, 255, .35), inset -2px -2px 5px rgba(0, 0, 0, .15); }
.btn-teal { color: #fff; background: linear-gradient(145deg, #17B0A9, #0B827E); box-shadow: 0 8px 18px rgba(14, 159, 154, .30), inset 1px 1px 2px rgba(255, 255, 255, .35), inset -2px -2px 5px rgba(0, 0, 0, .15); }
.btn-teal:hover { color: #fff; filter: brightness(1.05); }
.btn-success { color: #fff; background: linear-gradient(145deg, #2CB565, #178A48); box-shadow: 0 8px 18px rgba(28, 159, 85, .28), inset 1px 1px 2px rgba(255,255,255,.35), inset -2px -2px 5px rgba(0,0,0,.15); }
.btn-success:hover { color: #fff; filter: brightness(1.05); }
.btn-danger { color: #fff; background: linear-gradient(145deg, #DB4B54, #B4232D); box-shadow: 0 8px 18px rgba(200, 50, 60, .25), inset 1px 1px 2px rgba(255,255,255,.3), inset -2px -2px 5px rgba(0,0,0,.15); }
.btn-danger:hover { color: #fff; filter: brightness(1.05); }
.btn-warning { color: #2B1A00; background: linear-gradient(145deg, #F4C06A, #E0A033); box-shadow: 0 8px 18px rgba(224,160,51,.28), inset 1px 1px 2px rgba(255,255,255,.4), inset -2px -2px 5px rgba(0,0,0,.1); }
.btn-clay, .btn-light, .btn-outline-secondary {
  color: var(--navy-800); background: var(--clay-bg); box-shadow: var(--clay-shadow-sm); border: 1px solid rgba(255, 255, 255, .85);
}
.btn-clay:hover, .btn-light:hover, .btn-outline-secondary:hover { color: var(--royal); background: #fff; }
.btn-clay:active { box-shadow: var(--clay-inset); }
.btn-ghost { background: transparent; color: var(--navy-800); }
.btn-ghost:hover { background: rgba(42, 74, 212, .08); color: var(--royal); }
.btn-link { min-height: auto; padding: 0; }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn .spinner-border { width: 16px; height: 16px; border-width: 2px; }

/* ---------------- Forms (soft clay inputs) ---------------- */
.form-label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-label .req { color: var(--red); }
.form-control, .form-select {
  border-radius: 13px; border: 1px solid rgba(20, 38, 110, .12); background-color: rgba(255, 255, 255, .85);
  min-height: 44px; font-size: 14.5px; color: var(--ink);
  box-shadow: inset 2px 2px 5px rgba(42, 74, 212, .06);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-control:focus, .form-select:focus { border-color: var(--royal); background-color: #fff; box-shadow: 0 0 0 4px rgba(42, 74, 212, .14); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--red); }
.form-text { color: var(--muted); font-size: 12.5px; }
textarea.form-control { min-height: 90px; }
.form-control-sm, .form-select-sm { min-height: 36px; font-size: 13.5px; border-radius: 10px; }
.form-check-input { width: 1.15em; height: 1.15em; border-color: rgba(20,38,110,.3); }
.form-check-input:checked { background-color: var(--royal); border-color: var(--royal); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.form-section { padding-bottom: 6px; margin-bottom: 18px; border-bottom: 1px dashed var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { font-size: 14px; font-weight: 700; color: var(--navy-800); display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.input-group-text { border-radius: 13px; background: #F1F4FB; border-color: rgba(20, 38, 110, .12); }
.sticky-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 14px; margin-top: 6px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow: auto; border-radius: var(--r-md); }
.table-x { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table-x thead th {
  position: sticky; top: 0; z-index: 2; background: rgba(241, 244, 252, .96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left;
}
.table-x tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-x tbody tr { transition: background .15s; }
.table-x tbody tr:hover { background: rgba(42, 74, 212, .045); }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x .num, .table-x th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-x tfoot td { padding: 12px 14px; font-weight: 700; background: rgba(42, 74, 212, .06); }
.table-x .cell-main { font-weight: 600; color: var(--ink); }
.table-x .cell-sub { font-size: 12.5px; color: var(--muted); }
.table-x td.actions { white-space: nowrap; text-align: right; }
.table-x.compact td, .table-x.compact th { padding: 8px 10px; }
.table-x input.form-control-sm { min-width: 70px; }
.row-error { background: var(--red-100) !important; }
.row-warn { background: var(--amber-100) !important; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 14px 16px; margin-bottom: 16px; }
.filters .form-control, .filters .form-select { min-width: 160px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; gap: 6px; }
.pager .pages a, .pager .pages span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; padding: 0 8px; }
.pager .pages a { background: var(--clay-bg); box-shadow: var(--clay-shadow-sm); color: var(--navy-800); }
.pager .pages span.cur { background: var(--royal); color: #fff; font-weight: 700; }

/* ---------------- Badges ---------------- */
.badge-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.badge-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--green-100); color: #12673A; }
.badge-danger { background: var(--red-100); color: #9B1C25; }
.badge-warning { background: var(--amber-100); color: #7A4E0A; }
.badge-info { background: var(--royal-100); color: #1C3399; }
.badge-teal { background: var(--teal-100); color: #075E5A; }
.badge-navy { background: #DCE1F3; color: var(--navy-900); }
.badge-muted { background: #E7EAF1; color: #4A5265; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(42,74,212,.08); color: var(--navy-800); }

/* ---------------- Alerts / flash ---------------- */
.alert { border-radius: 16px; border: 1px solid transparent; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; font-size: 14px; }
.alert-success { background: rgba(221, 245, 231, .9); color: #12673A; border-color: rgba(28,159,85,.2); }
.alert-danger { background: rgba(251, 226, 228, .92); color: #8E1A22; border-color: rgba(200,50,60,.2); }
.alert-warning { background: rgba(253, 240, 214, .92); color: #6E4608; border-color: rgba(183,121,31,.2); }
.alert-info { background: rgba(227, 233, 253, .92); color: #1C3399; border-color: rgba(42,74,212,.18); }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast-x { padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .35s var(--ease-spring); font-size: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------------- Stepper (payroll workflow) ---------------- */
.stepper { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.step { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7); font-size: 13px; color: var(--muted); }
.step .n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: #E3E8F5; color: var(--muted); flex-shrink: 0; }
.step.done { color: var(--ink-2); }
.step.done .n { background: linear-gradient(145deg, #34C072, #178A48); color: #fff; box-shadow: inset 1px 1px 2px rgba(255,255,255,.4); }
.step.current { background: var(--clay-bg); box-shadow: var(--clay-shadow-sm); color: var(--navy-900); font-weight: 600; }
.step.current .n { background: linear-gradient(145deg, #4B67E6, #2340BC); color: #fff; box-shadow: inset 1px 1px 2px rgba(255,255,255,.4), 0 4px 10px rgba(42,74,212,.3); }
.step b { display: block; font-size: 13.5px; }

/* ---------------- Tabs ---------------- */
.tabs-x { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs-x a, .tabs-x button { padding: 8px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; }
.tabs-x a.active, .tabs-x button.active { background: #fff; color: var(--navy-900); box-shadow: var(--clay-shadow-sm); }

/* ---------------- Empty state ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .tile { margin: 0 auto 16px; width: 64px; height: 64px; border-radius: 22px; }
.empty .tile .ic { width: 28px; height: 28px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }

/* ---------------- Modals (glass) ---------------- */
.modal-content { border: 1px solid rgba(255,255,255,.8); border-radius: var(--r-xl); background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); box-shadow: 0 30px 70px rgba(7,15,51,.28), inset 0 1px 0 #fff; }
.modal-header, .modal-footer { border: 0; padding: 20px 24px; }
.modal-body { padding: 4px 24px 12px; }
.modal-title { font-weight: 700; color: var(--navy-900); font-size: 18px; }
.modal-backdrop.show { opacity: .35; background: #070F33; }
.dropdown-menu { border: 1px solid rgba(255,255,255,.85); border-radius: 18px; padding: 8px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: 0 20px 44px rgba(7,15,51,.18); }
.dropdown-item { border-radius: 11px; padding: 9px 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.dropdown-item:hover { background: var(--royal-100); }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; color: var(--ink); font-size: 13.5px; }
.notif-item:hover { background: var(--royal-100); color: var(--ink); }

/* ---------------- Drop zone ---------------- */
.dropzone { border: 2px dashed rgba(42, 74, 212, .3); border-radius: var(--r-lg); padding: 30px; text-align: center; background: rgba(255,255,255,.5); cursor: pointer; transition: all .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--royal); background: rgba(227,233,253,.6); }
.dropzone input[type=file] { display: none; }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden;
  background: radial-gradient(700px 500px at 20% 10%, rgba(42,74,212,.9), transparent 60%), radial-gradient(600px 500px at 90% 90%, rgba(14,159,154,.75), transparent 60%), linear-gradient(160deg, #0A1A4F, #12256E); }
.auth-hero h1 { color: #fff; font-size: 40px; font-weight: 800; line-height: 1.15; max-width: 520px; }
.auth-hero p { color: #CBD5FF; font-size: 16.5px; max-width: 480px; }
.auth-hero .float-card { padding: 16px 18px; color: var(--ink); max-width: 330px; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 430px; padding: 34px; }
.auth-card .logo { height: 54px; margin-bottom: 18px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------------- Misc ---------------- */
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); word-break: break-word; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.activity li:last-child { border-bottom: 0; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 230px; }
.progress-x { height: 10px; border-radius: 99px; background: #E3E8F5; overflow: hidden; box-shadow: var(--clay-inset); }
.progress-x > span { display: block; height: 100%; background: linear-gradient(90deg, var(--royal), var(--teal)); border-radius: 99px; transition: width .4s var(--ease); }
.money-pos { color: #12673A; }
.money-neg { color: #9B1C25; }
.client-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; padding: 4px; box-shadow: var(--clay-shadow-sm); }
.client-initial { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: var(--royal); background: var(--clay-bg); box-shadow: var(--clay-shadow-sm); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: rgba(42,74,212,.07); padding: 2px 7px; border-radius: 7px; color: var(--navy-800); }
.drag-handle { cursor: grab; color: var(--muted); }
.sortable-ghost { opacity: .4; }
.sort-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 12px; background: rgba(255,255,255,.75); border: 1px solid var(--line); }
.sort-item input[type=text] { flex: 1; }
.builder-preview { background: #DDE3F0; border-radius: var(--r-lg); padding: 18px; overflow: auto; max-height: calc(100vh - 140px); position: sticky; top: 96px; box-shadow: var(--clay-inset); }
.builder-preview .paper { background: #fff; width: 100%; max-width: 794px; margin: 0 auto; box-shadow: 0 10px 30px rgba(7,15,51,.18); border-radius: 4px; min-height: 600px; }
.color-input { width: 52px; padding: 4px; height: 44px; }
.legal-note { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1199.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(calc(-100% - 24px)); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(7, 15, 51, .35); z-index: 1035; }
  .main { margin-left: 0; padding: 10px 12px 32px; }
  .mobile-toggle { display: inline-grid; }
  .topbar { top: 8px; }
  .user-chip .meta { display: none; }
  .search-box { max-width: none; }
  .builder-preview { position: static; max-height: none; }
}
@media (max-width: 575.98px) {
  body { font-size: 14.5px; }
  .page-head h1 { font-size: 22px; }
  .card-x { padding: 16px; }
  .kpi .kpi-value { font-size: 22px; }
  .search-box { display: none; }
  .topbar .page-title { font-size: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .orb { display: none; }
}
@media print {
  .sidebar, .topbar, .page-head .actions, .filters, .sticky-actions, .orb { display: none !important; }
  .main { margin: 0; padding: 0; }
  .glass, .clay { box-shadow: none; background: #fff; backdrop-filter: none; }
}
