/* Project dashboards – one stylesheet for sign-in, admin and dashboard pages. */
:root {
  --ink: #16212e; --muted: #5a6878; --line: #d5dde6; --paper: #f3f5f8; --surface: #ffffff; --sunk: #eaeef3;
  --chrome: #0d1b2a; --chrome-ink: #e8f1f7; --chrome-muted: #9fb6c7; --cyan: #3fa7c9;
  --accent: #1e3a5f; --accent-ink: #ffffff;
  --ok: #2f7d55; --ok-bg: #e3f1e9; --info: #2c6c91; --info-bg: #e2eef5; --warn: #a86a0c; --warn-bg: #fbf0dc;
  --bad: #b23a2a; --bad-bg: #f8e4e0; --none: #7b878b; --none-bg: #eceff0;
  --radius: 6px; --gutter: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e4ebf2; --muted: #9eabbb; --line: #2a3747; --paper: #0f1620; --surface: #172230; --sunk: #1e2b3b;
    --chrome: #08111b; --accent-ink: #0d1214;
    --ok: #7dc9a0; --ok-bg: #173226; --info: #86bfe0; --info-bg: #172a36; --warn: #e9b55a; --warn-bg: #33270f;
    --bad: #f0907f; --bad-bg: #3a1c17; --none: #9aa6aa; --none-bg: #252e31;
  }
  :root:not([data-theme="light"]) { --accent: color-mix(in srgb, var(--accent-base, #1e3a5f) 45%, #ffffff); }
}
:root[data-theme="dark"] {
  --ink: #e4ebf2; --muted: #9eabbb; --line: #2a3747; --paper: #0f1620; --surface: #172230; --sunk: #1e2b3b;
  --chrome: #08111b; --accent-ink: #0d1214; --accent: color-mix(in srgb, var(--accent-base, #1e3a5f) 45%, #ffffff);
  --ok: #7dc9a0; --ok-bg: #173226; --info: #86bfe0; --info-bg: #172a36; --warn: #e9b55a; --warn-bg: #33270f;
  --bad: #f0907f; --bad-bg: #3a1c17; --none: #9aa6aa; --none-bg: #252e31;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 "Archivo", system-ui, "Segoe UI", Arial, sans-serif; }
h1 { font-size: 1.7rem; line-height: 1.15; font-weight: 650; font-variation-settings: "wdth" 80; letter-spacing: -.01em; margin: 0 0 .35rem; }
h1 .sub { font-weight: 450; color: var(--muted); font-size: .7em; display: block; margin-top: .2rem; }
h2 { font-size: 1.1rem; font-weight: 620; margin: 0 0 .7rem; }
a { color: var(--accent); }
small, .hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.lede { color: var(--muted); margin: 0 0 1.2rem; max-width: 70ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }

/* ---------- buttons & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: 0 1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.small { min-height: 34px; padding: 0 .75rem; font-size: .9rem; }
.btn.wide { width: 100%; min-height: 48px; margin-top: 1.4rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link { font-size: .9rem; }
.danger { color: var(--bad) !important; }

label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem .7rem; min-height: 42px; }
textarea { min-height: 80px; resize: vertical; }
input[type="color"] { padding: 4px; height: 42px; }
input[type="file"] { padding: .45rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; color: var(--ink); }
.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check.inline { display: inline-flex; margin: 0; font-size: .9rem; color: var(--muted); }
.req { color: var(--bad); font-weight: 500; font-size: .78rem; }
.form { max-width: 760px; }
.form.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form .full { grid-column: 1 / -1; }
.form > .btn, .form .full > .btn { margin-top: 1.2rem; }
.sect { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sect h2 { margin: 0; } .sect .hint { margin: .2rem 0 0; }
.suffix { display: flex; align-items: center; } .suffix input { border-radius: var(--radius) 0 0 var(--radius); }
.suffix span { padding: 0 .7rem; min-height: 42px; display: flex; align-items: center; background: var(--sunk); border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); white-space: nowrap; }
.short { width: 90px; }
.alert, .ok { padding: .7rem .9rem; border-radius: var(--radius); margin: 0 0 1rem; }
.alert { background: var(--bad-bg); color: var(--bad); } .ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- sign-in ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr); }
.plan { background: #1f292e; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px 48px 36px; position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 8.333%); }
.bars { position: relative; display: grid; gap: 11px; padding-bottom: 8px; }
.bar { display: block; height: 14px; margin-left: var(--s); width: var(--l); border-radius: 2px; background: #6f8f96; }
.bar.done { background: #b9d0d2; } .bar.crit { background: #e0a458; }
.today { position: absolute; top: -20px; bottom: 0; left: var(--t); width: 2px; background: #f2f5f5; opacity: .85; }
.today::before { content: "Today"; position: absolute; top: -4px; left: 6px; color: #f2f5f5; font-size: .78rem; }
@media (prefers-reduced-motion: no-preference) {
  .bar { animation: grow .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d); transform-origin: left; }
  @keyframes grow { from { transform: scaleX(0); } }
}
.plan-caption { color: #dfe8e9; margin: 28px 0 0; font-size: 1.05rem; font-weight: 600; font-variation-settings: "wdth" 85; }
.plan-caption span { color: #93a7ac; font-weight: 400; font-size: .9rem; }
.panel { display: grid; place-items: center; padding: 40px 24px; }
.signin { width: 100%; max-width: 380px; }
.pw { position: relative; } .pw input { padding-right: 4.5rem; }
.show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent); font: inherit; font-size: .88rem; font-weight: 600; padding: .4rem .5rem; cursor: pointer; }
.help { color: var(--muted); font-size: .88rem; margin-top: 1.1rem; }
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .plan { padding: 30px 16px 16px; } .bars { gap: 6px; } .bar { height: 7px; } .bars .bar:nth-child(n+11) { display: none; }
  .plan-caption { margin-top: 14px; font-size: .95rem; }
  .panel { place-items: start center; padding: 24px 16px 40px; }
}

/* ---------- chrome ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 12px var(--gutter); background: var(--chrome); color: var(--chrome-ink); }
.topbar a { color: var(--chrome-ink); text-decoration: none; }
.topbar .brand { font-weight: 650; font-variation-settings: "wdth" 80; font-size: 1.05rem; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: .93rem; }
.topbar nav a:hover { text-decoration: underline; }
.page { max-width: 1080px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.page.wide { max-width: 1320px; } .page.narrow { max-width: 520px; }
.block { margin-top: 2.2rem; }
.crumbs { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); }
.tag { display: inline-block; font-size: .74rem; padding: 0 7px; border-radius: 99px; background: var(--sunk); color: var(--muted); margin-left: 4px; vertical-align: 1px; white-space: nowrap; }
.tag.esc { background: var(--bad-bg); color: var(--bad); }

/* project header */
.proj-head { background: var(--chrome); color: var(--chrome-ink); padding: 0 var(--gutter); border-bottom: 4px solid var(--accent-base, var(--accent)); }
.ph-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 0; font-size: .88rem; }
.ph-top a { color: var(--chrome-muted); text-decoration: none; } .ph-top a:hover, .ph-top a.on { color: var(--chrome-ink); text-decoration: underline; }
.ph-user { display: flex; gap: 16px; }
.ph-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 14px 0 10px; flex-wrap: wrap; }
.ph-name { margin: 0; font-size: clamp(1.35rem, 3.2vw, 2.1rem); font-weight: 680; font-variation-settings: "wdth" 76; line-height: 1.05; letter-spacing: -.01em; }
.ph-title { margin: .35rem 0 0; color: var(--chrome-muted); font-size: .95rem; } .ph-title span { color: var(--chrome-muted); opacity: .8; }
.ph-title span::before { content: "— "; }
.ph-date { margin: 0; text-align: right; font-variant-numeric: tabular-nums; } .ph-date span { display: block; color: var(--chrome-muted); font-size: .8rem; }
.ph-date time { font-size: 1.05rem; font-weight: 600; }
.ph-team { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 4px 0 10px; font-size: .85rem; }
.ph-team li { display: flex; align-items: center; gap: 8px; } .ph-team .role { color: var(--chrome-muted); }
.ph-team img { height: 26px; max-width: 110px; object-fit: contain; background: #fff; border-radius: 3px; padding: 2px 4px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--chrome-muted); text-decoration: none; padding: 10px 14px 11px; white-space: nowrap; font-weight: 600; border-radius: var(--radius) var(--radius) 0 0; }
.tabs a:hover { color: var(--chrome-ink); }
.tabs a[aria-current="page"] { background: var(--paper); color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
.grid th, .grid td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-weight: 600; color: var(--muted); background: var(--sunk); white-space: nowrap; position: sticky; top: 0; }
.grid th[data-sort] { cursor: pointer; } .grid th[aria-sort="ascending"]::after { content: " ↑"; } .grid th[aria-sort="descending"]::after { content: " ↓"; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tr[data-href] { cursor: pointer; } .grid tr[data-href]:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid.compact td { padding: .35rem .75rem; }
.grid tr.is-off td { color: var(--muted); } .grid tr.is-bad td:last-child { color: var(--bad); }
.grid .vals { color: var(--muted); font-size: .85rem; }
.acts form, .acts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.t-ok.pill { background: var(--ok-bg); color: var(--ok); } .t-info.pill { background: var(--info-bg); color: var(--info); }
.t-warn.pill { background: var(--warn-bg); color: var(--warn); } .t-bad.pill { background: var(--bad-bg); color: var(--bad); }
.t-muted.pill { background: var(--none-bg); color: var(--none); }
.over { color: var(--bad); font-weight: 650; }
.mtag { font-size: .74rem; color: var(--muted); text-transform: capitalize; }
.empty { color: var(--muted); padding: 1rem 0; }
.count { color: var(--muted); font-size: .88rem; margin: .4rem 0; }

@media (max-width: 720px) {
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  table.grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid thead { display: none; }
  .grid tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 8px 12px; }
  .grid td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 38% 1fr; gap: 10px; }
  .grid td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; }
  .grid td:not([data-label])::before { content: none; } .grid td:not([data-label]) { display: block; }
  .grid td:first-child { font-weight: 600; font-size: 1rem; }
  .grid .num { text-align: left; }
  .grid td:empty { display: none; }
  .grid.map td { grid-template-columns: 30% 1fr; }
}

/* ---------- module pages ---------- */
.mod-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: .4rem; }
.mod-head .acts { margin-top: .3rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink); }
.chip b { font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; align-self: center; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin: 0 0 10px; }
.filters input[type="search"] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; flex: 0 1 220px; }
.filters label:not(.check) { margin: 0; }

dialog.drawer { padding: 0; border: 0; margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(560px, 100%); background: var(--surface); color: var(--ink); box-shadow: -10px 0 40px rgba(0,0,0,.18); }
dialog.drawer::backdrop { background: rgba(10, 16, 18, .45); }
.dr-in { padding: 0 22px 32px; }
.drawer header { position: sticky; top: 0; background: var(--surface); display: flex; justify-content: space-between; gap: 12px; padding: 18px 0 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.drawer h2 { font-size: 1.15rem; margin: 0; } .drawer h2 small { display: block; color: var(--muted); font-weight: 450; font-size: .9rem; margin-top: 2px; }
.x { background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.drawer h3 { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 1.2rem 0 .3rem; }
.drawer dl { display: grid; grid-template-columns: 42% 1fr; gap: 4px 12px; margin: 0; font-size: .93rem; }
.drawer dt { color: var(--muted); } .drawer dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.drawer .status-line { margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drawer .edit { margin-top: 1.4rem; }
@media (max-width: 720px) {
  dialog.drawer { margin: auto 0 0; width: 100%; height: auto; max-height: 88vh; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
  .dr-in { padding: 0 16px 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.drawer[open] { animation: slide .22s ease-out; }
  @keyframes slide { from { transform: translateX(30px); opacity: .4; } }
  @media (max-width: 720px) { @keyframes slide { from { transform: translateY(40px); opacity: .4; } } }
}
.doclist { list-style: none; padding: 0; margin: .2rem 0 0; display: grid; gap: 6px; }
.doclist li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.doclist a { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- overview ---------- */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 12px; }
.kpi-card header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.kpi-card h2 { margin: 0; font-size: 1rem; } .kpi-card h2 a { color: var(--ink); text-decoration: none; } .kpi-card h2 a:hover { text-decoration: underline; }
.kpi-card .total { font-size: 1.6rem; font-weight: 680; font-variation-settings: "wdth" 76; font-variant-numeric: tabular-nums; }
.kpi-card dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.kpi { border-left: 3px solid var(--none); padding-left: 10px; }
.kpi dt { font-size: .84rem; color: var(--muted); } .kpi dd { margin: 0; font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi dd.sub { font-size: .78rem; font-weight: 400; color: var(--muted); }
.kpi.t-ok { border-color: var(--ok); } .kpi.t-info { border-color: var(--info); } .kpi.t-warn { border-color: var(--warn); } .kpi.t-bad { border-color: var(--bad); }
.attention { margin-top: 28px; }
.attention h2 .n { display: inline-block; min-width: 1.6em; text-align: center; background: var(--bad); color: #fff; border-radius: 99px; font-size: .8rem; padding: 1px 7px; vertical-align: 2px; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stack { margin: 0; } .stack figcaption { font-weight: 620; margin-bottom: 6px; }
.legend { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.srow { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 30px; gap: 8px; align-items: center; margin: 6px 0; font-size: .85rem; }
.slabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar { display: flex; height: 16px; width: var(--w); border-radius: 3px; overflow: hidden; background: var(--sunk); }
.sbar i { display: block; height: 100%; }
.stot { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.t-ok.sw, .sbar .t-ok, .chip .t-ok { background: var(--ok); } .t-info.sw, .sbar .t-info, .chip .t-info { background: var(--info); }
.t-warn.sw, .sbar .t-warn, .chip .t-warn { background: var(--warn); } .t-bad.sw, .sbar .t-bad, .chip .t-bad { background: var(--bad); }
.t-muted.sw, .sbar .t-muted, .chip .t-muted { background: var(--none); }
@media (max-width: 980px) { .kpis, .charts { grid-template-columns: 1fr; } }

/* ---------- main site & admin ---------- */
.project-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.project-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; border-top: 4px solid var(--accent); }
.project-list li > a:first-child { padding: 16px 18px 10px; color: var(--ink); text-decoration: none; display: grid; gap: 3px; flex: 1; }
.project-list li > a:first-child:hover .pl-name { text-decoration: underline; }
.pl-name { font-size: 1.2rem; font-weight: 660; font-variation-settings: "wdth" 80; } .pl-title { color: var(--muted); } .pl-meta { color: var(--muted); font-size: .82rem; margin-top: 6px; }
.pl-admin { padding: 0 18px 14px; font-size: .9rem; }
.admin-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.acard.alt { background: var(--sunk); }
.acard.wide-card { grid-column: 1 / -1; border-left: 4px solid var(--accent); }
.acard h2 { margin: 0; } .acard h2 a { color: var(--ink); text-decoration: none; } .acard .meta { color: var(--muted); margin: 0 0 10px; font-size: .9rem; flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.inline-form select { min-height: 34px; padding: .2rem .5rem; width: auto; }
.entry fieldset { border: 0; border-top: 1px solid var(--line); margin: 0 0 6px; padding: 10px 0 14px; }
.entry legend { font-weight: 650; font-size: 1rem; padding: 0 8px 0 0; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.fgrid .full { grid-column: 1 / -1; }
.entry.form { max-width: 980px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 1rem; position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); }
.form-actions .push { margin-left: auto; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 4px 14px 14px; background: var(--surface); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop-list { margin: .4rem 0 0; color: var(--muted); font-size: .88rem; }
.team-rows { display: grid; gap: 8px; }
.team-row { display: grid; grid-template-columns: 1fr 1.3fr 1.4fr; gap: 8px; align-items: center; }
.logo-cell { display: flex; align-items: center; gap: 10px; } .logo-cell img { height: 34px; max-width: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 2px; }
.modes { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 12px; margin: 18px 0 0; background: var(--surface); }
.modes legend { font-weight: 650; padding: 0 6px; }
.cols-list { columns: 2 260px; padding-left: 1.1rem; font-size: .92rem; } .cols-list li { margin-bottom: 3px; break-inside: avoid; }
.handover { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 1.2rem; }
.handover p { margin: 0 0 .7rem; }
.handover dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 .9rem; }
.handover dt { color: var(--muted); } .handover dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pwshow { font-size: 1.15rem; letter-spacing: .04em; }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  h1 { font-size: 1.4rem; }
  .page { padding-top: 20px; }
  .form.two, .two-col, .fgrid { grid-template-columns: 1fr; }
  .team-row { grid-template-columns: 1fr 1fr; } .team-row .logo-cell { grid-column: 1 / -1; }
  .ph-main { align-items: flex-start; } .ph-date { text-align: left; }
  .filters select { flex: 1 1 45%; }
  .form-actions .push { margin-left: 0; }
  .kpi-card dl { gap: 8px 12px; }
}
/* phone menu: panel from the right */
.menu-btn, .side-scrim, .side-panel, .topbar nav.side-panel { display: none; }
@media (max-width: 720px) {
  .topbar, .proj-head { position: relative; }
  .topbar nav, .ph-user, .proj-head .tabs { display: none; }
  .topbar { padding-right: 56px; } .ph-top { padding-right: 48px; min-height: 40px; }
  .menu-btn { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; position: absolute; top: 4px; right: 6px; width: 44px; height: 42px; padding: 0 11px; background: none; border: 0; cursor: pointer; z-index: 2; }
  .menu-btn span { display: block; height: 2px; background: var(--chrome-ink); border-radius: 2px; }
  .side-scrim { display: block; position: fixed; inset: 0; background: rgba(8, 14, 16, .5); z-index: 80; opacity: 0; transition: opacity .2s; }
  .side-scrim.on { opacity: 1; }
  .side-panel { display: none; flex-direction: column; position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); background: var(--chrome); color: var(--chrome-ink); z-index: 90;
    transform: translateX(100%); transition: transform .24s ease-out; overflow-y: auto; padding-bottom: 24px; box-shadow: -12px 0 40px rgba(0,0,0,.35); }
  .side-panel.open, .topbar nav.side-panel.open { display: flex; }
  .side-panel.on { transform: none; }
  .sp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 8px 12px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .sp-close { background: none; border: 0; color: var(--chrome-muted); font-size: 28px; line-height: 1; width: 44px; height: 44px; cursor: pointer; }
  .sp-sec { margin: 16px 20px 4px; color: var(--chrome-muted); font-size: .8rem; font-weight: 600; }
  .side-panel a { color: var(--chrome-ink); text-decoration: none; padding: 12px 20px; border-left: 3px solid transparent; }
  .side-panel a:hover, .side-panel a:active { background: rgba(255,255,255,.06); }
  .side-panel a[aria-current="page"] { border-left-color: var(--accent); background: rgba(255,255,255,.08); font-weight: 650; }
}
@media (prefers-reduced-motion: reduce) { .side-panel, .side-scrim { transition: none; } }
@media print {
  .tabs, .ph-top, .filters, .chips, .btn, .acts { display: none !important; }
  body { background: #fff; } .proj-head { background: #fff; color: #000; border-bottom-color: #000; }
}
.side-scrim[hidden] { display: none !important; }
@media (hover: hover) and (pointer: fine) { .view-toggle { display: none; } }
/* document slots on the entry form */
.docslot { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 8px 12px 10px; margin-top: 10px; }
.slot-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.slot-file { margin: 2px 0 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.slot-file a { font-weight: 600; overflow-wrap: anywhere; }
.drop.small { padding: 0 10px 8px; border-width: 1px; }
.drop.small label { margin-top: .5rem; font-weight: 500; }
/* history */
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.versions > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.v-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.v-head span { color: var(--muted); font-size: .9rem; }
.v-changes { margin: 6px 0 0; padding-left: 1.1rem; font-size: .9rem; }
.v-f { color: var(--muted); } .v-old { text-decoration: line-through; color: var(--muted); } .v-new { font-weight: 600; }
.inline-form { display: inline; }

/* ===== Option B: navy chrome, pill buttons ===== */
.btn { border-radius: 999px; font-weight: 600; }
.btn.primary { box-shadow: 0 1px 2px rgba(13,27,42,.2); }
.topbar { background: var(--chrome); background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 24px 24px; border-bottom: 2px solid var(--cyan); }

.topbar > nav a { text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; font-weight: 600; color: var(--chrome-muted); }
.topbar > nav a:hover { color: #fff; }
.eyebrow { margin: 0 0 2px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.hint { color: var(--muted); font-size: .86rem; font-weight: 400; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; }

/* auth pages: forgot / reset / welcome */
.auth { min-height: calc(100vh - 0px); display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  background: var(--chrome); background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 10px; padding: 28px 28px 22px; border-top: 4px solid var(--cyan); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.auth-card .auth-brand { margin: 0 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); }
.auth-card label { display: block; margin: 1rem 0 .3rem; font-weight: 600; }
.auth-card .pw { position: relative; }
.auth-card .help { margin: 1rem 0 0; font-size: .9rem; color: var(--muted); }
.ok { background: var(--ok-bg); color: var(--ok); }

/* admin dashboard */
.adm { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.adm-nav { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 0; display: flex; flex-direction: column; }
.adm-nav .adm-k { margin: 14px 20px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.adm-nav .adm-k:first-child { margin-top: 0; }
.adm-nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; font-weight: 500; }
.adm-nav a:hover { background: var(--sunk); }
.adm-nav a[aria-current="page"] { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); font-weight: 650; color: var(--accent); }
.adm-nav .cnt { font-size: .75rem; background: var(--sunk); color: var(--muted); border-radius: 99px; padding: 1px 8px; }
.adm-roles { margin-top: auto; padding-top: 16px; }
.adm-roles dl { margin: 0 20px; font-size: .82rem; display: grid; gap: 1px; }
.adm-roles dt { font-weight: 650; margin-top: 6px; } .adm-roles dd { margin: 0; color: var(--muted); }
.adm-main { padding: 24px var(--gutter) 48px; min-width: 0; max-width: 1280px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.adm-head h1 { margin: 0; }
.adm-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.adm-filters select, .adm-filters input[type=search] { width: auto; min-width: 180px; border-radius: 999px; min-height: 36px; padding: .3rem 1rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg a { padding: 7px 14px; text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 550; border-right: 1px solid var(--line); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a span { color: var(--muted); font-size: .78rem; margin-left: 3px; }
.seg a.on { background: var(--chrome); color: #fff; } .seg a.on span { color: var(--chrome-muted); }
.grid.people th { background: var(--chrome); color: var(--chrome-ink); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
.grid.people td { vertical-align: middle; }
.grid.people tr.is-off td { opacity: .6; }
.grid td.empty { text-align: center; color: var(--muted); padding: 2rem; }
.who { display: flex; gap: 10px; align-items: center; }
.av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--chrome); color: #fff; font-weight: 700; font-size: .9rem; }
.who small { color: var(--muted); }
.tag.owner { background: var(--chrome); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 650; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.wait { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.off { background: var(--none-bg); color: var(--none); }
.rolesel { min-height: 34px; padding: .25rem 2rem .25rem .7rem; border-radius: 999px; width: auto; font-size: .88rem; font-weight: 550; }
.rolesel.r-admin { border-color: var(--accent); color: var(--accent); background-color: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.rolesel.r-editor { border-color: var(--info); color: var(--info); }
.rolesel.r-none { color: var(--muted); }
.table-wrap.tw-people { overflow: visible; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; border: 1px solid var(--line); background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--chrome); color: #fff; border-color: var(--chrome); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--chrome); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(13,27,42,.18); padding: 4px 0; }
.menu-pop button, .menu-pop a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 14px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--sunk); }
.menu-pop .danger { color: var(--bad); border-top: 1px solid var(--line); }
.linkbox { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px; }
.linkbox.unsent { border-left-color: var(--warn); }
.linkbox h2 { font-size: 1.05rem; margin: 0 0 4px; }
.linkbox p { margin: 0 0 8px; }
.copyrow { display: flex; gap: 8px; } .copyrow input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; max-width: 760px; }
fieldset.roles { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 10px; margin: 0; }
fieldset.roles legend { font-weight: 600; padding: 0 6px; }
.rolerow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rolerow:last-child { border-bottom: 0; } .rolerow select { width: 200px; }
.grid.log tr.bad td { color: var(--bad); }
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .adm-nav { flex-direction: row; flex-wrap: wrap; padding: 8px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .adm-nav .adm-k, .adm-roles, .adm-nav a:not([aria-current]):nth-of-type(n+4) { display: none; }
  .adm-nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .adm-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
  .menu-pop { right: auto; left: 0; }
}
.grid.people .badge { width: fit-content; }
