/* DocQR — main stylesheet */

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #0070f3;
  --blue-dk: #0051b3;
  --green:   #10b981;
  --red:     #ef4444;
  --amber:   #f59e0b;
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-200:#e5e7eb;
  --gray-300:#d1d5db;
  --gray-500:#6b7280;
  --gray-700:#374151;
  --gray-900:#111827;
  --font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Layout shell ───────────────────────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  background: var(--gray-900);
  color: #fff;
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-logo span { color: var(--blue); }
.sidebar nav { margin-top: 24px; }
.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar nav a.active {
  border-left: 3px solid var(--blue);
  padding-left: 17px;
}

/* ── Main content ───────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow: auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 {
  font-size: 20px;
  font-weight: 600;
}
.topbar .badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--gray-100);
  color: var(--gray-500);
}

.content {
  padding: 32px;
  max-width: 1200px;
}

/* ── KPI cards ──────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
}
.kpi .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.kpi .value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.kpi .sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.kpi.green .value { color: var(--green); }
.kpi.blue  .value { color: var(--blue);  }
.kpi.amber .value { color: var(--amber); }
.kpi.red   .value { color: var(--red);   }

/* ── Delivery funnel ────────────────────────────────────────────────────────── */
.funnel-row {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.funnel-step {
  flex: 1;
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid var(--gray-200);
}
.funnel-step:last-child { border-right: none; }
.funnel-step .step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.funnel-step .step-value {
  font-size: 22px;
  font-weight: 700;
}
.funnel-step .step-pct {
  font-size: 12px;
  color: var(--gray-500);
}

/* ── Revenue chart (CSS bar chart) ───────────────────────────────────────────── */
.chart-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}
.chart-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
}
.bar-chart .bar {
  flex: 1;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
  cursor: pointer;
}
.bar-chart .bar:hover { background: var(--blue-dk); }
.bar-chart .bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--gray-500);
  white-space: nowrap;
}

/* ── Orders table ────────────────────────────────────────────────────────────── */
.orders-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
}
.orders-card h3 { font-size: 16px; font-weight: 600; padding: 20px 24px 0; }
.orders-card h3 + p { padding: 0 24px 16px; font-size: 13px; color: var(--gray-500); }

table.orders {
  width: 100%;
  border-collapse: collapse;
}
table.orders th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  padding: 12px 24px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
table.orders td {
  padding: 14px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
table.orders tr:last-child td { border-bottom: none; }
table.orders tr:hover td { background: var(--gray-50); }

/* Status pills */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
}
.status.pending  { background: var(--gray-100); color: var(--gray-700); }
.status.paid     { background: #dcfce7; color: #15803d; }
.status.failed   { background: #fee2e2; color: #991b1b; }
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* Delivery pills */
.delivery {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
}
.delivery.pending { background: var(--gray-100); color: var(--gray-700); }
.delivery.sent    { background: #dbeafe; color: #1d4ed8; }
.delivery.opened  { background: #dcfce7; color: #15803d; }
.delivery.clicked { background: #f0fdf4; color: #166534; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dk); }
.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); }

/* ── Forms (checkout) ─────────────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  margin: 48px auto;
}
.form-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.form-card p  { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.form-group   { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--gray-700); }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 15px; outline: none; }
.form-group input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,112,243,.15); }
.form-group .hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.price-display { font-size: 32px; font-weight: 700; color: var(--gray-900); }
.price-display span { font-size: 16px; font-weight: 400; color: var(--gray-500); }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 16px 0; font-size: 14px; color: var(--gray-700); }

/* ── Patient QR page ──────────────────────────────────────────────────────────── */
.patient-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 24px;
}
.patient-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  text-align: center;
}
.patient-logo { font-size: 28px; font-weight: 800; margin-bottom: 24px; color: var(--gray-900); }
.patient-logo span { color: var(--blue); }
.patient-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.patient-card .subtitle { color: var(--gray-500); font-size: 14px; margin-bottom: 28px; }
.patient-card form { text-align: left; }
.patient-card .form-group { margin-bottom: 14px; }
.patient-card .form-group label { font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 5px; display: block; }
.patient-card .form-group input { width: 100%; padding: 11px 14px; border: 1px solid var(--gray-300); border-radius: 8px; font-size: 15px; }
.patient-card .form-group input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,112,243,.12); }

/* ── Confirmed page ───────────────────────────────────────────────────────────── */
.confirm-icon { font-size: 64px; margin-bottom: 16px; }

/* ── Landing page ────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  text-align: center;
  padding: 40px 24px;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  margin-bottom: 20px;
  color: rgba(255,255,255,.7);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span { color: #60a5fa; }
.hero p {
  font-size: 18px;
  color: rgba(255,255,255,.65);
  max-width: 520px;
  margin: 0 auto 32px;
}
.hero .cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #3b82f6;
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.hero .cta:hover { background: #2563eb; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 40px auto 0;
  width: 100%;
}
.feature {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
}
.feature h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p  { font-size: 14px; color: rgba(255,255,255,.55); line-height: 1.5; }

/* ── Utilities ────────────────────────────────────────────────────────────────── */
.mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none; }