:root {
  --fs-primary: #14b8a6;
  --fs-primary-strong: #0d9488;
  --fs-primary-soft: #ccfbf1;
  --fs-ink: #0f172a;
  --fs-slate: #334155;
  --fs-muted: #64748b;
  --fs-line: rgba(15, 118, 110, 0.14);
  --fs-surface: rgba(255, 255, 255, 0.78);
  --fs-surface-strong: rgba(255, 255, 255, 0.92);
  --fs-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100vh; }
body {
  margin: 0;
  color: var(--fs-slate);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background-color: #f8fcfb;
  background-image:
    linear-gradient(180deg, rgba(204, 251, 241, 0.46) 0, rgba(248, 252, 251, 0) 220px),
    linear-gradient(rgba(20, 184, 166, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.035) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
}
a { color: var(--fs-primary-strong); }
a:hover { color: #0f766e; }

.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-width: 0; min-height: 100vh; }

aside.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-self: start;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--fs-line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 10px 0 28px rgba(15, 118, 110, 0.035);
  backdrop-filter: blur(18px);
}

.sidebar .brand {
  position: relative;
  min-height: 92px;
  padding: 23px 20px 18px 68px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.1);
}
.sidebar .brand::before {
  position: absolute;
  top: 24px;
  left: 20px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, #0f172a 0%, #0f766e 100%);
  box-shadow: 0 8px 16px rgba(13, 148, 136, 0.24);
  content: "";
}
.sidebar .brand::after {
  position: absolute;
  top: 33px;
  left: 28px;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: #99f6e4;
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.92);
  content: "";
  transform: rotate(-28deg);
}
.sidebar .brand-name { color: var(--fs-ink); font-size: 15px; font-weight: 750; line-height: 1.25; }
.sidebar .brand-sub { margin-top: 3px; color: var(--fs-muted); font-size: 11px; letter-spacing: 0.04em; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 4px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.sidebar nav a:hover {
  border-color: rgba(20, 184, 166, 0.12);
  background: rgba(240, 253, 250, 0.88);
  color: #0f766e;
  transform: translateX(2px);
}
.sidebar nav a.active {
  border-color: rgba(20, 184, 166, 0.2);
  background: linear-gradient(90deg, #ccfbf1 0%, rgba(240, 253, 250, 0.52) 100%);
  color: #0f766e;
  font-weight: 700;
}
.sidebar nav a.active::before {
  position: absolute;
  top: 10px;
  left: -13px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--fs-primary);
  content: "";
}
.sidebar nav a .ico {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 8px;
  color: #0f766e;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  background: rgba(204, 251, 241, 0.52);
}
.sidebar nav a.active .ico { color: #ffffff; background: linear-gradient(145deg, #14b8a6, #0d9488); box-shadow: 0 5px 10px rgba(20, 184, 166, 0.22); }
.sidebar nav a .ico svg { width: 15px; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }

.sidebar .userbox {
  margin: 0 12px 12px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 12px;
  background: rgba(240, 253, 250, 0.68);
  font-size: 12px;
}
.sidebar .userbox .email { overflow: hidden; margin-bottom: 8px; color: var(--fs-ink); font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .userbox .role { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: #ccfbf1; color: #0f766e; font-size: 11px; font-weight: 650; }
.sidebar .userbox .role.admin { background: #ede9fe; color: #6d28d9; }
.sidebar .userbox .bal { margin-left: 6px; color: #0f766e; font-size: 12px; font-weight: 700; }
.sidebar .userbox .row { display: flex; gap: 8px; margin-top: 12px; }
.sidebar .userbox .row .btn { flex: 1; padding: 6px 8px; font-size: 11.5px; }

main.content { width: min(100%, 1480px); min-width: 0; padding: 34px clamp(22px, 3vw, 48px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.page-head h1 { color: var(--fs-ink); font-size: 25px; font-weight: 760; letter-spacing: 0; line-height: 1.2; }
.page-head h1::after { display: block; width: 34px; height: 3px; margin-top: 9px; border-radius: 99px; background: linear-gradient(90deg, #14b8a6, #5eead4); content: ""; }
.page-head .sub { max-width: 680px; margin-top: 8px; color: var(--fs-muted); font-size: 13px; }

.section { display: none; animation: section-enter .22s ease both; }
.section.active { display: block; }
@keyframes section-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel {
  border: 1px solid rgba(15, 118, 110, 0.13) !important;
  background: var(--fs-surface) !important;
  box-shadow: var(--fs-shadow);
  backdrop-filter: blur(18px);
}
.card {
  position: relative;
  min-height: 116px;
  overflow: hidden;
  padding: 18px !important;
  border-radius: 16px !important;
}
.card::before { position: absolute; top: 0; right: 18px; left: 18px; height: 3px; border-radius: 0 0 4px 4px; background: #14b8a6; content: ""; opacity: .95; }
.card:nth-child(3n+2)::before { background: #3b82f6; }
.card:nth-child(3n)::before { background: #8b5cf6; }
.card .lbl { margin-bottom: 10px; color: var(--fs-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.015em; }
.card .num { color: var(--fs-ink); font-size: 28px; font-weight: 760; letter-spacing: 0; line-height: 1; }
.card .num .unit { margin-left: 5px; color: var(--fs-muted); font-size: 12px; font-weight: 500; }
.card .delta { margin-top: 8px; color: #059669; font-size: 11.5px; font-weight: 600; }
.card .delta.neg { color: #dc2626; }

.panel { min-width: 0; margin-bottom: 18px; padding: 20px !important; border-radius: 16px !important; }
.panel h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(15, 118, 110, 0.1); color: var(--fs-ink); font-size: 14px; font-weight: 730; }
.panel h3::before { width: 7px; height: 7px; border-radius: 50%; background: var(--fs-primary); box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.13); content: ""; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; color: #334155; font-size: 12.5px; }
.tbl th { padding: 10px 10px; border-top: 1px solid rgba(15, 118, 110, 0.1); border-bottom: 1px solid rgba(15, 118, 110, 0.1); background: rgba(240, 253, 250, 0.62); color: #475569; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-align: left; white-space: nowrap; }
.tbl th:first-child { border-left: 1px solid rgba(15, 118, 110, 0.1); border-radius: 10px 0 0 10px; }
.tbl th:last-child { border-right: 1px solid rgba(15, 118, 110, 0.1); border-radius: 0 10px 10px 0; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid rgba(15, 118, 110, 0.08); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .16s ease; }
.tbl tbody tr:hover { background: rgba(240, 253, 250, 0.72); }
.tbl .mono { color: #334155; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; }
.tbl .actions { text-align: right; white-space: nowrap; }

.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.2; }
.tag.ok, .tag.used { background: #d1fae5; color: #047857; }
.tag.disabled, .tag.void { background: #f1f5f9; color: #64748b; }
.tag.revoked, .tag.failed { background: #fee2e2; color: #b91c1c; }
.tag.admin { background: #ede9fe; color: #6d28d9; }
.tag.unused { background: #ccfbf1; color: #0f766e; }

.btn {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: box-shadow .18s ease, transform .18s ease, background-color .18s ease, border-color .18s ease;
}
.btn:hover { background: #ffffff; border-color: rgba(20, 184, 166, 0.2); box-shadow: 0 4px 12px rgba(15, 118, 110, 0.1); transform: translateY(-1px); }
.btn.primary { border-color: transparent; background: linear-gradient(90deg, #14b8a6, #0d9488); color: #ffffff; box-shadow: 0 5px 14px rgba(20, 184, 166, 0.26); }
.btn.primary:hover { background: linear-gradient(90deg, #2dd4bf, #0f766e); color: #ffffff; }
.btn.ghost { border-color: rgba(15, 118, 110, 0.16); background: rgba(255, 255, 255, 0.72); color: #475569; }
.btn.danger { border-color: #fecaca; background: #fffafa; color: #dc2626; }
.btn.danger:hover { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.btn.tiny { min-height: 28px; padding: 5px 9px; border-radius: 8px; font-size: 11px; }
.btn[disabled] { cursor: not-allowed; opacity: .5; transform: none; }

input.txt, select.sel, input[type="file"].txt {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dbe5e4;
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--fs-ink);
  font: inherit;
  font-size: 12.5px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
input.txt:hover, select.sel:hover { border-color: #99d9d2; }
input.txt:focus, select.sel:focus { border-color: var(--fs-primary); box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14); background: #ffffff; }
input.txt::placeholder { color: #94a3b8; }
label { color: #475569 !important; font-weight: 650; }
.muted { color: var(--fs-muted) !important; }
#credit-balance-display { color: var(--fs-primary-strong) !important; font-weight: 760 !important; }

.bar-chart { display: grid; grid-template-columns: repeat(7, minmax(24px, 1fr)); gap: 9px; align-items: end; height: 146px; padding: 10px 5px 6px; }
.bar-chart .bar { min-height: 3px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, #5eead4 0%, #14b8a6 58%, #0d9488 100%); box-shadow: 0 7px 12px rgba(20, 184, 166, 0.16); position: relative; }
.bar-chart .bar .v { position: absolute; right: 0; bottom: -22px; left: 0; color: #64748b; font-size: 10px; text-align: center; }
.bar-chart .bar .h { position: absolute; top: -17px; right: 0; left: 0; color: #334155; font-size: 10px; font-weight: 700; text-align: center; }

.modal-mask { position: fixed; z-index: 1000; inset: 0; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(15, 23, 42, 0.42); backdrop-filter: blur(6px); }
.modal-mask.show { display: flex; }
.modal { width: min(520px, 100%); max-height: min(88vh, 720px); overflow: auto; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.72); border-radius: 18px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22); }
.modal h3 { margin: 0 0 18px; color: var(--fs-ink); font-size: 17px; font-weight: 750; }
.modal .row { margin-bottom: 14px; }
.modal .row label { display: block; margin-bottom: 6px; font-size: 12px; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.modal pre { border-radius: 12px !important; }

.toast { position: fixed; z-index: 1100; top: 18px; right: 18px; width: min(360px, calc(100vw - 36px)); }
.toast .item { margin-bottom: 8px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: #0f172a; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22); color: #ffffff; font-size: 12.5px; font-weight: 600; }
.toast .item.ok { background: linear-gradient(90deg, #059669, #0d9488); }
.toast .item.err { background: linear-gradient(90deg, #dc2626, #b91c1c); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; color: var(--fs-muted); font-size: 12px; }

/* 在线识别：分段流光进度条（阶段点亮式，无需读文字即可感知进度） */
.recognition-pipeline { margin-top: 14px; padding: 14px 18px 13px; border: 1px solid rgba(20, 184, 166, .14); border-radius: 14px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 118, 110, .06); }
.recognition-pipe-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.recognition-pipe-head .recog-pipe-title { color: var(--fs-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.recognition-pipe-head .recog-pipe-state { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: rgba(20, 184, 166, .1); color: #0f766e; font-size: 11px; font-weight: 700; }
.recognition-pipe-state .recog-state-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.recognition-pipeline:not(.is-done):not(.is-error) .recog-state-dot { animation: recognition-pulse 1.2s ease-in-out infinite; }
.recognition-pipeline.is-done .recog-pipe-state { background: rgba(16, 185, 129, .1); color: #047857; }
.recognition-pipeline.is-error .recog-pipe-state { background: rgba(239, 68, 68, .1); color: #b91c1c; }
.recognition-pipe-head time { margin-left: auto; color: var(--fs-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* 分段进度条：轨道内嵌阶段刻度，流光填充点亮已完成的段。 */
.recognition-bar { position: relative; display: flex; gap: 3px; height: 10px; }
.recognition-bar-seg { position: relative; flex: 1 1 0; overflow: hidden; border-radius: 999px; background: rgba(15, 118, 110, .08); }
/* 段内填充：由进度百分比决定该段填充比例；段满时呈现 teal 渐变+顶部高光。 */
.recognition-bar-seg .seg-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: inherit; background: linear-gradient(90deg, #2dd4bf, #0d9488); transition: width .6s cubic-bezier(.22, .8, .36, 1); }
.recognition-bar-seg .seg-fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255, 255, 255, .38) 0, rgba(255, 255, 255, 0) 55%); }
/* 已满段尾部流光扫过（仅对"刚被点亮"的段做一次，用 .seg-lit 触发）。 */
.recognition-bar-seg.seg-lit .seg-fill { background: linear-gradient(90deg, #2dd4bf, #0d9488); }
.recognition-bar-seg.seg-lit .seg-fill::before { content: ""; position: absolute; top: 0; bottom: 0; width: 34%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: recognition-seg-sweep .9s ease-out 1 both; }
/* 出错段标红。 */
.recognition-pipeline.is-error .recognition-bar-seg.seg-error .seg-fill { background: linear-gradient(90deg, #f87171, #dc2626); }
/* 完成态：全部段变绿。 */
.recognition-pipeline.is-done .recognition-bar-seg .seg-fill { background: linear-gradient(90deg, #34d399, #059669); }
/* 活动段（当前进行中）呼吸微光。 */
.recognition-bar-seg.seg-active .seg-fill { box-shadow: 0 0 8px rgba(20, 184, 166, .5); animation: recognition-seg-glow 1.3s ease-in-out infinite; }
@keyframes recognition-seg-sweep { from { transform: translateX(-120%); } to { transform: translateX(340%); } }
@keyframes recognition-seg-glow { 0%, 100% { box-shadow: 0 0 4px rgba(20, 184, 166, .35); } 50% { box-shadow: 0 0 10px rgba(20, 184, 166, .65); } }
@keyframes recognition-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .recognition-bar-seg.seg-active .seg-fill, .recognition-pipe-state .recog-state-dot { animation: none; }
  .recognition-bar-seg.seg-lit .seg-fill::before { animation: none; opacity: 0; }
}
/* 发票图片选择按钮：替代浏览器原生 file 控件。 */
.recog-file-btn { display: inline-flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; justify-content: flex-start; padding: 8px 14px; border-radius: 10px; }
.recog-file-btn svg { flex: 0 0 15px; color: var(--fs-primary-strong); }
.recog-file-btn #recog-file-name { overflow: hidden; color: var(--fs-slate); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.recog-file-btn.has-file { border-color: rgba(20, 184, 166, .38); background: rgba(240, 253, 250, .8); }
.recog-file-btn.has-file #recog-file-name { color: #0f766e; font-weight: 700; }
.recog-file-btn:focus-visible { outline: 3px solid rgba(20, 184, 166, .28); outline-offset: 2px; }

.recognition-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 26px 0 14px; }
.recognition-result-head h2 { color: var(--fs-ink); font-size: 20px; }
.recognition-result-head p { margin-top: 4px; color: var(--fs-muted); font-size: 12px; }
.recognition-summary { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.recognition-metric { position: relative; overflow: hidden; min-height: 88px; padding: 13px 14px; border: 1px solid rgba(15, 118, 110, .12); border-radius: 14px; background: rgba(255,255,255,.78); box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.recognition-metric span { display: block; color: var(--fs-muted); font-size: 11px; }
.recognition-metric strong { display: block; overflow: hidden; margin-top: 8px; color: var(--fs-ink); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recognition-metric.primary { border-color: rgba(13, 148, 136, .35); background: linear-gradient(135deg, #0f766e 0, #14b8a6 100%); box-shadow: 0 10px 26px rgba(13, 148, 136, .3); }
.recognition-metric.primary span { color: rgba(240, 253, 250, .85); }
.recognition-metric.primary strong { color: #fff; font-size: 24px; letter-spacing: .01em; }
.recognition-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.recognition-image { margin: 0; min-width: 0; }
.recognition-image figcaption { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #334155; font-size: 12px; font-weight: 700; }
.recognition-image img { display: block; width: 100%; height: 360px; border: 1px solid rgba(15, 118, 110, .14); border-radius: 12px; background: #f8fafc; object-fit: contain; }
.recognition-zoomable { cursor: zoom-in; }
.recognition-zoomable:focus { outline: 3px solid rgba(20,184,166,.28); outline-offset: 2px; }
/* 页面内大图预览层（Lightbox）。 */
#recog-lightbox { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 32px; background: rgba(15, 23, 42, .78); backdrop-filter: blur(6px); }
#recog-lightbox.open { display: flex; }
#recog-lightbox img { max-width: min(1100px, 92vw); max-height: 88vh; border-radius: 12px; background: #fff; box-shadow: 0 24px 64px rgba(0, 0, 0, .45); object-fit: contain; }
#recog-lightbox .recog-lightbox-close { position: absolute; top: 18px; right: 22px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
#recog-lightbox .recog-lightbox-close:hover { background: rgba(255, 255, 255, .28); }
.recognition-image-empty { display: grid; height: 360px; place-items: center; border: 1px dashed rgba(15, 118, 110, .2); border-radius: 12px; background: rgba(248,250,252,.72); color: var(--fs-muted); font-size: 12px; }
.recognition-party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.recognition-party h4 { margin-bottom: 10px; color: var(--fs-ink); font-size: 13px; }
.recognition-fields { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 7px 10px; margin: 0; }
.recognition-fields dt { color: var(--fs-muted); font-size: 11px; }
.recognition-fields dd { min-width: 0; margin: 0; color: #334155; font-size: 12px; word-break: break-word; }
.recognition-table-wrap { overflow-x: auto; border: 1px solid rgba(15, 118, 110, .1); border-radius: 12px; }
.recognition-table-wrap .tbl { margin: 0; border: 0; }
.recognition-items { min-width: 980px; }
.recognition-items td:nth-child(2), .recognition-items td:nth-child(3) { min-width: 150px; }
.recognition-items th:nth-child(n+5), .recognition-items td:nth-child(n+5) { text-align: right; font-variant-numeric: tabular-nums; }
.recognition-items tbody tr:nth-child(even) { background: rgba(240, 253, 250, .55); }
.recognition-table-wrap .tbl th:nth-child(n+2), .recognition-table-wrap .tbl td:nth-child(n+2) { text-align: right; }
.recognition-table-wrap .tbl th:first-child, .recognition-table-wrap .tbl td:first-child { text-align: left; }
.recognition-review { display: flex; align-items: center; gap: 10px; }
.recognition-review .status-ok { background: #d1fae5; color: #047857; }
.recognition-review .status-review { background: #fef3c7; color: #92400e; }
.recognition-review .status-failed { background: #fee2e2; color: #b91c1c; }
.recognition-raw { margin-top: 16px; border-top: 1px solid rgba(15, 118, 110, .1); padding-top: 12px; }
.recognition-raw summary { color: #0f766e; cursor: pointer; font-size: 12px; font-weight: 700; }
.recognition-json { max-height: 520px; margin-top: 10px; overflow: auto; padding: 14px; border-radius: 12px; background: #0f172a; color: #e2e8f0; font: 11px/1.65 Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
@keyframes recognition-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside.sidebar { position: sticky; top: 0; display: block; width: 100%; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--fs-line); }
  .sidebar .brand { min-height: 62px; padding: 17px 16px 10px 58px; border-bottom: 0; }
  .sidebar .brand::before { top: 15px; left: 16px; width: 28px; height: 28px; border-radius: 9px; }
  .sidebar .brand::after { top: 23px; left: 23px; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 10px; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { min-height: 36px; flex: 0 0 auto; margin: 0; padding: 6px 9px; font-size: 12px; }
  .sidebar nav a.active::before { display: none; }
  .sidebar nav a .ico { width: 21px; height: 21px; flex-basis: 21px; border-radius: 7px; font-size: 12px; }
  .sidebar .userbox { display: none; }
  main.content { padding: 24px 16px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-head h1 { font-size: 22px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { min-height: 102px; padding: 15px !important; }
  .card .num { font-size: 24px; }
  .panel { overflow-x: auto; padding: 16px !important; }
  .tbl { min-width: 650px; }
  .page-head > div[style] { width: 100%; flex-wrap: wrap; }
  .recognition-images, .recognition-party-grid { grid-template-columns: 1fr; }
  .recognition-bar { height: 10px; }
  .recognition-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recognition-metric.primary { grid-column: span 2; }
  .recognition-image img, .recognition-image-empty { height: 280px; }
}

@media (max-width: 460px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 94px; }
  .btn { min-height: 32px; }
}
