:root {
  --ink: #18241f;
  --ink-soft: #34443d;
  --muted: #74817b;
  --muted-2: #98a19c;
  --line: #e7e2d6;
  --line-soft: #f0ece3;
  --bg: #f5f2ea;
  --card: #fffdf9;
  --green-950: #0b2420;
  --green-900: #103029;
  --green-800: #164136;
  --green-700: #1e5747;
  --green-500: #2f8069;
  --green-100: #e4efe9;
  --gold: #c3a263;
  --gold-deep: #a88645;
  --gold-soft: #f4ead4;
  --rose: #b3544a;
  --rose-soft: #f7e6e2;
  --blue: #4b6f8f;
  --blue-soft: #e6eef4;
  --shadow-sm: 0 1px 2px rgba(24, 36, 31, .04), 0 4px 14px rgba(24, 36, 31, .04);
  --shadow-md: 0 18px 50px rgba(24, 36, 31, .12);
  --radius: 18px;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.eyebrow {
  margin: 0 0 12px; font-size: 11px; font-weight: 700;
  letter-spacing: .22em; color: var(--gold-deep); text-transform: uppercase;
}
.eyebrow.light { color: #d8c398; }
.muted { color: var(--muted); }

/* Boot */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: var(--green-950); color: #f5efe1;
}
.boot-mark, .brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #d8bd85, #a98644);
  color: #142b25; font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 8px 22px rgba(0,0,0,.18);
}
.boot .boot-mark { width: 54px; height: 54px; font-size: 30px; animation: breathe 1.8s ease-in-out infinite; }
.boot p { margin: 0; font-size: 13px; letter-spacing: .18em; color: #b9c7c1; }
@keyframes breathe { 0%, 100% { transform: translateY(0); opacity: .8; } 50% { transform: translateY(-4px); opacity: 1; } }

/* Brand */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; }
.brand-lockup div { display: flex; flex-direction: column; gap: 2px; }
.brand-lockup strong { font-size: 15px; letter-spacing: .06em; color: #f5efe1; }
.brand-lockup span { font-size: 9px; letter-spacing: .22em; color: #93a79f; }

/* Auth */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: clamp(32px, 4.5vw, 64px);
  color: #f5efe1;
  background:
    radial-gradient(1000px 600px at 86% 12%, rgba(195, 162, 99, .16), transparent 60%),
    radial-gradient(700px 500px at 8% 100%, rgba(47, 128, 105, .28), transparent 65%),
    linear-gradient(150deg, #123a31 0%, #0c2723 48%, #081d1a 100%);
}
.auth-brand::before, .auth-brand::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(216, 195, 152, .16);
}
.auth-brand::before { width: 560px; height: 560px; right: -190px; top: -190px; }
.auth-brand::after { width: 340px; height: 340px; right: -110px; top: -100px; border-color: rgba(216,195,152,.09); }
.auth-copy { margin: auto 0 0; padding-top: 72px; position: relative; z-index: 1; }
.auth-copy h1 {
  margin: 0 0 22px; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(38px, 4.1vw, 62px); line-height: 1.18; letter-spacing: .02em;
}
.auth-lead { max-width: 460px; margin: 0; color: #afc0b9; font-size: 14px; line-height: 1.9; }
.auth-points {
  list-style: none; padding: 0; margin: 46px 0 0; display: grid; gap: 20px;
  max-width: 460px; position: relative; z-index: 1;
}
.auth-points li { display: flex; gap: 14px; align-items: flex-start; }
.auth-points .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.05); color: #d8c398; border: 1px solid rgba(216,195,152,.16); }
.auth-points div { display: flex; flex-direction: column; gap: 4px; }
.auth-points strong { font-size: 13px; letter-spacing: .04em; color: #f2ecdd; font-weight: 600; }
.auth-points span { font-size: 12px; line-height: 1.6; color: #91a59d; }
.auth-foot { margin: 44px 0 0; font-size: 11px; letter-spacing: .08em; color: #728a82; position: relative; z-index: 1; }
.auth-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; padding: 48px 32px;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(195,162,99,.09), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 38px 36px 32px;
  box-shadow: 0 30px 70px rgba(24, 36, 31, .09);
  animation: rise .45s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-card h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: .01em; font-weight: 600; }
.auth-sub { margin: 0 0 28px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.auth-note { margin: 0; font-size: 11px; letter-spacing: .12em; color: var(--muted-2); }
.auth-tip { display: flex; align-items: center; gap: 7px; margin: 22px 0 0; font-size: 12px; color: var(--muted); }
.auth-tip .icon { width: 14px; height: 14px; }

/* Forms */
.stack-form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-soft); letter-spacing: .03em; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid #ded8cb; border-radius: 11px;
  background: #fffefb; color: var(--ink); outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field textarea { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.field input::placeholder { color: #b2b8b3; }
.field input:hover, .field select:hover { border-color: #cfc6b4; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47,128,105,.12); background: #fff;
}
.field input[readonly] { background: #f7f4ed; color: var(--muted); }
.form-error {
  margin: 0; padding: 9px 12px; border-radius: 9px;
  background: var(--rose-soft); color: #963f36; font-size: 12px; line-height: 1.5;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s, color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(160deg, #214f43, #12352d);
  color: #f7f1e3; border-color: #12352d;
  box-shadow: 0 8px 20px rgba(18, 53, 45, .18);
}
.btn.primary:hover { background: linear-gradient(160deg, #296253, #174138); box-shadow: 0 10px 24px rgba(18,53,45,.24); }
.btn.primary .icon { color: #d8c398; }
.btn.ghost { background: #fffdf9; border-color: #ddd6c8; color: var(--ink-soft); }
.btn.ghost:hover { border-color: #c9bfab; background: #fbf7ee; }
.btn.text { color: var(--muted); padding: 0 8px; }
.btn.text:hover { color: var(--ink); }
.btn.danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.danger:hover { background: #9d453c; }
.btn.wide { width: 100%; height: 46px; margin-top: 4px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #f3efe5; color: var(--ink); }
.icon-btn.subtle { color: #a9bbb3; }
.icon-btn.subtle:hover { background: rgba(255,255,255,.07); color: #fff; }

/* Sidebar */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: 248px; display: flex; flex-direction: column;
  padding: 26px 18px 20px;
  color: #dbe5df;
  background:
    radial-gradient(420px 280px at 100% 0%, rgba(195,162,99,.13), transparent 65%),
    linear-gradient(180deg, #10332b 0%, #0c2722 60%, #0a211d 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand { padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 22px; }
.side-nav { display: grid; gap: 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: #9db2aa; font-size: 13px; font-weight: 500;
  text-align: left; transition: background .16s, color .16s, border-color .16s;
}
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e6eee9; }
.nav-item.active { background: rgba(255,255,255,.075); color: #f6f0e1; border-color: rgba(216,195,152,.18); }
.nav-item.active::before {
  content: ""; position: absolute; left: -18px; top: 11px; bottom: 11px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.side-note {
  margin-top: auto; display: flex; gap: 10px; padding: 14px 12px;
  border-radius: 12px; background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.055);
}
.side-note .icon { width: 16px; height: 16px; color: #bda679; margin-top: 2px; }
.side-note p { margin: 0; font-size: 11px; line-height: 1.7; color: #839890; }
.user-card {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 5px; border: 0; background: transparent; border-radius: 10px; text-align: left;
}
.user-main:hover { background: rgba(255,255,255,.045); }
.avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, #d8c398, #b09152);
  color: #17342c; font-size: 13px; font-weight: 700;
}
.user-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-meta strong { font-size: 13px; color: #f0eadb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 10px; letter-spacing: .08em; color: #869c93; }
.scrim { display: none; }

/* Main */
.main { min-height: 100vh; margin-left: 248px; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 78px; padding: 14px clamp(20px, 3vw, 40px);
  background: rgba(245, 242, 234, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 226, 214, .8);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.topbar-title p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,253,249,.7);
  color: var(--muted); font-size: 11.5px; white-space: nowrap;
}
.date-chip .icon { width: 14px; height: 14px; }
.menu-btn { display: none; }
.content { padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 40px) 48px; max-width: 1500px; margin: 0 auto; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); min-width: 0;
  animation: rise .4s ease both;
}
.stat-card:nth-child(2) { animation-delay: .04s; }
.stat-card:nth-child(3) { animation-delay: .08s; }
.stat-card:nth-child(4) { animation-delay: .12s; }
.stat-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--green-100); color: var(--green-700);
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon.gold { background: var(--gold-soft); color: var(--gold-deep); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.rose { background: var(--rose-soft); color: var(--rose); }
.stat-card div:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stat-card p { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.stat-card strong {
  font-size: clamp(21px, 2vw, 27px); font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.stat-card span { font-size: 10.5px; color: var(--muted-2); }

/* Panel */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; animation: rise .45s .1s ease both;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 22px 24px 18px;
}
.panel-head h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.panel-head p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.panel-actions { display: flex; gap: 8px; }
.filter-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 14px 24px; background: #faf7f0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.search-box {
  flex: 1 1 260px; min-width: 220px; position: relative; display: flex; align-items: center;
}
.search-box .icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-2); }
.search-box input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid #ded8cb; border-radius: 9px; background: #fffefb; outline: none;
  font-size: 12.5px; transition: border-color .16s, box-shadow .16s;
}
.search-box input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47,128,105,.1); }
.search-box input::placeholder { color: #adb4ae; }
.select-wrap, .date-wrap { display: flex; align-items: center; gap: 7px; height: 38px; }
.select-wrap > span, .date-wrap > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.select-wrap select, .date-wrap input {
  height: 38px; padding: 0 10px; border: 1px solid #ded8cb; border-radius: 9px;
  background: #fffefb; font-size: 12px; outline: none; color: var(--ink-soft);
}
.select-wrap select { min-width: 120px; }
.date-wrap input { width: 132px; color: var(--muted); }
.select-wrap select:focus, .date-wrap input:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(47,128,105,.1); }
.filter-bar .btn.text { height: 38px; font-size: 12px; }

/* Table */
.table-wrap { position: relative; overflow-x: auto; }
.ledger-table { width: 100%; min-width: 940px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.ledger-table th {
  padding: 11px 16px; text-align: left;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--muted);
  background: #fdfbf6; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger-table th:nth-child(1) { width: 124px; }
.ledger-table th:nth-child(2) { width: 124px; }
.ledger-table th:nth-child(3) { width: 150px; }
.ledger-table th:nth-child(5) { width: 116px; }
.ledger-table th:nth-child(6) { width: 124px; }
.ledger-table th.actions-col { width: 92px; text-align: right; }
.ledger-table th.num, .ledger-table td.num { text-align: right; }
.table-wrap.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.th-note {
  display: block; margin-top: 2px; font-size: 9px; font-weight: 400;
  letter-spacing: .02em; color: var(--muted-2);
}
.ledger-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; vertical-align: middle; color: var(--ink-soft);
}
.ledger-table tbody tr { transition: background .14s; }
.ledger-table tbody tr:hover { background: #fcfaf4; }
.ledger-table tbody tr:last-child td { border-bottom: 0; }
.time-cell { display: flex; flex-direction: column; gap: 2px; }
.time-main { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-sub { font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.employee-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 26px; height: 26px; border-radius: 50%;
  background: #eef2ed; color: var(--green-700); font-size: 10px; font-weight: 700;
}
.employee-cell .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-tag {
  margin-left: 4px; padding: 1px 5px; border-radius: 4px;
  font-size: 9px; color: var(--green-700); background: var(--green-100);
  font-weight: 600; vertical-align: 1px;
}
.masked-account {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 6px;
  background: #f6f2e9; border: 1px solid #eee8db;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px; letter-spacing: .06em; color: #52605a; white-space: nowrap;
}
.masked-account .icon { width: 11px; height: 11px; color: #a5a094; }
.account-plain { background: #faf8f2; }
.product-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.money { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.money .cny { margin-right: 2px; font-size: 10px; font-weight: 500; color: var(--muted); }
.date-cell { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.date-cell .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.date-cell.overdue .dot { background: var(--rose); }
.date-cell.overdue { color: var(--rose); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions .icon-btn { width: 29px; height: 29px; }
.row-actions .icon-btn .icon { width: 15px; height: 15px; }
.row-actions .icon-btn.danger:hover { background: var(--rose-soft); color: var(--rose); }
.readonly-hint { font-size: 10px; color: var(--muted-2); white-space: nowrap; }

.empty-state { padding: 60px 24px 64px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 56px; height: 56px;
  margin: 0 auto 16px; border-radius: 16px;
  background: #f4efe4; color: #a3957a;
}
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.empty-state p { margin: 0 0 20px; font-size: 12px; color: var(--muted); }

.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: #fdfbf6; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--muted);
}
.table-foot p { margin: 0; }
.pager { display: flex; align-items: center; gap: 6px; }
.pager > span { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.page-size { display: flex; align-items: center; gap: 6px; margin-right: 8px; font-size: 11px; color: var(--muted); }
.page-size select {
  height: 28px; border: 1px solid var(--line); border-radius: 7px;
  background: #fffdf9; font-size: 11px; padding: 0 4px; outline: none;
}
.pager .icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fffdf9; }
.pager .icon-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Staff */
.staff-summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 24px 18px; }
.mini-stat {
  display: flex; align-items: baseline; gap: 7px;
  padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 9px;
  background: #faf7f0; font-size: 11px; color: var(--muted);
}
.mini-stat strong { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.staff-table { min-width: 860px; }
.staff-table th:nth-child(1) { width: 160px; }
.staff-table th:nth-child(2) { width: 140px; }
.staff-table th:nth-child(3) { width: 90px; }
.staff-table th:nth-child(4) { width: 90px; }
.staff-table th:nth-child(5) { width: 130px; }
.staff-table th:nth-child(6) { width: 150px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600;
  background: var(--green-100); color: var(--green-700);
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.off { background: #f0eee9; color: #8d8a81; }
.staff-user { display: flex; align-items: center; gap: 9px; }
.staff-user strong { display: block; font-size: 12.5px; color: var(--ink); }
.staff-user small { display: block; margin-top: 2px; font-size: 10px; color: var(--muted-2); }
.staff-actions { display: flex; justify-content: flex-end; gap: 2px; }
.staff-actions .icon-btn { width: 30px; height: 30px; }
.staff-actions .icon-btn .icon { width: 15px; height: 15px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 22px; background: rgba(8, 24, 20, .46);
  backdrop-filter: blur(4px); animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 44px); overflow: auto;
  background: var(--card); border: 1px solid rgba(255,255,255,.45);
  border-radius: 20px; box-shadow: var(--shadow-md);
  animation: modal-in .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 24px 26px 0;
}
.modal-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.modal-head p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.modal-body { padding: 22px 26px 4px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 18px 26px 24px;
}
.modal-foot .btn { min-width: 88px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.input-prefix { position: relative; }
.input-prefix span {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--muted); pointer-events: none;
}
.input-prefix input { padding-left: 29px; font-variant-numeric: tabular-nums; }
.form-hint {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 14px 0 0; padding: 10px 12px; border-radius: 9px;
  background: #f7f3e9; color: #7f7969; font-size: 11px; line-height: 1.65;
}
.form-hint .icon { width: 14px; height: 14px; margin-top: 1px; flex: 0 0 auto; color: #a58f61; }
.form-hint.alert { background: var(--rose-soft); color: #914239; }
.form-hint.alert .icon { color: var(--rose); }
.context-strip {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 10px 12px; border-radius: 9px;
  background: #faf7ef; border: 1px solid var(--line-soft);
  font-size: 11px; color: var(--muted);
}
.context-strip strong { color: var(--ink-soft); font-weight: 600; }
.context-strip .sep { width: 1px; height: 12px; background: var(--line); }
.confirm-copy { margin: 4px 0 0; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
.confirm-copy strong { color: var(--rose); }
.check-line { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; cursor: pointer; }
.check-line input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--green-700); }
.temp-password {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 11px 13px; border-radius: 9px;
  border: 1px dashed #d6c8a9; background: #fbf6e9;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; letter-spacing: .06em;
}
.temp-password span { font-family: var(--font-sans); font-size: 10px; color: var(--muted); letter-spacing: 0; }

/* Toast */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 9px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px;
  min-width: 230px; max-width: 360px; padding: 12px 15px;
  background: #15352d; color: #f4eee0;
  border: 1px solid rgba(216,195,152,.25); border-radius: 11px;
  box-shadow: 0 16px 40px rgba(10, 30, 25, .25);
  font-size: 12.5px; line-height: 1.5;
  animation: toast-in .25s cubic-bezier(.2,.8,.3,1) both;
}
.toast .icon { width: 17px; height: 17px; color: #d8c398; }
.toast.error { background: #4b211d; border-color: rgba(230,170,160,.25); }
.toast.error .icon { color: #eab5ad; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .app-shell.menu-open .sidebar { transform: none; }
  .app-shell.menu-open .scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(8,24,20,.35); backdrop-filter: blur(2px);
  }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { min-height: 70px; }
}
@media (max-width: 880px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 26px 24px 30px; }
  .auth-copy { padding-top: 34px; margin: 0; }
  .auth-copy h1 { font-size: 34px; margin-bottom: 14px; }
  .auth-lead { font-size: 12.5px; line-height: 1.8; }
  .auth-points { display: none; }
  .auth-foot { margin-top: 24px; }
  .auth-panel { padding: 30px 20px 40px; }
  .auth-card { padding: 30px 24px 26px; }
}
@media (max-width: 680px) {
  .auth-brand { padding: 22px 20px 26px; }
  .auth-copy { padding-top: 24px; }
  .auth-copy h1 { font-size: 31px; margin-bottom: 0; }
  .auth-lead, .auth-foot { display: none; }
  .auth-panel { padding: 24px 16px 32px; }
  .auth-card { padding: 28px 22px 24px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title p { display: none; }
  .date-chip { display: none; }
  .topbar-actions .btn.primary { padding: 0 12px; font-size: 12px; }
  .content { padding: 18px 16px 36px; }
  .stats-grid { gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 9px; }
  .stat-icon .icon { width: 16px; height: 16px; }
  .stat-card strong { font-size: 19px; }
  .stat-card span { display: none; }
  .panel-head { padding: 18px 16px 14px; flex-direction: column; gap: 12px; }
  .panel-actions { width: 100%; }
  .panel-actions .btn { width: 100%; }
  .filter-bar { padding: 12px 16px; gap: 8px; }
  .search-box { flex-basis: 100%; }
  .select-wrap { flex: 1 1 calc(50% - 4px); }
  .select-wrap select { width: 100%; min-width: 0; }
  .date-wrap { flex: 1 1 calc(50% - 4px); }
  .date-wrap input { width: 100%; }
  .filter-bar .btn.text { margin-left: auto; }
  .table-foot { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
  .pager { width: 100%; justify-content: space-between; }
  .page-size { margin-right: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; align-items: end; }
  .modal { max-height: calc(100vh - 24px); border-radius: 18px; }
  .modal-head { padding: 20px 20px 0; }
  .modal-body { padding: 18px 20px 4px; }
  .modal-foot { padding: 16px 20px 20px; }
  .modal-foot .btn { flex: 1; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
