/* ==========================================================================
   WeChat Ticket System — dashboard styles
   ========================================================================== */
:root {
  --brand: #07c160;
  --brand-dark: #06a552;
  --brand-soft: #e8f8ef;
  --tg: #229ed9;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8eb;
  --border-strong: #d3d7dc;

  --text: #1c1f23;
  --text-2: #5b6470;
  --text-3: #98a1ac;

  --danger: #e5484d;
  --danger-soft: #fdeceb;
  --warn: #f5a524;
  --warn-soft: #fdf4e7;
  --ok: #30a46c;
  --ok-soft: #e9f7ef;
  --info: #3b82f6;
  --info-soft: #eaf1fe;
  --purple: #8e4ec6;
  --purple-soft: #f3ecfa;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 4px 10px rgba(16, 24, 40, .08);
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; flex: none; }

/* ---------- layout ---------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #101418;
  color: #c7ccd4;
  display: flex;
  flex-direction: column;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex: none;
}
.brand-name { font-size: 14px; font-weight: 650; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #7d8795; }

.nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: #6b7482; padding: 12px 10px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: #c7ccd4;
  cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: rgba(255, 255, 255, .14);
  padding: 1px 7px; border-radius: 20px;
  min-width: 22px; text-align: center;
}
.nav-item.active .count { background: rgba(0, 0, 0, .22); }

.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.side-user .who { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.25; }
.side-user .role { font-size: 11px; color: #8b95a3; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.topbar .spacer { flex: 1; }

.page { padding: 22px; flex: 1; }
.page > .stack { display: flex; flex-direction: column; gap: 18px; }

/* hamburger / mobile */
.menu-btn { display: none; }
.scrim { display: none; }

/* ---------- cards / panels -------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-head h2 { font-size: 14px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--text-3); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- stats ------------------------------------------------------ */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.stat.clickable:hover { box-shadow: var(--shadow); transform: translateY(-1px); cursor: pointer; }
.stat-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.stat-note { font-size: 11.5px; color: var(--text-3); }

.i-red { background: var(--danger-soft); color: var(--danger); }
.i-amber { background: var(--warn-soft); color: var(--warn); }
.i-green { background: var(--ok-soft); color: var(--ok); }
.i-blue { background: var(--info-soft); color: var(--info); }
.i-grey { background: #eef0f3; color: var(--text-2); }
.i-purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.btn:hover { background: var(--surface-2); border-color: #bcc2ca; }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #cc3f44; border-color: #cc3f44; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #eef0f3; border-color: transparent; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* segmented control */
.segmented { display: inline-flex; background: #eef0f3; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: none; cursor: pointer;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- forms ------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, .15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .select:disabled, .textarea:disabled { background: #f2f4f6; color: var(--text-3); cursor: not-allowed; }
.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 12 12'%3E%3Cpath fill='%2398a1ac' d='M3 4.5L6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }
.input-sm { min-height: 30px; padding: 4px 9px; font-size: 12.5px; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.search { position: relative; flex: 1; min-width: 180px; max-width: 320px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-left: 32px; }
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; background: var(--surface-2);
}

/* ---------- tables ------------------------------------------------------ */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #f8f9fb; }
.tbl tbody tr.selected { background: var(--brand-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.cell-title { font-weight: 550; color: var(--text); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 11.5px; color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12px; }

/* ---------- badges ------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-neutral { background: #eef0f3; color: var(--text-2); }
.badge-open { background: var(--danger-soft); color: var(--danger); }
.badge-pending { background: var(--warn-soft); color: #b5760a; }
.badge-resolved { background: var(--ok-soft); color: var(--ok); }
.badge-closed { background: #eef0f3; color: var(--text-3); }
.badge-low { background: var(--ok-soft); color: var(--ok); }
.badge-medium { background: var(--info-soft); color: var(--info); }
.badge-high { background: var(--warn-soft); color: #b5760a; }
.badge-urgent { background: var(--danger-soft); color: var(--danger); }
.badge-admin { background: var(--purple-soft); color: var(--purple); }
.badge-agent { background: var(--info-soft); color: var(--info); }
.badge-wechat { background: #e8f8ef; color: var(--brand-dark); }
.badge-tg { background: #e5f2fa; color: var(--tg); }
.badge-off { background: var(--danger-soft); color: var(--danger); }

/* ---------- avatars ----------------------------------------------------- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 650; color: #fff;
  background: var(--brand); flex: none;
  overflow: hidden; text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.a1 { background: #07c160; } .avatar.a2 { background: #3b82f6; }
.avatar.a3 { background: #8e4ec6; } .avatar.a4 { background: #f5a524; }
.avatar.a5 { background: #e5484d; } .avatar.a6 { background: #0ea5a4; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- conversation ------------------------------------------------ */
.thread { display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow-y: auto; }
.msg { display: flex; gap: 10px; max-width: 82%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.me .msg-body { align-items: flex-end; }
.bubble {
  padding: 9px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  white-space: pre-wrap; word-break: break-word; font-size: 13.5px;
}
.msg.me .bubble { background: var(--brand); border-color: var(--brand); color: #fff; }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .bubble { background: transparent; border: none; color: var(--text-3); font-size: 11.5px; padding: 2px 8px; }
.bubble .sig { margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(0, 0, 0, .18); font-size: 11.5px; opacity: .82; font-style: italic; white-space: pre-wrap; }
.msg.me .bubble .sig { border-top-color: rgba(255, 255, 255, .38); }
.msg-meta { font-size: 11px; color: var(--text-3); display: flex; gap: 7px; align-items: center; }
.msg-meta .chip { background: #eef0f3; border-radius: 4px; padding: 0 5px; font-size: 10px; }

.attach { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); max-width: 260px; background: var(--surface-2); }
.attach img { display: block; width: 100%; max-height: 200px; object-fit: cover; cursor: zoom-in; }
.attach audio, .attach video { display: block; width: 260px; max-width: 100%; }
.attach .attach-name { padding: 6px 10px; font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }
.attach-file { padding: 10px 12px; display: flex; gap: 10px; align-items: center; font-size: 12.5px; }

/* ---------- composer ---------------------------------------------------- */
.composer { border-top: 1px solid var(--border); padding: 12px 16px; background: var(--surface); }
.composer-bar { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 12px; font-weight: 550; cursor: pointer; color: var(--text-2);
}
.tool:hover { background: var(--surface-2); color: var(--text); }
.tool.active { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.composer textarea { width: 100%; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer-foot .grow { flex: 1; }

.pending-file {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2); font-size: 12.5px;
}
.pending-file img { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; }
.pending-file .rm { cursor: pointer; color: var(--text-3); display: grid; place-items: center; }
.pending-file .rm:hover { color: var(--danger); }

.sig-note { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.sig-note b { color: var(--text-2); font-weight: 600; }

/* ---------- drawer (ticket detail) -------------------------------------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform .22s cubic-bezier(.32, .72, 0, 1);
  z-index: 60;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-title { font-size: 15px; font-weight: 650; }
.drawer-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.drawer-section { padding: 12px 16px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 16px; }
.kv label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; margin-bottom: 3px; }
.kv .v { font-size: 13px; }
.drawer-thread { flex: 1; min-height: 200px; }

/* ---------- modal ------------------------------------------------------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 19, 24, .5); backdrop-filter: blur(2px); z-index: 70; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.32, .72, 0, 1); }
.modal.wide { width: min(760px, 100%); }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 9px; }
.modal-foot .left { margin-right: auto; }

@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }

/* ---------- toasts ------------------------------------------------------ */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 9px; max-width: 360px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: #1c1f23; color: #fff;
  padding: 11px 13px; border-radius: var(--r); box-shadow: var(--shadow-lg);
  font-size: 13px; animation: slide .2s cubic-bezier(.32, .72, 0, 1);
}
.toast .ic { flex: none; margin-top: 1px; }
.toast.ok .ic { color: #4ade80 }
.toast.err .ic { color: #fca5a5 }
.toast.warn .ic { color: #fcd34d }
.toast.info .ic { color: #93c5fd }
.toast .txt { flex: 1; }
.toast .txt b { display: block; font-weight: 600; margin-bottom: 1px; }
.toast .x { color: #8b95a3; cursor: pointer; }
@keyframes slide { from { opacity: 0; transform: translateX(20px) } }

/* ---------- misc -------------------------------------------------------- */
.empty { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty .glyph { width: 46px; height: 46px; border-radius: 12px; background: #eef0f3; display: grid; place-items: center; margin: 0 auto 12px; color: var(--text-3); }
.empty h3 { font-size: 14px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 320px; margin: 0 auto 14px; }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(0, 0, 0, .14); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.light { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg) } }

.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 5px; height: 13px; }
@keyframes shimmer { to { background-position: -200% 0 } }
.skeleton-row { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }

.hidden { display: none !important; }
.filters-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); border: none; margin: 16px 0; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { margin-left: auto; }
.tabs-inline { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs-inline button { border: none; background: none; padding: 8px 12px; font-size: 13px; font-weight: 550; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs-inline button.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

.pillbar { display: flex; gap: 7px; flex-wrap: wrap; }
.pill { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 20px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; font-weight: 550; color: var(--text-2); }
.pill:hover { border-color: var(--brand); color: var(--brand-dark); }
.pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill .n { opacity: .7; font-weight: 600; margin-left: 4px; }

.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; align-items: center; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; background: var(--surface-2); color: var(--text-2); }

/* ---------- login ------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 500px at 20% 0%, #e8f8ef 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 100%, #eaf1fe 0%, transparent 55%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px; }
.login-card .brand-mark { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; margin-bottom: 14px; }
.login-card h1 { font-size: 19px; font-weight: 680; margin-bottom: 3px; }
.login-card p.sub { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }

/* ---------- responsive -------------------------------------------------- */
@media (max-width: 940px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 45; }
  .menu-btn { display: inline-flex; }
  .page { padding: 14px; }
  .topbar { padding: 0 14px; }
  .drawer { width: 100vw; }
  .tbl th.hide-sm, .tbl td.hide-sm { display: none; }
}
