/* Ugaaz portal: graphite ground, brushed-silver accents, WhatsApp green for chat actions, blue for data. */
:root {
  --bg: #0a0b0d; --bg-2: #101215; --surface: #15181c; --surface-2: #1b1f24;
  --line: rgba(214,219,226,.12); --line-2: rgba(214,219,226,.24);
  --text: #eceff3; --muted: #979ea8; --silver: #c9ced6;
  --chrome: linear-gradient(180deg, #f7f8fa 0%, #d5d9df 45%, #a9afb8 100%);
  --data: #4c8fe0; --data-2: #9cc3f2; --data-track: rgba(76,143,224,.14);
  --ok: #3fbf7f; --warn: #e0a84b; --bad: #ef6b5b; --new: #9cc3f2;
  --wa: #25d366; --wa-deep: #128c7e;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 16px; --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
@font-face { font-family: "wa-icon"; src: url("/assets/fonts/wa-icon.woff2") format("woff2"); font-display: block; }
.fa-brands.fa-whatsapp { font-family: "wa-icon"; font-style: normal; display: inline-block; -webkit-font-smoothing: antialiased; }
.fa-brands.fa-whatsapp::before { content: "\f232"; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(26px, 3vw, 34px); }
h2 { font-size: 18px; }
p { margin: 0; }
small { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.bad { color: var(--bad); }
.ok-text { color: var(--ok); font-size: 18px !important; }
.warn-text { color: var(--warn); }
.r { text-align: right; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: filter .2s, border-color .2s, background .2s; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--chrome); color: #0a0b0d; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.btn-danger { border-color: rgba(239,107,91,.5); color: #ffb3a9; background: transparent; }
.btn-danger:hover { background: rgba(239,107,91,.12); }
.btn-wa { background: linear-gradient(120deg, #3ee07f, var(--wa) 40%, var(--wa-deep)); color: #fff; box-shadow: 0 10px 30px -14px rgba(37,211,102,.7); }
.btn-wa:hover { filter: brightness(1.07); }
.wa-ico { font-size: 1.2em; line-height: 1; }
.wa-link { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 600; }
.wa-link .wa-ico { color: var(--wa); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-sm { width: 30px; height: 30px; font-size: 17px; color: var(--muted); }
.icon-sm:hover { color: var(--bad); border-color: var(--bad); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; color: var(--muted); cursor: pointer; text-decoration: none; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.btn-row form { margin: 0; }
.dot-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 13.5px; }
.opt { color: var(--muted); font-weight: 400; }
input:not([type=checkbox]):not([type=file]):not([type=hidden]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); font-size: 15px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--silver); box-shadow: 0 0 0 3px rgba(201,206,214,.15); }
input:disabled { opacity: .6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px !important; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--silver); }
.stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.span-2 { grid-column: 1 / -1; }
.span-all { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; min-width: 0; }
.suffix, .prefix { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); overflow: hidden; }
.suffix input, .prefix input { border: 0 !important; box-shadow: none !important; background: transparent !important; }
.suffix span, .prefix span { padding: 0 12px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.prefix span { padding-right: 0; }
.drop { position: relative; display: grid; place-items: center; min-height: 64px; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: 14px; color: var(--muted); text-align: center; cursor: pointer; font-size: 14px; }
.drop:hover, .drop.has-file { border-color: var(--silver); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.code-input { font-size: 22px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- flash + badges ---------- */
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; display: grid; gap: 4px; }
.flash-ok { border-color: rgba(63,191,127,.45); background: rgba(63,191,127,.08); }
.flash-bad { border-color: rgba(239,107,91,.5); background: rgba(239,107,91,.08); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: rgba(63,191,127,.12); }
.badge-warn { color: var(--warn); background: rgba(224,168,75,.12); }
.badge-bad { color: var(--bad); background: rgba(239,107,91,.12); }
.badge-info { color: var(--data-2); background: rgba(76,143,224,.14); }
.badge-new { color: #0a0b0d; background: var(--new); }
.badge-new::before { display: none; }
.badge-muted { color: var(--muted); background: rgba(151,158,168,.12); }
.count { margin-left: auto; font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--new); color: #0a0b0d; display: grid; place-items: center; }

/* ---------- admin shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg-2); padding: 18px 12px; display: flex; flex-direction: column; gap: 18px; }
.side-brand { display: flex; align-items: flex-end; gap: 9px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: .06em; padding: 0 8px; }
.side-brand small { font-family: var(--body); font-size: 11px; letter-spacing: .06em; color: var(--muted); padding-bottom: 3px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
.side nav a svg { width: 18px; height: 18px; flex: none; }
.side nav a:hover { color: var(--text); background: var(--surface); }
.side nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--silver); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 10px; font-size: 13.5px; color: var(--muted); }
.side-foot a { text-decoration: none; }
.side-foot form { margin: 0; }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bar-search { flex: 1; max-width: 360px; margin: 0; }
.bar-search input { min-height: 38px !important; border-radius: 999px !important; }
.bar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.bar-actions form { margin: 0; }
.who { color: var(--muted); font-size: 14px; }
.side-toggle { display: none; }
.content { padding: clamp(18px, 3vw, 32px); padding-bottom: 64px; min-width: 0; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; width: 260px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .side.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .side-toggle { display: inline-grid; }
  .who { display: none; }
}

/* ---------- client shell ---------- */
.cwrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.ctop { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ctop .cwrap { display: flex; align-items: center; gap: 18px; min-height: 64px; flex-wrap: wrap; }
.ctop .side-brand { padding: 0; }
.cnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.cnav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.cnav a:hover { color: var(--text); }
.cnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.lang { font-size: 13.5px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
.lang:hover { color: var(--text); }
.cfoot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.c-hero { padding: 12px 0 22px; display: grid; gap: 8px; }
.c-hero h1 { font-size: clamp(30px, 4vw, 42px); }
.lede { color: var(--muted); font-size: 16.5px; max-width: 62ch; }
@media (max-width: 760px) {
  .ctop .cwrap { gap: 8px; padding-block: 10px; }
  .cnav { order: 3; width: 100%; margin: 0 -4px; }
  .ctop .bar-actions .btn { display: none; }
}

/* ---------- page head, cards, grids ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title { display: grid; gap: 6px; min-width: 0; }
.crumb { color: var(--muted); text-decoration: none; font-size: 14px; }
.crumb::before { content: "← "; }
.crumb:hover { color: var(--text); }
.sub { color: var(--muted); font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sub a { color: var(--text); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.card + .card, .card + .grid-2, .grid-2 + .card, .kpis + .card, .tabs + .card, .card + .btn-row { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head a { color: var(--muted); font-size: 14px; text-decoration: none; }
.card-head a:hover { color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2.inner { margin-top: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.form-card { max-width: 900px; }
.table-card { padding: 4px 0; }
.table-card .empty { padding: 16px 20px; }
.empty { color: var(--muted); font-size: 14.5px; }
.empty-card { display: grid; gap: 10px; justify-items: start; max-width: 640px; }
.empty-card p { color: var(--muted); }
.empty-page { display: grid; gap: 14px; justify-items: start; padding: 60px 0; }
.mini { font-size: 15px; margin: 16px 0 10px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi { padding: 14px; } .kpi b { font-size: 21px; } .ok-text { font-size: 15px !important; } }
.kpi { display: grid; gap: 4px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
a.kpi:hover { border-color: var(--line-2); }
.kpi span { color: var(--muted); font-size: 13.5px; }
.kpi b { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi em { font-style: normal; font-size: 13px; color: var(--muted); }
.kpi em.bad { color: var(--bad); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 14.5px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--silver); }
.filters { display: flex; gap: 8px; margin-bottom: 16px; max-width: 520px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.list li:first-child { border-top: 0; }
.list li > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list li form { margin: 0; }
.list strong { font-weight: 600; overflow-wrap: anywhere; }
.list small { overflow-wrap: anywhere; }
.list li.unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--new); margin-right: 8px; vertical-align: middle; }
.row-link { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 1; min-width: 0; }
.row-link > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.meter { width: 90px; height: 6px; border-radius: 3px; background: var(--data-track); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; background: var(--data); border-radius: inherit; }
.meter-lg { width: 100%; height: 10px; border-radius: 5px; }
.progress-hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 16px; }
.progress-hero > div:first-child { display: grid; }
.progress-hero b { font-family: var(--display); font-size: 34px; font-variant-numeric: tabular-nums; line-height: 1; }
.task-line .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); background: none; cursor: pointer; }
.task-line .tick:hover { border-color: var(--ok); background: rgba(63,191,127,.15); }

/* tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table td small, .table td > small { display: block; }
.table a { text-decoration: none; }
.table a:hover strong { text-decoration: underline; }
.table .r { text-align: right; }
.table tfoot th, .table tfoot td { border-top: 1px solid var(--line-2); }
.table tfoot .balance th { font-family: var(--display); font-size: 18px; }
.items-view td, .items-view th { padding-inline: 4px; }

/* line-item editor */
.items { width: 100%; border-collapse: collapse; min-width: 620px; }
.items th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 6px; }
.items td { padding: 4px 6px; vertical-align: middle; }
.items .r { text-align: right; }
.items input.num-in { text-align: right; max-width: 120px; margin-left: auto; display: block; }
.items tfoot th, .items tfoot td { padding-top: 12px; }
.items [data-total] { font-family: var(--display); font-size: 18px; }

/* project cards */
.project-card { display: grid; gap: 8px; text-decoration: none; }
.project-card:hover { border-color: var(--line-2); }
.project-card h2 { font-size: 19px; }
.project-card .meter { width: 100%; }
.pc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lead { display: grid; gap: 8px; }

/* stages */
.stages-edit { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.stage-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.stage-form input[name=name] { grid-column: 1 / -1; font-weight: 600; }
.steps-v { list-style: none; margin: 0; padding: 0; display: grid; }
.steps-v li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.steps-v li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.steps-v li:last-child::before { display: none; }
.steps-v .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); position: relative; z-index: 1; }
.steps-v .st-done .dot { background: var(--data); border-color: var(--data); box-shadow: inset 0 0 0 4px var(--surface); }
.steps-v .st-in_progress .dot { border-color: var(--data); box-shadow: 0 0 0 4px var(--data-track); }
.steps-v div { display: grid; gap: 2px; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.timeline time { color: var(--muted); font-size: 13px; }
.timeline li { display: grid; gap: 4px; padding-left: 14px; border-left: 2px solid var(--line-2); }

/* files */
.files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.files li > div { flex: 1; min-width: 0; display: grid; }
.files a:not(.btn) { overflow-wrap: anywhere; font-weight: 600; text-decoration: none; }
.files form { margin: 0; }
.ftype { font-size: 11px; font-weight: 700; color: var(--silver); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 5px; min-width: 42px; text-align: center; }
.request { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid rgba(224,168,75,.35); background: rgba(224,168,75,.05); border-radius: 14px; margin-bottom: 10px; }
.request > div { display: grid; gap: 3px; }
@media (max-width: 760px) { .request { grid-template-columns: 1fr; } }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding: 4px 2px 12px; }
.bubble { max-width: min(78%, 620px); padding: 10px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.bubble.mine { align-self: flex-end; background: rgba(201,206,214,.1); border-color: var(--line-2); border-bottom-right-radius: 4px; }
.bubble.theirs { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble small { font-size: 12px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; margin: 0; }
.composer-row textarea { flex: 1; }
.chat-card .muted.small { margin-top: 10px; }

/* tasks board */
.task-new { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.task-new .grow { min-width: 0; }
.task-new .form-actions { margin: 0; grid-column: 1 / -1; }
@media (max-width: 900px) { .task-new { grid-template-columns: 1fr 1fr; } .task-new .grow { grid-column: 1 / -1; } }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.col h2 { font-size: 15px; margin-bottom: 12px; display: flex; gap: 8px; }
.col-body { display: grid; gap: 10px; min-height: 80px; border-radius: 12px; transition: background .2s; }
.col-body.over { background: rgba(201,206,214,.06); outline: 1.5px dashed var(--line-2); }
.tcard { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 6px; cursor: grab; }
.tcard.dragging { opacity: .45; }
.tcard p { color: var(--muted); font-size: 14px; }
.tcard.pri-high { border-left-color: var(--bad); }
.tcard.pri-low { border-left-color: var(--line); }
.tcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tcard-actions form { margin: 0; }

/* notices */
.notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; text-decoration: none; margin-bottom: 10px; border-color: rgba(156,195,242,.35); }
.notice:hover { border-color: var(--data-2); }
.notice span { color: var(--muted); }
.notice-bad { border-color: rgba(239,107,91,.45); }
.pay-box { padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); margin: 12px 0; font-variant-numeric: tabular-nums; }
.invite-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); display: grid; gap: 8px; }
.danger-zone summary { cursor: pointer; color: var(--muted); }
.danger-zone details[open] summary { margin-bottom: 10px; }
.danger-zone p { margin-bottom: 10px; color: var(--muted); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.qr-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.qr { width: 164px; height: 164px; background: #fff; padding: 10px; border-radius: 12px; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
.key { display: block; font-size: 15px; letter-spacing: .08em; margin-top: 4px; overflow-wrap: anywhere; }
#two-step form { margin: 10px 0 0; }

/* charts */
.chart { margin: 0; }
.chart svg { width: 100%; height: 260px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.chart .s1, .legend .s1 { fill: var(--data); background: var(--data); }
.chart .s2, .legend .s2 { fill: #8a919b; background: #8a919b; }
.chart .s3, .legend .s3 { fill: var(--wa); background: var(--wa); }
.legend { display: flex; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars-list li > div { gap: 6px; }
.hbar { display: block; height: 6px; border-radius: 3px; background: var(--data-track); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--data); border-radius: inherit; }

/* research editor */
.editor { display: grid; gap: 16px; }
.editor .form-card { max-width: none; }
.title-input { font-family: var(--display); font-size: 22px !important; font-weight: 600; }
.editor-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .editor-panes { grid-template-columns: 1fr; } }
.pane { display: grid; gap: 10px; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pane-head .mini { margin: 0; }
.pane textarea { font: 14.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; min-height: 520px; }
.toolbar-md { display: flex; gap: 4px; flex-wrap: wrap; }
.toolbar-md button, .img-btn { border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 4px 9px; font-size: 13px; cursor: pointer; color: var(--muted); }
.toolbar-md button:hover, .img-btn:hover { color: var(--text); border-color: var(--line-2); }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); margin: 0; }
.prose { font-size: 16.5px; line-height: 1.7; max-width: 70ch; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 14px; }
.prose h2 { font-size: 24px; margin-top: 28px; }
.prose h3 { font-size: 19px; margin-top: 22px; }
.prose h4 { font-size: 16px; margin-top: 18px; }
.prose a { color: var(--data-2); }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 3px solid var(--silver); color: var(--silver); }
.prose code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 22px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { border-top: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 24px 0; }
.preview { min-height: 520px; }

/* ---------- auth ---------- */
body.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art { position: relative; overflow: hidden; }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 10% 50%; }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,11,13,0) 50%, var(--bg)); }
.auth-panel { display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px); min-height: 100vh; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-top .side-brand { padding: 0; }
.auth-box { width: 100%; max-width: 420px; margin: auto 0; display: grid; gap: 14px; padding-block: 40px; }
.auth-box h1 { font-size: clamp(28px, 3.4vw, 38px); }
.muted-link { color: var(--muted); font-size: 14px; text-align: center; text-decoration: none; }
.muted-link:hover { color: var(--text); }
.auth-foot { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-art { height: 34vh; }
  .auth-art::after { background: linear-gradient(180deg, rgba(10,11,13,0) 40%, var(--bg)); }
  .auth-art img { object-position: 15% 50%; }
  .auth-panel { min-height: 0; margin-top: -60px; position: relative; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Language picker (EN / SO / SW with flags) */
.lang-dd { position: relative; }
.lang-dd summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; user-select: none; }
.lang-dd summary::-webkit-details-marker { display: none; }
.lang-dd summary:hover, .lang-dd[open] summary { border-color: var(--line-2, rgba(214,219,226,.26)); }
.lang-dd .chev { width: 11px; height: 11px; color: var(--muted); transition: transform .2s; }
.lang-dd[open] .chev { transform: rotate(180deg); }
.flag { width: 20px; height: 14px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.18); display: inline-block; }
.flag svg { width: 100%; height: 100%; display: block; }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 180px; padding: 6px; display: grid; gap: 2px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.lang-menu a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; text-decoration: none; font-size: 14.5px; color: var(--muted); }
.lang-menu a:hover, .lang-menu a[aria-current="true"] { background: rgba(201,206,214,.1); color: var(--text); }
.lang-menu .name { flex: 1; }
.lang-menu .code { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; }
@media (max-width: 520px) { .lang-dd summary .code { display: none; } }
.wa-link.esc { font-weight: 500; color: var(--muted); font-size: 14px; }
.wa-link.esc:hover { color: var(--text); }
.c-hero-actions { margin-top: 18px; }
.pay-notice summary { list-style: none; width: fit-content; }
.pay-notice summary::-webkit-details-marker { display: none; }
.pay-notice[open] summary { display: none; }
.pay-notice form { margin-top: 4px; }
.notice-card { border-color: rgba(76,143,224,.45); }

/* Requests pipeline */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.pl-step { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 2px; }
.pl-step b { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-step span { font-size: 13px; color: var(--muted); }
.pl-new { border-color: rgba(76,143,224,.45); }
.pipeline-steps { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.pipeline-steps .pl-step { padding: 0; }
.pipeline-steps button { all: unset; box-sizing: border-box; width: 100%; padding: 12px 14px; border-radius: 14px; cursor: pointer; font-size: 14px; color: var(--muted); text-align: center; }
.pipeline-steps button:hover { color: var(--text); }
.pipeline-steps button:focus-visible { outline: 2px solid var(--text); }
.pipeline-steps .is-done { border-color: rgba(201,206,214,.35); }
.pipeline-steps .is-done button { color: var(--text); }
.pipeline-steps .is-now { background: linear-gradient(110deg, #f7f8fa, #c9ced6); border-color: transparent; }
.pipeline-steps .is-now button { color: #0a0b0d; font-weight: 600; cursor: default; }
@media (max-width: 700px) { .pipeline { grid-template-columns: repeat(3, 1fr); } }
tr.is-new td:first-child { box-shadow: inset 3px 0 0 #4c8fe0; }
.dl { margin: 0; display: grid; }
.dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dl > div:first-child { border-top: 0; }
.dl dt { color: var(--muted); font-size: 14px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* Calls */
.list li.call { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: start; }
.call-when b { display: block; font-size: 16px; }
.call-when span { font-size: 13.5px; color: var(--muted); }
.call-who { display: grid; gap: 6px; min-width: 0; }
.link-form { display: flex; gap: 8px; flex-wrap: wrap; }
.link-form input { flex: 1; min-width: 200px; }
@media (max-width: 700px) { .list li.call { grid-template-columns: 1fr; gap: 8px; } }
.avail { display: grid; gap: 8px; }
.avail-row { display: grid; grid-template-columns: 140px 1fr auto 1fr; gap: 10px; align-items: center; }
.avail-row input[type=time] { min-height: 40px; }
.pipeline-steps .is-now button[disabled] { color: #0a0b0d; opacity: 1; }
.grid-2 > .card + .card { margin-top: 0; }
