/* Billing app styles, in the firm's colours: Investors Law navy and gold.
   Colours are defined once here. Each part of the app (contacts, matters, time,
   bills, trust, reports) also gets its own accent; see "Sections" below. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-display: swap; src: url("../fonts/eb-garamond-latin-400-normal.woff") format("woff"); }
@font-face { font-family: "EB Garamond"; font-weight: 600; font-display: swap; src: url("../fonts/eb-garamond-latin-600-normal.woff") format("woff"); }
@font-face { font-family: "EB Garamond"; font-weight: 700; font-display: swap; src: url("../fonts/eb-garamond-latin-700-normal.woff") format("woff"); }

:root {
  --navy: #0d264c;
  --navy-2: #1b3a6b;
  --gold: #a97124;
  --gold-light: #d9b56f;
  --gold-soft: #f7eedf;
  --accent: var(--navy);
  --accent-dark: #081a35;
  --accent-soft: #e8edf5;
  --text: #1a2233;
  --muted: #5f6878;
  --line: #e2e4e9;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --page: #f7f6f3;
  --sidebar: #ffffff;
  --sidebar-text: #3b4456;
  --danger: #a4262c;
  --danger-soft: #fbeaea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --ok: #1d6b3a;
  --ok-soft: #e6f4ea;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(13, 38, 76, .05), 0 1px 3px rgba(13, 38, 76, .04);
  --section: var(--navy);
  --section-soft: var(--accent-soft);
  /* Chart series */
  --s1: var(--navy-2);
  --s2: var(--gold);
  --s3: #7a2e46;
  /* Livelier accents (2026-11-28): used for charts, tiles and highlights, never for body text */
  --teal: #13877a;
  --teal-soft: #dff3ef;
  --violet: #5b4bc4;
  --violet-soft: #ecebfb;
  --coral: #d2573f;
  --coral-soft: #fdece7;
  --sky: #2f7fd1;
  --sky-soft: #e4f0fc;
  --sidebar-bg: linear-gradient(180deg, #0d264c 0%, #102e5c 55%, #1a2f63 100%);
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(91, 75, 196, .07), transparent 60%),
    radial-gradient(900px 420px at 10% 0%, rgba(169, 113, 36, .07), transparent 60%);
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: "EB Garamond", Georgia, "Times New Roman", serif; color: var(--navy); letter-spacing: .005em; }
h1 { font-size: 2rem; margin: 0 0 .15rem; font-weight: 600; line-height: 1.15; }
h2 { font-size: 1.4rem; margin: 1.6rem 0 .6rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; font-weight: 600; }
p { margin: .4rem 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right, td.num, th.num { text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; transition: grid-template-columns .2s;
  background: linear-gradient(to right, #13306a 0, #13306a var(--nav-w, 248px), transparent var(--nav-w, 248px)); }
html.nav-collapsed { --nav-w: 72px; }
.sidebar {
  background: var(--sidebar-bg); color: #c9d3e6;
  display: flex; flex-direction: column; padding: 1rem 0 .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  box-shadow: 2px 0 18px rgba(13, 38, 76, .12);
}
.sidebar .brand { display: block; color: #fff; font-family: "EB Garamond", Georgia, serif; font-weight: 600; font-size: 1.2rem;
  padding: 0 1rem .9rem; margin-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand-logo { display: block; background: #fff; border-radius: 10px; padding: .55rem .7rem; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.sidebar .brand img { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto; }
.sidebar .brand-mark { display: none; }
.sidebar .brand small { display: block; color: var(--gold-light); font-family: "Inter", sans-serif; font-weight: 600; font-size: .66rem;
  letter-spacing: .16em; text-transform: uppercase; margin-top: .65rem; }
.sidebar nav a, .sidebar .collapse-btn {
  display: flex; align-items: center; gap: .75rem; color: #d5ddec; font-weight: 500; font-size: .95rem;
  padding: .52rem .8rem; margin: .08rem .6rem; border-radius: 8px; position: relative;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 3px 0 0 var(--gold-light); }
.sidebar nav svg, .sidebar .collapse-btn svg, .me-out svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a svg { color: var(--nav-tint, #9fb2d6); }
.sidebar nav a.active svg, .sidebar nav a:hover svg { color: var(--nav-tint-on, #fff); }
.nav-core { --nav-tint: #9fc0ff; } .nav-calendar { --nav-tint: #7fd3ff; } .nav-tasks { --nav-tint: #b7a8ff; }
.nav-matters { --nav-tint: #8fb4ff; } .nav-contacts { --nav-tint: #6fd6c6; } .nav-timekeeping { --nav-tint: #86d9a2; }
.nav-fees { --nav-tint: #e9c48a; } .nav-corporate { --nav-tint: #7fd8cf; }
.nav-billing { --nav-tint: #f1c779; } .nav-trust { --nav-tint: #f0a3b9; } .nav-reports { --nav-tint: #b9b4ff; } .nav-settings { --nav-tint: #c3cbd9; }
.sidebar .ext { font-style: normal; font-size: .75rem; opacity: .6; margin-left: .15rem; }
.nav-count { margin-left: auto; background: var(--coral); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 10px; padding: .05rem .45rem; min-width: 1.4rem; text-align: center; }
.sidebar .bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: .5rem; }
.sidebar .me { display: flex; align-items: center; gap: .6rem; margin: .5rem .7rem .3rem; padding: .5rem .55rem; border-radius: 10px; background: rgba(255,255,255,.06); }
.sidebar .avatar { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  color: var(--navy); background: linear-gradient(135deg, var(--gold-light), #f3dfb2); }
.sidebar .me-text { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar .me-text strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me-text small { color: #9fb0cc; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.me-out { margin: 0; }
.me-out button { background: none; border: 0; color: #9fb0cc; padding: .3rem; border-radius: 6px; }
.me-out button:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .collapse-btn { background: none; border: 0; width: calc(100% - 1.2rem); color: #9fb0cc; font-size: .88rem; cursor: pointer; }
.sidebar .collapse-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
/* Collapsed menu: icons only */
html.nav-collapsed .app { grid-template-columns: 72px 1fr; }
html.nav-collapsed .sidebar nav a span, html.nav-collapsed .sidebar .collapse-btn span, html.nav-collapsed .sidebar .brand small,
html.nav-collapsed .sidebar .brand-logo, html.nav-collapsed .sidebar .brand-name, html.nav-collapsed .me-text, html.nav-collapsed .me-out { display: none; }
html.nav-collapsed .sidebar .brand-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: 0 auto; border-radius: 10px; background: #fff; color: var(--navy); font-size: 1.4rem; }
html.nav-collapsed .sidebar .brand { padding: 0 0 .8rem; }
html.nav-collapsed .sidebar nav a, html.nav-collapsed .sidebar .collapse-btn { justify-content: center; padding: .6rem 0; }
html.nav-collapsed .sidebar .collapse-btn svg { transform: rotate(180deg); }
html.nav-collapsed .sidebar .me { justify-content: center; background: none; }
html.nav-collapsed .nav-count { position: absolute; top: .1rem; right: .35rem; font-size: .65rem; padding: 0 .3rem; min-width: 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .6rem 1.75rem;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5; box-shadow: inset 0 3px 0 var(--section);
}
.topbar form.search { flex: 1; max-width: 520px; position: relative; }
.topbar .kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font: 600 .7rem "Inter", sans-serif; color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; background: #fff; pointer-events: none; }
.topbar form.search input { width: 100%; background: var(--bg-soft); border-color: transparent; padding-left: 2.1rem;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235f6878" stroke-width="2" stroke-linecap="round"%3E%3Ccircle cx="11" cy="11" r="7"/%3E%3Cpath d="M20 20l-3.5-3.5"/%3E%3C/svg%3E');
  background-repeat: no-repeat; background-position: .7rem center; background-size: 16px; }
.topbar form.search input:focus { background-color: #fff; }
.topbar .spacer { flex: 1; }
.content { padding: 1.6rem 1.75rem 3rem; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head > div:first-child { padding-left: 3.6rem; position: relative; min-height: 2.75rem; }
.page-head > div:first-child::before {
  content: ""; position: absolute; left: 0; top: .1rem; width: 2.75rem; height: 2.75rem; border-radius: 10px;
  background: var(--section-soft) var(--section-icon) no-repeat center / 1.45rem;
  box-shadow: inset 0 0 0 1px rgba(13, 38, 76, .06);
}
.page-head .muted { margin: .2rem 0 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url],
input[type=password], input[type=search], select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .45rem .6rem; background: #fff; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(169, 113, 36, .18); border-color: var(--gold); }
textarea { width: 100%; min-height: 4.5rem; }
label { font-weight: 500; display: block; margin-bottom: .2rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem 1.2rem; }
.form-grid .wide { grid-column: 1 / -1; }
.field input:not([type=checkbox]), .field select { width: 100%; }
.field .help { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.field .errorlist { color: var(--danger); list-style: none; padding: 0; margin: .2rem 0 0; font-size: .85rem; }
.field.checkbox label { display: flex; gap: .4rem; align-items: center; font-weight: 400; }
.form-actions { margin-top: 1.2rem; display: flex; gap: .5rem; }
.errorlist.nonfield { color: var(--danger); background: var(--danger-soft); padding: .6rem .8rem; border-radius: var(--radius); list-style: none; }
.inline-form { display: inline; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .8rem; }
.filters .field { min-width: 150px; }
.filters label { font-size: .8rem; color: var(--muted); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn, button {
  font: inherit; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: .42rem .85rem; border-radius: var(--radius); white-space: nowrap;
}
.btn:hover, button:hover { background: var(--bg-soft); text-decoration: none; }
.btn-primary, button.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 500; }
.btn-primary:hover, button.btn-primary:hover { background: var(--accent-dark); }
.btn-gold, button.btn-gold { background: linear-gradient(135deg, #b9802c, var(--gold)); border-color: #9a6620; color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(169, 113, 36, .3); }
.btn-gold:hover, button.btn-gold:hover { background: linear-gradient(135deg, #a97124, #8e5d1c); }
.btn-gold b { font-size: 1.1rem; line-height: 1; }
.btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.btn-danger { color: var(--danger); border-color: #e7b9bb; }
.btn-small { padding: .2rem .55rem; font-size: .85rem; }
.btn-link { border: 0; background: none; color: var(--accent); padding: 0; }

/* ---------- Tables ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 600; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: #fafafb; }
tbody tr:hover { background: #fbfaf7; }
tr.clickable { cursor: pointer; }
tfoot td { font-weight: 600; background: var(--bg-soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.table-wrap table { border: 0; }
.table-wrap tr:last-child td { border-bottom: 0; }
td.narrative { max-width: 460px; white-space: pre-line; }
.empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); }
.empty::before { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto .45rem; background: no-repeat center / contain; }
p.empty { margin: 0; }

.draft-line textarea { min-height: 2.6rem; }
.draft-line-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .35rem; }
.draft-line-row label { display: flex; align-items: center; gap: .3rem; font-weight: 400; font-size: .85rem; color: var(--muted); margin: 0; }
.draft-line-row input { width: 100px; padding: .25rem .4rem; }
.draft-line-row select { max-width: 170px; padding: .25rem; }
.draft-line-row .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--section); border-bottom-color: var(--gold); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .count { background: var(--bg-soft); border-radius: 10px; padding: 0 .45rem; font-size: .8rem; margin-left: .25rem; }

/* ---------- Cards, stats ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: #fff; box-shadow: var(--shadow);
  border-top: 3px solid var(--card-accent, var(--section)); }
.card h3 { margin: 0 0 .55rem; font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.card .figure { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--navy); line-height: 1.35; }
.card.accent-time { --card-accent: #2f7a4d; }
.card.accent-matters { --card-accent: #2c5694; }
.card.accent-billing { --card-accent: var(--gold); }
.card.accent-trust { --card-accent: #7a2e46; }
.card.accent-danger { --card-accent: var(--danger); }
.card .figure .cur { font-size: .8rem; color: var(--muted); font-weight: 500; margin-right: .25rem; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; background: #fff; box-shadow: var(--shadow); }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.chart-grid .panel { margin-bottom: 0; }
.chart-grid + .chart-grid { margin-top: 1rem; }
.chart-panel h3 { margin: 0 0 .7rem; display: flex; align-items: center; gap: .5rem; font-size: .95rem; color: var(--navy); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart .grid { stroke: #eceef2; stroke-width: 1; }
svg.chart .baseline { stroke: #c9ced8; stroke-width: 1; }
svg.chart .axis { fill: var(--muted); font-size: 11px; font-family: "Inter", sans-serif; }
svg.chart .bar { transition: opacity .15s; }
svg.chart .bar:hover { opacity: .8; }
.chart .s1, .key.s1, .bar-fill.s1 { fill: var(--s1); background: var(--s1); }
.chart .s2, .key.s2, .bar-fill.s2 { fill: var(--s2); background: var(--s2); }
.chart .s3, .key.s3, .bar-fill.s3 { fill: var(--s3); background: var(--s3); }
.chart .age0 { fill: #2f7a4d; } .chart .age1 { fill: #c9a14f; } .chart .age2 { fill: #c97a2b; }
.chart .age3 { fill: #b5482e; } .chart .age4 { fill: #8c1d24; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); margin: -.3rem 0 .4rem; justify-content: flex-end; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .key { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.bar-list { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: .7rem; align-items: center; font-size: .88rem; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg-soft); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; }
.bar-value { color: var(--navy); font-weight: 500; }
.bar-fill.other { background: #c9ced8; }
.bar-row.other .bar-label, .bar-row.other .bar-value { color: var(--muted); }
.chart-panel h3.sub { margin-top: 1.1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
ul.link-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
ul.link-list li { padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
ul.link-list li:last-child { border-bottom: 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.segmented button { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--navy); color: #fff; }
.plain-words { border-left: 4px solid var(--gold); }
.plain-words h3 { margin-top: 0; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gold); }
.plain-words ul { margin: 0; padding-left: 1.1rem; }
.plain-words li { margin: .2rem 0; font-size: 1rem; }
h3.table-title { margin-top: 1.2rem; color: var(--navy); }
.overview-table tr.future td { color: #b0b6c0; }
.overview-table td { white-space: nowrap; padding: .45rem .5rem; }
.overview-table th { padding: .45rem .5rem; vertical-align: bottom; }
.cards.five { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.definitions { font-size: .9rem; }
.overview-link { display: flex; gap: 1rem; align-items: center; color: inherit; border-left: 4px solid var(--gold); }
.overview-link:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(13, 38, 76, .08); }
.overview-link > div { flex: 1; }
.overview-link strong { font-size: 1.05rem; color: var(--navy); }
.overview-link p { margin: .2rem 0 0; }
.h2-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.h2-row .btn { font-size: .85rem; }
h2.section-currency { display: flex; align-items: center; gap: .6rem; }
h2.section-currency .badge { font-family: "Inter", sans-serif; font-size: .85rem; }

/* ---------- Report index ---------- */
.report-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.report-card { display: flex; gap: .9rem; align-items: flex-start; color: inherit; border-top-width: 1px; transition: border-color .15s, box-shadow .15s; }
.report-card:hover { text-decoration: none; border-color: var(--gold-light); box-shadow: 0 4px 14px rgba(13, 38, 76, .08); }
.report-card strong { color: var(--navy); }
.report-card p { margin: .25rem 0 0; }
.report-icon { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 9px; background: no-repeat center / 1.25rem; }

/* ---------- Status badges (always text, never colour alone) ---------- */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 10px; font-size: .8rem; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-open, .badge-paid, .badge-received, .badge-cleared, .badge-ready-to-bill, .badge-waived-consent-on-file, .badge-cleared-no-conflict { background: var(--ok-soft); color: var(--ok); border-color: #c4e3cd; }
.badge-intake, .badge-unpaid, .badge-requested, .badge-pending, .badge-awaiting-decision, .badge-draft { background: var(--warn-soft); color: var(--warn); border-color: #f0dca8; }
.badge-overdue, .badge-cancelled, .badge-declined, .badge-declined-conflict, .badge-void { background: var(--danger-soft); color: var(--danger); border-color: #efc5c7; }
.badge-cad { background: var(--accent-soft); color: var(--navy); border-color: #cbd6e8; font-weight: 600; letter-spacing: .03em; }
.badge-usd { background: var(--gold-soft); color: #7a4f12; border-color: #ecd9b4; font-weight: 600; letter-spacing: .03em; }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .6rem .9rem; border-radius: var(--radius); margin-bottom: .4rem; background: var(--accent-soft); }
.messages li.success { background: var(--ok-soft); color: var(--ok); }
.messages li.error { background: var(--danger-soft); color: var(--danger); }
.messages li.warning { background: var(--warn-soft); color: var(--warn); }
.notice { padding: .7rem .9rem; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); margin-bottom: 1rem; }
.notice.info { background: var(--accent-soft); color: var(--accent-dark); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Top bar widgets ---------- */
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu .menu-items {
  position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.08); min-width: 190px; padding: .3rem 0; z-index: 10;
}
details.menu .menu-items a { display: block; padding: .45rem .9rem; color: var(--text); }
details.menu .menu-items a:hover { background: var(--bg-soft); text-decoration: none; }
.timer { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .2rem .25rem .2rem .6rem; }
.timer .clock { font-variant-numeric: tabular-nums; min-width: 4.2rem; font-weight: 600; }
.timer { background: #fff; }
.timer.running { border-color: #2f7a4d; background: #e5f2ea; }
.timer select { padding: .2rem; max-width: 180px; font-size: .85rem; }

/* ---------- Login ---------- */
body.plain { background: var(--page); }
.login { max-width: 400px; margin: 10vh auto; padding: 2.2rem 2rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: 0 10px 30px rgba(13, 38, 76, .08); border-top: 4px solid var(--navy); }
.login-firm { font-family: "EB Garamond", Georgia, serif; font-size: 1.5rem; font-weight: 600; color: var(--navy);
  padding-bottom: .7rem; margin-bottom: 1.2rem; border-bottom: 2px solid var(--gold); }
.login-logo { text-align: center; }
.login-logo img { display: block; margin: 0 auto; max-width: 240px; max-height: 110px; width: auto; height: auto; }
.login h1 { margin-bottom: 1rem; }
.login .field { margin-bottom: .9rem; }
.login input { width: 100%; }
.qr svg { width: 220px; height: 220px; }

/* ---------- Sections: each part of the app has its own accent and icon ---------- */
.section-core { --section: #0d264c; --section-soft: #e8edf5; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230d264c" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M3 12l9-8 9 8M5 10v10h14V10"/%3E%3C/svg%3E'); }
.section-contacts { --section: #0f6b6b; --section-soft: #e2f1f0; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230f6b6b" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="9" cy="8" r="3.5"/%3E%3Cpath d="M2.5 20c.8-3.6 3.4-5.5 6.5-5.5s5.7 1.9 6.5 5.5M16 4.5a3.5 3.5 0 010 7M18 14.8c1.9.7 3 2.4 3.5 5.2"/%3E%3C/svg%3E'); }
.section-matters { --section: #2c5694; --section-soft: #e7eef8; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232c5694" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M3 7h18v13H3zM8 7V4h8v3"/%3E%3C/svg%3E'); }
.section-timekeeping { --section: #2f7a4d; --section-soft: #e5f2ea; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232f7a4d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="13" r="8"/%3E%3Cpath d="M12 9v4l3 2M9 2h6"/%3E%3C/svg%3E'); }
.section-billing { --section: #a06a1f; --section-soft: #f7eedf; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23a06a1f" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M6 2h9l4 4v16H6zM14 2v5h5M9 12h7M9 16h7"/%3E%3C/svg%3E'); }
.section-trust { --section: #7a2e46; --section-soft: #f5e7ec; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237a2e46" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M3 10h18M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 21h18M12 3l9 5H3z"/%3E%3C/svg%3E'); }
.section-reports { --section: #4a4f9a; --section-soft: #ecedf8; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%234a4f9a" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M4 20V10M10 20V4M16 20v-7M22 20H2"/%3E%3C/svg%3E'); }
.section-accounts { --section: #0d264c; --section-soft: #e8edf5; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230d264c" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="8" r="4"/%3E%3Cpath d="M4 21c1-4 4-6 8-6s7 2 8 6"/%3E%3C/svg%3E'); }
.report-icon.s1 { background-color: #f7eedf; background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23a06a1f" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M6 2h9l4 4v16H6zM14 2v5h5M9 12h7M9 16h7"/%3E%3C/svg%3E'); }
.report-icon.s2 { background-color: #e8edf5; background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230d264c" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M4 20V10M10 20V4M16 20v-7M22 20H2"/%3E%3C/svg%3E'); }
.report-icon.s3 { background-color: #f5e7ec; background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237a2e46" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M3 10h18M5 10v8M9.5 10v8M14.5 10v8M19 10v8M3 21h18M12 3l9 5H3z"/%3E%3C/svg%3E'); }
.empty::before { background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%239aa3b2" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Crect x="4" y="5" width="16" height="14" rx="2"/%3E%3Cpath d="M4 13h4l1.5 2h5L16 13h4"/%3E%3C/svg%3E'); }
.empty.good::before { background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%232f7a4d" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="12" cy="12" r="9"/%3E%3Cpath d="M8 12.5l2.7 2.7L16 9.8"/%3E%3C/svg%3E'); }


/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app, html.nav-collapsed .app { grid-template-columns: 1fr; background: none; }
  .sidebar .collapse-btn, .sidebar .me-text { display: none; }
  .hero-art { display: none; }
  .target-row { grid-template-columns: 1fr !important; }
  .tiles, .today-grid { grid-template-columns: 1fr !important; }
  .chart-grid { grid-template-columns: 1fr; }
  .sidebar .brand { border-bottom: 0; margin: 0; }
  .sidebar .brand-logo { display: inline-block; }
  .sidebar .brand img { max-width: 150px; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: .5rem; }
  .sidebar .brand { padding: .3rem .6rem; width: 100%; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar nav a { padding: .4rem .6rem; margin: .1rem; }
  .sidebar .bottom { margin-top: 0; }
  .topbar { padding: .5rem 1rem; flex-wrap: wrap; }
  .topbar form.search { order: 3; flex-basis: 100%; max-width: none; }
  .content { padding: 1rem; }
  .page-head > div:first-child { padding-left: 0; }
  .page-head > div:first-child::before { display: none; }
  .two-col { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .no-print, .page-head .actions, .filters { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card, .panel, .table-wrap { box-shadow: none; }
  .content { padding: 0; max-width: none; }
  .table-wrap { border: 0; }
}


/* ---------- Dashboard (2026-11-28) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 16px; padding: 1.6rem 1.8rem; margin-bottom: 1.2rem; color: #fff;
  background: linear-gradient(120deg, #0d264c 0%, #1d3f7a 52%, #4b3c9e 100%); box-shadow: 0 10px 30px rgba(13, 38, 76, .18);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.hero h1 { color: #fff; font-size: 2.2rem; margin: .1rem 0 .7rem; }
.hero-text, .hero-actions { position: relative; z-index: 1; }
.hero-date { margin: 0; color: var(--gold-light); font-weight: 600; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.hero-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.hero-chip { color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: .25rem .75rem; font-size: .88rem; }
.hero-chip b { color: var(--gold-light); margin-right: .15rem; }
.hero-chip:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.hero-chip.warn b { color: #ffb4a3; }
.hero-actions { display: flex; gap: .5rem; }
.hero-art { position: absolute; right: 0; top: 0; height: 100%; width: 55%; pointer-events: none; }
.hero-art .ha1 { fill: rgba(255,255,255,.05); } .hero-art .ha2 { fill: rgba(217,181,111,.12); }
.hero-art .ha3 { fill: none; stroke: rgba(217,181,111,.7); stroke-width: 2.5; stroke-linecap: round; }
.hero-art .ha4 { fill: none; stroke: rgba(127,211,255,.35); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.hero-art .ha5 circle { fill: #f3dfb2; }

.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .5rem; }
.today-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.today-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--today-accent); }
.tasks-card { --today-accent: linear-gradient(90deg, var(--violet), #8f7cf0); --today-soft: var(--violet-soft); --today-ink: var(--violet); }
.cal-card { --today-accent: linear-gradient(90deg, var(--sky), #49b4e8); --today-soft: var(--sky-soft); --today-ink: var(--sky); }
.today-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.today-count { width: 2.8rem; height: 2.8rem; border-radius: 12px; display: grid; place-items: center; background: var(--today-soft); color: var(--today-ink); font-size: 1.4rem; font-weight: 700; flex: none; }
.today-count svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.today-label { font-weight: 600; color: var(--navy); line-height: 1.2; }
.today-label small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.round-add { margin-left: auto; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--today-ink); color: #fff; font-size: 1.25rem; font-weight: 600; line-height: 1; transition: transform .15s; }
.round-add:hover { text-decoration: none; transform: scale(1.08) rotate(90deg); }
.today-empty { color: var(--muted); margin: .2rem 0; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; }
.ev-time { flex: none; width: 4.6rem; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--sky); font-size: .88rem; }
.ev-body small { display: block; color: var(--muted); }
.key-dates { margin-top: .7rem; padding-top: .6rem; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; }
.key-dates > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--coral); font-weight: 600; }
.key-dates a b { color: var(--coral); margin-right: .3rem; }
.key-dates a i { font-style: normal; color: var(--muted); }

/* Fee targets */
.target-row { display: grid; grid-template-columns: 1.05fr 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.target-row .panel { margin: 0; border-radius: 12px; }
.ring-panel { text-align: center; background: linear-gradient(180deg, #fff, #fbf8f2); }
.ring-panel h3 { margin: 0 0 .3rem; display: flex; gap: .45rem; align-items: center; justify-content: center; color: var(--navy); font-size: .95rem; }
svg.ring { width: 150px; height: 150px; display: block; margin: .2rem auto .4rem; }
.ring-track { fill: none; stroke: #eef0f4; }
.ring-fill { fill: none; stroke-linecap: round; animation: ring-grow 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes ring-grow { from { stroke-dasharray: 0 var(--circ); } }
.cur-cad .ring-a { stop-color: #2f7fd1; } .cur-cad .ring-b { stop-color: #5b4bc4; }
.cur-usd .ring-a { stop-color: #d9b56f; } .cur-usd .ring-b { stop-color: #b5651d; }
svg.ring.over .ring-a { stop-color: #13877a; } svg.ring.over .ring-b { stop-color: #2f7a4d; }
.ring-pct { font: 700 30px "Inter", sans-serif; fill: var(--navy); }
.ring-sub { font: 500 11px "Inter", sans-serif; fill: var(--muted); }
.ring-facts { display: grid; grid-template-columns: auto auto; gap: .15rem .8rem; margin: 0 auto; width: max-content; text-align: left; font-size: .86rem; }
.ring-facts dt { color: var(--muted); } .ring-facts dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ring-facts dd.good { color: var(--teal); } .ring-facts dd.bad { color: var(--coral); }
.target-chart h3 { margin-bottom: .3rem; }
.target-chart p { margin: .2rem 0 0; }
.chart .t-inv { fill: var(--sky); } .key.t-inv { background: var(--sky); }
.chart .t-col, .key.t-col { fill: var(--teal); background: var(--teal); }
.chart .t-exp, .key.t-exp { fill: var(--gold-light); background: var(--gold-light); }
.chart .t-tgt, .key.t-tgt { fill: var(--violet); background: var(--violet); opacity: .85; }
.target-legend { justify-content: flex-start; margin: -.3rem 0 .5rem; }

/* Invoice tiles */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: .9rem; }
.tile { position: relative; display: flex; flex-direction: column; gap: .2rem; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: .95rem 1rem 2rem; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; overflow: hidden; }
.tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tile-ink); opacity: .85; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(13, 38, 76, .1); }
.tile-draft { --tile-ink: #6b7a99; --tile-soft: #eef1f6; }
.tile-unpaid { --tile-ink: var(--gold); --tile-soft: var(--gold-soft); }
.tile-overdue { --tile-ink: var(--coral); --tile-soft: var(--coral-soft); }
.tile-icon { width: 2.1rem; height: 2.1rem; border-radius: 9px; display: grid; place-items: center; background: var(--tile-soft); color: var(--tile-ink); margin-bottom: .2rem; }
.tile-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-label { font-weight: 600; color: var(--navy); font-size: .92rem; }
.tile-figure { font-size: 2rem; font-weight: 700; color: var(--tile-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-money { font-size: 1.15rem; font-weight: 700; color: var(--tile-ink); font-variant-numeric: tabular-nums; }
.tile-money i { font-style: normal; font-size: .72rem; color: var(--muted); font-weight: 600; margin-right: .3rem; }
.tile-view { position: absolute; right: .9rem; bottom: .6rem; font-size: .8rem; color: var(--navy-2); }
.under-tiles { margin-top: .7rem; }

/* Tasks */
.task-list { list-style: none; margin: 0 0 1rem; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.task-list.compact { border: 0; box-shadow: none; margin: 0; }
.task { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .8rem; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task.compact, .task-list.compact .task { padding: .45rem 0; }
.task form { margin: 0; }
.tick { width: 1.35rem; height: 1.35rem; padding: 0; border-radius: 50%; border: 2px solid #b9c0cd; background: #fff; display: grid; place-items: center; margin-top: .1rem; }
.tick svg { width: 14px; height: 14px; fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick:hover { border-color: var(--teal); background: var(--teal-soft); }
.tick:hover svg { stroke: var(--teal); }
.task.done .tick { background: var(--teal); border-color: var(--teal); }
.task.done .tick svg { stroke: #fff; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task.key .tick { border-color: var(--coral); }
.task-body { min-width: 0; flex: 1; }
.task-title { color: var(--text); font-weight: 500; }
.task-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .82rem; margin-top: .15rem; }
.chip { display: inline-block; border-radius: 10px; padding: 0 .5rem; font-size: .76rem; font-weight: 600; background: var(--bg-soft); color: var(--muted); }
.chip-overdue { background: var(--coral-soft); color: #a3361f; }
.chip-today { background: var(--gold-soft); color: #7a4f12; }
.chip-soon { background: var(--sky-soft); color: #1d5ea3; }
.chip-key { background: var(--coral); color: #fff; }
h2.task-group { display: flex; align-items: center; gap: .5rem; font-size: 1.2rem; margin-top: 1.1rem; }
h2.task-group .count { font: 600 .75rem "Inter", sans-serif; background: var(--bg-soft); color: var(--muted); border-radius: 10px; padding: .05rem .5rem; }
h2.group-overdue { color: #a3361f; } h2.group-today { color: #8a5a00; }

/* A little life on the shared pieces */
.card, .panel { border-radius: 12px; }
.card { border-top: 0; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--card-accent, var(--section)), color-mix(in srgb, var(--card-accent, var(--section)) 45%, #fff)); }
.table-wrap { border-radius: 12px; }
.chart .s1, .key.s1, .bar-fill.s1 { fill: var(--sky); background: var(--sky); }
.chart .s2, .key.s2, .bar-fill.s2 { fill: var(--teal); background: var(--teal); }
.chart .s3, .key.s3, .bar-fill.s3 { fill: var(--violet); background: var(--violet); }
.tabs a.active { border-bottom-width: 3px; }
@media (prefers-reduced-motion: reduce) { .ring-fill { animation: none; } .tile, .round-add { transition: none; } }
.section-tasks { --section: #5b4bc4; --section-soft: #ecebfb; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235b4bc4" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M9 6h11M9 12h11M9 18h11M4 6l1 1 2-2M4 12l1 1 2-2M4 18l1 1 2-2"/%3E%3C/svg%3E'); }
/* Fee quotes and filing deadlines */
.section-fees { --section: #8a5a12; --section-soft: #f7eedf; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%238a5a12" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M6 2h9l4 4v16H6zM14 2v5h5M12.5 10.5c-.4-.6-1.1-1-2-1-1.1 0-2 .6-2 1.5s.9 1.3 2 1.5 2 .6 2 1.5-.9 1.5-2 1.5c-.9 0-1.6-.4-2-1M10.5 8.5v1M10.5 15.5v1"/%3E%3C/svg%3E'); }
.section-corporate { --section: #0f6b6b; --section-soft: #e2f1f0; --section-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%230f6b6b" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Crect x="3" y="5" width="18" height="16" rx="2"/%3E%3Cpath d="M3 10h18M8 3v4M16 3v4M8 14h3"/%3E%3C/svg%3E'); }
.badge-overdue, .badge-expired, .badge-declined { background: #fbe9ea; color: #a4262c; }
.badge-accepted, .badge-done, .badge-billed { background: #e5f2ea; color: #2f7a4d; }
.badge-ready-to-bill, .badge-sent, .badge-to-do { background: #fdf3e1; color: #8a5a12; }
.badge-not-reached, .badge-not-needed, .badge-written-off { background: #eef0f4; color: #5d6573; }
.text-danger { color: #a4262c; }
.form-grid .form-section { grid-column: 1 / -1; border-top: 1px solid var(--line, #e3e6ec); padding-top: .8rem; margin-top: .4rem; }
.form-grid .form-section h3 { margin: 0 0 .2rem; }
.form-grid .form-section p { margin: 0; }

/* ---------- Help and user guide ---------- */
.nav-help { --nav-tint: #ffd98a; }
.help-btn { flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--navy);
  border: 1px solid var(--line); background: #fff; }
.help-btn:hover { text-decoration: none; background: var(--accent-soft); }
.help { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; align-items: start; }
.help-toc { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow: auto; font-size: .9rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.help-toc ol { margin: .5rem 0 0; padding-left: 1.3rem; }
.help-toc li { margin: .28rem 0; }
.help-toc a { color: var(--text); }
.help-body { max-width: 860px; line-height: 1.6; }
.help-body section { scroll-margin-top: 4.5rem; padding-bottom: 1.2rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.help-body section:last-child { border-bottom: 0; }
.help-body h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }
.help-body h2 .n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font: 700 .9rem "Inter", sans-serif; color: #fff; background: var(--navy); }
.help-body h3 { margin: 1.3rem 0 .4rem; scroll-margin-top: 4.5rem; }
.help-body [id] { scroll-margin-top: 4.5rem; }
.help-body ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.help-body ol.steps > li { counter-increment: step; position: relative; padding: .15rem 0 .45rem 2.3rem; }
.help-body ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: .15rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: grid; place-items: center; font: 600 .8rem "Inter", sans-serif; color: var(--navy); background: var(--gold-soft); border: 1px solid #ecd9b5; }
.help-body ul ul { margin: .3rem 0; }
.help-tip { background: var(--accent-soft); border-left: 3px solid var(--navy); padding: .6rem .85rem; border-radius: 0 var(--radius) var(--radius) 0; }
.help-you { border-left: 3px solid var(--gold); }
.role { display: inline-block; font: 600 .7rem "Inter", sans-serif; letter-spacing: .02em; padding: .08rem .45rem; border-radius: 10px; vertical-align: middle;
  background: var(--gold-soft); color: #7a4f12; border: 1px solid #ecd9b5; }
.help-body figure { margin: 1rem 0 1.2rem; }
.help-body figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(13, 38, 76, .08); }
.help-body figcaption { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.help-table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; font-size: .93rem; }
.help-table th, .help-table td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-top: 1px solid var(--line); }
.help-table th { width: 30%; color: var(--navy); font-weight: 600; }
.help-table.roles th, .help-table.roles td { width: auto; text-align: center; }
.help-table.roles td:first-child { text-align: left; }
.faq { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin: .45rem 0; }
.faq summary { cursor: pointer; padding: .65rem .9rem; font-weight: 600; color: var(--navy); list-style-position: inside; }
.faq[open] summary { border-bottom: 1px solid var(--line); }
.faq > div { padding: .65rem .9rem .8rem; }
@media (max-width: 860px) {
  .help { grid-template-columns: 1fr; gap: 1rem; }
  .help-toc { position: static; max-height: none; }
}
@media print {
  .help { display: block; }
  .help-toc, .help-btn { display: none; }
  .faq > div { display: block !important; }
  .help-body section { break-inside: auto; }
}

/* Billable clients (Create invoice) */
.billable-bar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: .8rem; }
.billable-bar .select-all { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; margin: 0; }
.billable-bar .totals { margin-left: auto; }
.billable-table .client-group { border-top: 1px solid var(--line); }
.billable-table .client-row td { background: var(--bg-soft, #f7f8fa); font-weight: 600; }
.billable-table .client-row label, .billable-table .matter-row label { font-weight: inherit; margin: 0; display: inline; }
.billable-table .matter-row td.indent { padding-left: 1.6rem; }
.billable-table .client-group.picked .client-row td { background: #eef3fb; }
.billable-table input[type=checkbox] { width: auto; }
