:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: #202934;
  background: #f6f8f9;
  --line: #dfe5e7;
  --muted: #596774;
  --accent: #146554;
  --accent-dark: #0c5142;
  --soft: #e9f5ef;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
body { min-height: 100vh; font-size: 15px; }
h1 { font-size: 29px; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #c9d3d7;
  background: white;
  color: inherit;
}
button { cursor: pointer; font-weight: 600; white-space: nowrap; }
button:hover:not(:disabled) { background: #eff3f4; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #358978; outline-offset: 3px; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.danger { background: #a13237; border-color: #a13237; color: white; }
.danger:hover:not(:disabled) { background: #82252a; }
.text-button { border: 0; background: transparent; color: var(--accent-dark); }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
label input, label select, label textarea { width: 100%; min-width: 0; font-weight: 400; }
.stack { display: grid; gap: 17px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.skip { position: fixed; z-index: 2; top: 12px; left: 12px; transform: translateY(-150%); padding: 8px; background: white; color: var(--accent-dark); }
.skip:focus { transform: none; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 420px); padding: 36px; border-radius: 12px; border: 1px solid var(--line); background: white; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: white; border-radius: 9px; font-size: 17px; }
.workspace { display: grid; min-height: 100vh; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { background: white; border-right: 1px solid var(--line); padding: 22px 15px; }
.sidebar .brand { padding: 0 6px; margin-bottom: 39px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a { text-decoration: none; color: #435460; padding: 11px 14px; border-radius: 6px; font-weight: 600; }
.sidebar nav a:hover { background: #f1f5f5; color: #172630; }
.sidebar nav a[aria-current="page"] { color: var(--accent-dark); background: var(--soft); }
.topbar { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 32px; background: white; border-bottom: 1px solid var(--line); }
#current-module { color: var(--muted); font-size: 14px; }
.account, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.account { justify-content: flex-end; }
main { max-width: 1520px; margin: 0 auto; padding: 32px; }
.page-heading { display: flex; gap: 16px; margin-bottom: 23px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 17px; margin-bottom: 16px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.filters label { flex: 1 1 130px; max-width: 230px; }
.table-panel, .panel { background: white; border: 1px solid var(--line); border-radius: 8px; }
.panel { padding: 20px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-spacing: 0; text-align: left; white-space: nowrap; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { background: #f1f5f6; color: #485761; font-size: 13px; }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faf9; }
td .text-button { padding: 3px 8px; min-height: 32px; margin: -6px 0 -6px -8px; }
.clip { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #edf1f2; color: #44515d; font-size: 13px; }
.pill.good { color: #155846; background: #e3f3eb; }
.pill.closed { color: #872e33; background: #faeced; }
.message { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 6px; background: var(--soft); color: var(--accent-dark); overflow-wrap: anywhere; }
.message.error { background: #ffefed; color: #7e2625; }
#notice { margin-bottom: 16px; }
.empty { display: grid; place-items: center; gap: 9px; padding: 48px 15px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px,1fr)); gap: 14px; margin-bottom: 18px; }
.metric { display: grid; gap: 10px; padding: 18px; text-decoration: none; color: inherit; }
.metric:hover { border-color: var(--accent); }
.metric strong { font-size: 29px; font-variant-numeric: tabular-nums; line-height: 1; }
.metric span { color: var(--muted); font-size: 14px; }
.chart { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.chart li { display: grid; align-items: center; grid-template-columns: 95px minmax(0, 1fr) 30px; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart meter { width: 100%; height: 13px; accent-color: var(--accent); }

.drawer { position: fixed; margin: 0 0 0 auto; inset: 0 0 0 auto; width: min(100%, 550px); max-width: 100%; height: 100%; max-height: 100%; border: 0; padding: 0; box-shadow: -10px 0 40px #142c2730; color: inherit; }
.drawer::backdrop { background: #18292f69; }
.drawer-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px 23px; background: white; border-bottom: 1px solid var(--line); }
.drawer-content { padding: 23px; }
.facts { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr; column-gap: 12px; row-gap: 11px; margin: 0; padding: 14px; background: #f5f8f8; border-radius: 6px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.drawer-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.history li:first-child { padding-top: 0; }
@media (max-width: 740px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 13px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { margin-bottom: 10px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav a { padding: 7px 8px; font-size: 14px; }
  .topbar, main { padding-left: 16px; padding-right: 16px; }
}
