/* Zenatta brand: Green #044B30, Dark Gray #222222, Accent #0F8656,
   Gradient #02D58E -> #01784E, Buttons #0A5E3C / #0F8656. Raleway titles, Ubuntu body. */
:root {
  --green: #044B30;
  --green-700: #0A5E3C;
  --accent: #0F8656;
  --mint: #02D58E;
  --mint-deep: #01784E;
  --ink: #222222;
  --text: #000000;
  --muted: #5d6b64;
  --subtle: #8a978f;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --line: #e2e9e5;
  --line-soft: #eef3f0;
  --tint: #e8f4ee;

  --ok: #0F8656;
  --ok-bg: #e3f4ec;
  --info: #1f6f8b;
  --info-bg: #e3f1f6;
  --warn: #9a5b00;
  --warn-bg: #fdf0dc;
  --bad: #b42318;
  --bad-bg: #fde7e5;
  --neutral: #55625b;
  --neutral-bg: #eef1ef;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(4 75 48 / 0.04), 0 8px 24px -12px rgb(4 75 48 / 0.18);
  --shadow-lg: 0 24px 60px -20px rgb(4 40 26 / 0.35);
  --font-title: "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Ubuntu", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--ink); margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); }
button { font: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top navigation ---------- */
.topnav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topnav-inner { max-width: 1160px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--green); min-width: 0; }
.brand img { height: 48px; width: auto; display: block; }
.wordmark { font-family: var(--font-title); font-weight: 800; font-size: 22px; letter-spacing: 0.02em; color: var(--green); }
.brand-divider { width: 1px; height: 22px; background: var(--line); }
.brand-sub { font-family: var(--font-title); font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.topnav-right { display: flex; align-items: center; gap: 14px; min-width: 0; }

.deal-switch { position: relative; }
.deal-switch select {
  appearance: none; font: 500 14px var(--font-body); color: var(--ink);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23044B30' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 20px;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 36px 8px 14px; max-width: 280px; cursor: pointer;
}
.deal-switch select:hover { border-color: var(--accent); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep)); color: #fff;
  font: 700 13px var(--font-title); letter-spacing: 0.04em;
}
.user-name { font-weight: 500; white-space: nowrap; }
.btn-ghost { white-space: nowrap; background: none; border: 1px solid transparent; color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.btn-ghost:hover { color: var(--green); background: var(--tint); }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(900px 400px at 85% -10%, rgb(2 213 142 / 0.35), transparent 60%),
    radial-gradient(600px 300px at 10% 120%, rgb(15 134 86 / 0.45), transparent 60%),
    linear-gradient(135deg, #033a25 0%, var(--green) 45%, var(--green-700) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.08;
  background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero-inner {
  position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 40px 24px 96px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.hero .eyebrow { color: rgb(255 255 255 / 0.72); }
.hero h1 { color: #fff; font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; line-height: 1.15; margin: 6px 0 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: rgb(255 255 255 / 0.85); }
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: rgb(255 255 255 / 0.45); }
.pill-glass {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 0.12); border: 1px solid rgb(255 255 255 / 0.2); font-size: 13px; font-weight: 500;
}
.pill-glass::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgb(2 213 142 / 0.25); }

.hero-stats { display: flex; align-items: center; gap: 28px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgb(255 255 255 / 0.14); stroke-width: 12; }
.ring .bar { fill: none; stroke: url(#ringGradient); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 900ms cubic-bezier(.2,.8,.2,1); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-label strong { display: block; font: 700 28px/1 var(--font-title); color: #fff; }
.ring-label span { font-size: 12px; color: rgb(255 255 255 / 0.72); }
.hero-figures { display: grid; gap: 10px; }
.figure { display: flex; align-items: baseline; gap: 10px; }
.figure b { font: 700 22px var(--font-title); color: #fff; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.figure span { color: rgb(255 255 255 / 0.75); font-size: 13px; }
.figure.highlight b { color: var(--mint); }
.figure.low b { color: #ffd38a; }

/* ---------- Tabs ---------- */
main.container { flex: 1; }
.tabs {
  position: relative; z-index: 2; margin: -52px 0 24px; display: flex; gap: 4px; padding: 6px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); width: fit-content; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 10px 18px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: background 160ms, color 160ms;
}
.tabs button svg { width: 17px; height: 17px; opacity: 0.8; }
.tabs button:hover { color: var(--green); background: var(--tint); }
.tabs button[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, var(--green-700), var(--accent)); box-shadow: 0 6px 16px -6px rgb(15 134 86 / 0.6); }
.tabs button[aria-selected="true"] svg { opacity: 1; }

.view { padding-bottom: 56px; animation: fade 260ms ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards & layout ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; }
.card-head h3 { font-size: 17px; font-weight: 700; }
.card-head .link-btn { font-size: 14px; }
.eyebrow { font: 600 12px var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); }

.stat { padding: 20px 22px; display: flex; gap: 16px; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--accent); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.bad { background: var(--bad-bg); color: var(--bad); }
.stat-value { font: 700 24px/1.1 var(--font-title); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h3 { font-size: 15px; font-weight: 700; color: var(--green); }
.section-title .meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding: 16px 24px; border-top: 1px solid var(--line-soft); }
.list > li:first-child { border-top: 0; }
.list > li:hover { background: #fafcfb; }
.date-chip {
  width: 50px; text-align: center; border-radius: 12px; background: var(--tint); color: var(--green); padding: 6px 0 7px; line-height: 1.1;
}
.date-chip b { display: block; font: 700 19px var(--font-title); }
.date-chip span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.item-title { font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.item-sub { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.item-sub svg { width: 14px; height: 14px; opacity: 0.7; vertical-align: -2px; margin-right: 3px; }
.item-desc { color: #3b4741; margin-top: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.clamp.open { -webkit-line-clamp: unset; }
.item-aside { text-align: right; white-space: nowrap; }
.hours { font: 700 18px var(--font-title); color: var(--ink); font-variant-numeric: tabular-nums; }
.hours small { font: 500 12px var(--font-body); color: var(--muted); margin-left: 2px; }
.comped { display: block; font-size: 12px; color: var(--accent); margin-top: 2px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--tint); color: var(--green); font-size: 12px; font-weight: 500; }

/* ---------- Filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 7px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; transition: all 140ms;
}
.chip:hover { border-color: var(--accent); color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip .count { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--tint); color: var(--green); }
.chip[aria-pressed="true"] .count { background: rgb(255 255 255 / 0.18); color: #fff; }

/* ---------- Tasks ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.task { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; transition: transform 160ms, box-shadow 160ms; }
.task:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgb(4 75 48 / 0.05), 0 16px 32px -16px rgb(4 75 48 / 0.3); }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.task h4 { font: 600 15px/1.4 var(--font-body); color: var(--ink); }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; }
.task-meta svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; opacity: 0.7; }
.task-meta .overdue { color: var(--bad); font-weight: 500; }
.meter { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--mint-deep)); }
.meter.over > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- Meetings timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--mint), var(--line)); border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 24px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-card { padding: 20px 22px; }
.tl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.tl-date { font: 700 16px var(--font-title); color: var(--ink); }
.callout { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: #f2faf6; border: 1px solid #d5ece0; }
.callout .eyebrow { color: var(--accent); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout .eyebrow svg { width: 14px; height: 14px; }
.callout p { margin: 0; white-space: pre-line; color: #2c3a33; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  padding: 9px 16px; font-weight: 500; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--accent)); box-shadow: 0 6px 14px -8px rgb(10 94 60 / 0.7);
  transition: transform 140ms, box-shadow 140ms, filter 140ms;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 20px -10px rgb(10 94 60 / 0.8); }
.btn svg { width: 16px; height: 16px; }
.btn-soft { background: var(--tint); color: var(--green); box-shadow: none; }
.btn-soft:hover { background: #d9eee3; box-shadow: none; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--tint); color: var(--green); }

/* ---------- Tables (invoices) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 600 12px var(--font-title); letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); padding: 14px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 16px 24px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-no { font-weight: 600; color: var(--ink); }

/* ---------- States ---------- */
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--tint); color: var(--accent); }
.empty-icon svg { width: 28px; height: 28px; }
.empty h4 { font-size: 17px; margin-bottom: 4px; }
.error-card { border-color: #f4c7c3; }
.error-card .empty-icon { background: var(--bad-bg); color: var(--bad); }

.skeleton { position: relative; overflow: hidden; background: var(--line-soft); border-radius: 8px; }
.hero .skeleton { background: rgb(255 255 255 / 0.12); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.5), transparent); animation: shimmer 1.4s infinite;
}
.hero .skeleton::after { background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.15), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-title { height: 34px; width: min(420px, 80vw); margin: 14px 0; border-radius: 10px; }
.sk-card { height: 96px; border-radius: var(--radius); }
.sk-row { height: 64px; border-radius: 12px; margin-bottom: 10px; }

/* ---------- Drawer ---------- */
dialog.drawer {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100vw); max-width: 100vw;
  border: 0; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.drawer[open] { animation: slide 260ms cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog::backdrop { background: rgb(3 30 20 / 0.45); backdrop-filter: blur(2px); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 21px; margin-top: 4px; }
.drawer-body { padding: 8px 28px 32px; overflow-y: auto; }
.markdown h3 { font-size: 16px; color: var(--green); margin: 22px 0 8px; }
.markdown p { margin: 8px 0; }
.markdown ul { padding-left: 20px; margin: 8px 0; }
.markdown li { margin: 4px 0; }
.markdown li::marker { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; padding-bottom: 88px; }
}
@media (max-width: 680px) {
  .container, .topnav-inner { padding-left: 16px; padding-right: 16px; }
  .hero-inner { padding: 28px 16px 84px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .brand-divider, .brand-sub, .user-name { display: none; }
  .deal-switch select { max-width: 150px; padding: 7px 30px 7px 12px; font-size: 13px; }
  .topnav-right { gap: 8px; }
  .wordmark { font-size: 19px; }
  .brand img { height: 40px; }
  .btn-ghost { padding: 6px 8px; font-size: 14px; }
  .user .avatar { width: 30px; height: 30px; font-size: 12px; }
  .hero-stats { gap: 18px; }
  .ring, .ring svg { width: 108px; height: 108px; }
  .ring-label strong { font-size: 23px; }
  .tabs { border-radius: 16px; width: 100%; }
  .tabs button { padding: 9px 14px; }
  .list > li { padding: 14px 16px; gap: 12px; }
  .card-head { padding: 16px 16px 12px; }
  .task-grid { grid-template-columns: 1fr; }
  /* Invoice table becomes stacked cards */
  table thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  td::before { content: attr(data-label); color: var(--subtle); font-size: 13px; text-align: left; }
  td.num { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v2: home, deliverables, meetings ---------- */
.tabs[hidden] { display: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: rgb(255 255 255 / 0.8); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.back-link:hover { color: #fff; }
.back-link svg { width: 16px; height: 16px; }
.pill-glass.warn::before { background: #ffc56b; box-shadow: 0 0 0 3px rgb(255 197 107 / 0.25); }
.pill-glass.bad::before { background: #ff8a80; box-shadow: 0 0 0 3px rgb(255 138 128 / 0.25); }
.figure.over b { color: #ffc56b; }
.ring.is-over .bar { stroke: url(#ringOver); }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 12px; font-weight: 400; }
.pad { padding: 16px 24px; margin: 0; }
.txt-ok { color: var(--ok); } .txt-warn { color: var(--warn); } .txt-bad { color: var(--bad); }
.meter.warn > i { background: linear-gradient(90deg, #f6c445, #d99a00); }
.meter.over > i { background: linear-gradient(90deg, #f59e0b, #dc5f00); }
.section-title.first { margin-top: 0; }

/* Home hero KPIs */
.hero-kpis { display: flex; gap: 14px; }
.kpi { min-width: 120px; padding: 16px 18px; border-radius: 14px; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.16); backdrop-filter: blur(4px); }
.kpi b { display: block; font: 700 28px/1.1 var(--font-title); color: #fff; font-variant-numeric: tabular-nums; }
.kpi span { color: rgb(255 255 255 / 0.75); font-size: 13px; }
.kpi.attn b { color: #ffc56b; }

/* Home deal cards */
.deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.deal-card { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; text-decoration: none; color: inherit; transition: transform 160ms, box-shadow 160ms, border-color 160ms; }
a.deal-card:hover { transform: translateY(-3px); border-color: #cfe5d9; box-shadow: 0 1px 2px rgb(4 75 48 / 0.05), 0 20px 36px -18px rgb(4 75 48 / 0.35); }
.deal-card-top { display: flex; justify-content: space-between; align-items: center; }
.deal-open { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 160ms; }
.deal-open svg { width: 15px; height: 15px; }
a.deal-card:hover .deal-open { opacity: 1; }
.deal-card h3 { font-size: 18px; line-height: 1.3; }
.deal-hours-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.deal-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; }
.deal-note svg { width: 16px; height: 16px; }

/* Promotions */
.promo { display: flex; align-items: center; gap: 20px; padding: 22px 24px; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.promo-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--mint), var(--mint-deep)); box-shadow: 0 10px 20px -10px rgb(1 120 78 / 0.7); }
.promo-icon svg { width: 26px; height: 26px; }
.promo-body { flex: 1; min-width: 0; }
.promo-body h3 { font-size: 18px; margin: 2px 0 4px; }
.promo-body p { margin: 0; color: var(--muted); }
.promo-training { background: radial-gradient(600px 200px at 100% 0%, rgb(2 213 142 / 0.12), transparent 60%), var(--surface); }
.promo-training.enrolled { border-color: #cfe5d9; }
.course-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.course { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ok-bg); color: var(--green); font-size: 13px; font-weight: 500; }
.course svg { width: 14px; height: 14px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.promo-ext { align-items: flex-start; transition: transform 160ms, box-shadow 160ms; }
.promo-ext:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgb(4 75 48 / 0.05), 0 20px 36px -18px rgb(4 75 48 / 0.35); }
.promo-ext .promo-icon { background: linear-gradient(135deg, var(--green-700), var(--green)); }
.promo-cta { align-self: center; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 14px; white-space: nowrap; }
.promo-cta svg { width: 15px; height: 15px; }

/* Rows */
.row-main { min-width: 0; }
.task-ref { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-foot { margin-top: 6px; font-size: 12px; color: var(--subtle); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tl-head .btn-row { margin-top: 0; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; }
.link-btn svg { width: 15px; height: 15px; }
.deliv-mini .meter { margin-top: 10px; }
.list > li.deliv-mini { grid-template-columns: 1fr; }

/* Deliverables */
.deliv-list { display: grid; gap: 14px; }
.deliv { overflow: hidden; }
.deliv-head {
  width: 100%; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit;
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(160px, 1fr) auto 24px; gap: 20px; align-items: center; padding: 20px 24px;
}
.deliv-head:hover { background: #fafcfb; }
.deliv-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deliv-name h3 { font-size: 16px; }
.app-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.deliv-pct { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.deliv-pct b { font: 700 18px var(--font-title); color: var(--ink); }
.deliv-pct span { font-size: 12px; color: var(--muted); }
.deliv-stats { display: grid; gap: 2px; font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.deliv-stats b { color: var(--ink); }
.chev { color: var(--subtle); transition: transform 200ms; display: grid; place-items: center; }
.deliv.open .chev { transform: rotate(180deg); }
.deliv-body { border-top: 1px solid var(--line); background: #fbfdfc; }
.task-list > li.task-row { grid-template-columns: 130px 1fr auto; align-items: center; background: transparent; }
.task-status .pill { white-space: normal; text-align: center; }
.task-list.done { opacity: 0.85; }
.show-more {
  display: block; width: 100%; border: 0; border-top: 1px solid var(--line-soft); background: none; cursor: pointer;
  padding: 12px; color: var(--accent); font-weight: 500;
}
.show-more:hover { background: var(--tint); }
.show-more.big { margin-top: 18px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }

/* Meeting drawer */
.drawer-actions { margin: 18px 0 6px; }
.drawer-actions:empty { display: none; }
.attendees { margin: 16px 0 8px; padding: 14px 16px; background: var(--bg); border-radius: var(--radius-sm); }
.attendee-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attendee { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.attendee.internal .avatar { background: linear-gradient(135deg, var(--green-700), var(--green)); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: fade 200ms ease;
}

@media (max-width: 900px) {
  .hero-kpis { flex-wrap: wrap; }
  .deliv-head { grid-template-columns: 1fr 24px; }
  .deliv-progress, .deliv-stats { grid-column: 1; }
  .deliv-stats { text-align: left; display: flex; gap: 14px; flex-wrap: wrap; }
  .chev { grid-row: 1; grid-column: 2; }
}
@media (max-width: 680px) {
  .kpi { min-width: 0; flex: 1; padding: 12px; }
  .kpi b { font-size: 22px; }
  .deal-grid, .promo-grid { grid-template-columns: 1fr; }
  .promo { flex-wrap: wrap; }
  .deliv-head { padding: 16px; }
  .task-list > li.task-row { grid-template-columns: 1fr auto; }
  .task-status { grid-column: 1 / -1; }
  .tl-head .btn-row { width: 100%; }
}
body.is-home .hero-inner { padding-bottom: 44px; }
body.is-home main.container { padding-top: 32px; }
.promo-ext { flex-direction: column; gap: 14px; }
.promo-ext .promo-cta { align-self: flex-start; }

/* ---------- v3: billing ---------- */
.deal-card { position: relative; }
.deal-card h3 a.stretched { color: inherit; text-decoration: none; }
.deal-card h3 a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.deal-card:hover { transform: translateY(-3px); border-color: #cfe5d9; box-shadow: 0 1px 2px rgb(4 75 48 / 0.05), 0 20px 36px -18px rgb(4 75 48 / 0.35); }
.deal-card:hover .deal-open { opacity: 1; }
.deal-due { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.deal-due b { font-size: 15px; }
.deal-due.is-overdue { background: var(--bad-bg); color: var(--bad); }
.btn-sm { padding: 6px 12px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.btn-row.nowrap { flex-wrap: nowrap; justify-content: flex-end; margin-top: 0; }

.due-banner {
  display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff8ec, #fdf0dc); border: 1px solid #f3d9a8;
}
.due-banner.is-overdue { background: linear-gradient(135deg, #fff4f2, #fde7e5); border-color: #f4c7c3; }
.due-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--warn); flex-shrink: 0; }
.due-banner.is-overdue .due-icon { color: var(--bad); }
.due-icon svg { width: 24px; height: 24px; }
.due-body { flex: 1; min-width: 0; }
.due-banner .eyebrow { color: var(--warn); }
.due-banner.is-overdue .eyebrow { color: var(--bad); }
.due-amount { font: 700 26px/1.2 var(--font-title); color: var(--ink); margin: 2px 0 4px; }
.due-amount span { font: 400 15px var(--font-body); color: var(--muted); }
@media (max-width: 680px) {
  .due-banner { flex-wrap: wrap; }
  .btn-row.nowrap { flex-wrap: wrap; justify-content: flex-start; }
  td .btn-row.nowrap { justify-content: flex-end; }
}

/* ---------- v4: accounts on home ---------- */
.account-block { margin-bottom: 40px; }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.account-head h2 { font-size: 20px; font-weight: 700; }
.account-head .meta { color: var(--muted); font-size: 13px; }
.account-avatar {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--tint); color: var(--green); font: 700 15px var(--font-title); letter-spacing: 0.03em;
}
.account-total { margin-left: auto; }
.deal-rows { display: grid; gap: 12px; margin-bottom: 14px; }
.deal-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr) 300px;
  gap: 28px; align-items: center; padding: 20px 24px; transition: transform 160ms, box-shadow 160ms, border-color 160ms;
}
.deal-row:hover { transform: translateY(-2px); border-color: #cfe5d9; box-shadow: 0 1px 2px rgb(4 75 48 / 0.05), 0 18px 32px -18px rgb(4 75 48 / 0.35); }
.deal-row h3 { font-size: 17px; line-height: 1.3; margin-top: 8px; }
.deal-row h3 a.stretched { color: inherit; text-decoration: none; }
.deal-row h3 a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.deal-row .deal-note { margin-top: 10px; }
.deal-row-side { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.deal-row .deal-due span { font-size: 12px; }
.deal-row .deal-open { opacity: 0.5; }
.deal-row:hover .deal-open { opacity: 1; }
.deal-row .deal-hours-head { margin-bottom: 8px; }
.account-block .promo { padding: 16px 20px; }
.account-block .promo-icon { width: 44px; height: 44px; }
.account-block .promo-body h3 { font-size: 16px; }
@media (max-width: 900px) {
  .deal-row { grid-template-columns: 1fr; gap: 14px; }
  .deal-row-side { justify-content: space-between; }
}
@media (max-width: 680px) {
  .promo { flex-direction: column; align-items: flex-start; }
  .account-head { flex-wrap: wrap; }
  .account-total { margin-left: 58px; }
}
@media (max-width: 680px) {
  .kpi b { font-size: 18px; overflow-wrap: anywhere; }
}

/* ---------- v5: Your Team, booking, invite form ---------- */
.avatar { position: relative; overflow: hidden; }
.avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line); }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.consultant { display: flex; align-items: center; gap: 22px; padding: 24px 28px; margin-bottom: 8px;
  background: radial-gradient(500px 180px at 100% 0%, rgb(2 213 142 / 0.12), transparent 60%), var(--surface); }
.consultant h3 { font-size: 22px; margin: 2px 0; }
.consultant .btn-row { margin-left: auto; margin-top: 0; }
.person-body { min-width: 0; flex: 1; }
.person-title { color: var(--muted); font-size: 14px; }
.person-email { display: inline-block; margin-top: 2px; font-size: 14px; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.person-email:hover { text-decoration: underline; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.person { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; }
.person h4 { font: 600 16px var(--font-body); color: var(--ink); }
.person-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.person > .btn { align-self: center; }
.you { font: 600 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); background: var(--tint); padding: 2px 7px; border-radius: 6px; margin-left: 4px; vertical-align: 2px; }
.section-title .btn { margin-left: auto; }
.team-note { margin-top: 16px; }

.booking { margin-bottom: 8px; overflow: hidden; }
.booking-head { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.booking-head h3 { font-size: 18px; margin: 2px 0 2px; }
.booking-head p { margin: 0; }
.booking, .booking-frame { scroll-margin-top: 84px; }
.booking-frame { border-top: 1px solid var(--line); }
/* Sized to the viewport so the whole calendar is visible once scrolled to (sticky nav is ~72px). */
.booking-frame iframe { display: block; width: 100%; height: clamp(560px, calc(100vh - 100px), 760px); border: 0; }

dialog.modal { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal[open] { animation: fade 200ms ease; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; padding: 24px 26px 8px; }
.modal-head h2 { font-size: 21px; margin: 4px 0; }
.modal-head p { margin: 0; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 14px 26px 4px; }
.form-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  font: 15px var(--font-body); color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(15 134 86 / 0.15); }
.optional, .hint { font-weight: 400; color: var(--subtle); font-size: 12px; }
.form-error { margin: 12px 26px 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 26px 24px; }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; }

@media (max-width: 680px) {
  .consultant, .booking-head { flex-wrap: wrap; }
  .consultant .btn-row { margin-left: 0; width: 100%; }
  .people-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .booking-frame iframe { height: clamp(600px, calc(100dvh - 90px), 900px); }
}

/* ---------- v6: team management ---------- */
.person-manage { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.person-manage select { font: 13px var(--font-body); padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.person-manage select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(15 134 86 / 0.15); }
.link-btn.danger { color: var(--bad); }
.tag-admin { background: #e6efe9; color: var(--green); font-weight: 600; }
.btn-danger { background: linear-gradient(135deg, #c0392b, var(--bad)); box-shadow: 0 6px 14px -8px rgb(180 35 24 / 0.7); }
#confirmDialog .modal-head { padding-bottom: 4px; }
#confirmDialog p { margin-top: 6px; }

/* ---------- v7: card actions menu, edit dialog ---------- */
.person { position: relative; padding-right: 52px; }
.menu-wrap { position: absolute; top: 10px; right: 10px; }
.kebab { width: 32px; height: 32px; background: transparent; }
.kebab:hover, .kebab[aria-expanded="true"] { background: var(--tint); color: var(--green); }
.kebab svg { width: 18px; height: 18px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 160px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 9px 12px; border-radius: 8px; font: 500 14px var(--font-body); color: var(--ink);
}
.menu button:hover, .menu button:focus-visible { background: var(--tint); outline: none; }
.menu button.danger { color: var(--bad); }
.menu button.danger:hover { background: var(--bad-bg); }

.photo-edit { display: flex; align-items: center; gap: 18px; padding: 10px 26px 4px; }
.photo-edit .avatar.xl { box-shadow: none; }
.file-btn { cursor: pointer; }
.photo-edit .hint { margin-top: 6px; display: block; }
.form-grid select:disabled { background: var(--bg); color: var(--muted); }

/* ---------- Shared files ---------- */
.files-head { align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; }
.crumbs .link-btn { font-size: 15px; }
.crumb-sep { color: var(--subtle); }
.file-btn.is-disabled { opacity: 0.55; pointer-events: none; }
.dropzone { transition: border-color 160ms, background 160ms; }
.dropzone.dragging { border: 2px dashed var(--accent); background: var(--tint); }
.upload-status { padding: 14px 24px; border-bottom: 1px solid var(--line-soft); }
.upload-status .item-sub { justify-content: space-between; margin-bottom: 8px; }
.file-list > li { align-items: center; }
.file-icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--tint); color: var(--green); font: 700 11px var(--font-title); letter-spacing: 0.04em;
}
.file-icon.is-folder { background: #fdf0dc; color: #b7791f; }
.file-icon svg { width: 22px; height: 22px; fill: currentColor; }
.file-name { display: block; font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; text-align: left; margin-bottom: 2px; }
a.file-name:hover, button.file-name:hover { color: var(--accent); text-decoration: underline; }
.file-row .btn svg { width: 16px; height: 16px; }
.file-actions { display: flex; gap: 8px; }
@media (max-width: 680px) {
  .file-list > li { padding: 12px 16px; gap: 12px; }
  .hide-sm { display: none; }
}

/* ---------- File preview ---------- */
dialog.viewer {
  width: min(1100px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; max-width: none;
  padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink);
}
dialog.viewer[open] { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.viewer-title { flex: 1; min-width: 0; }
.viewer-title h2 { font-size: 18px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-tabs[hidden] { display: none; }
.viewer-tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); }
.viewer-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg); }
.viewer-loading { padding: 24px; }
.viewer-pdf { display: block; width: 100%; height: 100%; border: 0; }
.viewer-image { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.viewer-image img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: 8px; box-shadow: var(--shadow); background: #fff; }
.viewer-text { margin: 0; padding: 20px 24px; min-height: 100%; background: var(--surface); font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-docx { padding: 12px 0; }
.viewer-docx .docx-wrapper { background: transparent; padding: 12px; }
.viewer-docx .docx-wrapper > section.docx { box-shadow: var(--shadow); margin-bottom: 16px; max-width: 100%; }
.sheet-wrap { overflow: auto; background: var(--surface); }
.sheet { width: auto; min-width: 0; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 5px 9px; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.sheet thead th, .sheet tbody th { position: sticky; background: var(--neutral-bg); color: var(--muted); font-weight: 500; font-size: 12px; }
.sheet thead th { top: 0; z-index: 1; text-align: center; }
.sheet tbody th { left: 0; text-align: right; }
.sheet thead th:first-child { left: 0; z-index: 2; }
.viewer-note { padding: 10px 20px; }
.viewer-error { padding: 40px 20px; text-align: center; }
@media (max-width: 680px) {
  dialog.viewer { width: 100vw; height: 100dvh; border-radius: 0; }
  .viewer-head { padding: 12px 16px; }
  .viewer-head .btn { padding: 6px 10px; }
  /* docx-preview sets page size and margins inline; on phones let the page fit the screen. */
  .viewer-docx .docx-wrapper { padding: 8px; }
  .viewer-docx .docx-wrapper > section.docx { width: auto !important; min-height: 0 !important; padding: 24px 20px !important; }
}

/* ---------- Message consultant ---------- */
.form-grid textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
#messageDialog { width: min(620px, calc(100vw - 32px)); }
