:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #0e7490;
  --primary-600: #0b5e74;
  --primary-700: #084c5e;
  --primary-soft: #ecfeff;
  --primary-border: #a5f3fc;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; border: 2px solid transparent; }

/* ---------- boot ---------- */
.boot-screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; background: var(--bg); z-index: 60;
}
.boot-logo, .brand-mark {
  width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0e7490, #065666); color: #ecfeff; font-size: 26px; font-weight: 700;
  box-shadow: 0 12px 30px -10px rgba(14, 116, 144, .55);
}
.boot-logo { animation: floaty 1.4s ease-in-out infinite; }
.boot-text { color: var(--muted); font-size: 13px; letter-spacing: .06em; }
@keyframes floaty { 50% { transform: translateY(-6px); } }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(14, 116, 144, .16), transparent 60%),
    radial-gradient(700px 480px at 100% 110%, rgba(251, 191, 36, .12), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(980px, 100%); display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--panel); border-radius: 26px; overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .6);
}
.login-brand {
  position: relative; padding: 46px 44px; color: #e2f6f8;
  background: linear-gradient(155deg, #0b3d4b 0%, #0e5c70 48%, #0e7490 100%); overflow: hidden;
}
.login-brand::after {
  content: ""; position: absolute; right: -90px; bottom: -120px; width: 320px; height: 320px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .03), inset 0 0 0 80px rgba(255, 255, 255, .025);
}
.login-brand .brand-mark { background: rgba(255, 255, 255, .12); box-shadow: none; color: #fff; }
.login-brand h1 { font-size: 30px; margin: 22px 0 6px; letter-spacing: .04em; }
.brand-sub { margin: 0 0 28px; font-size: 14px; opacity: .82; line-height: 1.7; }
.brand-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.brand-points li { display: flex; gap: 12px; font-size: 13px; opacity: .92; line-height: 1.65; }
.brand-points span { flex: 0 0 22px; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.brand-foot { margin-top: 34px; font-size: 12px; opacity: .55; }

.login-form-wrap { padding: 42px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-tabs { display: flex; gap: 8px; background: #f1f5f9; border-radius: 12px; padding: 5px; margin-bottom: 26px; }
.login-tab { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.login-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.login-form input { border: 1px solid var(--line-strong); border-radius: 11px; padding: 11px 13px; font-size: 14px; background: #fbfcfd; transition: border .15s, box-shadow .15s; }
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .12); background: #fff; }
.login-tip { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; display: flex; flex-direction: column; gap: 26px;
  padding: 22px 16px 18px; color: #cbd5e1; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, #0b1220 0%, #0d1826 60%, #0a111c 100%);
  border-right: 1px solid rgba(148, 163, 184, .08);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px; }
.brand-mark.sm { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
.brand-name { font-size: 16px; font-weight: 700; color: #f1f5f9; line-height: 1.3; }
.brand-name span { display: block; font-size: 10.5px; font-weight: 400; color: #64748b; letter-spacing: .08em; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 11px;
  background: transparent; color: #94a3b8; font-size: 13.5px; text-align: left; position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(148, 163, 184, .09); color: #e2e8f0; }
.nav-item.active { background: linear-gradient(90deg, rgba(14, 116, 144, .32), rgba(14, 116, 144, .12)); color: #ecfeff; }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: #22d3ee; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(148, 163, 184, .12); padding-top: 16px; }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 0 4px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(145deg, #155e75, #0e7490); color: #ecfeff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.user-meta { min-width: 0; }
.user-meta b { display: block; color: #e2e8f0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar-foot .btn { width: 100%; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 18px 30px 14px;
  background: rgba(244, 247, 249, .82); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.topbar-title h1 { margin: 0; font-size: 19px; letter-spacing: .01em; }
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.menu-toggle { display: none; }
.page { padding: 6px 30px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1440px; width: 100%; }

.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- cards / layout ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { margin: 0; font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-body { padding: 18px 22px 22px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

/* ---------- stat cards ---------- */
.stat { display: flex; gap: 16px; padding: 20px; align-items: flex-start; }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 44px; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.teal { background: #ecfeff; color: #0e7490; }
.stat-icon.blue { background: #eff6ff; color: #1d4ed8; }
.stat-icon.amber { background: #fffbeb; color: #b45309; }
.stat-icon.slate { background: #f1f5f9; color: #475569; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 1px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--muted); }
.stat-foot b { color: var(--primary); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; border: 1px solid transparent; padding: 9px 16px; font-size: 13.5px;
  font-weight: 600; background: #f1f5f9; color: var(--ink-2); transition: transform .05s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(150deg, #0e7490, #0b5e74); color: #fff; box-shadow: 0 8px 18px -8px rgba(14, 116, 144, .55); }
.btn-primary:hover { background: linear-gradient(150deg, #0f819e, #0b5e74); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-dark { background: #0b1220; color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 4px 8px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 12.5px; padding: 0; }
.link-btn.danger { color: var(--danger); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.input, .select, textarea.input {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 9px 12px;
  font-size: 13.5px; transition: border .15s, box-shadow .15s; min-width: 0;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 116, 144, .1); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
textarea.input { resize: vertical; min-height: 84px; }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- table ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 5; background: #f8fafc; color: var(--muted);
  font-size: 11.5px; font-weight: 600; text-align: left; padding: 11px 14px; letter-spacing: .04em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:hover { background: #fafcfd; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .center { text-align: center; }
.tbl .num-strong { font-weight: 700; color: var(--ink); }
.tbl .muted { color: var(--muted); font-size: 12px; }
.tbl .cell-main { font-weight: 600; color: var(--ink); }
.tbl .nowrap { white-space: nowrap; }
.row-issue td { background: #fffaf2 !important; }
.row-dup td { background: #fff5f5 !important; }
.row-issue:hover td, .row-dup:hover td { filter: brightness(.99); }
.thumb { width: 46px; height: 32px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #f8fafc; cursor: pointer; }
.thumb-ph { width: 46px; height: 32px; border-radius: 6px; border: 1px dashed var(--line-strong); background: #f8fafc; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 10px; }
.checkbox { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.tbl input.cell-input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: transparent; font-size: 13px; }
.tbl input.cell-input:hover { border-color: var(--line); background: #fff; }
.tbl input.cell-input:focus { outline: none; border-color: var(--primary); background: #fff; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2.5px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.dup { background: #fee2e2; color: #b91c1c; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.manual { background: #ffedd5; color: #9a3412; }
.chip.neutral { background: #f1f5f9; color: #475569; }
.chip.teal { background: var(--primary-soft); color: var(--primary-600); }
.chip-list { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.toolbar .select, .toolbar .input { height: 36px; padding: 0 12px; font-size: 13px; }
.toolbar .select { padding-right: 32px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-box .input { padding-left: 33px; width: 220px; }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 18px; padding: 44px 24px; text-align: center;
  background: linear-gradient(180deg, #fbfdfe, #f7fafc); transition: border .15s, background .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--primary); box-shadow: var(--shadow-sm); }
.dropzone .dz-icon svg { width: 26px; height: 26px; }
.dropzone h3 { margin: 0 0 6px; font-size: 16px; }
.dropzone p { margin: 0; color: var(--muted); font-size: 12.5px; }
.dropzone .btn { margin-top: 16px; }
.file-queue { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-size: 13px; }
.q-item .q-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .q-size { color: var(--muted); font-size: 11.5px; }
.q-item .q-state { font-size: 12px; font-weight: 600; }
.spinner { width: 15px; height: 15px; border: 2px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.batch-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- overview ---------- */
.trend { display: flex; align-items: flex-end; gap: 14px; height: 168px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.trend-bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #22d3ee, #0e7490); min-height: 4px; transition: height .4s ease; }
.trend-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.trend-val { font-size: 11px; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-row { display: flex; flex-direction: column; gap: 6px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-head { display: flex; justify-content: space-between; font-size: 13px; }
.cat-head span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 7px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22d3ee, #0e7490); }

/* ---------- print page ---------- */
.layout-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.layout-card { border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 16px; display: flex; gap: 16px; align-items: center; cursor: pointer; background: #fff; transition: border .15s, box-shadow .15s; }
.layout-card:hover { border-color: var(--primary); }
.layout-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(14, 116, 144, .1); }
.a4-mini { width: 62px; height: 88px; border: 1.5px solid var(--ink-2); border-radius: 4px; background: #fff; padding: 5px; display: grid; gap: 3px; flex: 0 0 62px; }
.a4-mini.two { grid-template-rows: 1fr 1fr; }
.a4-mini.four { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.a4-mini i { border: 1px solid #94a3b8; border-radius: 2px; background: #f8fafc; }
.layout-card b { display: block; font-size: 14px; }
.layout-card small { color: var(--muted); font-size: 12px; }
.print-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.print-meta div { background: #f8fafc; border: 1px solid var(--line); border-radius: 11px; padding: 10px 16px; min-width: 130px; }
.print-meta span { display: block; font-size: 11.5px; color: var(--muted); }
.print-meta b { font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .e-icon { width: 64px; height: 64px; border-radius: 20px; background: #f1f5f9; color: #94a3b8; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.empty .e-icon svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }
.empty p { margin: 0 0 18px; font-size: 12.5px; }

/* ---------- modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(680px, 100%); max-height: 92vh; display: flex; flex-direction: column; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-head .close { margin-left: auto; border: 0; background: #f1f5f9; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 18px 18px; }
.modal .preview-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.modal .preview-img { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span2 { grid-column: span 2; }
.editor-note { background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary-700); padding: 10px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 16px; }

/* ---------- toast ---------- */
.toast-root { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0f172a; color: #f1f5f9; padding: 10px 18px; border-radius: 11px; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease; display: flex; gap: 8px; align-items: center; }
.toast.err { background: #7f1d1d; }
.toast.ok { background: #064e3b; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- misc ---------- */
.money { font-variant-numeric: tabular-nums; }
.pill-count { background: #fff; border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 14px 4px 0; }
.pager span { color: var(--muted); font-size: 12.5px; }
.settings-block { display: flex; flex-direction: column; gap: 16px; }
.settings-block .field input { max-width: 380px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; font-size: 12.5px; }
.notice.amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-card { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 35; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .topbar { padding: 14px 16px 10px; }
  .page { padding: 4px 16px 32px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .search-box .input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .layout-cards { grid-template-columns: 1fr; }
}
