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

/* Dashboard palette is intentionally restricted to white / black / brand blue (#0066b3) / brand gold (#feb911) —
   every other value below is a tint, shade, or neutral gray derived from those four. */
:root {
  --primary: #0d0d0d;
  --primary-dark: #000000;
  --sidebar-from: #000000;
  --sidebar-via: #0a0a0a;
  --sidebar-to: #111111;
  --brand: #0066b3;
  --brand-dark: #004d87;
  --brand-light: #e6f2fa;
  --accent: #feb911;
  --accent-dark: #d99c00;
  --accent-light: #fff3d9;
  --accent-text: #1a1408;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --text: #0d0d0d;
  --text-muted: #6b7280;
  --border: #e8e9ec;
  --green: #17a06a;
  --red: #d6455a;
  --sidebar-w: 258px;
  --radius: 16px;
  --radius-sm: 10px;
  --border-hover: #b9c2cc;
  --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: var(--bg);
  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%, rgba(0, 102, 179, .35) 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%, #fbfdff 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: #0d0d0d; 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, #eaf4fb 0%, #ffffff 75%); border-color: #cfe6f7; }
.stat-tile.c1::before { background: var(--brand); }
.stat-tile.c1 .stat-icon { background: var(--brand); color: #fff; }

.stat-tile.c2 { background: linear-gradient(165deg, #fff6e0 0%, #ffffff 75%); border-color: #fbe4ad; }
.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, #dcedfa 0%, #ffffff 75%); border-color: #b9daf2; }
.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, #ffe9b3 0%, #ffffff 75%); border-color: #f3cf72; }
.stat-tile.c4::before { background: var(--accent-dark); }
.stat-tile.c4 .stat-icon { background: var(--accent-dark); color: #fff; }

.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: #f8fafc; }
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%, #fbfdff 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); }
.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: #eef2f7; color: var(--text-muted); }
.badge.final { background: #dff5e8; color: #128a52; }

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: #e4f7ea; color: #1a7a3f; border: 1px solid #bfe8cd; }
.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); }
