:root {
  --bg: #0f1116; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a; --text: #e7e9ee; --muted: #8b93a3;
  --accent: #2ecc71; --accent2: #27ae60; --warn: #f39c12; --bad: #e74c3c; --info: #3498db;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--bad); min-height: 18px; margin-top: 8px; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 16px; margin: 22px 0 10px; font-weight: 600; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.brand img { width: 26px; height: 26px; }
.brand.big { font-size: 18px; margin-bottom: 14px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; display: flex; flex-direction: column; gap: 12px; }

.shell { display: flex; min-height: 100vh; }
.side { width: 220px; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; }
.side nav a { color: var(--text); padding: 8px 10px; border-radius: 8px; }
.side nav a:hover { background: var(--panel2); }
.side nav a.on { background: var(--panel2); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.main { flex: 1; padding: 26px 30px; min-width: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: -2px; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel2); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; cursor: pointer; font: inherit; }
.tabs button.on { color: var(--text); border-color: var(--accent); }

.timeline { position: relative; height: 46px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.timeline .blk { position: absolute; top: 0; bottom: 0; }
.timeline .work { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #ffffff55; border-right: 2px dashed #ffffff55; pointer-events: none; }
.ticks { position: relative; height: 18px; font-size: 11px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; font-size: 12px; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -2px; }
.bars .bar { height: 8px; background: var(--accent2); border-radius: 4px; }

.modal { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal-box { width: min(720px, 100%); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--panel2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 10px; z-index: 60; max-width: 420px; }
.toast.bad { border-color: var(--bad); }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.tip { position: fixed; pointer-events: none; background: #000d; border: 1px solid var(--line); padding: 6px 9px; border-radius: 6px; font-size: 12px; z-index: 70; }
@media (max-width: 800px) { .side { display: none; } .main { padding: 16px; } }
