/* Handshake — Email Revenue Growth OS (handshake.elitebrands.ca)
   Phase 1 item 1.0 — platform skeleton.
   EB CRM design language: Inter body, Geist Mono display type (x.ai-style),
   burnt-orange #D35400, light theme, no emojis.
   Visual-first dashboard: hero, KPI cards, chart panels. */

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2"),
       url("/fonts/GeistMono-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Bold.woff2") format("woff2"),
       url("/fonts/GeistMono-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --orange: #D35400;
  --orange-dark: #A84300;
  --orange-soft: #FDF0E6;
  --ink: #1a1a1a;
  --muted: #5f6368;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f8f9fa;
  --green: #137333;
  --green-soft: #e6f4ea;
  --red: #b3261e;
  --red-soft: #fce8e6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --header-h: 61px;
  --font-display: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
a { color: var(--orange); }
a:hover { color: var(--orange-dark); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* ---------- Header / footer ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px); z-index: 30; min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-mark {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 9px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { font-weight: 800; font-size: 18px; line-height: 1.15; }
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .4px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink);
}
.lang-toggle:hover { border-color: var(--orange); color: var(--orange); }
.workspace-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.workspace-pill svg { color: var(--orange); }
.nav-toggle {
  background: none; border: 1px solid var(--line); border-radius: 10px;
  width: 38px; height: 38px; cursor: pointer; color: var(--ink);
  display: none; align-items: center; justify-content: center; padding: 0;
}
.nav-toggle:hover { border-color: var(--orange); color: var(--orange); }
.user-menu { position: relative; }
.user-menu-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--orange); color: #fff; font: inherit; font-weight: 700;
  font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.user-menu-btn:hover { background: var(--orange-dark); }
.user-menu-panel {
  position: absolute; right: 0; top: 44px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; width: 250px; z-index: 40;
}
.user-menu-email { font-size: 13px; color: var(--muted); margin: 0 0 12px; overflow-wrap: anywhere; }
.user-menu-email strong { color: var(--ink); font-size: 14px; }
.site-footer {
  margin-top: 64px; padding: 28px 16px 40px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 14px;
}
.site-footer p { margin: 6px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }

/* ---------- Layout ---------- */
#app { min-height: 60vh; }
.app-shell { display: flex; align-items: flex-start; }
.app-content { flex: 1; min-width: 0; }
.container { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.container-wide { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; letter-spacing: -0.01em; }
h1.section-title { margin-top: 28px; }
h2 { font-size: 20px; margin: 28px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
p { margin: 10px 0; }
.lede { color: var(--muted); font-size: 17px; }
.small { font-size: 14px; color: var(--muted); }
.center { text-align: center; }

/* ---------- Sidebar nav ---------- */
.sidebar {
  flex: 0 0 248px; width: 248px; position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  border-right: 1px solid var(--line); background: #fff; padding: 16px 12px;
}
.sidebar-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 0 12px; margin: 4px 0 8px; font-weight: 600;
}
.side-list { list-style: none; margin: 0; padding: 0; }
.side-link {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500;
}
.side-link:hover { background: var(--bg-soft); color: var(--ink); }
.side-link.active { background: var(--orange-soft); color: var(--orange-dark); font-weight: 600; }

/* ---------- Buttons / forms / notices ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 10px;
  padding: 12px 22px; font: inherit; font-weight: 600; font-size: 16px;
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.3;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--orange-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.notice { border-radius: 10px; padding: 14px 16px; margin: 16px 0; font-size: 15px; }
.notice-error { background: var(--red-soft); border: 1px solid #f0b4b0; color: var(--red); }
.notice-success { background: var(--green-soft); border: 1px solid #a8d5b5; color: var(--green); }
.notice p { margin: 4px 0; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-field input {
  width: 100%; padding: 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.form-field input:focus { border-color: var(--orange); outline: 2px solid rgba(211,84,0,.25); outline-offset: 0; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 56px auto; padding: 0 16px; }
.auth-card { padding: 28px 24px; }
.auth-brand { margin-bottom: 16px; }
.auth-brand .brand-mark { width: 44px; height: 44px; font-size: 23px; border-radius: 11px; }
.auth-logo { width: 220px; max-width: 75%; height: auto; display: block; }
.auth-card h1 { margin-top: 0; }
.auth-note { margin-top: 18px; }

/* ---------- Hero ---------- */
@keyframes hsHeroShift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}
.hs-hero {
  background: linear-gradient(135deg,#0b0b16 0%,#2e0a3a 25%,#7a2e05 50%,#0e4a5a 75%,#0b0b16 100%);
  background-size: 300% 300%;
  animation: hsHeroShift 8s ease-in-out infinite;
  border-radius: 16px; padding: 28px; margin-bottom: 8px; color: #fff;
}
.hs-kicker {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: #f5b041; margin-bottom: 10px; font-weight: 600;
}
.hs-hero h2 { margin: 0 0 10px; font-size: 28px; line-height: 1.2; color: #fff; }
.hs-hero p { margin: 0; font-size: 15px; line-height: 1.55; color: #ece7e0; max-width: 640px; }
.hero-logo { width: 170px; height: auto; display: block; margin-bottom: 14px; }

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid; gap: 14px; margin-top: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.kpi-card { padding: 18px 16px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 700; color: var(--orange); line-height: 1.2; margin: 4px 0 2px; }
.kpi-empty { font-size: 13px; color: var(--muted); }

/* ---------- Chart / visual panels ---------- */
.panel-grid {
  display: grid; gap: 14px; margin-top: 14px;
  grid-template-columns: repeat(2, 1fr);
}
.panel { padding: 20px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; }
.panel-note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.empty-chart { width: 100%; height: auto; display: block; margin: 8px 0 2px; }
.health-panel { max-width: 560px; }
.health-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; }
.health-dot { width: 12px; height: 12px; border-radius: 50%; background: #9aa0a6; flex: 0 0 auto; }
.health-dot.ok { background: var(--green); }
.health-dot.attention { background: #b26a00; }
.health-status { font-weight: 600; }

/* ---------- Empty states ---------- */
.empty-card { text-align: center; padding: 36px 20px; }
.empty-title { font-weight: 700; font-size: 17px; margin: 0 0 6px; }
.empty-note { color: var(--muted); margin: 0; }

/* ---------- Provider connections (Phase 1 item 1.2) ---------- */
/* Simple status visuals for Settings & Integrations (admin-only):
   a status pill (green / grey / amber) + plain-language note. No
   technical detail on these cards. */
.provider-grid {
  display: grid; gap: 14px; margin-top: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.provider-card { padding: 20px; display: flex; flex-direction: column; }
.provider-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.provider-head h3 { margin: 0; font-size: 17px; }
.provider-desc { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; }
.provider-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.provider-missing { margin-top: 6px; }
.provider-data-list {
  list-style: none; margin: 12px 0 0; padding: 12px 0 0;
  border-top: 1px solid var(--line); font-size: 14.5px;
}
.provider-data-list li { margin: 4px 0; }
.provider-actions { margin-top: auto; padding-top: 16px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 10px; white-space: nowrap;
}
.status-pill.status-ok { background: var(--green-soft); border-color: #a8d5b5; color: var(--green); }
.status-pill.status-attention { background: #fef3e2; border-color: #f0c98a; color: #7a4a00; }
.status-pill.status-idle { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; top: var(--header-h); bottom: 0; z-index: 25;
    transform: translateX(-105%); transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .brand-sub { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hs-hero { padding: 22px 20px; }
  .hs-hero h2 { font-size: 24px; }
  .workspace-pill { padding: 6px 10px; }
}

/* ---------- Display type: Geist Mono (x.ai-style); Inter stays the body font ---------- */
h1, h2, h3, .hs-hero h2, .kpi-value, .btn, .empty-title { font-family: var(--font-display); }

/* ---------- Audience import (Phase 1 item 1.3) ---------- */
.select-input {
  width: 100%; padding: 12px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.select-input:focus { border-color: var(--orange); outline: 2px solid rgba(211,84,0,.25); outline-offset: 0; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, 1fr); }
.form-field-wide { grid-column: 1 / -1; }
.wizard-card { margin-top: 20px; }
.wizard-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.map-grid { margin-top: 8px; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.data-table td { overflow-wrap: anywhere; }
.reason-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 15px; }
.reason-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.reason-list li:last-child { border-bottom: none; }
.report-grid { display: grid; gap: 14px; margin-top: 16px; grid-template-columns: repeat(4, 1fr); }
.report-stat { padding: 16px; }
.progress-bar { height: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 16px 0 8px; }
.progress-fill { height: 100%; background: var(--orange); width: 0; transition: width .2s; }
.job-card { margin-top: 14px; }
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job-counts { color: var(--muted); font-size: 14.5px; margin: 10px 0; }
.job-report { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
input[type="file"] { font: inherit; font-size: 15px; }
/* ---------- Verification & Hygiene (Phase 1 item 1.5) ---------- */
.verify-scope-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.verify-scope-option {
  display: block; font-weight: 500; font-size: 15px;
  margin: 6px 0; cursor: pointer;
}
.verify-scope-option input { accent-color: var(--orange); margin-right: 8px; }

/* ---------- Suppression center (Phase 1 item 1.6) ---------- */
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f0b4b0; }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.supp-filter-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.supp-filter-row .form-field { flex: 1 1 220px; margin-bottom: 0; }
.supp-filter-row .supp-search-btn { flex: 0 0 auto; }
.supp-filter-row .supp-search-btn .btn { margin-bottom: 1px; }

/* ---------- Domains & Deliverability (Phase 1 item 1.7) ---------- */
/* Simple status visuals on the main screen; the technical record
   detail lives only in the admin-only Settings section. */
.dom-health-hero { max-width: 560px; }
.dom-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mono { font-family: var(--font-display); font-size: 13px; overflow-wrap: anywhere; }
.dom-record-card { margin-top: 14px; }
.dom-record-card p { margin: 6px 0; }

@media (max-width: 900px) {
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}
