/* Tricolour Solutions — Client Portal styles.
   Brand: Albert Sans (body) + Fraunces (display), square edges (radius 0),
   tricolour palette (teal / magenta / gold). No emoji anywhere. */

:root {
  --paper: #ffffff;
  --paper-2: #f5f5f4;
  --paper-3: #ececeb;
  --ink: #0e0e13;
  --ink-2: #26262e;
  --ink-muted: #55555f;
  --ink-faint: #86868f;
  --rule: rgba(14, 14, 19, 0.10);
  --rule-strong: rgba(14, 14, 19, 0.20);
  --teal: #19cbb5;
  --magenta: #ee3f86;
  --gold: #e2a41c;
  --indigo: #6366f1;
  --ok: #12855f;
  --warn: #b4232a;
  --shadow: 0 1px 0 rgba(14, 14, 19, 0.04);
  --font-sans: "Albert Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0; }
html, body { min-height: 100%; }
body {
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; border-radius: 0; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- Brand mark ---- */
.mark { display: flex; align-items: center; gap: 9px; }
.mark .sq { width: 10px; height: 10px; display: inline-block; }
.mark .sq.t { background: var(--teal); }
.mark .sq.m { background: var(--magenta); }
.mark .sq.g { background: var(--gold); }
.mark .name { font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }

/* ---- Centered auth screens (login / reset / set-password) ---- */
.auth-wrap {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.card {
  width: 100%; max-width: 430px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 40px 36px 120px;
}
.card .mark { margin-bottom: 26px; }
.card h1 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 27px; line-height: 1.2; margin-bottom: 10px;
}
.card p.lead { color: var(--ink-muted); font-size: 14.5px; margin-bottom: 26px; }

label {
  display: block; font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-muted); margin: 0 0 7px;
}
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-sans); font-size: 15px;
  padding: 12px 13px; outline: none;
}
input:focus { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo); }
.field + .field { margin-top: 16px; }

/* Show/Hide toggle inside password fields */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }
.pw-toggle {
  position: absolute; right: 0; top: 0; bottom: 0;
  padding: 0 12px; background: none; border: none; border-left: 1px solid var(--rule);
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--paper-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  font-size: 14px; letter-spacing: 0.02em; padding: 12px 18px; width: 100%;
}
.btn:hover { background: var(--ink-2); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.secondary:hover { background: var(--paper-2); }
.btn-row { margin-top: 18px; }

.linkbtn {
  background: none; border: none; color: var(--ink-muted);
  font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.linkbtn:hover { color: var(--ink); }
.auth-alt { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; }

.notice {
  margin-top: 16px; padding: 10px 13px; font-size: 13.5px;
  border-left: 2px solid var(--rule-strong); background: var(--paper-2); color: var(--ink-muted);
}
.notice.error { border-left-color: var(--warn); color: var(--warn); }
.notice.ok { border-left-color: var(--ok); color: var(--ok); }

.foot-note {
  margin-top: 30px; border-top: 1px solid var(--rule); padding-top: 14px;
  font-size: 12.5px; color: var(--ink-faint); line-height: 1.5;
}

/* ---- App shell (dashboard + project) ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
}
.topbar .who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-muted); }
.topbar .who .uemail { color: var(--ink); }

/* Initials avatar shown in place of the raw email. */
.avatar {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em; line-height: 1;
  border-radius: 0; user-select: none;
}

.container { max-width: 1040px; margin: 0 auto; padding: 34px 22px 140px; }

.page-head { margin-bottom: 26px; }
.page-head .eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.page-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: 30px; line-height: 1.15; margin-top: 6px; }
.page-head p { color: var(--ink-muted); margin-top: 8px; max-width: 60ch; }

.backlink { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-muted); text-decoration: none; margin-bottom: 16px; }
.backlink:hover { color: var(--ink); }
.backlink .arw { width: 15px; height: 15px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230e0e13' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='16.5' y1='10' x2='4' y2='10'/%3E%3Cpolyline points='9.5,4.5 4,10 9.5,15.5'/%3E%3C/svg%3E") no-repeat center / contain; }

/* ---- Project cards (dashboard) ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--rule-strong);
  padding: 22px; transition: border-color 0.12s ease, transform 0.12s ease;
}
.pcard:hover { border-color: var(--ink); transform: translateY(-2px); }
.pcard .pname { font-family: var(--font-serif); font-weight: 500; font-size: 20px; line-height: 1.2; }
.pcard .pstage { margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.pcard .psummary { margin-top: 12px; font-size: 13.5px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pmeta { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Project rows (dashboard list) ---- */
.prows { border: 1px solid var(--rule-strong); background: var(--paper); }
.prow {
  display: flex; align-items: center; gap: 20px; padding: 18px 22px;
  border-top: 1px solid var(--rule); text-decoration: none; color: inherit;
  transition: background 0.12s ease;
}
.prow:first-child { border-top: none; }
.prow:hover { background: var(--paper-2); }
.prow .pmain { flex: 1 1 240px; min-width: 0; }
.prow .pname { font-family: var(--font-serif); font-weight: 500; font-size: 19px; line-height: 1.2; }
.prow .pstage { font-size: 13px; color: var(--ink-muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pright { display: flex; align-items: center; gap: 18px; flex: none; }
.prow .pright .progress { width: 160px; }
@media (max-width: 560px) {
  .prow { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .prow .pright { width: 100%; justify-content: space-between; }
  .prow .pright .progress { flex: 1; width: auto; }
}

/* ---- Status chip ---- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--rule-strong); padding: 4px 9px; color: var(--ink-muted);
}
.chip .dot { width: 7px; height: 7px; }
.chip.active .dot { background: var(--teal); }
.chip.on_hold .dot { background: var(--gold); }
.chip.complete .dot { background: var(--ok); }
.chip.archived .dot { background: var(--ink-faint); }
.chip.due .dot { background: var(--gold); }
.chip.paid .dot { background: var(--ok); }
.chip.overdue .dot { background: var(--warn); }
.chip.void .dot { background: var(--ink-faint); }

/* ---- Progress bar ---- */
.progress { display: flex; align-items: center; gap: 10px; }
.progress .track { flex: 1; height: 6px; background: var(--paper-3); }
.progress .fill { height: 6px; background: var(--teal); }
.progress .pct { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 26px 0 22px; flex-wrap: wrap; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 10px 14px; font-size: 14px; color: var(--ink-muted); margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab .count { font-size: 11px; color: var(--ink-faint); margin-left: 5px; font-variant-numeric: tabular-nums; }

.panel { animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Overview / lists ---- */
.section-title { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.overview-summary { background: var(--paper); border: 1px solid var(--rule); padding: 20px 22px; margin-bottom: 22px; }
.overview-summary p { color: var(--ink-2); }

.mlist { list-style: none; border: 1px solid var(--rule); background: var(--paper); }
.mrow { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--rule); }
.mrow:first-child { border-top: none; }
.mbox { width: 15px; height: 15px; border: 1px solid var(--rule-strong); flex: none; position: relative; }
.mbox.done { background: var(--teal); border-color: var(--teal); }
.mbox.done::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mrow .mtitle { flex: 1; }
.mrow.done .mtitle { color: var(--ink-muted); }
.mrow .mdue { font-size: 12.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---- Documents ---- */
.doc-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--rule); border-top: none; background: var(--paper); }
.doc-row:first-child { border-top: 1px solid var(--rule); }
.doc-icon { width: 30px; height: 34px; border: 1px solid var(--rule-strong); flex: none; position: relative; background: var(--paper-2); }
.doc-icon::before { content: ""; position: absolute; top: 0; right: 0; border-width: 0 8px 8px 0; border-style: solid; border-color: var(--paper) var(--paper) var(--rule-strong) var(--rule-strong); }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }

/* ---- Updates feed ---- */
.feed { position: relative; padding-left: 22px; }
.feed::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--rule-strong); }
.feed-item { position: relative; padding: 0 0 22px 8px; }
.feed-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 9px; height: 9px; background: var(--magenta); }
.feed-item .fdate { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.feed-item .ftitle { font-family: var(--font-serif); font-weight: 500; font-size: 17px; margin: 4px 0 6px; }
.feed-item .fbody { color: var(--ink-2); font-size: 14.5px; }

/* ---- Invoices ---- */
.itable { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
.itable th, .itable td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--rule); font-size: 14px; }
.itable thead th { border-top: none; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.itable td.amount { text-align: right; font-variant-numeric: tabular-nums; }
.itable th.amount { text-align: right; }

/* ---- Empty / loading states ---- */
.empty { border: 1px dashed var(--rule-strong); background: var(--paper); padding: 34px 22px; text-align: center; color: var(--ink-muted); }
.empty h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); padding: 40px 0; justify-content: center; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--rule-strong); border-top-color: var(--ink); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.center-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }

@media (max-width: 560px) {
  .container { padding: 24px 16px 140px; }
  .topbar { padding: 12px 16px; }
  .topbar .who .uemail { display: none; }
  .card { padding: 32px 22px 120px; }
  .itable thead { display: none; }
  .itable, .itable tbody, .itable tr, .itable td { display: block; width: 100%; }
  .itable tr { border-top: 1px solid var(--rule); }
  .itable td { border-top: none; padding: 4px 16px; }
  .itable td.amount { text-align: left; }
}
