:root {
  --bg: #0a0d13;
  --panel: #11151d;
  --panel-2: #161b25;
  --line: #222836;
  --text: #e7ecf3;
  --dim: #8b96a7;
  --acc: #b6f34a;
  --acc-ink: #0e1407;
  --err: #ff7070;
  --ok: #4ade80;
  --warn: #fbbf24;
  --purple: #a78bfa;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100vh;
  font: 14px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
a { color: var(--acc); }

/* login */
#login {
  position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 50;
}
#login .box { width: 320px; }
#login h1 { font-size: 22px; margin: 0 0 4px; }
#login p { color: var(--dim); margin: 0 0 18px; font-size: 13px; }

.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.logo { font-weight: 700; letter-spacing: -0.3px; padding: 0 8px 16px; font-size: 15px; }
.logo em { color: var(--acc); font-style: normal; }
nav button {
  display: flex; width: 100%; gap: 8px; align-items: center; background: 0; border: 0; color: var(--dim);
  padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; margin-bottom: 2px;
}
nav button:hover { color: var(--text); background: var(--panel-2); }
nav button.on { color: var(--acc); background: #1a2413; }
nav .spacer { height: 1px; background: var(--line); margin: 12px 6px; }
main { padding: 26px 30px 60px; min-width: 0; }

h1.page { font-size: 22px; margin: 0 0 3px; letter-spacing: -0.3px; }
.hint { color: var(--dim); font-size: 13px; margin: 0 0 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-size: 24px; letter-spacing: -0.6px; }
.kpi span { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.panel h2 { font-size: 14px; margin: 0 0 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }

.btn {
  background: var(--acc); color: var(--acc-ink); border: 0; border-radius: 9px; padding: 9px 14px;
  font-weight: 650; cursor: pointer; font-size: 13px;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.danger { background: transparent; color: var(--err); border: 1px solid #4a2323; }
.btn:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); }
label { font-size: 12px; color: var(--dim); display: block; }
label input, label select, label textarea { margin-top: 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 150px; }
.row > .shrink { flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid #1a1f29; vertical-align: top; }
tr:hover td { background: #0e131b; }

.link-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.slug { color: var(--acc); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--dim); }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; color: var(--dim); }
.chip.on { color: var(--acc); border-color: #3d5222; background: #161f10; }

.stages { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 130px; }
.col.over { border-color: var(--acc); background: #121a10; }
.col h3 { font-size: 12px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--dim); display: flex; justify-content: space-between; }
.lead {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px;
  margin-bottom: 8px; cursor: grab; font-size: 12.5px;
}
.lead:active { cursor: grabbing; }
.lead b { display: block; font-size: 13px; }
.lead .c { color: var(--acc); word-break: break-all; }
.lead .m { color: var(--dim); font-size: 12px; margin-top: 3px; }

.modal { position: fixed; inset: 0; background: #070a0fd9; display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: 480px; max-height: 86vh; overflow: auto; }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.notes { max-height: 190px; overflow: auto; margin: 6px 0 10px; }
.note { border-left: 2px solid var(--line); padding: 4px 0 4px 9px; margin-bottom: 6px; font-size: 13px; }
.note time { display: block; color: var(--dim); font-size: 11px; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 58px 1fr 64px; gap: 8px; align-items: center; font-size: 12.5px; }
.bar i { height: 7px; border-radius: 4px; background: var(--acc); display: block; min-width: 2px; }
.bar span { text-align: right; color: var(--dim); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.spark div { flex: 1; background: #2b3a1c; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.spark div > b { position: absolute; inset: auto 0 0 0; background: var(--acc); border-radius: 3px 3px 0 0; display: block; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 9px; font-size: 13px; z-index: 60; }
.toast.err { border-color: #5a2626; color: var(--err); }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 10px; }
  .logo { padding: 0 8px 0 4px; white-space: nowrap; }
  nav { display: flex; gap: 4px; }
  nav button { white-space: nowrap; padding: 7px 10px; }
  nav .spacer { display: none; }
  main { padding: 18px 14px 50px; }
}
