@font-face { font-family: Heebo; src: url(/fonts/Heebo-Regular.ttf); font-weight: 400; }
@font-face { font-family: Heebo; src: url(/fonts/Heebo-Bold.ttf); font-weight: 700; }

:root {
  color-scheme: light;
  /* brand: mint #9ED9C3, tomato #E0432F, cream #F4ECD6, coffee #6A4330 */
  --mint: #9ed9c3; --tomato: #e0432f; --cream: #f4ecd6; --coffee: #6a4330;
  --bg: var(--cream); --surface: #fffbf2; --line: #e4d8bd; --ink: #3b2418; --ink-2: #7a5a47; --accent: var(--coffee); --accent-soft: #ddf2e9;
  /* tomato darkened until white text on it is readable (5:1) */
  --action: #cc3824; --action-hover: #b02d1b;
  --danger: #b93321; --danger-soft: #fbe3dd; --warn: #8a4b00; --warn-soft: #fbe7bf; --good: #1f6e57; --good-soft: #ddf2e9;
  --PA: var(--coffee); --DUBI_RH: #2f9577; --DUBI_TRANSPORT: var(--tomato); --UNCLASSIFIED: #a08f7f;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Heebo, Arial, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.01em; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--danger); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--coffee); outline-offset: 2px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; }
bdi { unicode-bidi: isolate; }
[hidden] { display: none !important; }

/* controls */
button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 5px 16px; border: 1px solid #d3c3a0; border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
button:hover, .btn:hover { background: var(--cream); text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--action); border-color: var(--action); color: #fff; }
.primary:hover { background: var(--action-hover); }
.danger { color: var(--danger); }
.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--danger); }
.link:hover { background: none; text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; min-height: 36px; padding: 5px 10px; border: 1px solid #cdbb95; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: 17px; min-height: 17px; height: 17px; margin: 0; accent-color: var(--action); }
label.field { display: block; }
label.field > span { display: block; margin-bottom: 3px; font-size: 13px; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.error { color: var(--danger); min-height: 1.5em; }

/* shell */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--mint); color: var(--ink); padding: 18px 12px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 8px 18px; font-size: 21px; font-weight: 700; color: var(--ink); }
.brand img { width: 100%; max-width: 200px; height: auto; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav .group { margin: 16px 10px 4px; font-size: 13px; color: var(--coffee); }
.side a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius); color: inherit; }
.side a:hover { background: #8bcbb3; text-decoration: none; }
.side a[aria-current] { background: var(--cream); color: var(--ink); font-weight: 700; }
.side a .count { margin-inline-start: auto; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--c); }
.side .dot { outline: 1px solid var(--cream); }
.c-PA { --c: var(--PA); } .c-DUBI_RH { --c: var(--DUBI_RH); } .c-DUBI_TRANSPORT { --c: var(--DUBI_TRANSPORT); } .c-ALL { --c: var(--ink); } td .dot { display: inline-block; } .c-UNCLASSIFIED { --c: var(--UNCLASSIFIED); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 11px; background: var(--action); color: #fff; text-align: center; font-size: 12px; line-height: 20px; font-weight: 700; }
.who { border-top: 1px solid #7fbfa7; padding: 12px 10px 0; margin-top: 12px; font-size: 13px; }
.who strong { display: block; font-size: 14px; }
.who .lang { margin: 6px 0; min-height: 30px; padding: 2px 8px; font-size: 13px; background: var(--surface); border-color: #7fbfa7; }
.who button { color: var(--ink); margin-inline-end: 12px; font-size: 13px; }
main { padding: 22px 28px 60px; min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.top .grow { flex: 1; min-width: 110px; overflow-wrap: anywhere; }
.bell { position: relative; padding: 5px 10px; }
.bell .count { position: absolute; top: -8px; inset-inline-start: -8px; }
.bell svg { width: 18px; height: 18px; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tabs a { padding: 6px 14px; color: var(--ink-2); }
.tabs a[aria-current] { background: var(--mint); color: var(--ink); font-weight: 700; }

/* blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel > h2 { margin-bottom: 10px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); border: 1px solid #ecd08f; }
.empty { padding: 36px; text-align: center; color: var(--ink-2); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 11px; font-size: 13px; background: #ece4d2; color: var(--coffee); white-space: nowrap; }
.badge.first { background: var(--mint); color: var(--ink); }
.badge.won { background: var(--good-soft); color: var(--good); }
.badge.lost { background: #ece4d2; color: #6f6157; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }

/* texts typed by people keep their own direction, aligned with the page */
dt, dd, h1, .timeline p, .card .name, .bars .name { unicode-bidi: plaintext; text-align: left; }
:root[dir=rtl] :is(dt, dd, h1, .timeline p, .card .name, .bars .name) { text-align: right; }

/* dashboard */
.cat { display: grid; gap: 18px; }
.cat header { display: flex; align-items: baseline; gap: 8px; }
.cat header .dot { align-self: center; width: 11px; height: 11px; }
.cat header a { margin-inline-start: auto; }
.kpis { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; gap: 1px; background: var(--line); }
.kpi { flex: 1 1 120px; padding: 10px 14px; background: var(--surface); color: var(--ink); }
a.kpi:hover { background: var(--cream); text-decoration: none; }
.kpi b { display: block; font-size: 30px; line-height: 1.2; }
.kpi.hot b { color: var(--danger); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.charts h3 { margin-bottom: 8px; }
.bars { display: grid; grid-template-columns: minmax(90px, max-content) 1fr max-content; gap: 8px 12px; align-items: center; font-size: 14px; }
.bars .name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 14px; background: #f0e7d0; }
.bars .fill { height: 100%; background: var(--c); border-start-end-radius: 4px; border-end-end-radius: 4px; min-width: 2px; }
.bars .fill.zero { min-width: 0; }
.bars .fill.lost { background: #b3a595; }
.bars .val { font-variant-numeric: tabular-nums; }

/* list */
.filters { display: grid; grid-template-columns: 1.6fr repeat(6, minmax(110px, 1fr)) auto; gap: 8px; align-items: end; margin-bottom: 14px; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 13px; font-weight: 400; color: var(--ink-2); background: #f8f1df; }
th, td { padding: 9px 12px; border-bottom: 1px solid #efe5cd; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.go { cursor: pointer; }
tbody tr.go:hover { background: #f8f1df; }
td a { color: var(--ink); font-weight: 700; }
td.nowrap a { color: var(--accent); font-weight: 400; }
td.nowrap { white-space: nowrap; }
td .sub { display: block; font-size: 13px; color: var(--ink-2); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; }
pre { margin: 6px 0 0; padding: 10px; background: var(--cream); border-radius: 8px; overflow: auto; max-height: 260px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }

.row.small { margin-bottom: 6px; gap: 14px; }

/* kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #ebe0c4; border-radius: var(--radius); padding: 10px; min-height: 60vh; }
.col.over { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.col > header { display: flex; justify-content: space-between; padding: 0 4px 8px; font-weight: 700; }
.col > header span { font-weight: 400; color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; cursor: grab; }
.card.drag { opacity: .45; }
.card .name { font-weight: 700; color: var(--ink); }
.card select { min-height: 30px; padding: 2px 6px; font-size: 13px; margin-top: 8px; }

/* lead */
.lead { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, 1fr); gap: 16px; align-items: start; }
dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 18px; margin: 0; }
dt { color: var(--ink-2); max-width: 240px; } dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.timeline li { border-inline-start: 2px solid var(--line); padding-inline-start: 12px; overflow-wrap: anywhere; }
.timeline .note { border-color: var(--tomato); }
.timeline .note p { white-space: pre-line; background: var(--cream); border-radius: 6px; padding: 8px 10px; margin-bottom: 2px; }
details > summary { cursor: pointer; color: var(--danger); }

/* dialogs, menus, toast */
dialog { border: 0; border-radius: 18px; padding: 22px; background: var(--surface); width: min(560px, calc(100vw - 32px)); color: inherit; box-shadow: 0 18px 60px #3b241840; }
dialog::backdrop { background: #3b241873; }
dialog h2 { font-size: 18px; margin-bottom: 14px; }
dialog form { display: grid; gap: 12px; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; }
.menu { position: absolute; z-index: 5; top: 44px; inset-inline-end: 0; width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 34px #3b24182e; }
.menuwrap { position: relative; }
.menu header { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.menu a { display: block; padding: 9px 14px; color: inherit; border-bottom: 1px solid #efe5cd; }
.menu a.unread { background: var(--accent-soft); }
#toast { position: fixed; bottom: 22px; inset-inline: 0; margin: auto; width: fit-content; max-width: 90vw; padding: 9px 18px; border-radius: var(--radius); background: var(--coffee); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
#toast.on { opacity: 1; } #toast.bad { background: var(--danger); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--mint); }
.login form { width: min(370px, 100%); display: grid; gap: 14px; background: var(--surface); border-radius: 18px; padding: 28px; }
.login .brand { color: var(--ink); padding: 0; }

@media (max-width: 1250px) { .filters { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
@media (max-width: 980px) { .lead, .charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .shell { display: block; }
  .side { position: static; height: auto; padding: 10px; }
  .brand { padding-bottom: 8px; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side nav .group { display: none; }
  .side a { white-space: nowrap; }
  .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; }
  main { padding: 16px 16px 48px; }
  .menu { position: fixed; top: 80px; inset-inline: 16px; width: auto; }
  dl { grid-template-columns: 1fr; gap: 0; } dd { margin-bottom: 9px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
