:root {
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --dark: #202124;
  --accent: #3D5AFE;
  --cyan: #00BCD4;
  --text: #1F2329;
  --muted: #8A8F99;
  --line: #EEF0F3;
  --ok: #17A34A;
  --err: #E5484D;
  --warn: #E9A23B;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }

.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex: 0 0 220px; background: var(--dark); color: #C7CBD1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.logo { padding: 22px 20px 18px; font-size: 17px; font-weight: 700; color: #FFF; letter-spacing: .5px; }
.logo span { color: var(--cyan); font-size: 12px; margin-left: 4px; }
.side nav { flex: 1; padding: 8px 0; }
.side nav a { display: block; padding: 12px 20px; color: #C7CBD1; border-left: 3px solid transparent; }
.side nav a:hover { background: #292B2F; color: #FFF; }
.side nav a.on { background: #2A2D31; color: #FFF; border-left-color: var(--accent); }
.side-foot { padding: 16px 20px; border-top: 1px solid #2E3135; font-size: 12px; color: #8F949C; }
.side-foot a { color: #8F949C; margin-left: 6px; }

.main { flex: 1; min-width: 0; padding: 22px 28px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { font-size: 20px; margin: 0; }
.clock { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border-radius: 10px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,40,.05); margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } }

.stat { background: #FFF; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: #FAFBFC; white-space: nowrap; }
tr:hover td { background: #FCFDFF; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, monospace; font-size: 12px; color: #5A6270; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: #F0F2F5; color: #5A6270; white-space: nowrap; }
.pill.ok { background: #E9F8EF; color: var(--ok); }
.pill.err { background: #FDECEC; color: var(--err); }
.pill.run { background: #E8F0FF; color: var(--accent); }
.pill.warn { background: #FEF6E7; color: #B7791F; }

.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 13px; background: #F0F2F5; color: var(--text); }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--accent); color: #FFF; }
.btn.ghost { background: #EEF1FF; color: var(--accent); }
.btn.danger { background: #FDECEC; color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { display: block; width: 100%; margin-top: 18px; padding: 10px; }

input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #DDE1E7; border-radius: 8px; background: #FFF; outline: none; }
input:focus, select:focus { border-color: var(--accent); }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.ok { background: #E9F8EF; color: #0E7A38; }
.alert.err { background: #FDECEC; color: #B42318; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }

.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--dark); }
.login-box { width: 360px; background: #FFF; border-radius: 14px; padding: 30px 28px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.brand { font-size: 22px; font-weight: 700; }
.brand small { color: var(--cyan); font-size: 12px; margin-left: 4px; }
.brand-sub { color: var(--muted); margin: 4px 0 22px; font-size: 13px; }
.login-box label { display: block; font-size: 13px; color: #5A6270; margin: 12px 0 6px; }
.login-box input { width: 100%; }
.foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }
.alert + form, .login-box .alert { margin-bottom: 8px; }
