/* ==========================================================================
   双语教育集团智慧财务工资管理系统 v2 — Executive Financial UI/UX System
   Zero external CDN dependencies · Built for LAN high-density financial workflows
   ========================================================================== */
:root {
  --navy: #0f2744;
  --navy-deep: #09182b;
  --navy-soft: #1a3b61;
  --emerald: #0b7a5c;
  --emerald-hover: #08634a;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;
  --teal: #0d9488;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --crimson: #be123c;
  --crimson-soft: #fff1f2;
  --crimson-border: #fecdd3;
  --blue: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;

  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e5eaf1;
  --border-strong: #cfd8e3;

  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 39, 68, 0.045);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 12px 28px rgba(15, 39, 68, 0.06);
  --shadow-lg: 0 24px 60px rgba(9, 24, 43, 0.24);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }

.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.text-danger { color: var(--crimson); }
.text-success { color: var(--emerald); }
.text-amber { color: var(--amber); }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ico { width: 17px; height: 17px; flex-shrink: 0; display: inline-block; vertical-align: -3px; }
.ico-sm { width: 15.5px; height: 15.5px; flex-shrink: 0; display: inline-block; vertical-align: -2.5px; }

/* ================= Login Page ================= */
.login-body { min-height: 100vh; background: var(--bg); display: flex; }
.login-shell { display: grid; grid-template-columns: 1.05fr 1fr; width: 100%; min-height: 100vh; }
.login-brand-panel {
  background:
    radial-gradient(circle at 18% 16%, rgba(45, 212, 191, 0.16), transparent 44%),
    radial-gradient(circle at 88% 84%, rgba(14, 165, 233, 0.12), transparent 45%),
    linear-gradient(155deg, var(--navy-deep) 0%, var(--navy) 54%, #0c3d46 100%);
  color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}
.login-brand-panel > * { position: relative; z-index: 1; }
.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #2dd4bf, #0d9488);
  color: var(--navy-deep); font-weight: 800; font-size: 21px;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.4);
}
.brand-logo.sm { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35); }
.brand-title { font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 12.5px; color: #99d5cf; margin-top: 1px; }
.brand-hero h1 { font-size: clamp(28px, 3.1vw, 40px); line-height: 1.24; margin: 0 0 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand-hero p { font-size: 14.5px; color: #cbd5e1; max-width: 470px; margin: 0; line-height: 1.7; }
.brand-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.hl-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px; padding: 15px 16px;
  backdrop-filter: blur(8px);
}
.hl-num { display: block; font-size: 21px; font-weight: 700; color: #5eead4; letter-spacing: -0.02em; }
.hl-lbl { display: block; font-size: 12px; color: #cbd5e1; margin-top: 3px; }
.brand-footer { font-size: 12px; color: #94b8c4; display: flex; align-items: center; gap: 12px; }

.login-form-panel { display: flex; align-items: center; justify-content: center; padding: 36px 24px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 492px; background: var(--surface); border-radius: 16px;
  padding: 34px 36px; box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.login-card h2 { margin: 0 0 4px; font-size: 22px; color: var(--navy); letter-spacing: -0.01em; }
.login-card > p { margin: 0 0 22px; font-size: 13px; }
.stack-form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="month"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 13px; min-height: 42px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font-size: 15px; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(11, 122, 92, 0.16);
}
input:disabled, select:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }

.demo-panel { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-strong); }
.demo-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.demo-panel-head code { background: var(--surface-3); padding: 2px 7px; border-radius: 4px; color: var(--navy); font-weight: 600; }
.demo-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo-role-btn {
  text-align: left; padding: 10px 12px; border-radius: 9px; border: 1.5px solid var(--border);
  background: var(--surface-2); cursor: pointer; transition: all 0.15s;
}
.demo-role-btn:hover {
  border-color: var(--emerald); background: var(--emerald-soft);
  transform: translateY(-1px); box-shadow: var(--shadow-xs);
}
.demo-role-btn strong { display: block; font-size: 13.5px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-role-btn span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* ================= Buttons & Badges (Generous & Easy to Click) ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; min-height: 44px; border-radius: 9px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none !important;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--emerald); color: #fff; box-shadow: 0 2px 6px rgba(11, 122, 92, 0.28); }
.btn-primary:hover:not(:disabled) { background: var(--emerald-hover); transform: translateY(-1px); }
.btn-soft { background: var(--emerald-soft); color: #047857; border-color: #6ee7b7; }
.btn-soft:hover:not(:disabled) { background: #d1fae5; border-color: var(--emerald); }
.btn-navy { background: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(15, 39, 68, 0.22); }
.btn-navy:hover:not(:disabled) { background: var(--navy-soft); }
.btn-secondary { background: #fff; color: var(--ink); border-color: #bfc9d6; box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--crimson); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #9f1239; }
.btn-danger-outline { background: #fff; color: var(--crimson); border-color: #fda4af; }
.btn-danger-outline:hover:not(:disabled) { background: var(--crimson-soft); border-color: var(--crimson); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: rgba(15, 39, 68, 0.06); color: var(--navy); }
.btn-sm { padding: 9px 16px; min-height: 40px; font-size: 14.5px; border-radius: 8px; }
.btn-xs { padding: 7px 13px; min-height: 35px; font-size: 13.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--border-strong);
  background: #fff; color: var(--ink-2); font-size: 16px; cursor: pointer; display: grid; place-items: center; transition: all 0.15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--navy); color: var(--navy); }

/* Status Badges with Crisp Indicator Dot */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-plain::before { display: none; }
.badge-DRAFT { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-PENDING_ACCOUNTANT, .badge-PENDING_DIRECTOR, .badge-PENDING_PRINCIPAL {
  background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border);
}
.badge-REJECTED { background: var(--crimson-soft); color: var(--crimson); border: 1px solid var(--crimson-border); }
.badge-APPROVED { background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-PAID, .badge-ok, .badge-plus { background: var(--emerald-soft); color: #047857; border: 1px solid var(--emerald-border); }
.badge-warn { background: var(--amber-soft); color: #b45309; border: 1px solid var(--amber-border); }
.badge-minus { background: var(--crimson-soft); color: var(--crimson); border: 1px solid var(--crimson-border); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.alert-danger { background: var(--crimson-soft); color: #9f1239; border: 1px solid var(--crimson-border); }
.alert-success { background: var(--emerald-soft); color: #065f46; border: 1px solid var(--emerald-border); }
.alert-info { background: var(--blue-soft); color: #1e40af; border: 1px solid var(--blue-border); }
.alert-warn { background: var(--amber-soft); color: #92400e; border: 1px solid var(--amber-border); }

/* ================= App Shell & Executive Sidebar ================= */
.app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 212, 191, 0.14), transparent 36%),
    linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #e2e8f0; display: flex; flex-direction: column;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.sb-title { font-size: 15.5px; font-weight: 700; color: #fff; letter-spacing: 0.01em; }
.sb-sub { font-size: 11px; color: #8ad3cb; }

.user-card {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 16px; padding: 10px 11px;
  background: rgba(255, 255, 255, 0.06); border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #1d4e68, #0f766e);
  color: #ccfbf1; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-tag { font-size: 11px; color: #5eead4; margin-top: 1px; font-weight: 600; }
.user-dept { font-size: 11px; color: #94a3b8; }

.sidebar-nav { display: grid; gap: 6px; flex: 1; align-content: start; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  padding: 12px 13px; border-radius: 9px; border: none; background: transparent;
  color: #cbd5e1; cursor: pointer; text-align: left; font-weight: 600; font-size: 14.5px;
  transition: all 0.15s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(11, 122, 92, 0.95), rgba(13, 148, 136, 0.88));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(11, 122, 92, 0.35);
}
.nav-item-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-pill { background: rgba(255, 255, 255, 0.22); color: #fff; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }

.sidebar-footer { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.09); display: grid; gap: 8px; }
.sidebar-footer .btn-ghost { color: #cbd5e1; border: 1px solid rgba(255, 255, 255, 0.16); }
.sidebar-footer .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.security-pill { font-size: 11px; color: #8ad3cb; text-align: center; opacity: 0.9; }

.main-shell { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 11px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 25;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { margin: 0; font-size: 19px; color: var(--navy); font-weight: 700; letter-spacing: -0.01em; }
.topbar-desc { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px; }
.notif-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 40px;
  border-radius: 999px; border: 1.5px solid var(--border-strong); background: #fff;
  cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink-2); transition: all 0.15s;
}
.notif-btn:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-soft); }
.notif-badge { background: var(--crimson); color: #fff; font-size: 12px; padding: 0 6px; min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; }
.notif-badge[hidden] { display: none; }

/* Comfortable Role Switcher Bar */
.demo-switcher-bar {
  background: linear-gradient(90deg, #f0fdfa 0%, #f8fafc 100%);
  border-bottom: 1px solid #cce6de;
  padding: 9px 24px;
}
.demo-switcher-bar[hidden] { display: none; }
.demo-switcher-inner { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; max-width: 1440px; margin: 0 auto; scrollbar-width: none; }
.demo-switcher-inner::-webkit-scrollbar { display: none; }
.demo-tag {
  font-size: 12.5px; font-weight: 700; color: var(--emerald);
  background: #fff; border: 1.5px solid var(--emerald-border);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.demo-pills { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: nowrap; }
.demo-pill {
  padding: 7px 13px; min-height: 36px; border-radius: 999px; border: 1.5px solid #cbd5e1;
  background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.14s; white-space: nowrap; flex-shrink: 0;
}
.demo-pill:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-soft); }
.demo-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 2px 6px rgba(15, 39, 68, 0.22); }

.content-area { padding: 18px 24px 44px; max-width: 1440px; width: 100%; margin: 0 auto; }
.mobile-only { display: none; }

/* ================= Cards, Unified KPI Strip & Connected Stepper ================= */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 15.5px; color: var(--navy); font-weight: 700; }

/* Dashboard KPI Grid */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 4px 4px 0; background: var(--navy); }
.kpi-card.accent::before { background: var(--emerald); }
.kpi-card.amber::before { background: var(--amber); }
.kpi-card.crimson::before { background: var(--crimson); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-val { font-size: 23px; font-weight: 700; color: var(--navy); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-card.accent .kpi-val { color: var(--emerald); }
.kpi-sub { font-size: 11.5px; color: var(--muted-light); margin-top: 2px; }

/* Compact Unified Metric Strip for Batch Workbench (saves vertical height!) */
.metric-strip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden;
}
.metric-cell { padding: 12px 16px; position: relative; }
.metric-cell + .metric-cell { border-left: 1px solid var(--border); }
.metric-cell.highlight { background: linear-gradient(180deg, #f3fcf9 0%, #ffffff 100%); }
.metric-cell .m-lbl { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.metric-cell .m-val { font-size: 19px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -0.02em; }
.metric-cell.highlight .m-val { color: var(--emerald); }
.metric-cell .m-val.danger { color: var(--crimson); }
.metric-cell .m-sub { font-size: 11px; color: var(--muted-light); margin-top: 1px; }

/* Batch Hero Toolbar */
.batch-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.verify-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--emerald-soft); color: #065f46; border: 1px solid var(--emerald-border);
}

/* Connected Horizontal Stepper */
.stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 18px; margin-bottom: 12px; box-shadow: var(--shadow-xs); overflow-x: auto;
}
.step-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; flex: 1; }
.step-item:not(:last-child)::after {
  content: ""; height: 2px; flex: 1; margin: 0 12px; background: #e2e8f0; border-radius: 2px; min-width: 16px;
}
.step-item.done:not(:last-child)::after { background: var(--emerald-border); }
.step-dot {
  width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1;
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0;
}
.step-item.done { color: var(--emerald); font-weight: 600; }
.step-item.done .step-dot { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.step-item.current { color: var(--navy); font-weight: 700; }
.step-item.current .step-dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 3px rgba(15, 39, 68, 0.14); }
.step-item.rejected { color: var(--crimson); font-weight: 700; }
.step-item.rejected .step-dot { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* Docked Prominent Workflow Action Bar */
.wf-bar {
  background: linear-gradient(90deg, #f4fcf9 0%, #ffffff 60%);
  border: 1.5px solid #bfe6d8; border-left: 4px solid var(--emerald);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow-xs);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.wf-bar.pay-mode { background: linear-gradient(90deg, #f1f5fb 0%, #ffffff 60%); border-color: #cbd5e1; border-left-color: var(--navy); }
.wf-bar-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 300px; flex-wrap: wrap; }
.wf-check { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--navy); cursor: pointer; white-space: nowrap; }
.wf-check input { width: 20px; height: 20px; accent-color: var(--emerald); cursor: pointer; }
.wf-note-input { flex: 1; min-width: 220px; max-width: 440px; }

/* ================= Tables & Multi-Header Payroll Preview ================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data-table th {
  background: #f1f5f9; color: var(--navy); font-weight: 700; font-size: 13.5px;
  padding: 12px 13px; border-bottom: 1.5px solid var(--border-strong);
  text-align: left; white-space: nowrap; letter-spacing: 0.01em;
}
table.data-table td { padding: 12px 13px; border-bottom: 1px solid #e9eef4; vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #f8fafc; }
table.data-table tbody tr.row-warning { background: #fffdf5; }
table.data-table tbody tr.row-warning:hover { background: #fef9e7; }
table.data-table tbody tr.row-danger { background: #fff5f6; }
table.data-table tfoot td { background: #f8fafc; font-weight: 700; color: var(--navy); border-top: 1.5px solid var(--border-strong); }

.payroll-preview-wrap { max-height: 64vh; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; }
table.payroll-grid { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 12.5px; }
table.payroll-grid th, table.payroll-grid td {
  padding: 7px 10px; border-right: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; white-space: nowrap;
}
table.payroll-grid thead tr.grp-row th {
  position: sticky; top: 0; z-index: 4; background: var(--navy); color: #fff;
  text-align: center; font-weight: 600; font-size: 12px; border-right: 1px solid rgba(255, 255, 255, 0.16);
}
table.payroll-grid thead tr.col-row th {
  position: sticky; top: 31px; z-index: 4; background: #eef3f8; color: var(--navy);
  font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border-strong);
}
table.payroll-grid thead tr.grp-row th.grp-adj { background: var(--emerald); }
table.payroll-grid thead tr.grp-row th.grp-net { background: #1e3a8a; }
table.payroll-grid .sticky-c1 { position: sticky; left: 0; z-index: 3; min-width: 44px; text-align: center; background: #fff; }
table.payroll-grid .sticky-c2 { position: sticky; left: 44px; z-index: 3; min-width: 80px; background: #fff; box-shadow: 3px 0 8px rgba(15, 23, 42, 0.06); font-weight: 600; }
table.payroll-grid thead .sticky-c1, table.payroll-grid thead .sticky-c2 { z-index: 6; background: #eef3f8; }
table.payroll-grid thead tr.grp-row .sticky-c1 { background: var(--navy); }
table.payroll-grid tbody tr:nth-child(even) td { background: #fafbfd; }
table.payroll-grid tbody tr:nth-child(even) .sticky-c1,
table.payroll-grid tbody tr:nth-child(even) .sticky-c2 { background: #fafbfd; }
table.payroll-grid tbody tr:hover td { background: #f0f9ff; }
table.payroll-grid td.cell-total { font-weight: 700; color: var(--navy); background: #eff6ff !important; }
table.payroll-grid td.cell-net { font-weight: 700; color: var(--emerald); background: #ecfdf5 !important; }
table.payroll-grid td.cell-adj-plus { color: var(--emerald); font-weight: 600; }
table.payroll-grid td.cell-adj-minus { color: var(--crimson); font-weight: 600; }
table.payroll-grid td.cell-warn { background: #fff1f2 !important; color: var(--crimson); font-weight: 600; }
table.payroll-grid tfoot td { position: sticky; bottom: 0; z-index: 3; background: #e8eef5 !important; font-weight: 700; color: var(--navy); border-top: 1.5px solid var(--border-strong); }

/* ================= Tabs, Forms & Grids ================= */
.tabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab-btn {
  padding: 11px 18px; border: none; border-bottom: 3px solid transparent; background: transparent;
  color: var(--muted); font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--emerald); border-bottom-color: var(--emerald); }

.form-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 11px; }
.fieldset-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px;
  background: var(--surface-2); margin-bottom: 12px;
}
.fieldset-title { font-weight: 700; color: var(--navy); font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.todo-card {
  border: 1px solid var(--border); border-left: 3.5px solid var(--emerald); border-radius: 10px;
  padding: 13px 15px; background: #fff; cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-xs);
}
.todo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--emerald-border); }
.todo-card.rejected { border-left-color: var(--crimson); }

.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px solid #dbe4ee; }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before {
  content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--emerald); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--emerald);
}
.timeline li.tl-reject::before { background: var(--crimson); box-shadow: 0 0 0 1.5px var(--crimson); }

/* ================= Payslip Voucher Card ================= */
.payslip-sheet {
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 22px 24px; background: #fff;
  box-shadow: var(--shadow-xs);
}
.payslip-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 2px solid var(--navy); padding-bottom: 12px; margin-bottom: 16px;
}
.payslip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 16px; }
.ps-kv { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.ps-kv span { color: var(--muted); }
.ps-kv strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.payslip-total-bar {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px;
  background: linear-gradient(90deg, #f8fafc 0%, #f0fdfa 100%);
  border: 1px solid var(--emerald-border); border-radius: 10px; padding: 14px 18px;
}

/* ================= Charts ================= */
.bar-chart { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 112px; align-items: center; gap: 12px; font-size: 13px; }
.bar-track { height: 10px; background: #e8eef5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--navy), var(--emerald)); transition: width 0.35s ease; }

/* ================= Modals & Toasts ================= */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 24, 43, 0.52); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 14px; width: 100%; max-width: 960px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalPop 0.18s ease-out;
}
.modal-card.modal-md { max-width: 580px; }
.modal-card.modal-xl { max-width: 1180px; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.98) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-head {
  padding: 15px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2);
}
.modal-head h3 { margin: 0; font-size: 15.5px; color: var(--navy); font-weight: 700; }
.modal-body { padding: 18px 22px; overflow-y: auto; }

.toast-container { position: fixed; top: 18px; right: 22px; z-index: 95; display: grid; gap: 8px; max-width: 390px; }
.toast {
  padding: 11px 16px; border-radius: 10px; color: #fff; font-weight: 600; font-size: 13px;
  box-shadow: 0 10px 26px rgba(9, 24, 43, 0.24); animation: slideIn 0.2s ease-out;
}
.toast-ok { background: var(--emerald); }
.toast-err { background: var(--crimson); }
.toast-info { background: var(--navy); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.loading-box, .empty-box { text-align: center; padding: 40px 20px; color: var(--muted); }
.pager-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
}
.pager-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pager-select { width: auto !important; min-width: 112px; min-height: 36px !important; padding: 5px 10px !important; font-size: 13.5px !important; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-size: 12px; cursor: pointer; color: var(--ink-2); transition: all 0.14s;
}
.chip:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-soft); }

/* ================= Responsive & Print ================= */
@media (max-width: 1024px) {
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-cell { border-bottom: 1px solid var(--border); }
}
@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { padding: 28px 24px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; width: 238px; z-index: 50; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  .mobile-only { display: grid; }
  .two-col { grid-template-columns: 1fr; }
  .stepper { flex-direction: column; align-items: stretch; gap: 8px; }
  .step-item:not(:last-child)::after { display: none; }
  .payslip-grid { grid-template-columns: 1fr 1fr; }
  .demo-role-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  .sidebar, .topbar, .demo-switcher-bar, .modal-head, .no-print { display: none !important; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal-card { box-shadow: none; max-height: none; }
}
