:root {
  --bg: #eef3f6;
  --panel: #fff;
  --ink: #1c2b36;
  --muted: #6d7f8d;
  --line: #d7e1e8;
  --accent: #129aab;
  --accent-ink: #0c7380;
  --soft: #e5f6f8;
  --ok: #1f9d6a;
  --warn: #c4841d;
  --danger: #d4536d;
  --shadow: 0 10px 30px rgba(22, 50, 63, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.45 "Segoe UI", sans-serif; }
a { color: var(--accent-ink); text-decoration: none; }
h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.03em; }
h2 { margin: 22px 0 10px; font-size: 16px; }
small, .hint, .lead { color: var(--muted); }
.lead { margin-top: 0; }
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #14313d; color: #fff; padding: 18px 14px; }
.brand { display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 700; margin-bottom: 22px; }
.brand span, .brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #d5e4ea; border-radius: 10px; padding: 9px 10px; }
.side nav a.on, .side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.who { font-weight: 700; }
.role { color: var(--muted); font-size: 12px; }
.content { padding: 24px 28px 48px; }
.flash { background: #fff6e8; border: 1px solid #f0d7a8; color: #7a5410; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px; color: inherit; }
.card b { font-size: 16px; }
.panel { padding: 16px; margin: 16px 0; }
.filters, .toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0 18px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, button { font: inherit; }
input, select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--ink); min-width: 140px; }
button, .login-card button { border: 0; border-radius: 10px; background: var(--accent); color: #fff; padding: 9px 14px; cursor: pointer; font-weight: 650; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.warn { background: var(--warn); }
button.link { background: transparent; color: var(--accent-ink); padding: 0; min-height: 0; }
.grid, .matrix { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 14px; overflow: hidden; }
.grid th, .grid td, .matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.grid th, .matrix th { font-size: 12px; color: var(--muted); background: #f7fbfc; }
.matrix th b { display: block; color: var(--ink); font-size: 13px; }
.matrix { min-width: 720px; }
.scroll { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.person { min-width: 160px; font-weight: 700; }
.cell { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.cell input { min-width: 0; width: 100%; }
.cell form, .ops form { display: flex; flex-direction: column; gap: 4px; }
.ops { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; background: var(--soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.pill.done, .pill.approved, .pill.fin_done, .pill.pushed { background: #e5f7ee; color: var(--ok); }
.pill.wait1, .pill.wait2, .pill.submitted, .pill.head_ok, .pill.wait_fin, .pill.happr { background: #fff4df; color: var(--warn); }
.pill.rej1, .pill.rej2, .pill.rejected, .pill.rej_emp, .pill.rej_head { background: #ffe8ed; color: var(--danger); }
.title-row, .crumb { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb { margin-bottom: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.login-body { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(420px, calc(100% - 32px)); background: var(--panel); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { font-size: 26px; }
.login-card input, .login-card button { width: 100%; }
td small, th small { display: block; color: var(--muted); font-weight: 500; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side nav { flex-direction: row; overflow: auto; }
  .split { grid-template-columns: 1fr; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
}
