:root {
  --bg: #12140f;
  --bg-2: #181c14;
  --panel: #1c2218;
  --panel-2: #232a1e;
  --line: #30382a;
  --text: #e8ecdf;
  --muted: #8f977e;
  --brass: #c9a227;
  --brass-2: #e0bc4a;
  --ok: #6f9a4c;
  --warn: #c9842a;
  --bad: #c45c3a;
  --info: #6a8aa3;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset;
  --radius: 10px;
  --sidebar: 248px;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 10% -10%, #24301c 0%, transparent 50%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--brass-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: linear-gradient(180deg, #1a2016, #141810);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand-mark {
  width: 36px; height: 36px;
  border: 1px solid var(--brass);
  color: var(--brass);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .04em;
}
.brand b { display: block; letter-spacing: .16em; font-size: 13px; }
.brand span { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover, .nav a.active {
  background: var(--panel-2);
  text-decoration: none;
}
.nav a.active { color: var(--brass-2); }

.main { flex: 1; min-width: 0; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(18,20,15,.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top h1 { margin: 0; font-size: 20px; font-weight: 550; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.who b { color: var(--text); }
.btn, button.btn, input[type=submit] {
  appearance: none;
  border: 1px solid var(--brass);
  background: #2a2614;
  color: var(--brass-2);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.btn:hover { background: #3a3418; }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--text); }
.btn.bad { border-color: var(--bad); color: #f0c2b4; background: #2a1612; }

.content { padding: 24px 28px 48px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 560; }
.kpi-val {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--brass-2);
}
.kpi-lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(255,255,255,.02); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.open, .pill.new, .pill.assigned { color: #f0d48a; border-color: #6a5420; }
.pill.in_progress { color: #9ec4e0; border-color: #35566c; }
.pill.done, .pill.closed, .pill.ok, .pill.active { color: #b7d59a; border-color: #3e5a2c; }
.pill.critical { color: #f0b3a3; border-color: #6e3224; }
.pill.failed, .pill.cancelled, .pill.decommissioned { color: #e0a090; border-color: #5a2c22; }

form.stack { display: grid; gap: 10px; }
form.stack.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #12150f;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
textarea { min-height: 84px; resize: vertical; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: #1e2a16; border: 1px solid #3e5a2c; }
.flash.err { background: #2a1612; border: 1px solid #6e3224; }

.split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 980px) {
  .app { display: block; }
  .sidebar { width: auto; height: auto; position: relative; }
  .split, form.stack.two { grid-template-columns: 1fr; }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.doc { max-width: 820px; margin: 0 auto; background: #f4efe2; color: #1c1a14; padding: 36px; border-radius: 4px; }
.doc h1 { margin-top: 0; }
.doc table { color: inherit; }
.doc th, .doc td { border-bottom: 1px solid #d7d0c0; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 48px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { background: #12150f; height: 10px; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--brass); }
.matrix td:nth-child(3) { color: var(--ok); font-weight: 600; }
