:root {
  --brand: #E4572E; --ink: #1F2430; --muted: #6B7280; --line: #E5E7EB; --bg: #F6F7F9; --card: #fff;
  --ok: #15803D; --warn: #B45309; --bad: #B91C1C; --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.center { display: grid; place-items: center; min-height: 60vh; }
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #D1D5DB; padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: #fff; font-weight: 700; }
.side .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; font-size: 12px; color: #fff; }
.side a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: #D1D5DB; }
.side a:hover { background: #2B3140; }
.side a.on { background: #343B4D; color: #fff; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8B93A5; padding: 14px 10px 4px; }
.side select { width: 100%; margin: 0 0 8px; background: #2B3140; color: #fff; border: 0; }
.pill { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; }
main { padding: 24px 32px 64px; max-width: 1200px; }
.top { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat .n { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #FAFAFB; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #FAFAFB; }
td.r, th.r { text-align: right; }
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.danger { color: var(--bad); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
textarea { min-height: 90px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
label.check input { width: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #EEF0F3; color: var(--ink); white-space: nowrap; }
.tag.ok { background: #DCFCE7; color: var(--ok); } .tag.warn { background: #FEF3C7; color: var(--warn); } .tag.bad { background: #FEE2E2; color: var(--bad); }
.tag.dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #999); margin-right: 6px; }
.auth { max-width: 380px; margin: 10vh auto; }
.auth .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 16px; }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 25, .45); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 20px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 30; }
.toast.err { background: var(--bad); }
.bars { display: flex; align-items: end; gap: 4px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; max-width: 48px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.code { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: .08em; background: #FFF7ED; border: 1px dashed var(--brand); padding: 6px 12px; border-radius: 8px; display: inline-block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.menu-btn { display: none; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 10; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  main { padding: 16px; }
  .menu-btn { display: inline-flex; }
  .cols { grid-template-columns: 1fr; }
}
