:root {
  --accent: #0f6e5e;
  --accent-dark: #0b4f43;
  --accent-light: #e3f3ef;
  --bad: #b3261e;
  --warn: #9a6400;
  --ok: #0f6e5e;
  --bg: #f6f7f6;
  --card: #ffffff;
  --border: #e3e6e3;
  --text: #1c2420;
  --muted: #6b766f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent-dark); }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* ---------- Layout shell (logged in) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: var(--accent-dark); color: #fff;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
}
.sidebar .brand { font-weight: 700; font-size: 16px; padding: 6px 10px 16px; color: #fff; }
.sidebar a {
  color: #d7ebe6; text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; gap: 8px; align-items: center;
}
.sidebar a:hover { background: rgba(255,255,255,.08); }
.sidebar a.active { background: var(--accent); color: #fff; font-weight: 600; }
.sidebar a.logout { margin-top: auto; color: #f0c9c6; }
.content { flex: 1; padding: 24px 28px; max-width: 1180px; }

.navtoggle { display: none; }
.burger { display: none; }

@media (max-width: 980px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: auto; flex: none; position: fixed; inset: 0 0 0 auto; width: 230px; transform: translateX(-100%);
    transition: transform .2s ease; z-index: 50; height: 100vh; overflow-y: auto;
  }
  .navtoggle:checked ~ .shell .sidebar { transform: translateX(0); }
  .burger {
    display: flex; align-items: center; justify-content: center; position: fixed; top: 12px; left: 12px; z-index: 60;
    width: 38px; height: 38px; background: var(--accent-dark); color: #fff; border-radius: 8px; cursor: pointer; font-size: 18px;
  }
  .content { padding: 60px 16px 24px; max-width: 100%; }
}

.wrap { max-width: 480px; margin: 60px auto; padding: 0 16px; }
.login { max-width: 380px; margin: 80px auto; padding: 0 16px; }

/* ---------- Card & grid ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .grid.g2, .grid.g4 { grid-template-columns: 1fr 1fr; } }

.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat .n { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }

.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { color: var(--muted); display: block; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; background: #fff; color: var(--text);
}
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* ---------- Badges & flash ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-light); color: var(--accent-dark); }
.badge.warn { background: #fdf2d8; color: var(--warn); }
.badge.bad { background: #fbe3e1; color: var(--bad); }
.badge.ok { background: var(--accent-light); color: var(--ok); }
.badge.muted { background: #eceeec; color: var(--muted); }

.flash { background: var(--accent-light); color: var(--accent-dark); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.err { background: #fbe3e1; color: var(--bad); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table td, table th { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; }
table td.num, table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Tabs & steps ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent-dark); border-color: var(--accent); font-weight: 600; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; color: var(--muted); }
.steps li.done { color: var(--text); text-decoration: line-through; }

/* ---------- Pipeline strip ---------- */
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pipeline .step {
  flex: 1; min-width: 110px; background: var(--accent-light); border-radius: 10px; padding: 10px 12px; text-align: center;
}
.pipeline .step .n { font-size: 20px; font-weight: 700; color: var(--accent-dark); }
.pipeline .step .l { font-size: 12px; color: var(--muted); }
