/* ─────────────────────────────────────────────────────────────
   Restaurant Intelligence · soft light theme
   General Sans (distinctive grotesk) on a dewy gray backdrop with
   a single big rounded canvas card and lemon-yellow highlight.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:               #e8e8e6;
  --surface:          #ffffff;
  --surface-soft:     #f7f7f4;
  --ink:              #0f0f0f;
  --ink-soft:         #404042;
  --ink-muted:        #8a8a8e;
  --ink-faint:        #b8b8bb;
  --line:             #ececea;
  --line-strong:      #d8d8d4;
  --pill-border:      #e3e3df;
  --pill-bg:          #f4f4f0;

  --lemon:            #fde047;
  --lemon-soft:       #fef9c3;
  --lemon-edge:       #fbcb04;

  --accent-row:       #fef9c3;
  --good-bg:          #dcfce7;
  --good-fg:          #14803c;
  --warm-bg:          #fef3c7;
  --warm-fg:          #a16207;
  --cool-bg:          #dbeafe;
  --cool-fg:          #1e40af;
  --gray-bg:          #f1f1ef;
  --gray-fg:          #6b7280;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { background: var(--bg); color: var(--ink); margin: 0; padding: 0; }
body {
  font-family: "General Sans", system-ui, sans-serif;
  font-weight: 450;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ────────── outer canvas ────────── */
.shell {
  max-width: 1480px;
  margin: 32px auto;
  padding: 0 32px;
}

.canvas {
  background: var(--surface);
  border-radius: 28px;
  padding: 28px 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 24px 80px -32px rgba(0,0,0,0.10);
}
/* lemon glow in top-right */
.canvas::before {
  content: "";
  position: absolute;
  top: -240px; right: -200px;
  width: 720px; height: 480px;
  background: radial-gradient(closest-side, var(--lemon-soft) 0%, rgba(254,249,195,0) 70%);
  pointer-events: none;
  z-index: 0;
}
.canvas > * { position: relative; z-index: 1; }

/* ────────── top bar ────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* fixed centre column so nav never shifts */
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.topbar > :first-child  { justify-self: start; }
.topbar > .nav-pills    { justify-self: center; }
.topbar > .top-actions  { justify-self: end; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  background: var(--surface);
}
.brand-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.nav-pills {
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
}
.nav-pills a {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: all .15s;
  white-space: nowrap;
}
.nav-pills a:hover { color: var(--ink); }
.nav-pills a.active { background: var(--ink); color: var(--surface); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.avatar-btn {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--ink);
  color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* ────────── headline + KPI bars ────────── */
.headline-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.page-title {
  font-family: "General Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 22px;
}

.kpi-bars {
  display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start;
}
.kpi {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 140px;
}
.kpi .label {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
}
.kpi-track {
  display: flex; align-items: center; gap: 10px;
}
.kpi-bar {
  width: 180px; height: 22px;
  background: var(--gray-bg);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.kpi-bar .fill {
  height: 100%;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  min-width: 36px;
}
.kpi-bar .fill.black { background: var(--ink); color: var(--surface); }
.kpi-bar .fill.yellow { background: var(--lemon); color: var(--ink); }
.kpi-bar .fill.gray  { background: #d8d8d4; color: var(--ink); }

.headline-aside {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}
.aside-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.aside-pill:hover { background: var(--surface-soft); }
.aside-pill svg { color: var(--ink-muted); }

/* ────────── filter strip ────────── */
.filter-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 18px;                    /* extra right padding so the chevron has breathing room */
  background: var(--surface);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.filter-pill .chev { flex-shrink: 0; }
.filter-pill:hover { background: var(--surface-soft); }
.filter-pill.has-value { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.filter-pill.has-value svg { color: var(--surface); }
.filter-pill select,
.filter-pill input {
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  max-width: 120px;
}
.filter-pill select option { color: var(--ink); background: var(--surface); }
.filter-pill .chev { color: var(--ink-muted); }
.filter-pill.has-value .chev { color: var(--surface); }

.search-pill {
  flex: 1; min-width: 220px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--pill-bg);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: all .15s;
}
.search-pill:focus-within { background: var(--surface); border-color: var(--ink); }
.search-pill input {
  flex: 1; background: transparent; border: none; outline: none;
  font: inherit; color: var(--ink);
  padding: 0;
}
.search-pill input::placeholder { color: var(--ink-muted); }
.search-pill svg { color: var(--ink-muted); }

.strip-actions {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.action-btn {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  cursor: pointer;
}
.action-btn:hover { background: var(--surface-soft); color: var(--ink); }

.export-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}

.clear-btn {
  background: none; border: none; cursor: pointer;
  font: inherit; color: var(--ink-muted);
  font-size: 13px;
  padding: 0 8px;
}
.clear-btn:hover { color: var(--ink); }

/* ────────── table ────────── */
.results-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-muted);
}
.results-meta strong { color: var(--ink); font-weight: 600; }

.table-shell {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--line);
  overflow: hidden;
}

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl thead th.sortable { cursor: pointer; user-select: none; }
table.tbl thead th.sortable:hover { color: var(--ink); }
table.tbl thead th .arrow { color: var(--ink-faint); margin-left: 2px; }
table.tbl thead th.active { color: var(--ink); }
table.tbl thead th.active .arrow { color: var(--ink); }
table.tbl thead th .arrow { color: var(--ink-faint); }

table.tbl tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background .12s;
  cursor: pointer;
}
table.tbl tbody tr:last-child { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-soft); }
table.tbl tbody tr.selected { background: var(--accent-row); }
table.tbl tbody tr.selected:hover { background: var(--lemon-soft); }
table.tbl td { padding: 14px 18px; vertical-align: middle; }

.cb {
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  display: inline-block;
  cursor: pointer;
  background: var(--surface);
  position: relative;
  transition: all .12s;
  flex-shrink: 0;
}
tr.selected .cb {
  background: var(--ink); border-color: var(--ink);
}
tr.selected .cb::after {
  content: "";
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--surface);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.row-identity {
  display: flex; align-items: center; gap: 12px;
}
.row-avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.row-avatar.a0 { background: #fde68a; }
.row-avatar.a1 { background: #bbf7d0; }
.row-avatar.a2 { background: #bfdbfe; }
.row-avatar.a3 { background: #fbcfe8; }
.row-avatar.a4 { background: #ddd6fe; }
.row-avatar.a5 { background: #fed7aa; }
.row-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.row-name .name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 280px;
}
.row-name .meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
}

.country-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.country-tag .flag { font-size: 16px; }

.col-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.col-num .sub {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 12px;
  margin-left: 3px;
}

.score-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  background: var(--pill-bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.score-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
}
.score-pill.hot::before  { background: #16a34a; }
.score-pill.warm::before { background: #ca8a04; }
.score-pill.cold::before { background: #3b82f6; }
.score-pill.dq::before   { background: #9ca3af; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 999px; }
.status-pill.hot  { background: var(--good-bg); color: var(--good-fg); }
.status-pill.hot  .dot { background: var(--good-fg); }
.status-pill.warm { background: var(--warm-bg); color: var(--warm-fg); }
.status-pill.warm .dot { background: var(--warm-fg); }
.status-pill.cold { background: var(--cool-bg); color: var(--cool-fg); }
.status-pill.cold .dot { background: var(--cool-fg); }
.status-pill.dq   { background: var(--gray-bg); color: var(--gray-fg); }
.status-pill.dq   .dot { background: var(--gray-fg); }

.empty-row {
  padding: 80px 20px !important;
  text-align: center;
  color: var(--ink-muted);
}

/* ────────── pagination ────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px;
  padding: 0 6px;
}
.pagination button {
  padding: 9px 16px;
  border: 1px solid var(--pill-border);
  background: var(--surface);
  border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
}
.pagination button:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .info { font-size: 13px; color: var(--ink-muted); }
.pagination .info strong { color: var(--ink); font-weight: 600; }

/* ────────── drawer ────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.35);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  transition: opacity .25s;
  display: none;
}
.drawer-overlay.open { display: block; opacity: 1; }

.drawer {
  position: fixed; top: 16px; right: 16px; bottom: 16px;
  width: 100%; max-width: 700px;
  background: var(--surface);
  border-radius: 28px;
  z-index: 50;
  transform: translateX(calc(100% + 32px));
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 0 24px 80px -16px rgba(0,0,0,0.20);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  padding: 28px 32px 22px;
  background: linear-gradient(180deg, var(--lemon-soft) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-head-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.drawer-close {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--pill-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
}
.drawer-close:hover { background: var(--surface-soft); color: var(--ink); }
.drawer h2.title {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  margin: 0 0 6px; line-height: 1.15;
}
.drawer-meta {
  font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.drawer-meta .mono { font-family: ui-monospace, monospace; font-size: 12px; }
.drawer-meta .sep { color: var(--ink-faint); }
.drawer-meta a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 0; }

.drawer-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 18px 32px;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.drawer-stats > div { display: flex; flex-direction: column; gap: 4px; }
.drawer-stats .label {
  font-size: 11px; color: var(--ink-muted); font-weight: 500;
}
.drawer-stats .num {
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.drawer-stats .num.accent { color: var(--good-fg); }

.section {
  padding: 22px 32px 6px;
}
.section h3 {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink);
}
.section h3 .count {
  font-size: 11px; font-weight: 500;
  padding: 3px 10px;
  background: var(--pill-bg);
  border-radius: 999px;
  color: var(--ink-soft);
}

.contact-card {
  margin: 0 32px 10px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.contact-card .top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.contact-card .who { display: flex; align-items: center; gap: 10px; }
.contact-card .ava {
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.contact-card .name { font-weight: 500; color: var(--ink); }
.contact-card .role { font-size: 12px; color: var(--ink-muted); margin-bottom: 8px; }
.contact-card .channels {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px;
}
.contact-card .channels a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--ink-faint);
}
.contact-card .channels a:hover { border-bottom-color: var(--ink); }
.contact-card .channels .invalid {
  color: var(--ink-faint); text-decoration: line-through;
  font-style: italic;
}
.contact-card .channels .none { color: var(--ink-muted); font-style: italic; }
.dm-pill {
  display: inline-block;
  padding: 2px 8px;
  background: var(--good-bg); color: var(--good-fg);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  margin-left: 8px;
}
.conf { font-size: 11px; color: var(--ink-muted); }

.loc-card {
  margin: 0 32px 8px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.loc-card .where {
  font-size: 12px; color: var(--ink-muted);
}
.loc-card .stats { display: flex; gap: 12px; font-size: 12px; color: var(--ink-muted); }
.loc-card .stats .score { color: var(--ink); font-weight: 600; }

/* ────────── login ────────── */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.login-canvas {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 28px;
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}
.login-canvas::before {
  content: "";
  position: absolute;
  top: -180px; right: -160px;
  width: 480px; height: 320px;
  background: radial-gradient(closest-side, var(--lemon-soft) 0%, rgba(254,249,195,0) 70%);
  pointer-events: none;
}
.login-canvas > * { position: relative; }
.login-eyebrow {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 16px;
}
.login-title {
  font-size: 32px; font-weight: 600; letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.login-sub { color: var(--ink-muted); margin: 0 0 28px; }
.login-canvas label {
  font-size: 11px; font-weight: 500; color: var(--ink-muted);
  display: block; margin-bottom: 6px;
}
.login-canvas input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--pill-border);
  background: var(--surface);
  border-radius: 12px;
  font: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.login-canvas input:focus {
  outline: none; border-color: var(--ink); background: var(--surface-soft);
}
.login-canvas .field { margin-bottom: 14px; }
.login-canvas button[type="submit"] {
  margin-top: 12px;
  width: 100%;
  padding: 12px;
  background: var(--ink); color: var(--surface);
  border: none;
  border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.login-canvas button[type="submit"]:hover:not(:disabled) { background: #1f1f1f; }
.login-canvas button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.login-err { color: #b91c1c; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ────────── states ────────── */
.loading, .error-msg {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}
.error-msg { color: #b91c1c; }

/* ────────── animations ────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeUp .35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .10s; }
.delay-3 { animation-delay: .15s; }
