/* Hello Habesha — Client Portal
   Brand: Habesha Blue primary · Ink Navy text · Gold/Green/Red as sparing accents (70/20/10)
   Mobile-first: base styles are for phones, wider screens enhance. */
:root {
  --blue: #0C509A;
  --blue-dark: #093C73;
  --blue-50: #E7EEF7;
  --green: #09733C;
  --green-50: #E6F2EB;
  --gold: #FCB905;
  --gold-50: #FFF6D9;
  --red: #D71B1E;
  --red-50: #FCEBEB;
  --navy-900: #18304E;
  --navy-600: #4B5E78;
  --navy-400: #7D8BA0;
  --navy-200: #D7DEE7;
  --navy-100: #EEF1F5;
  --white: #FFFFFF;

  --done: var(--green);
  --prog: var(--blue);
  --block: var(--red);
  --todo: var(--navy-200);

  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 48, 78, .06), 0 1px 1px rgba(24, 48, 78, .04);
  --head: "Plus Jakarta Sans", "Noto Sans Ethiopic", system-ui, sans-serif;
  --body: Inter, "Noto Sans Ethiopic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bottom-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy-100); color: var(--navy-900);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
}
body.signed-in { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.08rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.main { padding-top: 16px; padding-bottom: 40px; min-height: 55vh; }
.muted { color: var(--navy-600); }
.small, small { font-size: .84rem; }
.center { text-align: center; }
.right { margin-left: auto; }
.strong { font-weight: 600; }
.lead { color: var(--navy-600); max-width: 70ch; }
.narrow { max-width: 720px; }
.hide-sm { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--navy-200); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy-900); }
.brand:hover { text-decoration: none; }
.mark { display: inline-flex; align-items: center; gap: 8px; }
.mark img { width: 34px; height: 34px; }
.word { font-family: var(--head); font-weight: 800; font-size: .78rem; line-height: 1.02; letter-spacing: .02em; color: var(--navy-900); }
.word.light { color: var(--white); }
.tagline { font-size: .74rem; color: var(--navy-600); border-left: 1px solid var(--navy-200); padding-left: 10px; line-height: 1.2; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--navy-600); font-weight: 500; font-size: .92rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: var(--white) !important; display: grid; place-items: center; font-weight: 600; }
.avatar:hover { text-decoration: none; background: var(--blue-dark); }
.back-btn { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; color: var(--navy-900); border-radius: 50%; }
.back-btn:hover { background: var(--navy-100); }

/* ---------- project header ---------- */
.projhead { background: var(--white); border-bottom: 1px solid var(--navy-200); padding-top: 14px; padding-bottom: 12px; }
.projtitle { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pt-text { min-width: 0; }
.projtitle h1 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.actions .btn.sm { min-width: 40px; padding: 7px 10px; }
.site { font-size: .84rem; color: var(--navy-600); }
.actions { display: flex; gap: 6px; flex: none; }
.tabs { display: none; }

/* ---------- bottom nav (phones) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--white);
  border-top: 1px solid var(--navy-200); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--navy-600); font-size: .7rem; font-weight: 500; position: relative; }
.bottomnav a .ic { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--blue); }
.bottomnav a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.bottomnav a:hover { text-decoration: none; }
.bottomnav .dot { position: absolute; top: 6px; left: calc(50% + 6px); }
.dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: var(--white); font-size: .68rem; font-weight: 700; margin-left: 6px; line-height: 1; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  background: var(--blue); color: var(--white); border: 1.5px solid var(--blue); border-radius: 10px;
  padding: 10px 18px; font: 600 .94rem/1.2 var(--body); cursor: pointer; text-decoration: none !important;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: .88rem; border-radius: 9px; }
.btn.outline { background: transparent; color: var(--navy-900); border-color: var(--navy-900); }
.btn.outline:hover { background: var(--navy-100); }
.btn.ghost { background: transparent; color: var(--blue); border-color: var(--navy-200); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.wide { width: 100%; }
.btn.success { background: var(--green); border-color: var(--green); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-50); }
button.link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; padding: 4px 0; }
button.link.danger, a.danger { color: var(--red); }
form.inline { display: inline; }
.form { display: grid; gap: 14px; margin-bottom: 24px; }
.form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 500; color: var(--navy-600); }
.form label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--navy-900); font-weight: 400; font-size: .94rem; }
.form label.check input { margin-top: 3px; }
.form .row2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form .row3 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--navy-900); background: var(--white);
  border: 1px solid var(--navy-200); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--blue); flex: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
fieldset { border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; display: grid; gap: 10px; background: var(--white); }
legend { font-size: .82rem; font-weight: 600; color: var(--navy-600); padding: 0 6px; }
.drop { border: 2px dashed var(--navy-200); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--white); cursor: pointer; }
.drop input { border: 0; background: none; max-width: 320px; margin: 0 auto 6px; }
.danger-zone { border-top: 1px solid var(--navy-200); padding-top: 20px; margin-top: 12px; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; background: var(--green-50); border-left: 4px solid var(--green); color: var(--navy-900); }
.flash.err { background: var(--red-50); border-left-color: var(--red); }

/* ---------- auth ---------- */
.authwrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 16px 0; position: relative; }
.authbox { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--navy-200); border-radius: 16px; padding: 28px 22px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.authbox .knot { width: 64px; height: 64px; display: block; margin: 0 auto 12px; }
.authbox h1 { text-align: center; }
.authbox p.muted { text-align: center; }
.watermark { position: absolute; inset: 0; background: url(brand/knot-navy.png) center / 520px no-repeat; opacity: .04; pointer-events: none; }

.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead h1, .pagehead h2 { margin: 0; }
.section { margin-top: 28px; }
.empty-state { text-align: center; padding: 40px 18px; border: 2px dashed var(--navy-200); border-radius: var(--radius); color: var(--navy-600); background: var(--white); }
.knot-rule { display: flex; align-items: center; gap: 12px; margin: 28px 0 18px; }
.knot-rule::before, .knot-rule::after { content: ""; flex: 1; height: 1px; background: var(--navy-200); }
.knot-rule img { opacity: .9; }

/* ---------- cards & grids ---------- */
.card { background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; min-width: 0; box-shadow: var(--shadow); }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cardhead h2 { margin: 0; }
.grid2 { display: grid; gap: 0; }
.grid2 > .card { margin-bottom: 14px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 14px; display: grid; gap: 2px; box-shadow: var(--shadow); align-content: start; }
.kpi .k { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-600); }
.kpi .v { font-family: var(--head); font-weight: 800; font-size: 1.7rem; line-height: 1.15; }
.kpi .v small { font-size: .9rem; color: var(--navy-600); font-weight: 700; }
.kpi .s { font-size: .8rem; color: var(--navy-600); }
.kpi.hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; }
.kpi.hero .donut { width: 96px; height: 96px; flex: none; }
.kpi.alert { border-color: var(--red); }
.kpi.alert .v { color: var(--red); }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--white); border: 1px solid var(--navy-200); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.callout.info { border-left-color: var(--blue); }
.callout.danger { border-left-color: var(--red); }
.callout h2 { margin: 0 0 4px; font-size: 1rem; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }

/* status colours */
.s-done { --c: var(--done); } .s-prog { --c: var(--prog); } .s-block { --c: var(--block); } .s-todo { --c: var(--todo); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }
.s-todo .sw, .sw.s-todo { box-shadow: inset 0 0 0 1px #b9c4d2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--navy-600); margin: 6px 0; }

/* stacked bars */
.stack { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--navy-100); min-width: 60px; }
.seg { background: var(--c); display: block; min-width: 4px; }
.seg:hover, .seg:focus { filter: brightness(1.15); }
.rows { display: grid; gap: 14px; margin-top: 10px; }
.row { display: grid; grid-template-columns: 1fr 56px; gap: 6px 12px; align-items: center; }
.row .stack { grid-column: 1 / -1; grid-row: 2; }
.rlabel { display: grid; font-size: .9rem; line-height: 1.3; font-weight: 500; }
.rlabel small { color: var(--navy-600); font-weight: 400; }
.rval { text-align: right; display: grid; line-height: 1.2; font-size: .9rem; }
.rval small { color: var(--navy-600); }
.pwrap { display: flex; align-items: center; gap: 10px; }
.pwrap .stack { flex: 1; }
.pie-wrap { display: flex; align-items: center; gap: 18px; padding: 4px 0; }
.pie { width: 120px; height: 120px; flex: none; }
.pie-slice, .pie path, .pie circle { fill: var(--c); stroke: var(--white); stroke-width: 1; }
.pie path:hover, .pie path:focus, .pie circle:hover { filter: brightness(1.12); outline: none; }
.pie-pct { font-size: 8px; font-weight: 700; fill: #fff; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.pie .s-todo ~ .pie-pct { fill: var(--navy-900); }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; color: var(--navy-700, var(--navy-900)); }
.pie-legend strong { font-weight: 500; color: var(--navy-600); }
.pct { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-weight: 600; }

/* donut */
.donutwrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.donut { width: 150px; height: 150px; }
.donut-track { stroke: var(--navy-100); }
.arc { stroke: var(--c); transition: stroke-width .15s; }
.arc:hover, .arc:focus { stroke-width: 6.4; outline: none; }
.donut-num { font-family: var(--head); font-weight: 800; font-size: 8px; fill: var(--navy-900); text-anchor: middle; }
.donut-sub { font-size: 3.2px; fill: var(--navy-600); text-anchor: middle; }
.dlegend { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 170px; }
.dlegend li { display: flex; align-items: center; font-size: .9rem; }
.dlegend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 20px; }

/* week chart */
.weekscroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.weeks { display: grid; grid-template-columns: repeat(var(--n), minmax(14px, 1fr)); gap: 3px; height: 150px; align-items: end; margin-top: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--navy-200); min-width: calc(var(--n) * 17px); }
.wk { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; border-radius: 5px 5px 0 0; }
.wk .col { display: flex; flex-direction: column; gap: 1px; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 3px; }
.wk .col span { background: var(--c); display: block; min-height: 2px; }
.wk em { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-style: normal; font-size: .66rem; color: var(--navy-600); }
.wk.now { background: var(--blue-50); }
.wk.now em { color: var(--blue); font-weight: 700; }

/* Google live data */
.syncbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.live-head { padding-bottom: 10px; }
.live-say { font-family: var(--head); font-weight: 700; font-size: 1.15rem; margin: 4px 0 0; line-height: 1.35; }
.blist { display: grid; gap: 10px; }
.bl { min-width: 0; }
.bl-top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.bl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bl-bar { height: 8px; border-radius: 4px; background: var(--navy-100); margin: 4px 0 2px; overflow: hidden; }
.bl-bar span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.bl small { font-size: .75rem; }

/* line / sparkline charts (results) */
.metric-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.metric .mv { font-family: var(--head); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.metric .delta { font-size: .82rem; font-weight: 600; }
.delta.good { color: var(--green); } .delta.bad { color: var(--red); } .delta.flat { color: var(--navy-600); }
.spark { width: 100%; height: 90px; display: block; margin-top: 8px; overflow: visible; }
.spark .grid { stroke: var(--navy-100); stroke-width: 1; }
.spark .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: var(--blue); opacity: .08; }
.spark .pt { fill: var(--blue); stroke: var(--white); stroke-width: 2; }
.spark .hit { fill: transparent; cursor: default; }
.spark .axis { font-size: 10px; fill: var(--navy-600); }

/* ---------- task cards ---------- */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.filters .search { grid-column: 1 / -1; }
.filters .fbtns { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none; }
.chips a { white-space: nowrap; border: 1px solid var(--navy-200); background: var(--white); color: var(--navy-600); padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 500; }
.chips a.on { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.chips a:hover { text-decoration: none; }
.group { margin: 22px 0 8px; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.group h2 { margin: 0; }
.tlist-cards { display: grid; gap: 8px; }
.tcard { background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); scroll-margin-top: 80px; }
.tcard.is-done { background: #fafbfd; }
.tcard.is-done .ttitle a { color: var(--navy-600); font-weight: 500; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .78rem; color: var(--navy-600); }
.ttitle { font-weight: 600; margin: 4px 0 8px; line-height: 1.4; }
.ttitle a { color: var(--navy-900); }
.tfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tfoot .hours { font-size: .8rem; color: var(--navy-600); }
.tfoot .right { display: flex; gap: 6px; align-items: center; }
.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .76rem; color: var(--navy-600); white-space: nowrap; }
.owner { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--navy-100); color: var(--navy-600); }
.owner.client { background: var(--gold); color: var(--navy-900); }
.subcount { font-size: .78rem; color: var(--navy-600); display: inline-flex; gap: 4px; align-items: center; }
.subcount .ic { width: 15px; height: 15px; }
.cmt-toggle { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--navy-200); background: var(--white); color: var(--navy-600); border-radius: 999px; padding: 5px 11px; font: 500 .8rem var(--body); cursor: pointer; min-height: 32px; }
.cmt-toggle .ic { width: 16px; height: 16px; }
.cmt-toggle.has-new { border-color: var(--red); color: var(--red); }
.cmt-toggle[aria-expanded=true] { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.inline-thread { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--navy-200); }
.inline-thread[hidden] { display: none; }
.subtasks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.subtasks li { display: flex; gap: 10px; align-items: center; font-size: .88rem; padding: 6px 8px; border-radius: 8px; background: var(--navy-100); }
.subtasks li.done span.t { text-decoration: line-through; color: var(--navy-600); }
.tick { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--navy-400); background: var(--white); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--white); flex: none; }
.tick .ic { width: 16px; height: 16px; }
.tick.on { background: var(--green); border-color: var(--green); }
.tick:disabled { cursor: default; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 500; white-space: nowrap; color: var(--navy-900); }
.badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.s-todo.badge i { box-shadow: inset 0 0 0 1px #b9c4d2; }
.st-select { width: auto; min-height: 36px; padding: 5px 30px 5px 10px; font-size: .86rem; font-weight: 500; border-left: 5px solid var(--c); border-radius: 9px; }
.prio { font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--navy-200); color: var(--navy-600); }
.prio.p-p0 { border-color: var(--navy-900); color: var(--navy-900); }
.tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--blue-50); color: var(--blue); border-radius: 5px; padding: 1px 6px; }
.tag.client { background: var(--navy-100); color: var(--navy-600); }

/* payments */
.pbadge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pay-paid { background: var(--green-50); color: var(--green); }
.pay-pending { background: var(--gold); color: var(--navy-900); }
.pay-overdue { background: var(--red-50); color: var(--red); }
.pay-soon { background: var(--blue-50); color: var(--blue); }
.pay-up { background: var(--navy-100); color: var(--navy-600); }
.paylist { display: grid; gap: 8px; }
.pay { background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.pay.overdue { border-left: 4px solid var(--red); }
.pay-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pay-amt { font-family: var(--head); font-weight: 800; font-size: 1.2rem; }
.pay-meta { font-size: .82rem; color: var(--navy-600); }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
details.more-form > summary { cursor: pointer; color: var(--blue); font-weight: 500; font-size: .88rem; list-style: none; padding: 6px 0; }
details.more-form > summary::-webkit-details-marker { display: none; }
details.more-form[open] > summary { margin-bottom: 8px; }

/* tables (documents, admin) */
.table { width: 100%; border-collapse: collapse; background: var(--white); }
.table th { text-align: left; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-600); padding: 10px 12px; border-bottom: 1px solid var(--navy-200); background: var(--navy-100); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--navy-200); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; margin-bottom: 16px; border: 1px solid var(--navy-200); border-radius: var(--radius); background: var(--white); }
.table.doc td { font-size: .88rem; min-width: 140px; }
.table.doc tr.subhead td { font-family: var(--head); font-weight: 700; background: var(--navy-100); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.subtabs a { white-space: nowrap; border: 1px solid var(--navy-200); background: var(--white); padding: 6px 12px; border-radius: 999px; color: var(--navy-600); font-size: .86rem; font-weight: 500; }
.subtabs a.on { background: var(--navy-900); border-color: var(--navy-900); color: var(--white); }
.doc-title { margin-top: 4px; }

/* project list (home) */
.plist { display: grid; gap: 10px; }
.pcard { display: grid; gap: 8px; background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: inherit; }
.pcard:hover { text-decoration: none; border-color: var(--blue); }
.pcard h2 { margin: 0; font-size: 1.05rem; }
.pcard .sub { font-size: .82rem; color: var(--navy-600); }
.pcard .chipsrow { display: flex; gap: 6px; flex-wrap: wrap; }
.mini { font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--navy-100); color: var(--navy-600); }
.mini.red { background: var(--red-50); color: var(--red); }
.mini.blue { background: var(--blue-50); color: var(--blue); }
.mini.gold { background: var(--gold); color: var(--navy-900); }

/* task detail */
.crumbs { display: flex; font-size: .88rem; margin-bottom: 12px; gap: 12px; }
.taskdetail { max-width: 780px; }
.taskdetail h1 { font-size: 1.3rem; margin-top: 6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--navy-200); border: 1px solid var(--navy-200); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.facts > div { padding: 12px 14px; background: var(--white); }
.facts dt { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-600); margin-bottom: 4px; }
.facts dd { margin: 0; }
.notes { background: var(--white); border-left: 4px solid var(--navy-200); padding: 12px 14px; border-radius: 0 10px 10px 0; color: var(--navy-600); }

/* lists */
.tlist, .alist, .feed { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--navy-100); font-size: .92rem; }
.tlist li:last-child, .alist li:last-child, .feed li:last-child { border-bottom: 0; }
.alist li { padding: 8px 0; border-bottom: 1px solid var(--navy-100); font-size: .88rem; }
.feed li { padding: 12px 0; border-bottom: 1px solid var(--navy-100); }
.excerpt { color: var(--navy-600); font-size: .9rem; margin-top: 2px; }
.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.linklist a { display: flex; gap: 14px; align-items: center; background: var(--white); border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 16px; color: var(--navy-900); font-weight: 600; box-shadow: var(--shadow); }
.linklist a .ic { color: var(--blue); }
.linklist a small { display: block; font-weight: 400; color: var(--navy-600); }
.linklist a:hover { text-decoration: none; border-color: var(--blue); }

/* comments — chat style: yours on the right, theirs on the left */
.comments { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.comment { max-width: 92%; background: var(--white); border: 1px solid var(--navy-200); border-radius: 14px 14px 14px 4px; padding: 10px 14px; justify-self: start; box-shadow: var(--shadow); }
.comment.mine { justify-self: end; background: var(--blue-50); border-color: #c8d7ea; border-radius: 14px 14px 4px 14px; }
.chead { font-size: .8rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; color: var(--navy-600); }
.chead .who { display: inline-flex; gap: 6px; align-items: center; color: var(--navy-900); }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .7rem; font-weight: 700; background: var(--navy-900); color: var(--white); }
.by-admin .av { background: var(--blue); }
.ctask { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .76rem; }
.cbody { margin-top: 4px; overflow-wrap: anywhere; }
.comment .del { display: block; text-align: right; margin-top: -2px; }
.comment .del button { font-size: .76rem; color: var(--navy-400); }
.comments.compact .comment { padding: 8px 12px; }
.cform { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.cform textarea { flex: 1; resize: vertical; min-height: 44px; }
.cform.compact textarea { min-height: 40px; }
.nocomments { margin: 0 0 10px; }

/* attachments */
.cform { flex-wrap: wrap; }
.cform textarea { flex: 1 1 200px; }
.cform .attach { order: 3; flex: 1 0 100%; }
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .84rem; color: var(--navy-600); margin: 0; }
.attach input[type=file] { border: 0; background: none; padding: 0; width: auto; max-width: 100%; font-size: .84rem; }
.attach-l { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--navy-900); }
.attach-l .ic { width: 16px; height: 16px; }
.files { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.files li { margin: 0; }
.fimg img { display: block; max-width: 180px; max-height: 120px; border-radius: 8px; border: 1px solid var(--navy-200); object-fit: cover; }
.fchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--navy-200); border-radius: 8px; background: var(--white); font-size: .84rem; max-width: 100%; }
.fchip:hover { border-color: var(--blue); text-decoration: none; }
.fext { font-size: .68rem; font-weight: 700; background: var(--navy-900); color: var(--white); border-radius: 4px; padding: 2px 5px; }
.fname { overflow-wrap: anywhere; }
.taskdetail > .files { margin-bottom: 12px; }

.sharebox { background: var(--white); border: 1px solid var(--navy-200); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.sharebox pre { background: var(--navy-100); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; font-size: .88rem; }

/* footer */
.foot { background: var(--navy-900); color: #c9d2de; font-size: .82rem; margin-top: 24px; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.foot a { color: var(--white); }
.foot a:hover { color: var(--gold); }
.foot .mark img { width: 28px; height: 28px; }

/* floating add button (admin, phones) */
.fab { position: fixed; right: 16px; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom)); z-index: 35; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(12, 80, 154, .35); }
.fab .ic { width: 26px; height: 26px; }
.fab:hover { background: var(--blue-dark); }

/* report (print-friendly) */
.report h1 { font-size: 1.4rem; }
.report .rsec { margin-top: 22px; }
.report table { font-size: .9rem; }

#tip { position: fixed; z-index: 60; pointer-events: none; background: var(--navy-900); color: var(--white); font-size: .78rem; padding: 6px 10px; border-radius: 8px; max-width: 260px; box-shadow: 0 4px 12px rgba(24,48,78,.25); }

/* ---------- ≥ 600px ---------- */
@media (min-width: 600px) {
  .hide-sm { display: revert !important; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi.hero { grid-column: span 2; }
  .form .row3 { grid-template-columns: 1fr 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: center; }
  .filters .search { grid-column: auto; }
  .filters .fbtns { grid-column: auto; }
  .row { grid-template-columns: minmax(150px, 1.1fr) 3fr 60px; }
  .row .stack { grid-column: auto; grid-row: auto; }
  .comment { max-width: 80%; }
}

/* ---------- ≥ 900px (desktop) ---------- */
@media (min-width: 900px) {
  body.signed-in { padding-bottom: 0; }
  .bottomnav, .fab, .back-btn { display: none; }
  h1 { font-size: 1.75rem; }
  .main { padding-top: 24px; }
  .projhead { padding-top: 22px; padding-bottom: 0; }
  .projtitle h1 { font-size: 1.6rem; }
  .tabs { display: flex; gap: 26px; margin-top: 16px; overflow-x: auto; }
  .tabs a { color: var(--navy-600); font-weight: 500; padding: 10px 0 12px; border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; }
  .tabs a.on { color: var(--blue); border-bottom-color: var(--blue); }
  .tabs a:hover { text-decoration: none; color: var(--navy-900); }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid2.wide-left { grid-template-columns: 3fr 2fr; align-items: start; }
  .card { padding: 20px 22px; margin-bottom: 16px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .tcard { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; align-items: center; }
  .tcard .tmain { min-width: 0; }
  .tcard .ttitle { margin-bottom: 0; }
  .tcard .tfoot { justify-content: flex-end; }
  .tcard .inline-thread, .tcard .subtasks { grid-column: 1 / -1; }
  .plist { grid-template-columns: 1fr 1fr; }
}

@media print {
  .topbar, .tabs, .actions, .cform, .filters, .foot, .bottomnav, .fab, .noprint, .projhead .actions { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .projhead { border: 0; }
}
@media (max-width: 599px) {
  .table th, .table td { padding: 8px 10px; }
  .table { font-size: .86rem; }
}

/* ---------- support cases ---------- */
.caselist { display: grid; gap: 8px; }
.case { display: grid; gap: 4px; border: 1px solid var(--navy-200); border-radius: var(--radius); padding: 12px 14px; background: var(--white); color: inherit; }
.case:hover { text-decoration: none; border-color: var(--blue); }
.case.late { border-left: 4px solid var(--red); }
.case-top { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.case-title { font-weight: 600; line-height: 1.4; }
.case-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .8rem; color: var(--navy-600); }
.lateTxt { color: var(--red); font-weight: 600; font-size: .8rem; }
.ubadge, .cbadge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.u-crit { background: var(--red); color: var(--white); }
.u-high { background: var(--gold); color: var(--navy-900); }
.u-norm { background: var(--blue-50); color: var(--blue); }
.u-low { background: var(--navy-100); color: var(--navy-600); }
.cs-open { background: var(--navy-100); color: var(--navy-900); border: 1px solid var(--navy-200); }
.cs-prog { background: var(--blue-50); color: var(--blue); }
.cs-wait { background: var(--gold-50); color: #7a5a00; }
.cs-done { background: var(--green-50); color: var(--green); }
.cs-closed { background: var(--navy-100); color: var(--navy-400); }
.sysline { justify-self: center; text-align: center; font-size: .8rem; color: var(--navy-600); background: var(--navy-100); border-radius: 10px; padding: 6px 12px; max-width: 92%; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--navy-100); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }

/* ---------- native app feel (phones & tablets, < 900px) ---------- */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
a, button, input, select, textarea, label, summary { touch-action: manipulation; }
@media (max-width: 899px) {
  :root { --bottom-h: 62px; }
  body { background: #F2F4F8; -webkit-overflow-scrolling: touch; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

  /* frosted top bar, no tagline, no footer — like an app, not a website */
  /* the blur lives on a pseudo-element: a backdrop-filter on .topbar itself would trap the fixed account-menu sheet inside it */
  .topbar { z-index: 60; background: none; border-bottom: .5px solid rgba(24, 48, 78, .14); padding-top: env(safe-area-inset-top); }
  .topbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .86);
            -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
  .topbar-in { min-height: 52px; }
  .tagline, .foot { display: none; }
  .back-btn { width: 40px; height: 40px; }
  .back-btn:active, .avatar:active { transform: scale(.92); }

  /* frosted bottom tab bar with a pill behind the active icon */
  .bottomnav { background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
               border-top: .5px solid rgba(24, 48, 78, .16); }
  .bottomnav a { gap: 2px; font-size: .68rem; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .12s, color .15s; }
  .bottomnav a::after { content: ""; position: absolute; top: 7px; width: 54px; height: 30px; border-radius: 15px; background: var(--blue-50); z-index: -1; opacity: 0; transform: scale(.7); transition: opacity .18s, transform .18s; }
  .bottomnav a.on::after { opacity: 1; transform: none; }
  .bottomnav a.on::before { display: none; }
  .bottomnav a.on { font-weight: 700; }
  .bottomnav a:active { transform: scale(.9); }
  .bottomnav a { z-index: 0; isolation: isolate; }

  /* larger, softer cards and lists */
  .card, .kpi, .tcard, .case, .linklist a, .authbox { border-radius: 16px; border-color: rgba(24, 48, 78, .08); box-shadow: 0 1px 3px rgba(24, 48, 78, .07); }
  .linklist { gap: 10px; }
  .linklist a { padding: 14px 16px; }
  .linklist a::after { content: "›"; margin-left: auto; font-size: 1.5rem; line-height: 1; color: var(--navy-400); font-weight: 400; }
  .btn { border-radius: 12px; min-height: 48px; }
  .btn.sm { min-height: 40px; }
  .form .btn:not(.sm), .authbox .btn { width: 100%; }
  input, select, textarea { border-radius: 12px; min-height: 48px; background: #fff; }
  .chips a { padding: 8px 14px; font-size: .88rem; }
  .chips { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }

  /* touch feedback */
  .btn, .case, .tcard, .linklist a, .chips a, .kpi { transition: transform .12s ease, background-color .12s, opacity .12s; }
  .btn:active, .case:active, .linklist a:active, .chips a:active { transform: scale(.975); opacity: .85; }
  .btn, .bottomnav, .topbar, .chips, .tabs { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

  /* page content slides in */
  .main { animation: pageIn .24s cubic-bezier(.2, .8, .2, 1); }
  @keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  /* messages appear as toasts under the top bar */
  .flash { position: fixed; z-index: 70; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
           top: calc(env(safe-area-inset-top) + 60px); margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--navy-900); color: #fff;
           border-left: 0; box-shadow: 0 8px 24px rgba(24, 48, 78, .28); animation: toastIn .28s cubic-bezier(.2, .8, .2, 1); transition: opacity .3s, transform .3s; }
  .flash.err { background: var(--red); }
  .flash.gone { opacity: 0; transform: translateY(-12px); pointer-events: none; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

  /* chat composer: attach box tucked away so the message box stays big */
  .cform { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .main, .flash { animation: none !important; }
  * { transition: none !important; }
}
/* installed to the home screen */
@media (display-mode: standalone) {
  body { -webkit-user-select: none; user-select: none; }
  input, textarea, .cbody, .notes, .ttitle, .case-title { -webkit-user-select: text; user-select: text; }
}

/* ---------- account menu ---------- */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu[open] > summary { box-shadow: 0 0 0 3px var(--blue-50); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; width: 260px; background: var(--white); border: 1px solid var(--navy-200);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(24, 48, 78, .18); padding: 6px; animation: toastIn .16s ease-out; }
.usermenu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--navy-100); margin-bottom: 4px; display: grid; gap: 1px; }
.usermenu .who small { color: var(--navy-600); overflow-wrap: anywhere; }
.usermenu .who .role { color: var(--navy-400); font-size: .74rem; }
.usermenu .menu a, .usermenu .menu .signout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 9px; color: var(--navy-900) !important;
  font: 500 .94rem var(--body); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; }
.usermenu .menu a:hover, .usermenu .menu .signout:hover { background: var(--navy-100); text-decoration: none; }
.usermenu .menu .signout { color: var(--red) !important; }
.usermenu .menu .signout:hover { background: var(--red-50); }
.usermenu .menu .ic { color: var(--navy-600); }
.usermenu .menu .signout .ic { color: var(--red); }
.signout-row { margin: 18px 0 0; }
.danger-btn { color: var(--red); border-color: rgba(215, 27, 30, .45); }
.danger-btn:hover { background: var(--red-50); }
@media (max-width: 899px) {
  .usermenu[open]::before { content: ""; position: fixed; inset: 0; z-index: 75; background: rgba(24, 48, 78, .28); }
  .usermenu .menu { position: fixed; z-index: 80; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; border-radius: 18px; padding: 8px;
    animation: sheetIn .22s cubic-bezier(.2, .8, .2, 1); }
  .usermenu .menu a, .usermenu .menu .signout { padding: 15px 14px; font-size: 1rem; }
  @keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- monthly plan ---------- */
.mplan-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mplan-sum > div { background: var(--navy-100); border-radius: 12px; padding: 10px 12px; display: grid; gap: 1px; }
.mplan-sum .k { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--navy-600); }
.mplan-sum strong { font-family: var(--head); font-size: 1.02rem; }
.mplan { display: grid; gap: 10px; }
.mrow { border: 1px solid var(--navy-200); border-radius: 14px; padding: 12px 14px; background: var(--white); }
.mrow.m-now { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.mrow.m-next, .mrow.m-later { background: #fbfcfe; }
.mtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.mh { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.mh-ok { background: var(--green-50); color: var(--green); }
.mh-late { background: var(--red-50); color: var(--red); }
.mh-idle { background: var(--navy-100); color: var(--navy-600); }
.mbar { height: 10px; border-radius: 999px; background: var(--navy-100); overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .4s; min-width: 0; }
.mnums { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .86rem; color: var(--navy-600); }
.mnums strong { color: var(--navy-900); }
.mpay { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--navy-200); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (min-width: 600px) { .mplan-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* billing cycles (26th -> 25th) */
.cycle{margin:0 0 28px}
.group.sub{margin-top:14px}.group.sub h3{font-size:1rem;margin:0}
.cyc-sum{margin:8px 0 6px}
.cyc-bar{display:flex;height:10px;border-radius:6px;background:var(--line,#e5e7eb);overflow:hidden}
.cyc-bar i{display:block;height:100%}
.cv-cov{background:#2f8f5b}.cv-cur{background:#e0a526}.cv-over{background:#c0392b}
.cyc-cases{list-style:none;margin:6px 0 0;padding:0}.cyc-cases li{padding:6px 0;border-bottom:1px solid var(--line,#e5e7eb)}

/* editable document sheets */
.docedit td{vertical-align:top;min-width:120px}
.docedit input:not([type=checkbox]),.docedit select,.docedit textarea{width:100%;min-width:0;font:inherit}
.docedit textarea{resize:vertical}
.stickybar{position:sticky;bottom:0;background:var(--bg,#fff);padding:12px 0;border-top:1px solid var(--line,#e5e7eb);display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* simple monthly view */
.monthpick{margin:0 0 14px}.monthpick select{font:inherit;padding:8px 10px;max-width:100%}
.cyc-head{display:flex;justify-content:space-between;gap:12px;align-items:baseline;margin-bottom:6px;flex-wrap:wrap}
.monthcard .monthtasks{margin:12px 0 0}

.monthprog{margin:14px 0 0;box-shadow:none;border:0;padding:0;background:none}

/* tasks page: month bar, status tabs */
.taskhead{padding:14px 16px;margin-bottom:12px}
.taskbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:12px}
.taskbar label{display:flex;flex-direction:column;gap:3px;font-size:.78rem;color:var(--muted,#667)}
.taskbar select,.taskbar .search{font:inherit;padding:8px 10px;min-width:0}
.taskbar .search{flex:1;min-width:140px}
.statuschips b{font-weight:600;opacity:.65;margin-left:2px}
.statuschips a.danger{color:#b3261e;border-color:#f0b8b4}
.statuschips a.danger.on{background:#b3261e;border-color:#b3261e;color:#fff}
.group.sec-overdue h3{color:#b3261e}
.tcard.is-late{border-left:3px solid #b3261e}
.duetag{font-size:.75rem;color:var(--muted,#667)}
.duetag.late{color:#b3261e;font-weight:600}



/* --- Project Overview: Clean Brand Layout (Habesha Blue · Ink Navy · White) --- */
.proj-hero {
  background: var(--white);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.proj-hero-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.proj-hero-main {
  flex: 1;
  min-width: 260px;
}
.proj-hero-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue);
  margin-bottom: 6px;
}
.proj-hero-title {
  font-family: var(--head);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--navy-900);
  margin: 0 0 6px;
}
.proj-hero-site {
  font-size: .88rem;
  color: var(--navy-600);
  margin-bottom: 14px;
}
.proj-hero-site a {
  color: var(--blue);
  font-weight: 600;
}
.proj-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.proj-hero-prog {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--navy-100);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius);
  flex: none;
}
.proj-hero-donut {
  width: 76px;
  height: 76px;
  flex: none;
}
.proj-hero-donut svg {
  width: 100%;
  height: 100%;
}
.proj-hero-stat {
  display: flex;
  flex-direction: column;
}
.proj-hero-stat .k {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--navy-600);
}
.proj-hero-stat .v {
  font-family: var(--head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
}
.proj-hero-stat .sub {
  font-size: .8rem;
  color: var(--navy-600);
  margin-top: 2px;
}

/* 4 Clean Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.stat-box {
  background: var(--white);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-box-lbl {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--navy-600);
  margin-bottom: 4px;
}
.stat-box-val {
  font-family: var(--head);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1.2;
}
.stat-box-sub {
  font-size: .8rem;
  color: var(--navy-600);
  margin-top: 3px;
}

/* Phases Roadmap Cards */
.phase-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 680px) {
  .phase-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .phase-list {
    grid-template-columns: repeat(3, 1fr);
  }
}
.phase-card {
  background: var(--white);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit !important;
  text-decoration: none !important;
  transition: border-color .15s ease;
}
.phase-card:hover {
  border-color: var(--blue);
}
.phase-card.is-active {
  border-color: var(--blue);
  background: #FCFDFE;
}
.phase-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.phase-card-name {
  font-family: var(--head);
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy-900);
  margin: 0;
}
.phase-card-tag {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.phase-card-tag.done {
  background: var(--green-50);
  color: var(--green);
}
.phase-card-tag.prog {
  background: var(--blue-50);
  color: var(--blue);
}
.phase-card-tag.todo {
  background: var(--navy-100);
  color: var(--navy-600);
}
.phase-card-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--navy-200);
  overflow: hidden;
}
.phase-card-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
}
.phase-card.is-active .phase-card-bar i {
  background: var(--blue);
}
.phase-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--navy-600);
}

/* Two-column overview layout */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 900px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }
}
.prio-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .02em;
  flex: none;
}
.prio-p0 { background: var(--red-50); color: var(--red); }
.prio-p1 { background: var(--blue-50); color: var(--blue); }
.prio-p2 { background: var(--navy-100); color: var(--navy-600); }
.prio-p3 { background: var(--navy-100); color: var(--navy-400); }

/* Task list clean formatting */
.tlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--navy-100);
}
.tlist-item:last-child {
  border-bottom: 0;
}
.tlist-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.tlist-item-code {
  font-size: .76rem;
  font-weight: 700;
  color: var(--navy-600);
  font-family: ui-monospace, monospace;
  flex: none;
}
.tlist-item-title {
  font-size: .88rem;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tlist-item-title:hover {
  color: var(--blue);
}

/* Wins list */
.win-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--navy-100);
}
.win-row:last-child {
  border-bottom: 0;
}
.win-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--green);
  margin-top: 2px;
  font-weight: 700;
}
.win-content {
  flex: 1;
  min-width: 0;
}
.win-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy-900);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 2px;
}
.win-title:hover {
  color: var(--blue);
}
.win-meta {
  font-size: .75rem;
  color: var(--navy-600);
}

.overview-grid > * { min-width: 0; }

/* ---------- Rebuilt Billing & Financial Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bill-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.bill-table th, .bill-table td { padding: 10px 10px; border-bottom: 1px solid var(--navy-100, #f1f5f9); text-align: left; vertical-align: middle; }
.bill-table th { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy-600, #475569); background: var(--navy-50, #f8fafc); border-bottom: 1px solid var(--navy-200, #e2e8f0); white-space: nowrap; }
.bill-table th.num, .bill-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-table tfoot td { background: var(--navy-50, #f8fafc); border-top: 2px solid var(--navy-200, #e2e8f0); border-bottom: 0; }
.bank-box { padding: 10px 12px; border: 1px solid var(--navy-200, #e2e8f0); border-radius: 6px; background: var(--navy-50, #f8fafc); }
.mini.green { background: var(--green-50, #dcfce7); color: var(--green, #15803d); }
.invoice-sheet { padding: 22px 24px; }
@media print {
  .no-print, .crumbs, .more-form, details { display: none !important; }
  .invoice-sheet { border: 0 !important; padding: 0 !important; box-shadow: none !important; }
}
