/* Hanken Grotesk — self-hosted (OFL), comparable to the dashboard design font.
   Served from /static/fonts so it stays within the 'self' CSP (no external calls). */
@font-face {
  font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/hanken-latinext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/static/fonts/hanken-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Toros Consulting brand palette */
  --navy: #1f444d;        /* brand slate-teal (matches logo background) */
  --navy-2: #2c5a64;      /* lighter slate for hovers */
  --brand-deep: #163138;  /* darker slate */
  --cyan: #00e5e5;        /* brand cyan accent (progress, focus, highlights) */
  --cyan-bright: #00ffff; /* logo cyan */
  --blue: #0c818a;        /* deep teal: primary actions & links (accessible on white) */
  --blue-deep: #0a6c74;   /* hover for primary actions */
  --lightblue: #dcf5f5;   /* pale cyan: active nav, card heads */
  --lightblue-2: #eefbfb; /* faint cyan: input tint, hovers */
  --green: #1e8e5a;
  --amber: #c8821a;
  --red: #c0392b;
  --grey: #f3f7f7;
  --border: #d4e2e2;
  --text: #1b2e33;
  --muted: #7a8c8a;
  --shadow: 0 1px 3px rgba(20,50,55,.09), 0 6px 20px rgba(20,50,55,.07);
  --radius: 10px;
  /* Status + surface tokens (reused everywhere) */
  --ok: #1aa05a; --warn: #e0a100; --bad: #d8513f;
  --ok-bg: #e3f5ea; --warn-bg: #fcf1d9; --bad-bg: #fbe6e2;
  --card: #fff; --line: #e6ece9; --ink: #13302f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--grey);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--blue); }

/* ---- Top bar ---- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 16px; }
.topbar .brand .logo-img { height: 40px; width: auto; display: block; }
.topbar .brand .divider { width: 1px; height: 34px; background: rgba(255,255,255,.18); }
.topbar .brand .titles { display: flex; flex-direction: column; }
.topbar .brand .project { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .brand .sub { font-size: 12px; opacity: .8; }
.topbar .meta { text-align: right; font-size: 12px; }
.topbar .meta .deadline { background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 20px; display: inline-block; }
.topbar .meta .carrier { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.topbar .logo { font-weight: 800; letter-spacing: 1px; }

/* ---- Layout ---- */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 250px; flex: 0 0 250px;
  background: #fff; border-right: 1px solid var(--border);
  padding: 14px 0; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; cursor: pointer; color: var(--text);
  border-left: 3px solid transparent; font-weight: 500;
}
.nav-item:hover { background: var(--lightblue-2); }
.nav-item.active { background: var(--lightblue); border-left-color: var(--cyan); color: var(--navy); font-weight: 700; }
.nav-item .pct { margin-left: auto; font-size: 11px; color: var(--muted); }
.pct-badge { flex-shrink: 0; background: var(--lightblue); color: var(--navy); border: 1px solid var(--cyan); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pct-badge span { font-weight: 800; font-size: 15px; }
.nav-ico { width: 22px; height: 22px; object-fit: contain; flex: none; }
.scan-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.scan-badge.bad { background: #fdecea; color: #b3261e; }
.scan-badge.pending { background: #fff4d6; color: #7a5b00; }
.scan-badge.ok { background: #e6f4ea; color: #1e7d34; }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 14px 18px 6px; }

.content { flex: 1; padding: 26px 34px; max-width: 1040px; margin-inline: auto; width: 100%; }
.content h1 { font-size: 22px; color: var(--navy); margin: 0 0 4px; }
.content .section-desc { color: var(--muted); margin: 0 0 20px; max-width: 760px; }

/* ---- Cards / groups ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 1px 2px rgba(20,50,48,.04); margin-bottom: 20px; overflow: hidden; }
.card-head { background: var(--lightblue); padding: 12px 18px; font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--border); }
.card-head .req { font-weight: 400; color: var(--muted); font-size: 12px; }
.card-desc { padding: 10px 18px 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 8px 18px 16px; }

/* ---- Questions ---- */
.q-row { padding: 12px 0; border-bottom: 1px solid #eef1f5; }
.q-row:last-child { border-bottom: none; }
.q-top { display: flex; gap: 14px; align-items: flex-start; }
.q-ref { font-size: 12px; color: var(--muted); font-weight: 700; min-width: 46px; padding-top: 8px; }
.q-main { flex: 1; }
.q-label { font-weight: 600; margin-bottom: 6px; }
.q-req { font-size: 12px; color: var(--blue); background: var(--lightblue-2); padding: 2px 8px; border-radius: 4px; display: inline-block; margin-left: 8px; }
.q-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.fld { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=number], select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,200,200,.18); }
textarea { resize: vertical; min-height: 60px; }
.input-blue { background: var(--lightblue-2); }
select.compliance { font-weight: 700; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.field { margin-bottom: 12px; }
.w-compliance { width: 150px; flex: 0 0 150px; }
.tech-comment.required-empty { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,57,43,.13); background: #fff6f5; }
.w-answer { width: 200px; flex: 0 0 200px; }
.flex-comment { flex: 1; min-width: 220px; }
.single-response { margin-top: 6px; }
.single-response input { width: 100%; max-width: 760px; }

/* ---- Tables (repeating rows) ---- */
table.rows { width: 100%; border-collapse: collapse; }
table.rows th { text-align: left; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--border); font-weight: 700; }
table.rows td { padding: 6px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
table.rows input, table.rows select, table.rows textarea { font-size: 13px; padding: 6px 8px; }
.btn-row { margin-top: 12px; }

/* ---- Commercial totals ---- */
.line-grid { display: grid; grid-template-columns: 60px 1fr 130px 130px 130px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.line-grid.head { font-size: 12px; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.line-grid .ref { font-size: 12px; color: var(--muted); font-weight: 700; }
.subtotal { display: flex; justify-content: flex-end; gap: 24px; padding: 10px 0; font-weight: 700; color: var(--navy); border-top: 2px solid var(--border); }
.grandtotal { background: var(--navy); color: #fff; padding: 14px 18px; border-radius: var(--radius); display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; margin-top: 10px; }
.comm-controls { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.comm-toggle { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--navy); cursor: pointer; }
.comm-toggle input { width: 17px; height: 17px; }
.comm-term { display: flex; align-items: center; gap: 9px; }
.comm-term input { width: 100px; }
.line-grid input.comm-total.locked { background: #eef3f3; color: var(--muted); cursor: not-allowed; font-weight: 700; }
.line-desc { display: flex; align-items: center; gap: 10px; padding: 2px 0 12px 60px; border-bottom: 1px solid #eef1f5; }
.line-desc-label { font-size: 12px; color: var(--blue); font-weight: 600; white-space: nowrap; }
.line-desc input { max-width: 560px; }
.tco-card { border-color: var(--cyan); }
.tco-bar { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 4px 2px; }
.tco-bar .tco-title { font-weight: 800; color: var(--navy); font-size: 15px; margin-right: auto; }
.tco-bar .tco-fig { color: var(--muted); font-size: 13px; }
.tco-bar .tco-fig b { color: var(--navy); font-size: 15px; margin-left: 6px; }
.tco-bar .tco-grand b { color: var(--blue); }

/* ---- Buttons ---- */
.btn { font-family: inherit; font-size: 14px; font-weight: 600; border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--navy); }
.btn-ghost:hover { background: var(--lightblue-2); }
.btn-danger { background: #fff; border: 1px solid var(--red); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-success { background: var(--green); color: #fff; }

/* ---- Misc ---- */
.save-indicator { position: fixed; bottom: 18px; right: 20px; background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; opacity: 0; transition: opacity .25s; box-shadow: var(--shadow); z-index: 100; }
.save-indicator.show { opacity: 1; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 12px; font-weight: 700; text-transform: capitalize; }
.badge.invited { background: #eee; color: #666; }
.badge.in_progress { background: #fff3df; color: var(--amber); }
.badge.submitted { background: #def3e6; color: var(--green); }
.pill { display: inline-block; font-weight: 800; font-size: 10px; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: #eef2f1; color: #6b7d7b; }
.pill--ok { color: #157a43; background: var(--ok-bg); }
.pill--warn { color: #9a6b00; background: var(--warn-bg); }
.pill--bad { color: #b23a2a; background: var(--bad-bg); }
.pill--muted { color: #6b7d7b; background: #eef2f1; }
.upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--lightblue-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.file-chip a { font-weight: 600; }
.muted { color: var(--muted); }
.center-box { max-width: 420px; margin: 12vh auto; background: #fff; padding: 34px; border-radius: var(--radius); box-shadow: var(--shadow); }
.center-box .logo-banner { display: block; height: 64px; width: auto; margin: 0 auto 22px; border-radius: 8px; }
.center-box h1 { color: var(--navy); margin-top: 0; }
.error { color: var(--red); font-size: 13px; margin-top: 8px; }
.readonly-table { width: 100%; border-collapse: collapse; background: #fff; }
.readonly-table td { padding: 7px 12px; border-bottom: 1px solid #eef1f5; font-size: 13px; }
.readonly-table td:nth-child(odd) { color: var(--muted); font-weight: 600; width: 26%; }
.submit-bar { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
.hidden { display: none !important; }
.section-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-top: 22px; padding: 16px 20px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; bottom: 14px; }
.section-footer .foot-right { display: flex; align-items: center; gap: 14px; }
.section-footer .btn-primary { font-size: 15px; padding: 10px 20px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.site-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.site-thumb { width: 100%; height: 170px; object-fit: cover; display: block; background: var(--lightblue-2); cursor: pointer; }
.site-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 44px; color: var(--navy); }
.site-doc span { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.site-meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.site-title { font-weight: 700; color: var(--navy); }
.site-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.progress-wrap { height: 6px; background: #e6ebf2; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); width: 0; transition: width .3s; }

/* Progress rings (dashboard hero + section cards) */
.ring-track { fill: none; stroke: var(--ring-track, #e7efec); stroke-width: 3.4; }
.ring-fill  { fill: none; stroke-width: 3.4; stroke-linecap: round;
              transform: rotate(-90deg); transform-origin: center; transition: stroke-dasharray .35s ease; }
.ring-wrap  { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-pct   { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; line-height: 1; }

/* Deadline header urgency */
.deadline-hd { font-weight: 700; color: var(--navy); }
.deadline-hd.amber { color: #b8860b; }
.deadline-hd.red { color: var(--red); }

/* Dashboard — worklist (left) */
.dash-wrap { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.dash-worklist { flex: 1; min-width: 320px; }
.wl-title { font-size: 26px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); margin: 0 0 6px; }
.wl-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.wl-row { display: flex; align-items: center; gap: 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; margin-bottom: 11px; box-shadow: 0 1px 2px rgba(20,50,48,.04); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.wl-row:hover { border-color: var(--cyan); box-shadow: 0 4px 14px rgba(20,50,48,.09); }
.wl-row--bad { border-color: #f0d6d0; }
.wl-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wl-main { flex: 1; min-width: 0; }
.wl-head { display: flex; align-items: center; gap: 8px; }
.wl-name { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.wl-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin: 3px 0 9px; }
.wl-bar { height: 6px; background: #eef2f1; border-radius: 4px; overflow: hidden; }
.wl-bar-fill { height: 100%; border-radius: 4px; transition: width .35s ease; }
.wl-pct { width: 46px; text-align: right; flex: none; font-size: 18px; font-weight: 800; }
.wl-btn { font-size: 12.5px; font-weight: 800; padding: 10px 16px; border-radius: 9px; flex: none; white-space: nowrap; }
.wl-btn-go { background: #16706b; color: #fff; }
.wl-btn-ghost { background: #fff; color: #16504c; border: 1px solid #cfdbd9; }
.wl-divider { height: 1px; background: #e3eae7; margin: 16px 0 14px; }
.wl-done-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--muted); margin-bottom: 11px; }
.wl-done { display: flex; align-items: center; gap: 15px; background: #f6faf8; border: 1px solid var(--line); border-radius: 13px; padding: 13px 17px; margin-bottom: 11px; cursor: pointer; }
.wl-done:hover { border-color: #bfe3cd; }
.wl-check { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.wl-done-main { flex: 1; }
.wl-done-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.wl-review { font-size: 12px; font-weight: 700; color: #16706b; flex: none; }
.wl-alldone { background: var(--ok-bg); color: #157a43; font-weight: 700; padding: 16px 18px; border-radius: 13px; }

/* Dashboard — summary rail (right, sticky) */
.dash-rail { width: 284px; flex: none; position: sticky; top: 72px; }
.rail-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; box-shadow: 0 1px 2px rgba(20,50,48,.04); }
.rail-ring-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 18px; border-bottom: 1px solid #edf1ef; }
.rail-ring { position: relative; width: 112px; height: 112px; }
.rail-ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rail-ring-pct { font-size: 27px; font-weight: 800; line-height: 1; color: var(--ink); }
.rail-ring-lbl { font-size: 8.5px; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin-top: 2px; }
.rail-sub-pill { font-size: 10px; font-weight: 800; color: #157a43; background: var(--ok-bg); padding: 4px 11px; border-radius: 20px; letter-spacing: .03em; margin-top: 14px; }
.rail-block { padding: 18px 0; border-bottom: 1px solid #edf1ef; }
.rail-lbl { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.rail-big { font-size: 30px; font-weight: 800; line-height: 1; color: #0e3a39; }
.rail-stats { padding: 18px 0; display: flex; justify-content: space-between; }
.rail-stat { text-align: center; cursor: pointer; }
.rail-stat-n { font-size: 18px; font-weight: 800; color: var(--ink); }
.rail-stat-l { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.rail-cta { display: block; font-size: 13.5px; font-weight: 800; background: #16706b; color: #fff; padding: 13px; border-radius: 10px; text-align: center; cursor: pointer; }
.rail-cta:hover { background: #0f5853; }
@media (max-width: 880px) { .dash-rail { width: 100%; position: static; } }
