@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Dashboard palette — teal / gold / cream brand system. Every var below maps onto this fixed set:
   ink #12181A, ink-2 #1C2624, teal #123F41, teal-tint #E8F1F0, gold #E9DD8A, gold-600 #D9C765,
   cream #F9EBD9, line #E7DCC6, line-2 #E2E8E7, muted #5C6867, good #2F8F6B. */
:root {
  --primary: #1C2624;
  --primary-dark: #12181A;
  --sidebar-from: #1C2624;
  --sidebar-via: #171F1F;
  --sidebar-to: #12181A;
  --brand: #123F41;
  --brand-dark: #123F41;
  --brand-light: #E8F1F0;
  --accent: #E9DD8A;
  --accent-dark: #D9C765;
  --accent-light: #F9EBD9;
  --accent-text: #12181A;
  --bg: #F9EBD9;
  --card-bg: #ffffff;
  --text: #12181A;
  --text-muted: #5C6867;
  --border: #E2E8E7;
  --line: #E7DCC6;
  --green: #2F8F6B;
  --red: #d6455a;
  --sidebar-w: 258px;
  --radius: 16px;
  --radius-sm: 10px;
  --border-hover: color-mix(in srgb, var(--brand) 35%, white);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  background: #f9ebd96b;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.breadcrumb a:hover { color: var(--brand-dark); }

.app { display: flex; min-height: 100vh; }

/* ===== Sidebar — black with a blue glow accent ===== */
.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(520px 320px at 100% 0%, color-mix(in srgb, var(--brand) 55%, transparent) 0%, transparent 60%),
    linear-gradient(200deg, var(--sidebar-from) 0%, var(--sidebar-via) 55%, var(--sidebar-to) 100%);
  color: #fff;
  flex-shrink: 0;
  padding: 26px 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 18px;
}
.sidebar .brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; border: 1px solid rgba(255,255,255,.15); }
.sidebar .brand-name { font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.sidebar .brand-tag { font-size: 11px; opacity: .68; margin-top: 2px; }

.sidebar nav { padding: 0 12px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b7bcc4;
  padding: 11px 14px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background .18s var(--ease), color .18s var(--ease), transform .12s var(--ease);
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; transform: translateX(2px); }
.sidebar nav a.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-weight: 600;
}
.sidebar nav a.active .icon { color: #fff; }
.sidebar nav .icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: #8b8f96;
  font-size: 13px;
  border-radius: 6px;
  transition: color .18s var(--ease);
}
.sidebar nav .icon svg { width: 18px; height: 18px; flex-shrink: 0; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 30px 34px 60px;
  width: calc(100% - var(--sidebar-w));
  background: radial-gradient(1100px 420px at 100% -10%, var(--brand-light) 0%, transparent 60%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.topbar h1 { font-size: 24px; margin: 0; color: var(--primary-dark); letter-spacing: -.02em; font-weight: 800; }
.topbar .breadcrumb { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: 1px solid var(--primary-dark);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s var(--ease), transform .12s var(--ease), background .18s var(--ease);
}
.btn:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--accent-text);
  border-color: var(--accent-dark);
  font-weight: 700;
}
.btn.accent:hover { border-color: var(--primary); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f3c9c9; }
.btn.danger:hover { background: #fdeeee; border-color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  transition: border-color .2s var(--ease);
}
.card h2, .card h3 { margin-top: 0; color: var(--primary-dark); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ===== KPI stat tiles — alternating light blue / light gold tints, big bold icon chips ===== */
.stat-tile {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: linear-gradient(165deg, #ffffff 0%, color-mix(in srgb, var(--brand-light) 40%, white) 100%);
  overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.stat-tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}
.stat-tile:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.stat-tile .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-light), #dbeefb);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
}
.stat-tile .stat-icon svg { width: 26px; height: 26px; flex-shrink: 0; }
.stat-tile .label { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; }
.stat-tile .value { font-size: 32px; font-weight: 800; color: var(--text); margin: 7px 0 4px; letter-spacing: -.02em; }
.stat-tile .change { font-size: 13px; font-weight: 700; color: var(--green); }
.stat-tile .change.neg { color: var(--red); }
.stat-tile .note { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.stat-tile.c1 { background: linear-gradient(165deg, color-mix(in srgb, var(--brand) 10%, white) 0%, #ffffff 75%); border-color: color-mix(in srgb, var(--brand) 22%, white); }
.stat-tile.c1::before { background: var(--brand); }
.stat-tile.c1 .stat-icon { background: var(--brand); color: #fff; }

.stat-tile.c2 { background: linear-gradient(165deg, var(--accent-light) 0%, #ffffff 75%); border-color: color-mix(in srgb, var(--accent) 40%, white); }
.stat-tile.c2::before { background: var(--accent); }
.stat-tile.c2 .stat-icon { background: var(--accent); color: var(--accent-text); }

.stat-tile.c3 { background: linear-gradient(165deg, color-mix(in srgb, var(--brand) 20%, white) 0%, #ffffff 75%); border-color: color-mix(in srgb, var(--brand) 38%, white); }
.stat-tile.c3::before { background: var(--brand-dark); }
.stat-tile.c3 .stat-icon { background: var(--brand-dark); color: #fff; }

.stat-tile.c4 { background: linear-gradient(165deg, color-mix(in srgb, var(--accent-dark) 30%, white) 0%, #ffffff 75%); border-color: color-mix(in srgb, var(--accent-dark) 45%, white); }
.stat-tile.c4::before { background: var(--accent-dark); }
.stat-tile.c4 .stat-icon { background: var(--accent-dark); color: var(--accent-text); }

.kpi-row { margin-bottom: 30px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; border-radius: var(--radius-sm); overflow: hidden; }
table.data-table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
}
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table tr:nth-child(even) td { background: color-mix(in srgb, var(--brand-light) 25%, white); }
table.data-table tr:hover td { background: var(--brand-light); }

/* ===== "Your Clients" — premium card grid ===== */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.client-card {
  position: relative;
  background: linear-gradient(165deg, #ffffff 0%, color-mix(in srgb, var(--brand-light) 40%, white) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.client-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.client-card:hover { border-color: var(--brand); transform: translateY(-3px); text-decoration: none; }
a.client-card, a.client-card:hover { color: inherit; }
.client-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.client-card-avatar {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.client-card-name { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.client-card-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 18px; word-break: break-word; }
.client-card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }

.client-list, .report-list { list-style: none; padding: 0; margin: 0; }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: #fff;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.item-row:hover { border-color: var(--brand); transform: translateY(-2px); }
.item-row .title { font-weight: 700; color: var(--text); }
.item-row .sub { font-size: 12.5px; color: var(--text-muted); }
.item-row .actions { display: flex; gap: 8px; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
.badge.draft { background: color-mix(in srgb, var(--border) 55%, white); color: var(--text-muted); }
.badge.final { background: color-mix(in srgb, var(--green) 18%, white); color: color-mix(in srgb, var(--green) 75%, black); }

form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
form .hint { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: -3px; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=email], input[type=tel], input[type=url], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s var(--ease);
}
input[type=text]:focus, input[type=number]:focus, input[type=email]:focus, input[type=tel]:focus, input[type=url]:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
textarea { resize: vertical; }
input[type=file] { font-size: 13px; }

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--brand);
  padding-bottom: 8px;
  margin: 30px 0 16px;
}
.section-title:first-child { margin-top: 0; }

.dyn-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.dyn-row > div { flex: 1; }
.dyn-row .remove-row { flex: 0 0 auto; margin-top: 26px; }

.thumb-preview { max-width: 220px; max-height: 130px; border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; display: block; object-fit: cover; }

.shot-remove-wrap { display: inline-block; }
.shot-remove-wrap .btn { margin-top: 6px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .icon {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  margin: 0 auto 14px;
}
.empty-state .icon svg { width: 30px; height: 30px; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.flash.success { background: color-mix(in srgb, var(--green) 15%, white); color: color-mix(in srgb, var(--green) 70%, black); border: 1px solid color-mix(in srgb, var(--green) 30%, white); }
.flash.error { background: #fdeeee; color: #b02a2a; border: 1px solid #f3c9c9; }

.two-col-actions { display: flex; gap: 10px; margin-top: 20px; }

section#offer {
    background: #fff;
}

/* ===== Report Form — premium touches (numbered sections, styled checkboxes, refined file/fetch buttons) ===== */
.report-form { counter-reset: rf-section; }
.report-form .card {
  position: relative;
  overflow: hidden;
}
.report-form .card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--brand);
}
.report-form .card .section-title {
  counter-increment: rf-section;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
}
.report-form .card .section-title::before {
  content: counter(rf-section);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Accordion: click a section title to expand/collapse everything below it in that card */
.report-form .card .section-title {
  cursor: pointer;
  user-select: none;
}
.report-form .card .section-title::after {
  content: '';
  width: 9px; height: 9px;
  border-right: 2px solid var(--brand-dark);
  border-bottom: 2px solid var(--brand-dark);
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform .2s var(--ease);
  flex-shrink: 0;
}
.report-form .card.collapsed .section-title { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.report-form .card.collapsed .section-title::after { transform: rotate(-45deg); }
.report-form .card.collapsed > *:not(.section-title) { display: none; }

.report-form label { color: var(--primary); }
.report-form .hint { line-height: 1.6; }

.report-form input[type=checkbox] {
  width: 17px; height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
  vertical-align: middle;
}

.report-form .toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.report-form .toggle-label:hover { border-color: var(--brand); background: var(--brand-light); }

.report-form input[type=file] { padding: 8px 0; }
.report-form input[type=file]::file-selector-button {
  padding: 9px 16px;
  margin-right: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.report-form input[type=file]::file-selector-button:hover { background: var(--brand); }

.report-form #fetchGoogleBtn {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border: 1px solid var(--brand-dark);
  font-weight: 700;
}
.report-form #fetchGoogleStatus { font-size: 12.5px; font-weight: 600; margin-left: 6px; }

.report-form table.data-table { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.report-form table.data-table input[type=text] { border: 1px solid transparent; background: transparent; padding: 6px 8px; }
.report-form table.data-table input[type=text]:focus { background: #fff; border-color: var(--brand); }

/* =========================================================================
   Dashboard v2 — activity chart, status panel, recent reports, client table
   ========================================================================= */
.dash-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 22px; margin-bottom: 22px; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { font-size: 14px; font-weight: 800; margin: 0; letter-spacing: -.01em; color: var(--primary-dark); text-transform: uppercase; letter-spacing: .04em; }
.panel-head .link { font-size: 12.5px; font-weight: 700; }

/* mini bar chart */
.barchart { display: flex; align-items: flex-end; gap: 12px; height: 168px; padding-top: 22px; }
.barchart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; min-width: 0; }
.barchart .bar {
  width: 100%; max-width: 48px; min-height: 4px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  position: relative;
  transition: filter .15s var(--ease);
}
.barchart .bar-col:hover .bar { filter: brightness(1.12); }
.barchart .bar-col:last-child .bar { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.barchart .bar-val { position: absolute; top: -19px; left: -6px; right: -6px; text-align: center; font-size: 11.5px; font-weight: 800; color: var(--text); }
.barchart .bar-lbl { font-size: 10.5px; color: var(--text-muted); font-weight: 700; text-align: center; white-space: nowrap; letter-spacing: .02em; }
.chart-empty { height: 168px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; }

/* status split */
.status-figure { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--primary-dark); }
.status-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.split-bar { height: 15px; border-radius: 8px; overflow: hidden; display: flex; background: var(--border); margin: 18px 0 14px; }
.split-bar > span { display: block; height: 100%; }
.split-bar .seg-final { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }
.split-bar .seg-draft { background: var(--accent); }
.split-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.split-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.split-legend .dot { width: 10px; height: 10px; border-radius: 3px; }
.split-legend .dot.final { background: var(--brand); }
.split-legend .dot.draft { background: var(--accent); }
.status-metric { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.status-metric b { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.status-metric span { font-size: 12.5px; color: var(--text-muted); }

/* top clients — horizontal bars */
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 12px; }
.hbar-row:hover { text-decoration: none; }
.hbar-row:hover .hbar-name { color: var(--brand-dark); }
.hbar-name { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; border-radius: 7px; background: var(--border); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--brand), var(--brand-dark)); }
.hbar-val { font-size: 13px; font-weight: 800; color: var(--primary-dark); text-align: right; }

/* create report page */
.new-report-card .section-title { margin-top: 0; }

/* recent reports */
.recent-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; background: #fff;
  transition: border-color .18s var(--ease), transform .15s var(--ease);
}
.recent-row:last-child { margin-bottom: 0; }
.recent-row:hover { border-color: var(--brand); transform: translateX(2px); }
.recent-row .rr-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.recent-row .rr-avatar {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.recent-row .rr-name { font-weight: 700; font-size: 13.5px; color: var(--text); }
.recent-row .rr-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.recent-row .rr-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ===== Client toolbar + table ===== */
.table-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box { position: relative; flex: 1 1 260px; max-width: 380px; }
.search-box input {
  padding-left: 40px;
  background: #fff;
}
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 15px; border-radius: 21px; border: 1px solid var(--border);
  background: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: var(--text-muted); font-family: inherit;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: var(--primary-dark); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.client-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.client-table thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 800; padding: 13px 16px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--brand-light) 30%, white); white-space: nowrap;
}
table.client-table th.sortable { cursor: pointer; user-select: none; }
table.client-table th.sortable:hover { color: var(--brand-dark); }
table.client-table th .sort-ind { opacity: .4; margin-left: 4px; font-size: 9px; }
table.client-table th.sorted .sort-ind { opacity: 1; color: var(--brand); }
table.client-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
table.client-table tbody tr:last-child td { border-bottom: none; }
table.client-table tbody tr { transition: background .12s var(--ease); }
table.client-table tbody tr:hover { background: var(--brand-light); }
.client-cell { display: flex; align-items: center; gap: 12px; }
.client-cell .avatar {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.client-cell .c-name { font-weight: 700; color: var(--text); }
.client-cell .c-web { font-size: 12px; color: var(--text-muted); }
.client-cell .c-web a { color: var(--text-muted); }
.count-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 20px;
  background: var(--brand-light); color: var(--brand-dark); font-weight: 800; font-size: 12px;
}
.count-pill.zero { background: color-mix(in srgb, var(--border) 40%, white); color: var(--text-muted); }
.mini-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.dim { color: var(--text-muted); }
.no-results { text-align: center; padding: 46px 20px; color: var(--text-muted); font-size: 14px; }

/* ===== Modal (quick new report) ===== */
.modal-overlay {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--primary-dark) 70%, transparent);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 460px;
  box-shadow: 0 40px 90px -25px rgba(0, 0, 0, .5);
  animation: modalPop .2s var(--ease);
}
@keyframes modalPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.modal p { margin: 0 0 4px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* =========================================================================
   Report Form — tabbed premium layout
   ========================================================================= */
.report-form.rf-tabbed { counter-reset: rf-section; }
.rf-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .rf-shell { grid-template-columns: 1fr; } }
.rf-panels { min-width: 0; }

.rf-tabnav {
  position: sticky; top: 20px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px;
}
@media (max-width: 1000px) { .rf-tabnav { position: static; } }
.rf-tablist { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 1000px) {
  .rf-tablist { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .rf-tab { flex: 0 0 auto; }
  .rf-tab .rf-tab-label { white-space: nowrap; }
}
.rf-tab {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background .15s var(--ease);
}
.rf-tab:hover { background: var(--bg); }
.rf-tab.active { background: var(--brand-light); }
.rf-tab-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.rf-tab.active .rf-tab-num { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border-color: var(--brand-dark); }
.rf-tab.done .rf-tab-num { background: var(--green); border-color: var(--green); color: #fff; }
.rf-tab.done .rf-tab-num::before { content: '\2713'; }
.rf-tab.done .rf-tab-num .num-txt { display: none; }
.rf-tab-label { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.rf-tab.active .rf-tab-label { color: var(--brand-dark); font-weight: 700; }

.rf-progress { padding: 14px 12px 8px; margin-top: 8px; border-top: 1px solid var(--border); }
.rf-progress-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rf-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .3s var(--ease); }
.rf-progress-text { font-size: 10.5px; color: var(--text-muted); font-weight: 700; margin-top: 7px; text-align: center; letter-spacing: .02em; }
.rf-autosave-status { font-size: 10.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; text-align: center; min-height: 13px; }
.rf-autosave-status.err { color: var(--red); font-weight: 700; }

.rf-panels > .card { display: none; }
.rf-panels > .card.active { display: block; animation: rfFade .25s var(--ease); }
@keyframes rfFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* neutralise the accordion chrome when tabbed (tab rail already carries step numbers) */
.report-form.rf-tabbed .card .section-title { cursor: default; }
.report-form.rf-tabbed .card .section-title::after { display: none; }
.report-form.rf-tabbed .card .section-title::before { display: none; }
/* wide data tables (Top Pages etc.) scroll inside their panel instead of blowing out the page */
.report-form.rf-tabbed .card { overflow-x: auto; }
.report-form.rf-tabbed .card > .grid,
.report-form.rf-tabbed .card > table.data-table { min-width: 0; }

.rf-actionbar {
  position: sticky; bottom: 14px; z-index: 20;
  background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-top: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .2);
}
.rf-actionbar-nav { display: flex; gap: 8px; align-items: center; }
.rf-actionbar-nav .btn { padding: 7px 14px; font-size: 12.5px; }
.rf-actionbar-nav .btn svg { width: 13px; height: 13px; }
.rf-save-hint { font-size: 12px; color: var(--text-muted); font-weight: 600; margin: 0 auto; }
.btn:disabled { opacity: .4; pointer-events: none; }
@media (max-width: 1320px) { .rf-save-hint { display: none; } }

/* toast — confirmation after a background "Preview" save */
.rf-toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(16px);
  background: var(--primary-dark); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 600; max-width: 90vw; text-align: center;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; z-index: 400;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.rf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rf-toast.err { background: var(--red); }
@media (max-width: 620px) {
  .rf-actionbar { flex-wrap: wrap; justify-content: center; }
  .rf-actionbar-nav { flex: 1; justify-content: space-between; }
}

/* =========================================================================
   Premium single-form pages (Add / Edit Client)
   ========================================================================= */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .form-layout { grid-template-columns: 1fr; } }

.form-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.form-card-head {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 26px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-light) 30%, white) 0%, #ffffff 100%);
}
.form-card-head .fh-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.form-card-head .fh-icon svg { width: 24px; height: 24px; }
.form-card-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: var(--primary-dark); }
.form-card-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
.form-card-body { padding: 24px 26px; }

.form-section + .form-section { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--border); }
.form-section-title {
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.form-section-title svg { width: 15px; height: 15px; }
.form-section-desc { font-size: 12.5px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.5; }

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label { margin: 0 0 6px; }
.field .hint { margin: 5px 0 0; }
.req { color: var(--red); font-weight: 700; margin-left: 2px; }

.input-icon { position: relative; }
.input-icon > svg {
  position: absolute; left: 13px; top: 12px; width: 16px; height: 16px;
  color: var(--text-muted); pointer-events: none;
}
.input-icon input { padding-left: 40px; }

.logo-field { display: flex; gap: 16px; align-items: center; }
.logo-preview {
  width: 74px; height: 74px; border-radius: 16px; flex-shrink: 0;
  border: 1px solid var(--border); background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview .ph { font-size: 24px; font-weight: 800; color: var(--brand-dark); }
.logo-field .logo-drop { flex: 1; min-width: 0; }
.form-card input[type=file] { font-size: 13px; }
.form-card input[type=file]::file-selector-button {
  padding: 9px 16px; margin-right: 12px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .15s var(--ease);
}
.form-card input[type=file]::file-selector-button:hover { background: var(--brand); }

.form-actions {
  display: flex; gap: 10px; padding: 18px 26px;
  border-top: 1px solid var(--border); background: color-mix(in srgb, var(--brand-light) 30%, white);
}

.form-aside .tip-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.form-aside .tip-card + .tip-card { margin-top: 16px; }
.form-aside .tip-card h3 {
  margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--primary-dark);
  display: flex; align-items: center; gap: 8px;
}
.form-aside .tip-card h3 svg { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
.form-aside .tip-card p { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.form-aside .tip-card p:last-child { margin-bottom: 0; }
.form-aside .tip-card ul { margin: 0; padding-left: 16px; }
.form-aside .tip-card li { font-size: 12.5px; color: var(--text-muted); line-height: 1.75; }
.form-aside .tip-card a { font-weight: 600; }
