/* ============================================================
   共青春运营后台 · P0 视觉升级
   纸感 / 青绿 / 珊瑚红 · 桌面优先
   ============================================================ */

:root {
  --paper: #f4f0e6;
  --paper-2: #f2f4ef;
  --paper-3: #ece6d8;
  --white: #ffffff;
  --ink: #10211c;
  --ink-2: #33453e;
  --muted: #68786f;
  --muted-2: #8e9a92;
  --line: #e4e7de;
  --line-2: #eef1ea;
  --jade: #0d5b4a;
  --jade-2: #147a61;
  --jade-3: #2fa383;
  --mint: #e2f2e9;
  --mint-2: #bfe5d2;
  --coral: #e4572e;
  --coral-soft: #fbe7df;
  --amber: #e3a13c;
  --amber-soft: #f8eed9;
  --blue: #3a6f9e;
  --blue-soft: #e4edf5;
  --sidebar: #0b1a16;
  --sidebar-active: #174438;
  --shadow: 0 10px 30px rgba(16, 33, 28, .06);
  --shadow-lg: 0 24px 70px rgba(16, 33, 28, .18);
  --serif: "Noto Serif SC", "Songti SC", "STZhongsong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
code { font-family: var(--mono); font-size: .92em; }

/* ============ LOGIN ============ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: var(--paper);
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(32px, 5vw, 72px);
  color: #f4f1e7;
  background:
    radial-gradient(900px 600px at 18% 18%, rgba(47, 163, 131, .28), transparent 58%),
    linear-gradient(135deg, #0b1a16 0%, #0d5b4a 72%, #147a61 100%);
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -220px; bottom: -220px;
  border: 1px solid rgba(244, 241, 231, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(244, 241, 231, .035), 0 0 0 90px rgba(244, 241, 231, .02);
}
.login-copy { position: relative; z-index: 1; max-width: 560px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .22em;
  color: rgba(244, 241, 231, .62);
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: .7; }
.login-copy h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.34;
  letter-spacing: .01em;
  margin: 22px 0 18px;
  font-weight: 700;
}
.login-copy > p {
  max-width: 470px;
  color: rgba(244, 241, 231, .62);
  font-size: 12.5px;
  line-height: 1.9;
}
.login-metrics { display: flex; gap: clamp(24px, 4vw, 52px); margin-top: 42px; }
.login-metrics b {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
}
.login-metrics span { display: block; margin-top: 4px; font-size: 10px; color: rgba(244, 241, 231, .48); letter-spacing: .1em; }
.login-stamp {
  position: absolute; right: 42px; bottom: 42px; z-index: 1;
  width: 86px; height: 86px; display: grid; place-items: center;
  border: 2px solid rgba(228, 87, 46, .72);
  outline: 1px solid rgba(228, 87, 46, .55);
  outline-offset: 4px;
  border-radius: 4px;
  color: #f2b09b;
  font-family: var(--serif);
  font-size: 15px; font-weight: 700; line-height: 1.25;
  text-align: center;
  transform: rotate(-6deg);
  opacity: .9;
}
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--paper-2); }
.login-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; color: var(--ink); text-decoration: none; }
.brand-dot { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--jade); position: relative; flex: none; }
.brand-dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--coral); }
.login-card h2 { font-family: var(--serif); font-size: 28px; margin: 24px 0 6px; }
.login-card .muted { font-size: 12px; line-height: 1.8; }
.login-submit { width: 100%; margin-top: 20px; }
.login-error { color: var(--coral); font-size: 11.5px; margin-top: 10px; min-height: 18px; }
.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 10.5px; color: var(--muted-2); line-height: 1.7; }

/* ============ SHELL ============ */
.shell { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: 232px;
  display: flex; flex-direction: column;
  padding: 20px 12px 14px;
  color: #e9efe9;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, .05);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}
.side .brand { padding: 2px 10px 0; }
.brand-mark { width: 32px; height: 32px; color: #c9ecd9; flex: none; }
.brand-name { display: block; font-family: var(--serif); font-size: 22px; line-height: 1; letter-spacing: .16em; color: #f4f1e7; }
.brand-sub { display: block; margin-top: 5px; font-size: 7.5px; font-weight: 500; letter-spacing: .19em; color: rgba(244, 241, 231, .36); text-transform: uppercase; }
.nav-group {
  margin: 24px 12px 8px;
  font-size: 8.5px;
  letter-spacing: .2em;
  color: rgba(244, 241, 231, .26);
  text-transform: uppercase;
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 37px; padding: 0 11px;
  border: 0; border-radius: 8px;
  background: transparent; color: rgba(233, 239, 233, .62);
  font-size: 12px; text-align: left;
  transition: background .16s, color .16s;
}
.nav:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 2px 0 0 #5cc39a; }
.nav-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .78; flex: none; }
.nav.active .nav-icon { opacity: 1; color: #9fe0c3; }
.nav .count {
  margin-left: auto;
  min-width: 18px; padding: 2px 5px;
  border-radius: 999px;
  background: var(--coral); color: #fff;
  font-family: var(--mono); font-size: 8.5px; line-height: 1.3; text-align: center;
}
.nav .count:empty { display: none; }
.side-spacer { flex: 1; }
.side-foot { padding: 14px 10px 10px; font-size: 9px; line-height: 1.7; color: rgba(244, 241, 231, .28); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 13px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: #d9efe3; color: var(--jade);
  font-family: var(--serif); font-size: 13px; font-weight: 700; flex: none;
}
.side-user-info { min-width: 0; }
.side-user-info b { display: block; font-size: 11px; font-weight: 500; color: #f4f1e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-info span { display: block; margin-top: 2px; font-size: 8px; color: rgba(244, 241, 231, .35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-icon { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: rgba(244, 241, 231, .34); }
.logout-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.logout-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.main { margin-left: 232px; min-height: 100vh; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb .sep { opacity: .45; }
.search-wrap {
  margin-left: 18px;
  width: min(330px, 26vw); height: 34px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--muted-2);
}
.search-wrap:focus-within { border-color: var(--jade-2); background: #fff; }
.search-wrap svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; flex: none; }
.search-input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11.5px; }
.search-input::placeholder { color: var(--muted-2); }
.search-wrap kbd { font-family: var(--mono); font-size: 8px; color: var(--muted-2); border: 1px solid var(--line); background: #fff; padding: 2px 4px; border-radius: 4px; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade-3); box-shadow: 0 0 0 4px rgba(47, 163, 131, .12); flex: none; }
.status.bad .dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(228, 87, 46, .12); }
.operator { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted-2); }
.top-btn {
  height: 32px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--muted);
  font-size: 10px;
}
.top-btn:hover { border-color: #c9d0c4; color: var(--ink); }
.top-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.content-wrap { padding: 22px 24px 50px; max-width: 1600px; }

/* ============ PAGE HEAD ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head .date { display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: .04em; color: var(--muted-2); }
.page-head .date i { width: 5px; height: 5px; border-radius: 50%; background: var(--jade-3); }
.page-head h1 { margin: 6px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.page-head .sub { margin-top: 5px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.page-head .sub b { color: var(--coral); font-weight: 700; }
.h-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn2 {
  height: 34px; padding: 0 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.btn2:hover { border-color: #bfc8b9; }
.btn2.primary { background: var(--jade); border-color: var(--jade); color: #fff; }
.btn2.primary:hover { background: var(--jade-2); }
.btn2 svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ============ KPI / PANELS ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--jade); opacity: .85; }
.kpi.coral::after { background: var(--coral); }
.kpi.amber::after { background: var(--amber); }
.kpi.blue::after { background: var(--blue); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 10.5px; color: var(--muted); }
.kpi-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--mint); color: var(--jade); flex: none; }
.kpi.coral .kpi-icon { background: var(--coral-soft); color: var(--coral); }
.kpi.amber .kpi-icon { background: var(--amber-soft); color: #a16a1b; }
.kpi.blue .kpi-icon { background: var(--blue-soft); color: var(--blue); }
.kpi-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi-value { margin-top: 10px; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.kpi-value small { margin-left: 3px; font-family: var(--sans); font-size: 10px; font-weight: 500; color: var(--muted-2); }
.kpi-sub { margin-top: 6px; font-size: 10.5px; line-height: 1.6; color: var(--muted-2); }
.overview-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-bottom: 14px; }
.overview-grid.redemption-grid { grid-template-columns: 1fr; }
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 14px; line-height: 1.4; }
.panel-head p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.6; color: var(--muted-2); }
.panel-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-note { margin: 12px 0 0; font-size: 9.5px; line-height: 1.7; color: var(--muted-2); }
.alert-banner {
  margin-bottom: 14px; padding: 11px 14px;
  border: 1px solid #f3c9bd; border-radius: 10px;
  background: var(--coral-soft); color: #a53c1f; font-size: 11px;
}
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 58px 1fr 48px; align-items: center; gap: 10px; font-size: 11px; }
.bar-row.wide { grid-template-columns: 150px 1fr 48px; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 8px; border-radius: 999px; background: #f0f2ec; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--jade); transition: width .3s ease; }
.bar-value { text-align: right; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 9.5px; color: var(--muted-2); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--jade); }
.legend-dot.jade { background: var(--jade); }
.legend-dot.amber { background: var(--amber); }
.legend-dot.blue { background: var(--blue); }
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 12px 0 0; border-bottom: 1px solid var(--line-2); }
.trend-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.trend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; width: 100%; }
.trend-bars i { display: block; width: 4px; border-radius: 3px 3px 0 0; background: var(--jade); }
.trend-bars.single i { width: 26px; background: linear-gradient(180deg, var(--jade-3), var(--jade)); }
.trend-bars i.b { background: var(--amber); }
.trend-bars i.c { background: var(--blue); }
.trend-x { font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); white-space: nowrap; }
.funnel-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.funnel-row { display: grid; grid-template-columns: 46px 1fr 100px; align-items: center; gap: 10px; font-size: 10.5px; }
.funnel-row .bar-fill { background: var(--jade); }
.funnel-row .bar-value { font-size: 9.5px; }
.status-line { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); font-size: 11px; }
.status-line.bad .dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(228, 87, 46, .12); }
.status-line b { font-weight: 700; }
.status-line span:last-child { margin-left: auto; font-size: 9.5px; color: var(--muted-2); }
.kv-list { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 10.5px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row span { color: var(--muted-2); }
.kv-row b { font-weight: 700; color: var(--ink-2); font-family: var(--mono); font-size: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.mini-grid.nine { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-card { padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.mini-k { font-size: 9.5px; color: var(--muted-2); }
.mini-v { margin-top: 5px; font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.2; }
.mini-s { margin-top: 2px; font-size: 9.5px; color: var(--muted-2); }
.audit-panel { margin-top: 0; }

/* ============ TABLES ============ */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 8px; text-align: left; color: var(--muted-2); font-size: 10px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 12px 8px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s; }
tbody tr:hover td { background: #fbfcf9; }
td .title { font-weight: 700; color: var(--ink); line-height: 1.45; }
td .sub { margin-top: 3px; font-size: 10px; line-height: 1.55; color: var(--muted-2); }
.table-panel { padding: 16px; }
.table-panel table { min-width: 760px; }
.panel-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; padding: 3px; background: var(--paper-2); border-radius: 9px; }
.tab {
  border: 0; border-radius: 7px; padding: 7px 10px;
  background: transparent; color: var(--muted);
  font-size: 10.5px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(16, 33, 28, .07); }
.tab b { margin-left: 4px; font-family: var(--mono); font-size: 9px; color: var(--muted-2); font-weight: 500; }
.tab.active b { color: var(--jade); }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-search {
  width: 230px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  outline: none; background: var(--paper-2); color: var(--ink); font-size: 11px;
}
.table-search:focus { border-color: var(--jade-2); background: #fff; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; font-size: 9.5px; color: var(--muted-2); }
.table-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 10px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.role-card { min-height: 240px; }
.role-head h3 { margin: 10px 0 6px; font-family: var(--serif); font-size: 20px; }
.role-head h3 code { font-family: var(--mono); font-size: 9px; color: var(--muted-2); }
.role-head p { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.perm-list { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.perm-list li { display: flex; align-items: flex-start; gap: 7px; font-size: 10.5px; line-height: 1.6; color: var(--ink-2); }
.perm-list svg { width: 13px; height: 13px; margin-top: 2px; fill: none; stroke: var(--jade); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.settings-note { margin-bottom: 14px; }
.compact-table td { padding: 9px 8px; font-size: 11px; }
#requestTable tbody tr:focus-visible { outline: 2px solid var(--jade-2); outline-offset: -2px; background: #fbfcf9; }
.nav:focus-visible, .btn2:focus-visible, .tab:focus-visible, .top-btn:focus-visible, .link:focus-visible, .icon-btn:focus-visible, .logout-icon:focus-visible {
  outline: 2px solid var(--jade-3);
  outline-offset: 2px;
}

/* ============ BADGES / BUTTONS / LINKS ============ */
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.badge.jade { background: var(--mint); color: var(--jade); }
.badge.amber { background: var(--amber-soft); color: #94631d; }
.badge.coral { background: var(--coral-soft); color: #c14a26; }
.badge.blue { background: var(--blue-soft); color: #35668f; }
.actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.link { border: 0; background: transparent; color: var(--jade); font-size: 10.5px; font-weight: 700; padding: 5px 6px; border-radius: 6px; white-space: nowrap; }
.link:hover { background: var(--mint); }
.link.danger { color: var(--coral); }
.link.danger:hover { background: var(--coral-soft); }
.link.muted { color: var(--muted-2); }
.empty { padding: 42px 12px; text-align: center; font-size: 11px; color: var(--muted-2); }
.chip { border: 1px solid var(--line); background: var(--paper-2); color: var(--muted); border-radius: 999px; padding: 7px 12px; font-size: 10.5px; }
.chip.active { background: var(--mint); color: var(--jade); border-color: transparent; font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============ FORMS / MODAL ============ */
.field { margin-top: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 10.5px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  outline: none; background: var(--paper-2); color: var(--ink); font-size: 12px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--jade-2); background: #fff; }
.auto-value { width: 100%; padding: 10px 12px; border: 1px dashed var(--mint-2); border-radius: 10px; background: var(--mint); color: var(--jade); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.field textarea { resize: vertical; line-height: 1.7; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 0; border-radius: 10px;
  background: var(--paper-2); color: var(--ink);
  font-size: 12px; font-weight: 700;
}
.btn-primary { background: var(--jade); color: #fff; }
.btn-primary:hover { background: var(--jade-2); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #bcc7ba; }
.btn-sm { padding: 7px 10px; border-radius: 8px; font-size: 10.5px; }
.error { min-height: 18px; margin-top: 10px; color: var(--coral); font-size: 11px; }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(16, 33, 28, .46); }
.modal-card { width: min(620px, 100%); max-height: 86vh; overflow: auto; padding: 22px; border-radius: 16px; background: #fff; box-shadow: 0 30px 80px rgba(16, 33, 28, .25); }
.modal-card h3 { margin: 0 0 14px; font-family: var(--serif); font-size: 20px; }
.modal-card.modal-wide { width: min(760px, 100%); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ============ DRAWER ============ */
.drawer-mask {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(16, 33, 28, .42);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
  width: min(480px, 100vw);
  display: flex; flex-direction: column;
  background: #fff;
  box-shadow: -20px 0 70px rgba(16, 33, 28, .2);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .24s ease, visibility .24s ease;
}
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: translateX(0); visibility: visible; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head > div { min-width: 0; }
.drawer-head h2 { margin: 8px 0 6px; font-family: var(--serif); font-size: 19px; line-height: 1.45; }
.drawer-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 9.5px; color: var(--muted-2); }
.drawer-meta span { white-space: nowrap; }
.icon-btn { width: 30px; height: 30px; display: grid; place-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); flex: none; }
.icon-btn:hover { border-color: #bfc8b9; color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; }
.student-card { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 16px; border-radius: 12px; background: var(--paper-2); }
.student-card .avatar { width: 36px; height: 36px; }
.student-card > div { min-width: 0; }
.student-card b { display: block; font-size: 12px; }
.student-card span { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.student-card .badge { margin-left: auto; flex: none; }
.modal-card.modal-student { width: min(920px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.student-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.student-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.student-section-head h4 { margin: 0; font-family: var(--serif); font-size: 14px; }
.student-section-head span { font-size: 9.5px; color: var(--muted-2); }
.student-table th { padding: 7px 6px; font-size: 9px; }
.student-table td { padding: 8px 6px; vertical-align: top; font-size: 10.5px; }
.student-table tbody tr { cursor: pointer; }
.student-table tbody tr:hover { background: var(--paper-2); }
.student-table tbody tr:focus-visible { outline: 2px solid var(--jade-2); outline-offset: -2px; background: var(--paper-2); }
.student-arrow { width: 18px; color: var(--muted-2); text-align: right; font-size: 15px; line-height: 1.2; }
.student-empty { padding: 10px 12px; border-radius: 8px; background: var(--paper-2); color: var(--muted-2); font-size: 10px; }
.student-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.student-modal-head h3 { margin: 0; }
.student-modal-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--muted); font-size: 18px; line-height: 1; display: grid; place-items: center; flex: none; }
.student-modal-close:hover { background: var(--coral-soft); color: var(--coral); }
.student-record-head { margin-bottom: 10px; }
.student-record-head .link { padding-left: 0; }
.student-record-head-right { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 10px; }
.modal-card.modal-student .student-modal-body { flex: 1; min-height: 0; overflow: auto; padding-right: 4px; overscroll-behavior: contain; }
.modal-card.modal-student .modal-actions { position: static; flex: none; margin-top: 14px; padding-top: 12px; background: #fff; border-top: 1px solid var(--line); }
.detail-block { margin-bottom: 16px; }
.detail-block > label { display: block; margin-bottom: 6px; font-size: 9px; letter-spacing: .14em; color: var(--muted-2); text-transform: uppercase; }
.detail-block p { margin: 0; font-size: 11.5px; line-height: 1.85; color: var(--ink-2); }
.loc { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 8px; background: var(--paper-2); font-size: 10.5px; color: var(--muted); }
.loc svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.timeline { display: flex; flex-direction: column; }
.tl-item { position: relative; padding: 0 0 14px 18px; border-left: 1px solid var(--line); }
.tl-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl-item::before { content: ""; position: absolute; left: -4px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }
.tl-item.current::before { background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); }
.tl-item b { display: block; font-size: 11px; line-height: 1.5; }
.tl-item span { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.6; color: var(--muted-2); }
.drawer-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: #fff; }
.drawer-foot .muted { font-size: 10.5px; }

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: #0b1a16; color: #f4f1e7;
  font-size: 11px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .22s, transform .22s;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .search-wrap { width: 220px; }
  .operator { display: none; }
}

@media (max-width: 900px) {
  .side { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .side .brand { width: 100%; padding: 0 4px 8px; }
  .nav-group, .side-spacer, .side-foot { display: none; }
  .nav-list { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 100%; }
  .nav { width: auto; height: 32px; padding: 0 10px; font-size: 10.5px; }
  .nav .count { margin-left: 4px; }
  .side-user { width: 100%; padding: 8px 4px 0; border-top: 0; }
  .main { margin-left: 0; }
  .topbar { height: auto; min-height: 58px; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .search-wrap { order: 3; width: 100%; margin: 0; }
  .top-right { gap: 6px; }
  .content-wrap { padding: 14px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .h-actions { width: 100%; }
  .table-panel { overflow-x: auto; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .table-search { flex: 1; width: auto; min-width: 160px; }
  .panel { overflow-x: auto; }
  .drawer { width: 100%; }
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 600px) {
  .kpi-grid, .mini-grid, .mini-grid.nine { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .bar-row.wide { grid-template-columns: 100px 1fr 44px; }
  .trend-chart { gap: 4px; }
  .trend-bars i { width: 3px; }
  .page-head h1 { font-size: 23px; }
  .top-btn span { display: none; }
  .top-btn { width: 32px; justify-content: center; padding: 0; }
  .modal-card { padding: 18px; }
  .grid2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============ PRODUCTION MODULES ============ */
.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.assign-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); }
.assign-box span { display: block; font-size: 9px; color: var(--muted-2); }
.assign-box b { display: block; margin-top: 3px; font-size: 11px; line-height: 1.5; }
.sla-line { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; background: var(--paper-2); font-size: 10px; color: var(--muted); }
.sla-line.hot { background: var(--coral-soft); color: #a53c1f; }
.sla-line b { font-size: 10.5px; }
.sla-line .spacer { flex: 1; }
.advice-box { display: flex; gap: 8px; padding: 10px 12px; border: 1px solid #d9ece1; background: #f2f8f4; border-radius: 9px; font-size: 10px; line-height: 1.75; color: #3f5f50; }
.advice-box b { display: block; color: var(--jade); font-size: 10px; margin-bottom: 2px; }
.advice-box span { display: block; font-size: 9.5px; line-height: 1.7; }

.merchant-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 12px; align-items: start; }
#merchantTable { overflow-x: auto; }
#merchantTable table { min-width: 660px; }
.merchant-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.settlement-big { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1; }
.settlement-big small { font-family: var(--sans); font-size: 9px; color: var(--muted-2); font-weight: 400; margin-left: 6px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.progress-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--jade), var(--jade-3)); }
.rail-kv { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 9.5px; color: var(--muted-2); }
.rail-kv b { font-family: var(--mono); font-size: 9.5px; color: var(--ink); }
.rail-list { display: flex; flex-direction: column; }
.rail-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.rail-row:last-child { border-bottom: 0; }
.rail-row .rail-main { flex: 1; min-width: 0; }
.rail-row .rail-main b { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-row .rail-main span { display: block; margin-top: 2px; font-size: 8.5px; color: var(--muted-2); }
.rail-row .rail-val { font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; }
.rail-empty { padding: 14px 4px; text-align: center; font-size: 10px; color: var(--muted-2); }
.rail-actions { display: flex; gap: 6px; margin-top: 10px; }
.rail-actions .btn2 { flex: 1; justify-content: center; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { width: 100%; min-width: 360px; border-collapse: separate; border-spacing: 4px; }
.heatmap th { font-size: 8.5px; font-weight: 500; color: var(--muted-2); padding: 2px; text-align: center; }
.heatmap th:first-child { text-align: left; }
.heatmap td { height: 34px; border-radius: 6px; text-align: center; font-family: var(--mono); font-size: 8.5px; color: #fff; background: var(--paper-2); }
.heatmap td.future { background: transparent; color: var(--muted-2); }
.heatmap td.heat-1 { background: #b7e0cc; color: #0d5b4a; }
.heatmap td.heat-2 { background: #8fd3b5; color: #0d5b4a; }
.heatmap td.heat-3 { background: #45b08c; }
.heatmap td.heat-4 { background: #14765f; }
.heatmap td.heat-5 { background: #0d5b4a; }
.sla-kpi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sla-kpi > div { padding: 10px; border-radius: 8px; background: var(--paper-2); }
.sla-kpi b { display: block; font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.sla-kpi span { display: block; margin-top: 2px; font-size: 8.5px; color: var(--muted-2); }
.sla-list { margin-top: 10px; }
.sla-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 9.5px; color: var(--muted); }
.sla-row:last-child { border-bottom: 0; }
.sla-row b { font-family: var(--mono); font-size: 9px; color: var(--coral); }
.rank-note { margin-top: 10px; font-size: 9px; line-height: 1.7; color: var(--muted-2); }
.rank-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1200px) {
  .merchant-layout { grid-template-columns: 1fr; }
  .merchant-rail { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .merchant-rail { grid-template-columns: 1fr; }
  .assign-grid { grid-template-columns: 1fr; }
  .sla-kpi { grid-template-columns: 1fr; }
}

/* ============ REDEMPTION REVIEW ============ */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.evidence-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.evidence-card h4 { margin: 0 0 8px; font-size: 11px; }
.review-compare { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.review-flags { margin: 10px 0 0; padding-left: 17px; font-size: 10px; line-height: 1.8; color: var(--coral); }
.proof-box { margin-top: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }
.proof-box img { display: block; max-width: 100%; max-height: 380px; margin: 0 auto; border-radius: 8px; }
.reviewed-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 9px; background: var(--paper-2); font-size: 10px; color: var(--muted); }
@media (max-width: 700px) {
  .review-grid { grid-template-columns: 1fr; }
}
