:root {
  --brand: #2BB4B0;
  --brand-dark: #1E8F8C;
  --brand-soft: #E6F7F6;
  --ink: #1F2A2E;
  --ink-2: #55636B;
  --ink-3: #8B979D;
  --line: #E3E9EB;
  --bg: #F4F7F8;
  --card: #FFFFFF;
  --ok: #1E9E5A;
  --warn: #C97A11;
  --danger: #C0392B;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: 216px; flex: 0 0 216px; background: #FFFFFF; border-right: 1px solid var(--line);
  padding: 16px 0 32px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand { padding: 0 16px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.sidebar .brand b { display: block; font-size: 15px; }
.sidebar .brand span { font-size: 11px; color: var(--ink-3); line-height: 1.5; display: block; margin-top: 4px; }
.sidebar .grp { padding: 12px 16px 4px; font-size: 11px; color: var(--ink-3); letter-spacing: .5px; }
.sidebar a.item {
  display: block; padding: 8px 16px; color: var(--ink-2); font-size: 13px;
  border-left: 3px solid transparent;
}
.sidebar a.item:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.sidebar a.item.active { background: var(--brand-soft); color: var(--brand-dark); border-left-color: var(--brand); font-weight: 500; }
.sidebar span.item.disabled { display: block; padding: 8px 16px; color: #B9C2C6; font-size: 13px; }
.sidebar span.item.disabled em { font-style: normal; font-size: 11px; color: #C9D1D4; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #FFF; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.topbar .who { font-size: 13px; color: var(--ink-2); }
.topbar .who b { color: var(--ink); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; margin-left: 6px; }
.content { padding: 20px 22px 48px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; margin: 0 0 4px; font-weight: 600; }
.page-head p { margin: 0; color: var(--ink-3); font-size: 12.5px; max-width: 900px; line-height: 1.6; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .k { font-size: 12px; color: var(--ink-3); }
.card .v { font-size: 24px; font-weight: 600; margin: 6px 0 2px; }
.card .s { font-size: 11.5px; color: var(--ink-3); }
.card.accent { border-color: var(--brand); background: linear-gradient(180deg, #FFF, var(--brand-soft)); }
.card.accent .v { color: var(--brand-dark); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow-x: auto; }
.panel > h2 { font-size: 14px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.panel .body { padding: 14px 16px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; background: #FFF; }
table.grid th, table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
table.grid th { background: #FAFCFC; color: var(--ink-2); font-weight: 500; font-size: 12.5px; }
table.grid td.muted, table.grid td.wrap { white-space: normal; min-width: 200px; }
table.grid td.name-col { min-width: 190px; }
table.grid tr:hover td { background: #FBFDFD; }
table.grid td.ops { white-space: nowrap; position: sticky; right: 0; background: #FFF; box-shadow: -8px 0 8px -8px rgba(31, 42, 46, .16); }
table.grid th:last-child { position: sticky; right: 0; background: #FAFCFC; box-shadow: -8px 0 8px -8px rgba(31, 42, 46, .16); }
table.grid tr:hover td.ops { background: #FBFDFD; }
table.grid td.ops form { display: inline; }

.btn {
  display: inline-block; padding: 6px 13px; border-radius: 7px; border: 1px solid var(--brand);
  background: var(--brand); color: #FFF; cursor: pointer; font-size: 13px; line-height: 1.4;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; color: #FFF; }
.btn.ghost { background: #FFF; color: var(--brand-dark); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn.mini { padding: 3px 9px; font-size: 12px; }
.btn.gray { border-color: var(--line); background: #FFF; color: var(--ink-2); }
.btn.gray:hover { background: #F2F5F6; color: var(--ink); }
.btn.danger { border-color: var(--danger); background: #FFF; color: var(--danger); }
.btn.danger:hover { background: #FDECEA; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.field label .req { color: var(--danger); margin-left: 3px; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field input[type=date], .field select, .field textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #FFF; color: var(--ink);
}
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.field.wide { grid-column: 1 / -1; }

.flash { padding: 9px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.flash.ok { background: #EAF7EF; color: #1B7A46; border: 1px solid #C6E9D5; }
.flash.err { background: #FDECEA; color: #A32B1E; border: 1px solid #F5C6C0; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; border: 1px solid var(--line); background: #F7FAFA; color: var(--ink-2); }
.tag.ok { background: #EAF7EF; color: #1B7A46; border-color: #C6E9D5; }
.tag.warn { background: #FDF4E6; color: #A6690F; border-color: #F3DEC0; }
.tag.danger { background: #FDECEA; color: #A32B1E; border-color: #F5C6C0; }
.tag.brand { background: var(--brand-soft); color: var(--brand-dark); border-color: #BDEAE8; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar form { display: flex; gap: 8px; }
.toolbar input[type=text] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.toolbar .spacer { flex: 1; }

.pager { display: flex; gap: 6px; padding: 12px 16px; align-items: center; color: var(--ink-3); font-size: 12.5px; }

.empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.muted { color: var(--ink-3); font-size: 12px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #EAF7F7, #F7FAFA 60%); padding: 20px; }
.login-box { width: 100%; max-width: 380px; background: #FFF; border-radius: 14px; border: 1px solid var(--line); padding: 28px 26px; }
.login-box h1 { font-size: 18px; margin: 0 0 4px; }
.login-box p.sub { color: var(--ink-3); font-size: 12.5px; margin: 0 0 20px; line-height: 1.6; }
.login-box .field { margin-bottom: 14px; }

footer.icp { padding: 14px 22px 26px; color: var(--ink-3); font-size: 12px; }
footer.icp a { color: var(--ink-3); text-decoration: underline; }

.notice { background: #FFF8E8; border: 1px solid #F1DFB6; color: #7A5A12; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.65; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 7px 12px; font-size: 13px; }
.kv .k { color: var(--ink-3); }
