:root {
  --ink: #17181c; --muted: #6a6f7a; --line: #e4e6ea; --bg: #f5f6f8; --card: #fff;
  --accent: #2b5fb4; --accent-soft: #e8f0fb;
  --green: #1f7a3f; --green-bg: #e4f4e8; --amber: #9a5b00; --amber-bg: #fbf0dc;
  --red: #b3261e; --red-bg: #fbe9e7; --gray-bg: #eef0f3;
  --c-meet: #5b7fcf; --c-daily: #3e9b8a; --c-fixed: #c0874a; --c-other: #8a8fa0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-size: 15px; white-space: nowrap; }
.brand span { color: var(--muted); margin-left: 8px; }
nav { display: flex; gap: 4px; align-items: center; flex: 1; flex-wrap: wrap; }
nav button, nav a { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  color: var(--muted); text-decoration: none; font-size: 13.5px; }
nav button.on { background: var(--ink); color: #fff; }
nav a:hover, nav button:hover:not(.on) { background: var(--gray-bg); }
.save { font-size: 12px; color: var(--muted); white-space: nowrap; }
.save.err { color: var(--red); }
main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 80px; }
.view { display: none; } .view.on { display: block; }

.head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.monthnav button { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip.draft { background: var(--amber-bg); color: var(--amber); }
.chip.signed { background: var(--green-bg); color: var(--green); }
.chip.Green { background: var(--green-bg); color: var(--green); }
.chip.Amber { background: var(--amber-bg); color: var(--amber); }
.chip.Red { background: var(--red-bg); color: var(--red); }
.chip.Blocked, .chip.none { background: var(--gray-bg); color: var(--muted); }
.chip.sugg { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.spacer { flex: 1; }
.btn { border: 1px solid var(--line); background: #fff; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.btn:hover { border-color: #c9cdd4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 4px; }
.x:hover { color: var(--red); }

.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.signed { background: var(--green-bg); }
.banner.warn { background: var(--red-bg); color: var(--red); }
.banner.info { background: var(--accent-soft); }

.grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi .n { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi.bad .n { color: var(--red); }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--gray-bg); position: relative; }
.bar i { display: block; height: 100%; }
.bar .over { background: repeating-linear-gradient(45deg, var(--red), var(--red) 4px, #d9534f 4px, #d9534f 8px); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; background: var(--c); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.group td { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); }
input.cell, select.cell, textarea.cell { width: 100%; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; }
input.cell:hover, select.cell:hover, textarea.cell:hover { border-color: var(--line); }
input.cell:focus, select.cell:focus, textarea.cell:focus { outline: none; border-color: var(--accent); background: #fff; }
input.cell.num { text-align: right; width: 70px; }
input.cell.date { width: 132px; }
input.cell:disabled, select.cell:disabled, textarea.cell:disabled { color: var(--ink); opacity: 1; }
input.cell::placeholder { color: #9aa0aa; }
td .muted, .muted { color: var(--muted); font-size: 12px; }
.addrow { margin-top: 8px; }

ul.agenda { list-style: none; margin: 0; padding: 0; }
ul.agenda li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
ul.agenda li:first-child { border-top: 0; }
ul.agenda .d { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-right: 6px; }
.kind.event { color: var(--accent); } .kind.cfp { color: var(--amber); } .kind.decision { color: var(--red); }
ul.decisions { list-style: none; padding: 0; margin: 0; }
ul.decisions li { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding: 3px 0; }
ul.decisions li:first-child { border-top: 0; }
.inline { display: flex; gap: 6px; margin-top: 8px; }
.inline input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
textarea.notes { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; }

.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tm { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.tm h3 { font-size: 13.5px; margin: 0 0 6px; display: flex; justify-content: space-between; }
.tm.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tm ul { list-style: none; margin: 0; padding: 0; }
.tm li { font-size: 12.5px; padding: 3px 0; }
.tm li.overdue { color: var(--red); font-weight: 600; }
.tm .empty { color: var(--muted); font-size: 12px; }
.progress { height: 6px; border-radius: 3px; background: var(--gray-bg); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--green); }
.scroll { overflow-x: auto; }

.modal { position: fixed; inset: 0; background: rgba(20,22,28,.45); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal[hidden] { display: none; }
.sheet { background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: 90vh; overflow: auto; padding: 20px 22px; }
.sheet h2 { margin: 0 0 6px; font-size: 18px; }
.preview { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; max-height: 46vh; overflow: auto; background: #fcfcfd; }
.signers label { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 30; font-size: 13px; }
.toast[hidden] { display: none; }

@media (max-width: 980px) { .grid { grid-template-columns: 1fr; } .kpis { grid-template-columns: 1fr 1fr; } }
@media print {
  .top, .actions, .x, .addrow, .inline, .btn { display: none !important; }
  main { padding: 0; } .grid { grid-template-columns: 1fr; } .card { break-inside: avoid; }
  input.cell, select.cell { border: 0; }
}




textarea.cell.grow { display: block; resize: none; overflow: hidden; min-height: 0; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.cell.wide { min-width: 240px; }
td { overflow-wrap: anywhere; }
th { white-space: normal; }
select.cell { min-width: 92px; }
td > b { white-space: nowrap; overflow-wrap: normal; }

.quick .qgrid { display: grid; grid-template-columns: 140px minmax(180px, 1.2fr) 90px minmax(200px, 2fr) minmax(180px, 1.5fr) auto; gap: 8px; }
.quick .qgrid input, .quick .qgrid select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fff; min-width: 0; }
.quick .pace { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.quick .pace b { color: var(--ink); }
.quick .pace .ahead { color: var(--red); font-weight: 600; }
.quick .pace .behind { color: var(--amber); font-weight: 600; }
.bar.marker { height: 14px; overflow: visible; }
@media (max-width: 980px) { .quick .qgrid { grid-template-columns: 1fr 1fr; } }
