:root {
  --bg: #f4f3ee;
  --paper: #ffffff;
  --ink: #17181a;
  --muted: #6f7378;
  --line: #e4e2da;
  --line-strong: #d3d0c6;
  --green: #1f6f4a;
  --green-soft: #e7f2ec;
  --orange: #b4611b;
  --orange-soft: #fbf0e3;
  --red: #b23a32;
  --red-soft: #fbeae7;
  --blue: #2c5d8f;
  --blue-soft: #eaf1f8;
  --purple: #6a4a8f;
  --purple-soft: #f0ebf7;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 28px rgba(20, 22, 26, .05);
  --radius: 14px;
  --sidebar: 236px;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: 28px; line-height: 1.25; }
h2 { font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 620; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: inline; }

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

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #14161a;
  color: #c9ccd1;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 22px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: #e9ff6b; color: #14161a;
  font-weight: 800; font-size: 17px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 14.5px; letter-spacing: .01em; }
.brand-text small { color: #71767e; font-size: 9px; letter-spacing: .18em; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: #a8adb5; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #1e2127; color: #fff; }
.nav-item.active { background: #262a31; color: #fff; }
.nav-item.active .ico { color: #e9ff6b; }
.ico { width: 18px; text-align: center; font-size: 14px; color: #767c85; }
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #e9ff6b; }
.side-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid #24272d; }
.src { font-size: 10.5px; color: #767c85; line-height: 1.5; }
.live {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #63d18b; margin-right: 5px; box-shadow: 0 0 0 3px rgba(99,209,139,.12);
}
.side-link { display: inline-block; margin-top: 10px; font-size: 12px; color: #a8adb5; }
.side-link:hover { color: #e9ff6b; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 243, 238, .86);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; font-size: 13px; color: var(--muted); margin-right: 6px; }
.bell:hover { color: var(--ink); }
.badge-dot {
  position: absolute; top: -8px; right: -14px;
  background: var(--red); color: #fff; font-size: 9.5px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: grid; place-items: center; padding: 0 4px;
}
.page { padding: 26px 28px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
.foot { margin-top: auto; padding: 18px 28px; border-top: 1px solid var(--line); font-size: 11px; color: #9a9d9f; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 560; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #191b1e; color: #fff; }
.btn-primary:hover { background: #2c3036; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: #fff; border-color: #b9b5a9; }
.btn-dark { background: var(--green); color: #fff; }
.btn-dark:hover { background: #185a3c; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { color: var(--green); font-weight: 550; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }
.back { display: inline-block; margin-bottom: 14px; font-size: 12.5px; color: var(--muted); }
.back:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { display: flex; justify-content: space-between; gap: 24px; margin: 6px 0 22px; }
.eyebrow { font-size: 9.5px; letter-spacing: .2em; color: #8d9093; margin-bottom: 10px; }
.hero h1 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 620; }
.hero h1 em { font-style: normal; color: var(--green); }
.lede { color: var(--muted); font-size: 13px; margin-top: 8px; }
.run-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 15px; min-width: 230px; box-shadow: var(--shadow);
}
.run-head { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.run-time { font-size: 14px; font-weight: 600; margin: 3px 0; display: flex; gap: 8px; align-items: center; }
.run-time span { font-size: 10px; font-weight: 500; padding: 1px 6px; border-radius: 5px; background: var(--green-soft); color: var(--green); }
.run-time .status-error { background: var(--red-soft); color: var(--red); }
.run-meta { font-size: 11px; color: var(--muted); }

/* ---------- kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 13px; transition: border-color .15s, box-shadow .15s;
}
.kpi:hover { border-color: #c9c5b8; box-shadow: var(--shadow); }
.kpi-label { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.kpi-value { font-size: 27px; font-weight: 620; letter-spacing: -.03em; margin: 2px 0 1px; }
.kpi-value.accent-danger { color: var(--red); }
.kpi-foot { font-size: 10.5px; color: #9a9d9f; }

/* ---------- panels ---------- */
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-flush .panel-head { padding: 16px 20px 0; }
.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.split { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }

/* ---------- table ---------- */
.table { width: 100%; border-collapse: collapse; }
.notice-table th:nth-child(1) { width: 44%; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #8d9093;
  padding: 10px 14px; background: #faf9f5; border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 14px; border-bottom: 1px solid #efede6; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfaf6; }
.title-link { font-weight: 560; line-height: 1.45; display: block; }
.title-link:hover { color: var(--green); }
.sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.arrow { color: #b0b3b6; font-size: 15px; }
.arrow:hover { color: var(--ink); }
.empty { padding: 34px 16px; text-align: center; color: #9a9d9f; font-size: 12.5px; }

/* ---------- tags & pills ---------- */
.tag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 6px;
  border-radius: 4px; font-size: 10.5px; font-weight: 550; white-space: nowrap;
}
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-orange { background: var(--orange-soft); color: var(--orange); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-purple { background: var(--purple-soft); color: var(--purple); }
.tag-grey { background: #f0efea; color: #6f7378; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-warn { background: var(--orange-soft); color: var(--orange); }
.pill-danger { background: var(--red-soft); color: var(--red); }
.pill-dead { background: #eee; color: #888; }
.row-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { padding: 10px 0; border-bottom: 1px solid #efede6; }
.feed-item:last-child { border-bottom: none; }
.feed-item:hover .feed-title { color: var(--green); }
.feed-top { display: flex; justify-content: space-between; font-size: 10.5px; color: #9a9d9f; }
.feed-title { font-size: 13px; font-weight: 550; line-height: 1.45; margin: 2px 0 4px; }
.feed-meta { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.dot { color: #c8c6bd; }

/* ---------- notice strip ---------- */
.notice-strip {
  display: flex; align-items: center; gap: 14px;
  background: #fffdf4; border: 1px solid #efe3c4; border-radius: 11px;
  padding: 9px 14px; margin-bottom: 16px;
}
.strip-label { font-size: 10px; letter-spacing: .12em; color: var(--orange); font-weight: 700; }
.strip-body { flex: 1; display: flex; gap: 16px; overflow: hidden; }
.strip-item { font-size: 12px; color: #79551d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-item.danger { color: var(--red); }
.strip-more { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- filters ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.filters {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field.grow { flex: 1; min-width: 200px; }
.field.bw { width: 190px; }
.field label { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
input[type=text], input[type=search], input[type=number], input[type=date],
input[type=time], input[type=password], input:not([type]), select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: #fff; outline: none; width: 100%;
}
textarea { height: auto; padding: 8px 10px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8f8a7c; box-shadow: 0 0 0 3px rgba(20,22,26,.05); }
.range { display: flex; align-items: center; gap: 5px; }
.range span { color: #b0b3b6; }
.seg { display: flex; background: #eae8e1; border-radius: 9px; padding: 3px; }
.seg-item { padding: 5px 12px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.seg-item.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* ---------- detail ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 16px; }
.detail-main h1 { font-size: 24px; line-height: 1.35; max-width: 880px; }
.detail-sub { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 270px; gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.facts > div { padding: 9px 0; border-bottom: 1px dashed #eceae2; }
.facts > div:nth-last-child(-n+2) { border-bottom: none; }
.facts dt { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 13px; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.side-card-label { font-size: 10px; letter-spacing: .1em; color: #9a9d9f; margin-bottom: 6px; }
.countdown-big { font-size: 22px; font-weight: 620; margin-bottom: 2px; }
.doc {
  white-space: pre-wrap; word-break: break-word; font-family: var(--mono);
  font-size: 11.5px; line-height: 1.75; color: #414449; background: #fbfaf6;
  border: 1px solid #efede6; border-radius: 9px; padding: 16px;
  max-height: 520px; overflow: auto; margin: 0;
}
.callout { padding: 10px 14px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px; border: 1px solid; }
.callout.info { background: var(--blue-soft); border-color: #cfe0f0; color: #2c4f70; }
.callout.warn { background: var(--orange-soft); border-color: #f0d9bb; color: #7b4717; }
.callout.danger { background: var(--red-soft); border-color: #f0cdc8; color: #7d2a24; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 11px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.form label input, .form label select, .form label textarea { color: var(--ink); font-size: 13px; }
.form-row { display: flex; gap: 10px; }
.form-row > label { flex: 1; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }
.form-actions.sticky { position: sticky; bottom: 14px; background: rgba(244,243,238,.9); padding: 10px; border-radius: 10px; backdrop-filter: blur(6px); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.form-card h2 { margin-bottom: 14px; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.check { flex-direction: row !important; align-items: center; gap: 5px !important; font-size: 12px !important; color: var(--ink) !important; }
.check input { width: auto; height: auto; }
.settings { max-width: 900px; }
.settings .panel { padding: 20px 22px; }
.settings .panel-head { margin-bottom: 14px; }

/* ---------- alerts ---------- */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px;
}
.alert-item.warning { border-left-color: var(--orange); }
.alert-item.danger { border-left-color: var(--red); }
.alert-item.info { border-left-color: var(--blue); }
.alert-item.read { opacity: .55; }
.alert-icon {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange-soft); color: var(--orange); font-weight: 700; font-size: 12px; flex: 0 0 22px;
}
.alert-item.danger .alert-icon { background: var(--red-soft); color: var(--red); }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; font-size: 13px; }
.alert-text { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.alert-time { font-size: 10.5px; color: #a3a6a8; margin-top: 4px; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { padding: 2px 12px 0 0; border-right: 1px dashed var(--line); }
.step:last-child { border-right: none; }
.step b { font-size: 10px; color: var(--green); letter-spacing: .1em; }
.step h3 { font-size: 13px; margin: 4px 0 4px; }
.step p { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* ---------- bid ---------- */
.bid-form { max-width: 820px; }
.company-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.company-card { cursor: pointer; }
.company-card input { position: absolute; opacity: 0; }
.company-inner { border: 1px solid var(--line-strong); border-radius: 10px; padding: 14px 16px; transition: .15s; }
.company-card input:checked + .company-inner { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 2px rgba(31,111,74,.12); }
.company-name { font-size: 16px; font-weight: 620; }
.linked-notice { background: #fbfaf6; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 6px 0 6px 22px; position: relative; font-size: 12.5px; border-bottom: 1px dashed #efede6; }
.checklist li:last-child { border-bottom: none; }
.checklist li::before { position: absolute; left: 0; top: 5px; font-size: 12px; }
.checklist li.ok::before { content: "✓"; color: var(--green); font-weight: 700; }
.checklist li.warn::before { content: "!"; color: var(--orange); font-weight: 700; }

/* ---------- flash ---------- */
.flash {
  margin: 14px 28px -8px; padding: 9px 13px;
  background: var(--green-soft); border: 1px solid #cfe6d8; color: var(--green);
  border-radius: 8px; font-size: 12.5px;
}

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .detail-grid, .split { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2) { border-right: none; }
}
@media (max-width: 820px) {
  .sidebar { display: none; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .hero { flex-direction: column; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .company-pick { grid-template-columns: 1fr; }
  .filters .field, .filters .field.bw { width: 100%; }
}


/* 看板内嵌表格：固定列宽，避免标题被挤成竖排 */
.grid-2 .table { table-layout: fixed; }
.grid-2 .notice-table th:nth-child(5), .grid-2 .notice-table td:nth-child(5) { display: none; }
.grid-2 .notice-table th:nth-child(1) { width: 42%; }
.grid-2 .notice-table th:nth-child(2) { width: 12%; }
.grid-2 .notice-table th:nth-child(3) { width: 22%; }
.grid-2 .notice-table th:nth-child(4) { width: 18%; }
.grid-2 .notice-table th:nth-child(6) { width: 6%; }
.grid-2 .table th, .grid-2 .table td { padding-left: 8px; padding-right: 8px; }
.grid-2 .table td:first-child .title-link {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}


/* 公司主体资料 */
.company-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.company-form { max-width: none; }
.company-form .form { gap: 10px; }
.company-form .panel-head { margin-bottom: 10px; }
@media (max-width: 900px) { .company-grid { grid-template-columns: 1fr; } }


/* 知识库列表列宽 */
.knowledge-table { table-layout: fixed; }
.knowledge-table th:nth-child(1) { width: 44%; }
.knowledge-table th:nth-child(2) { width: 9%; }
.knowledge-table th:nth-child(3) { width: 10%; }
.knowledge-table th:nth-child(4) { width: 15%; }
.knowledge-table th:nth-child(5) { width: 11%; }
.knowledge-table td { vertical-align: top; }
.knowledge-table td .tag { white-space: nowrap; }

/* ---------- auth / login ---------- */
.auth-body {
  background:
    radial-gradient(900px 500px at 15% -10%, #e9ff6b 0%, rgba(233, 255, 107, 0) 55%),
    radial-gradient(700px 420px at 110% 110%, #dfe9e3 0%, rgba(223, 233, 227, 0) 60%),
    var(--bg);
}
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 36px 16px;
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.auth-brand-text strong { font-size: 15px; letter-spacing: .01em; }
.auth-brand-text small { color: var(--muted); font-size: 9px; letter-spacing: .18em; margin-top: 2px; }
.auth-card {
  width: 100%; max-width: 390px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 23px; }
.auth-sub { color: var(--muted); font-size: 12px; margin: 6px 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
.auth-form .auth-remember {
  flex-direction: row; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink);
}
.auth-form .auth-remember input { width: auto; height: auto; }
.auth-submit { width: 100%; height: 39px; margin-top: 4px; }
.auth-error, .auth-flash {
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px;
  border: 1px solid;
}
.auth-error { background: var(--red-soft); border-color: #f0cdc8; color: #7d2a24; }
.auth-flash { background: var(--green-soft); border-color: #cfe6d8; color: var(--green); }
.auth-hint { margin-top: 18px; font-size: 11px; color: #9a9d9f; text-align: center; }
.auth-foot { margin-top: 18px; font-size: 10.5px; color: #a3a6a8; text-align: center; }

/* ---------- topbar user ---------- */
.top-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.top-user .who {
  font-size: 12px; font-weight: 600; max-width: 96px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-link { font-size: 12px; color: var(--muted); white-space: nowrap; }
.top-link:hover { color: var(--ink); }

/* ---------- account / users ---------- */
.account-grid {
  display: grid; grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px; align-items: start; max-width: 1040px;
}
.account-form .panel-head { margin-bottom: 14px; }
.account-sub { margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: #fbfaf6;
}
.user-form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.user-id { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.user-id strong { font-size: 13.5px; }
.user-fields { max-width: 760px; }
.user-delete { padding-top: 1px; }
.danger-text { color: var(--red) !important; }
@media (max-width: 980px) {
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .top-user .who { display: none; }
  .user-row { flex-direction: column; }
}

/* ---------- 中标预测 ---------- */
.forecast-panel { margin-bottom: 16px; padding-bottom: 0; }
.forecast-list {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line); margin: 0 -20px;
}
.forecast-item {
  padding: 14px 18px 16px; border-right: 1px solid var(--line);
  transition: background .15s ease; min-width: 0;
}
.forecast-item:last-child { border-right: 0; }
.forecast-item:hover { background: #faf9f4; }
.forecast-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.forecast-top b { font-size: 22px; letter-spacing: -.03em; color: var(--green); }
.forecast-title {
  margin: 7px 0 6px; font-weight: 600; font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.forecast-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fit-panel .side-card-label { display: flex; justify-content: space-between; align-items: center; }
.fit-panel .tiny { font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.fit-row { padding: 12px 0; border-top: 1px solid var(--line); }
.fit-row:first-of-type { border-top: 0; padding-top: 4px; }
.fit-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.fit-head b { font-size: 20px; color: var(--green); letter-spacing: -.03em; }
.fit-bar { height: 4px; background: #eceae2; border-radius: 99px; margin: 6px 0; overflow: hidden; }
.fit-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.fit-sub { font-size: 11px; color: var(--muted); }
.fit-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.fit-reasons span {
  font-size: 10.5px; color: #5e6165; background: #f6f5ef; border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 5px; line-height: 1.4;
}
.fit-missing { font-size: 10.5px; color: var(--orange); margin-top: 6px; line-height: 1.5; }

.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.metric {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow);
}
.metric-label { font-size: 11.5px; color: var(--muted); }
.metric-value { font-size: 30px; font-weight: 620; letter-spacing: -.04em; line-height: 1.3; }
.metric-value small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.metric-foot { font-size: 11px; color: #9a9d9f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rank-head {
  display: grid; grid-template-columns: 64px 1fr 190px; align-items: center;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--muted); letter-spacing: .04em; background: #fbfaf6;
}
.rank-col-no { text-align: left; }
.rank-row {
  display: grid; grid-template-columns: 64px 1fr 190px; gap: 0;
  padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: start;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: #fcfbf7; }
.rank-no {
  font-family: var(--mono); font-size: 13px; color: #a6a49b; padding-top: 2px;
}
.rank-main { min-width: 0; padding-right: 24px; }
.rank-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.45; }
.rank-title:hover { color: var(--green); }
.rank-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.rank-meta .dot { margin: 0 5px; color: #c3c0b5; }
.rank-reasons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.rank-reasons span {
  font-size: 11px; background: var(--green-soft); color: #2a6350;
  padding: 2px 7px; border-radius: 5px; line-height: 1.5;
}
.rank-reasons span.neg { background: var(--orange-soft); color: var(--orange); }
.rank-missing { font-size: 11px; color: var(--red); margin-top: 6px; }
.rank-score { text-align: right; min-width: 0; }
.prob-big { font-size: 34px; font-weight: 650; letter-spacing: -.05em; color: var(--green); line-height: 1.15; }
.prob-big small { font-size: 16px; font-weight: 500; margin-left: 1px; }
.rank-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

@media (max-width: 1100px) {
  .forecast-list { grid-template-columns: repeat(2, 1fr); }
  .forecast-item:nth-child(2n) { border-right: 0; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .rank-head { display: none; }
  .rank-row { grid-template-columns: 38px 1fr; }
  .rank-score { grid-column: 2; text-align: left; margin-top: 10px; }
  .rank-main { padding-right: 0; }
  .forecast-list { grid-template-columns: 1fr; }
  .forecast-item { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ============================================================
   Visual refresh + admin console (2026-12)
   ============================================================ */
:root {
  --bg: #f2f1eb;
  --paper: #fffefb;
  --ink: #15181a;
  --muted: #686d72;
  --line: #e4e1d7;
  --line-strong: #d2cec1;
  --green: #1d6a46;
  --green-soft: #e5f1e9;
  --shadow: 0 1px 2px rgba(20, 22, 26, .03), 0 14px 38px rgba(20, 22, 26, .055);
  --radius: 16px;
  --sidebar: 246px;
}

body { background: var(--bg); }
h1 { font-size: 30px; letter-spacing: -.035em; }
h2 { letter-spacing: -.015em; }

/* sidebar */
.sidebar {
  background: linear-gradient(180deg, #111512 0%, #151a16 100%);
  padding: 24px 14px 16px;
  border-right: 1px solid #232923;
}
.brand { padding: 0 10px 26px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(233, 255, 107, .18), 0 8px 22px rgba(0, 0, 0, .28);
}
.brand-text strong { font-size: 15px; }
.nav { gap: 3px; }
.nav-item {
  position: relative; padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; color: #a7ada6;
}
.nav-item:hover { background: #1d231e; }
.nav-item.active {
  background: #242b24; color: #f4f5ed;
  box-shadow: inset 0 0 0 1px rgba(233, 255, 107, .08);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 0 3px 3px 0; background: #e9ff6b;
}
.nav-item.active .ico { color: #e9ff6b; }
.nav-group-label {
  margin: 18px 12px 7px; padding-top: 15px;
  border-top: 1px solid #272e27;
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  color: #6f776e;
}
.side-foot { border-top-color: #252c25; }

/* topbar + page */
.topbar {
  height: 68px; padding: 0 32px;
  background: rgba(249, 248, 243, .82);
  border-bottom: 1px solid rgba(228, 225, 215, .9);
}
.crumb { font-size: 12.5px; letter-spacing: .015em; }
.top-actions { gap: 9px; }
.top-user { display: flex; align-items: center; gap: 9px; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--line); }
.top-user .who { font-weight: 600; font-size: 12.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-link { font-size: 12px; color: var(--muted); }
.top-link:hover { color: var(--ink); }
.page { padding: 30px 34px 48px; max-width: 1380px; }

/* buttons + panels */
.btn { border-radius: 10px; }
.btn-primary {
  background: #18201a; color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.btn-primary:hover { background: #27332a; }
.btn-ghost { background: rgba(255, 255, 255, .5); }
.panel { border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head h2 { font-size: 15.5px; }
.panel-link { font-size: 12px; color: var(--muted); }
.panel-link:hover { color: var(--green); }
.table th { background: #f8f7f2; padding: 11px 16px; }
.table td { padding: 13px 16px; }
.table tbody tr:hover { background: #fbfaf5; }

/* admin header + tabs */
.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin: 4px 0 20px;
}
.admin-head h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 640; }
.admin-head p { color: var(--muted); font-size: 13px; margin-top: 8px; max-width: 720px; }
.admin-head .eyebrow { margin-bottom: 9px; }
.admin-actions { display: flex; gap: 8px; flex-shrink: 0; padding-bottom: 3px; }
.admin-tabs {
  display: inline-flex; gap: 3px; padding: 4px;
  background: #e9e7de; border: 1px solid #dfdcd1; border-radius: 12px;
  margin-bottom: 18px;
}
.admin-tab {
  padding: 7px 16px; border-radius: 9px;
  font-size: 12.5px; font-weight: 560; color: #62665f;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { background: #fffefb; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 22, 26, .09); }

/* health */
.health-strip {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 13px;
  background: #fffefb; box-shadow: var(--shadow);
}
.health-strip > div { flex: 1; display: flex; flex-direction: column; line-height: 1.45; }
.health-strip strong { font-size: 12.5px; font-weight: 600; }
.health-strip small { color: var(--muted); font-size: 11px; }
.health-strip > a { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.health-strip > a:hover { color: var(--ink); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.health-strip.warn { border-color: #ebd6ba; background: #fffaf2; }
.health-strip.warn .health-dot { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.health-strip.danger { border-color: #efd0cb; background: #fff7f5; }
.health-strip.danger .health-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  display: block; padding: 16px 17px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 15px;
  box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: #cbc7b9; box-shadow: 0 2px 4px rgba(20,22,26,.04), 0 18px 42px rgba(20,22,26,.08); }
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ico {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.stat-ico.green { background: var(--green-soft); color: var(--green); }
.stat-ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat-ico.purple { background: var(--purple-soft); color: var(--purple); }
.stat-ico.red { background: var(--red-soft); color: var(--red); }
.stat-ico.grey { background: #efeee8; color: #777b74; }
.stat-label { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.stat-value { font-size: 32px; line-height: 1.2; font-weight: 640; letter-spacing: -.045em; margin: 8px 0 3px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 11px; color: #969990; }
.stat-danger { border-color: #eed2cd; background: #fffaf8; }
.stat-danger .stat-value { color: var(--red); }

/* admin layout */
.admin-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.admin-grid-lower { grid-template-columns: 1fr 1.45fr; }
.admin-grid > .panel { margin-bottom: 0; }
.trend-bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; height: 188px; padding: 8px 2px 0; }
.trend-col { flex: 1; min-width: 38px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-stack { position: relative; width: 100%; max-width: 58px; height: 145px; display: flex; align-items: flex-end; background: linear-gradient(180deg, transparent, #f5f3ec); border-radius: 6px; overflow: hidden; }
.trend-fill { display: block; width: 100%; background: #263b2d; border-radius: 5px 5px 0 0; min-height: 2px; }
.trend-fail { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(178, 58, 50, .38); min-height: 2px; }
.trend-col span { font-size: 10px; color: #92958d; }
.trend-col em { font-style: normal; font-size: 10.5px; color: #5f645d; font-variant-numeric: tabular-nums; }

.mini-list { display: flex; flex-direction: column; gap: 13px; padding-top: 4px; }
.mini-row { display: grid; grid-template-columns: 118px 1fr 34px; align-items: center; gap: 10px; }
.mini-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #4f554e; }
.mini-track { height: 7px; background: #f0eee7; border-radius: 6px; overflow: hidden; }
.mini-track i { display: block; height: 100%; border-radius: 6px; background: #a9b7aa; }
.mini-track i.green { background: #4f8a6b; }
.mini-track i.blue { background: #6f91b0; }
.mini-track i.purple { background: #8f7aa8; }
.mini-track i.orange { background: #c58a51; }
.mini-track i.red { background: #c47c73; }
.mini-track i.grey { background: #a8aba2; }
.mini-row b { text-align: right; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: #a8aba2; }
.dot.green { background: #4f8a6b; } .dot.blue { background: #6f91b0; }
.dot.purple { background: #8f7aa8; } .dot.orange { background: #c58a51; }
.dot.red { background: #c47c73; } .dot.grey { background: #a8aba2; }

.actor-list { display: flex; flex-direction: column; }
.actor-row { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid #f0eee7; }
.actor-row:last-child { border-bottom: 0; }
.actor-main { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.actor-main strong { font-size: 12.5px; }
.actor-main small { font-size: 10.5px; color: var(--muted); }
.actor-row b { font-size: 13px; font-variant-numeric: tabular-nums; }
.actor-row b small { font-size: 10px; color: var(--muted); margin-left: 2px; font-weight: 500; }

.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; background: #e7eee7; color: #2a553c;
  font-size: 13px; font-weight: 700;
}
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }

.table-tight td { padding: 10px 16px; font-size: 12px; }
.cell-clip { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5e635c; }
.empty-cell { padding: 34px 16px !important; text-align: center; color: #9a9d95; font-size: 12px; }
.empty-line { padding: 22px 2px; color: #9a9d95; font-size: 12px; }

.failure-list { display: flex; flex-direction: column; }
.failure-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1e7e3; }
.failure-row:last-child { border-bottom: 0; }
.failure-row > div { flex: 1; display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.failure-row strong { font-size: 12px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.failure-row small { font-size: 10.5px; color: var(--muted); }

/* audit filters */
.audit-filter-panel { padding: 15px 17px; }
.audit-filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.audit-filters .field { display: flex; flex-direction: column; gap: 5px; min-width: 118px; }
.audit-filters .field > span { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.audit-filters .field-grow { flex: 1; min-width: 210px; }
.audit-filters input, .audit-filters select {
  height: 35px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; padding: 0 10px; font-size: 12px; outline: none;
}
.audit-filters input:focus, .audit-filters select:focus { border-color: #7b9a83; box-shadow: 0 0 0 3px rgba(29, 106, 70, .09); }
.audit-filter-actions { display: flex; gap: 7px; }

.audit-summary {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 3px 3px 13px;
}
.audit-summary > div { display: flex; flex-direction: column; line-height: 1.35; }
.audit-summary .muted { font-size: 10.5px; }
.audit-summary strong { font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.audit-active-filters { flex-direction: row !important; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: #eceae2; font-size: 10.5px; color: #565b54; }
.text-red { color: var(--red); }

/* audit table */
.audit-table-panel { overflow: hidden; }
.audit-table { table-layout: fixed; }
.audit-table .col-time { width: 104px; }
.audit-table .col-detail { width: 64px; }
.audit-table th:nth-child(2) { width: 130px; }
.audit-table th:nth-child(3) { width: 112px; }
.audit-table th:nth-child(4) { width: 66px; }
.audit-table th:nth-child(6) { width: 170px; }
.audit-table td { vertical-align: top; font-size: 12px; }
.audit-table .mono { font-size: 10.5px; color: #6f746c; }
.audit-table .col-time small { display: block; font-size: 10px; color: #9a9d95; margin-top: 1px; }
.audit-user { display: block; font-weight: 560; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-table td > small.muted { font-size: 10px; }
.audit-actor-mobile { display: none; }
.audit-target { overflow: hidden; }
.audit-target strong { display: block; font-size: 11.5px; font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-target span { display: block; font-size: 11px; color: #6f746c; line-height: 1.45; }
.audit-source { overflow: hidden; }
.audit-source span { display: block; font-size: 10.5px; }
.audit-source small { display: block; font-size: 9.5px; color: #9a9d95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-ok, .status-fail { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 560; }
.status-ok { color: var(--green); }
.status-fail { color: var(--red); }
.status-ok::before, .status-fail::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.row-failure { background: #fffbfa; }
.row-failure:hover { background: #fff7f5 !important; }
.audit-detail summary { cursor: pointer; color: var(--muted); font-size: 11px; list-style: none; }
.audit-detail summary::-webkit-details-marker { display: none; }
.audit-detail summary:hover { color: var(--ink); }
.audit-detail pre {
  position: absolute; z-index: 30; right: 40px; margin-top: 7px;
  max-width: 460px; max-height: 280px; overflow: auto;
  padding: 12px 14px; border-radius: 10px;
  background: #171b18; color: #dfe5dc; font-size: 10.5px; line-height: 1.55;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28); white-space: pre-wrap; word-break: break-all;
}

/* account cards */
.create-panel { scroll-margin-top: 86px; }
.user-create-form .form-row { grid-template-columns: 1.1fr 1fr 1fr; }
.accounts-panel .account-list { padding: 0 20px 8px; }
.account-card { border-bottom: 1px solid #f0eee7; }
.account-card:last-child { border-bottom: 0; }
.account-head { display: flex; align-items: flex-start; gap: 13px; padding: 15px 0; }
.account-id { flex: 1; min-width: 0; }
.account-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.account-name strong { font-size: 13.5px; font-weight: 620; }
.account-name .mono { font-size: 10.5px; }
.account-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 10.5px; color: #858a82; }
.account-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.account-disabled { opacity: .72; }
.account-edit { position: relative; }
.account-edit > summary { list-style: none; cursor: pointer; }
.account-edit > summary::-webkit-details-marker { display: none; }
.account-edit[open] > summary { background: #eceae2; border-color: #d3cfc2; }
.account-edit-form {
  margin-top: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: 11px; background: #faf9f5;
}
.account-edit-form .form-row { grid-template-columns: 1fr 1fr; }

/* login */
.auth-body {
  min-height: 100vh; margin: 0; padding: 0;
  background: #f4f2ec; display: block;
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.auth-stage {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 42px 54px 36px;
  background:
    radial-gradient(900px 420px at 8% 100%, rgba(56, 105, 71, .32), transparent 62%),
    linear-gradient(145deg, #0e1310 0%, #121a14 52%, #0d120f 100%);
  color: #eef2ea;
}
.auth-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65), transparent 78%);
}
.auth-stage > * { position: relative; z-index: 1; }
.auth-stage-top { display: flex; align-items: center; gap: 11px; }
.auth-logo {
  width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center;
  background: #e9ff6b; color: #11150f; font-weight: 800; font-size: 18px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
}
.auth-logo.sm { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
.auth-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.auth-logo-text strong { font-size: 14px; letter-spacing: .01em; }
.auth-logo-text small { font-size: 8.5px; letter-spacing: .22em; color: #8e988c; margin-top: 1px; }
.auth-env {
  margin-left: auto; padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(233, 255, 107, .2); color: #d9e6b6;
  font-size: 9.5px; letter-spacing: .12em;
}
.auth-stage-mid { margin: auto 0; max-width: 620px; padding: 42px 0; }
.auth-kicker { font-size: 9.5px; letter-spacing: .24em; color: #9aaa8f; margin-bottom: 22px; }
.auth-stage h1 {
  font-size: clamp(34px, 4.1vw, 57px); line-height: 1.14;
  font-weight: 560; letter-spacing: -.045em; color: #f4f6ee;
}
.auth-stage h1 span { color: #dff58c; }
.auth-lede { max-width: 470px; margin-top: 22px; font-size: 13.5px; line-height: 1.8; color: #aeb8ab; }
.auth-points { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 30px; }
.auth-points span { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #b9c3b5; }
.auth-points i { width: 5px; height: 5px; border-radius: 50%; background: #dff58c; box-shadow: 0 0 0 3px rgba(223, 245, 140, .08); }
.auth-stage-foot {
  display: flex; gap: 38px; padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .09);
}
.auth-stage-foot div { display: flex; flex-direction: column; line-height: 1.35; }
.auth-stage-foot strong { font-size: 17px; font-weight: 560; color: #eef3e8; letter-spacing: -.02em; }
.auth-stage-foot span { font-size: 10px; color: #899487; margin-top: 3px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 44px 40px; background: #f6f4ee; }
.login-card {
  width: 100%; max-width: 398px;
  padding: 38px 37px 30px;
  background: #fffefa; border: 1px solid #e6e2d6; border-radius: 20px;
  box-shadow: 0 2px 4px rgba(24, 26, 22, .03), 0 30px 80px rgba(24, 26, 22, .09);
}
.login-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-mobile-brand .auth-logo-text strong { color: var(--ink); }
.login-mobile-brand .auth-logo-text small { color: #8a8e84; }
.login-card .eyebrow { color: #8f948a; margin-bottom: 12px; }
.login-card h2 { font-size: 28px; font-weight: 630; letter-spacing: -.04em; }
.login-sub { font-size: 12px; color: #7b8076; line-height: 1.65; margin: 8px 0 22px; }
.auth-flash, .auth-error {
  padding: 10px 12px; border-radius: 9px; font-size: 11.5px; line-height: 1.5; margin-bottom: 14px;
}
.auth-flash { background: var(--green-soft); color: #2a6045; border: 1px solid #cfe4d7; }
.auth-error { background: #fdf0ee; color: #a33c33; border: 1px solid #f1d2cd; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span { font-size: 10.5px; font-weight: 560; color: #666b62; letter-spacing: .04em; }
.login-field input {
  height: 43px; padding: 0 12px; border-radius: 9px;
  border: 1px solid #d8d4c8; background: #fff;
  font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-field input::placeholder { color: #b0b3aa; }
.login-field input:focus { border-color: #75917d; box-shadow: 0 0 0 3px rgba(29, 106, 70, .1); }
.sub-buyer { display: inline-block; max-width: 18em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; color: var(--muted); }
.doc-state { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.doc-open { background: #e7f2ec; color: #1f6f4a; }
.doc-passed { background: #fbe9e7; color: #b23a32; }
.doc-none { background: #f0eee6; color: #7a7d73; }
.countdown-big.doc-passed { color: #b23a32; font-size: 26px; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -1px; }
.login-check { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #656a61; }
.login-check input { accent-color: var(--green); width: 13px; height: 13px; }
.login-help { font-size: 10.5px; color: #9a9e94; }
.login-submit { width: 100%; height: 44px; margin-top: 4px; border-radius: 9px; font-size: 13px; }
.login-submit span { margin-left: 2px; }
.login-foot { display: flex; align-items: center; gap: 7px; margin-top: 22px; padding-top: 15px; border-top: 1px solid #efede4; font-size: 9.5px; color: #9a9e94; letter-spacing: .02em; }

/* responsive */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .admin-grid-lower { grid-template-columns: 1fr; }
  .audit-table th:nth-child(6), .audit-table td:nth-child(6) { display: none; }
}
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-stage { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px 20px; }
  .login-mobile-brand { display: flex; }
  .login-card { border: 0; box-shadow: none; background: transparent; padding: 10px 0; }
  .admin-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .admin-actions { padding-bottom: 0; }
  .user-create-form .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .page { padding: 22px 18px 40px; }
  .topbar { padding: 0 18px; }
  .top-user .who { display: none; }
  .top-user .top-link { display: inline-flex; font-size: 12px; padding: 0 2px; }
  .stat-grid, .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-3 > :last-child, .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .notice-table th:nth-child(2), .notice-table td:nth-child(2),
  .notice-table th:nth-child(5), .notice-table td:nth-child(5),
  .notice-table th:nth-child(6), .notice-table td:nth-child(6) { display: none; }
  .page-head { flex-wrap: wrap; }
  .page-head .seg { width: 100%; }
  .seg-item { flex: 1; white-space: nowrap; text-align: center; }
  .notice-table { table-layout: fixed; width: 100%; }
  .notice-table .title-link { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .notice-table th, .notice-table td { padding-left: 8px; padding-right: 8px; }
  .notice-table td { overflow: hidden; }
  .doc-range span { display: block; }
  .grid-2 .notice-table th:nth-child(1) { width: 46%; }
  .grid-2 .notice-table th:nth-child(3) { width: 27%; }
  .grid-2 .notice-table th:nth-child(4) { width: 27%; }
  .audit-table th:nth-child(2), .audit-table td:nth-child(2),
  .audit-table th:nth-child(5), .audit-table td:nth-child(5),
  .audit-table th:nth-child(6), .audit-table td:nth-child(6) { display: none; }
  .audit-table th, .audit-table td { padding-left: 7px; padding-right: 7px; }
  .audit-table .col-time { width: 92px; }
  .audit-table th:nth-child(3) { width: 104px; }
  .audit-table th:nth-child(4) { width: 58px; }
  .audit-table .col-detail { width: 46px; }
  .audit-actor-mobile { display: block; margin-top: 3px; font-size: 10px; color: #8a8d84; }
  .account-head { flex-wrap: wrap; }
  .account-actions { width: 100%; justify-content: flex-end; }
  .account-edit-form .form-row { grid-template-columns: 1fr; }
  .audit-filters .field-grow { min-width: 100%; }
  .audit-summary { gap: 14px; }
  .audit-active-filters { margin-left: 0; }
  .mini-row { grid-template-columns: 96px 1fr 30px; }
}


/* mobile shell refinements */
.top-mobile-brand { display: none; align-items: center; gap: 8px; color: var(--ink); font-weight: 750; font-size: 14px; letter-spacing: .01em; white-space: nowrap; }
.top-mobile-brand .logo-dot { width: 20px; height: 20px; border-radius: 6px; background: #d8ff63; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
@media (max-width: 820px) {
  .topbar { height: 60px; padding: 0 16px; gap: 10px; }
  .crumb { display: none; }
  .top-mobile-brand { display: inline-flex; }
  .top-actions { flex: 1; justify-content: flex-end; gap: 8px; }
  .top-actions a.bell, .top-actions form[action="/admin/crawl"] { display: none; }
  .top-actions .btn-primary { height: 34px; padding: 0 13px; font-size: 12.5px; }
  .top-user { gap: 6px; padding-left: 8px; }
  .top-user .who { display: none; }
  .panel, .panel-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel > .table:not(.audit-table):not(.notice-table), .panel-flush > .table:not(.audit-table):not(.notice-table) { min-width: 640px; }
  .page { padding: 20px 16px 34px; }
  .auth-panel { align-items: flex-start; padding: 54px 22px 40px; }
  .trend-bars { gap: 8px; }
  .trend-stack { max-width: 100%; }
}
@media (max-width: 380px) {
  .stat-grid, .stat-grid-3 { grid-template-columns: 1fr; }
  .stat-grid-3 > :last-child { grid-column: auto; }
}

.mfa-secret { display: block; padding: 14px 16px; border: 1px dashed var(--line);
  border-radius: 10px; background: #faf9f4; font-size: 15px; letter-spacing: .12em;
  word-break: break-all; margin: 10px 0; }
.login-field em { font-style: normal; color: var(--muted); font-size: 10px; margin-left: 6px; }
