:root {
  color-scheme: light;
  --bg: #f4f6f8; --card: #fff; --ink: #18212b; --muted: #5f6b77; --line: #d9dfe5;
  --accent: #1f5f8b; --accent-dark: #174a6e; --accent-soft: #e8f1f7; --red: #b42318; --green: #17663a; --green-soft: #e7f5ec;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 "Segoe UI", Arial, sans-serif; }
h1 { font-size: 22px; line-height: 1.25; margin: 18px 0 10px; }
h2 { font-size: 17px; line-height: 1.3; margin: 16px 0 8px; }
p { margin: 8px 0; color: var(--muted); }
a { color: var(--accent-dark); }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { width: 400px; max-width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.brand { font-weight: 700; color: var(--accent-dark); text-decoration: none; }
label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 14px; }
input:not([type=hidden]), select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #aab4bd; border-radius: 6px; background: #fff; color: inherit; font: inherit; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { display: block; width: 100%; min-height: 44px; margin-top: 18px; padding: 10px 14px; border: 0; border-radius: 6px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); }
.btn.compact { display: inline-block; width: auto; min-width: 140px; }
.error { color: var(--red); margin-top: 12px; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.langs { display: flex; justify-content: center; gap: 14px; margin-top: 16px; }
.link { min-height: 32px; border: 0; padding: 4px; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.link[aria-current] { color: var(--ink); font-weight: 600; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { padding: 7px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; }
nav a:hover { background: var(--bg); color: var(--ink); }
nav a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.who { margin-left: auto; color: var(--muted); }
.plain { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.page-title { margin-top: 0; }
.panel { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 24px 22px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.history { margin-top: 16px; }
dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 8px 0 4px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 14px; font-weight: 600; }
.nowrap { white-space: nowrap; width: 1%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.page-head .page-title { margin: 0; }
.page-head .btn { margin: 0; }
.back { margin: 0 0 10px; }
.search { margin-bottom: 14px; }
.search label { margin-top: 0; }
.search-row { display: flex; gap: 8px; }
.search-row input { min-width: 0; flex: 1; }
.search-row .plain { min-height: 42px; }
.panel.flush { padding: 0; }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: 18px; }
.empty { padding: 18px; margin: 0; }
.sub { color: var(--muted); font-size: 14px; }
.wrap { overflow-wrap: anywhere; }
.state { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.state.ok { background: var(--green-soft); color: var(--green); }
.state.wait { background: #fdf3dc; color: #7a4d00; }
.state.bad { background: #fde8e6; color: var(--red); }
.error.box { margin: 0 0 14px; padding: 10px 14px; border-radius: 6px; background: #fde8e6; }
.link-box { margin-bottom: 16px; border-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.plain.danger { border-color: #e5b4ae; color: var(--red); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input:not([type=hidden]) { width: auto; min-height: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.kpi b { display: block; font-size: 24px; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 14px; }
.kpi.bad b { color: var(--red); }
.kpi.wait b { color: #7a4d00; }
.code { font-weight: 700; white-space: nowrap; }
.route { display: flex; flex-wrap: wrap; gap: 3px; }
.chip { display: inline-block; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 12px; line-height: 1.35; white-space: nowrap; }
.chip.none { color: #9aa4ae; background: #fff; }
.chip.wait { background: #fdf3dc; border-color: #edd9a8; color: #7a4d00; }
.chip.active { background: var(--accent-soft); border-color: #a9cbe0; color: var(--accent-dark); font-weight: 600; }
.chip.done { background: var(--green-soft); border-color: #b5dcc4; color: var(--green); }
.route.steps .chip { white-space: normal; }
tr.late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.risk td:first-child { box-shadow: inset 3px 0 0 #d9a227; }
progress { width: 70px; height: 8px; vertical-align: middle; }
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  header { padding: 10px 16px; }
  nav { order: 3; width: 100%; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 4px 16px 18px; }
  .btn.compact { width: 100%; }
  table.people thead, table.board thead, table.lines thead, table.jobs thead { display: none; }
  table.people, table.people tbody, table.people tr, table.people td,
  table.board, table.board tbody, table.board tr, table.board td,
  table.lines, table.lines tbody, table.lines tr, table.lines td,
  table.jobs, table.jobs tbody, table.jobs tr, table.jobs td { display: block; width: 100%; }
  table.people tr, table.board tr, table.lines tr, table.jobs tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.people tr:last-child, table.board tr:last-child, table.lines tr:last-child, table.jobs tr:last-child { border-bottom: 0; }
  table.people td, .panel.flush table.people td:first-child,
  table.board td, .panel.flush table.board td:first-child,
  table.lines td, .panel.flush table.lines td:first-child,
  table.jobs td, .panel.flush table.jobs td:first-child { padding: 3px 0; border: 0; white-space: normal; }
  tr.late, tr.risk { border-left: 3px solid var(--red); }
  tr.risk { border-left-color: #d9a227; }
  tr.late td:first-child, tr.risk td:first-child { box-shadow: none; }
}
@media (max-width: 480px) { .card { padding: 20px; } }
details.act { border-top: 1px solid var(--line); padding: 8px 0; }
details.act:first-child { border-top: 0; }
details.act summary { cursor: pointer; font-weight: 600; }
details.act form { margin-top: 8px; max-width: 520px; }
details.act button { margin-top: 8px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.plain-list li:first-child { border-top: 0; }
