/* =============================================================
   040 Parts Lead-Erfassungstool — Shop-CI (White/Black/Orange-Red)
   Glas-Akzente + große Touch-Targets für Outdoor/Sonnenlicht-Nutzung.
   ============================================================= */

:root {
  /* Shop palette */
  --bg-canvas: #FFFFFF;
  --bg-canvas-2: #F4F4F2;
  --bg-cream: #FFFFFF;
  --bg-soft: #F7F6F2;
  --ink: #0A0A0A;
  --ink-2: #1A1A1A;
  --ink-soft: #383838;
  --ink-mute: #6E6E6E;
  --ink-faint: #B0B0B0;
  --line: rgba(10, 10, 10, 0.10);
  --line-strong: rgba(10, 10, 10, 0.18);

  --accent: #FF6B35;
  --accent-2: #E04A1A;
  --accent-soft: rgba(255, 107, 53, 0.10);
  --accent-ring: rgba(255, 107, 53, 0.32);

  --success: #2E7D32;
  --warn: #C8884B;
  --danger: #C41E3A;
  --info: #205C8C;

  /* Glass — used selectively over photo or color blocks */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.80);
  --glass-shadow: 0 8px 28px -10px rgba(10, 10, 10, 0.18), 0 1px 2px rgba(10, 10, 10, 0.04);
  --glass-shadow-lg: 0 24px 60px -20px rgba(10, 10, 10, 0.22), 0 4px 12px -3px rgba(10, 10, 10, 0.06);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.18, .89, .32, 1.28);

  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05);
  --shadow-md: 0 4px 14px rgba(10, 10, 10, 0.08);
  --shadow-lg: 0 14px 40px rgba(10, 10, 10, 0.12);

  --font-sans: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body, html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  min-height: 100vh;
  font-size: 17px;  /* Outdoor readability bump */
  line-height: 1.55;
  position: relative;
}

/* Ambient — subtle shop-style with a gentle accent wash */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 88% 10%, rgba(255, 107, 53, 0.10) 0%, transparent 60%),
    radial-gradient(50% 50% at 12% 92%, rgba(10, 10, 10, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F6F2 100%);
}

.bg-grain { display: none; }  /* Removed for cleaner shop-style look */

/* =============== Type =============== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-weight: 800;
}
h1 { font-size: clamp(34px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }

p { margin: 0 0 12px; color: var(--ink-soft); }
small, .small { font-size: 14px; color: var(--ink-mute); }
.muted { color: var(--ink-mute); }
.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }

a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =============== Layout =============== */

.container { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1320px; }

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.2) blur(18px);
  -webkit-backdrop-filter: saturate(1.2) blur(18px);
  border-bottom: 1px solid var(--line);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo +50%: now 54px header, 72px hero — strong shop presence */
.brand img { height: 54px; width: auto; display: block; }

.brand .badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-2);
  padding: 6px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
}

.header-actions { display: flex; gap: 12px; align-items: center; }

.app-main { flex: 1; padding: 24px 0 80px; }

.app-footer {
  padding: 28px 0 40px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}

/* =============== Card / Glass =============== */

.card, .glass {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  position: relative;
}

.glass-overlay {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  backdrop-filter: saturate(1.2) blur(20px);
  -webkit-backdrop-filter: saturate(1.2) blur(20px);
  box-shadow: var(--glass-shadow);
}

.card-pad { padding: 36px; }
@media (max-width: 640px) { .card-pad { padding: 24px 22px; } }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.card-header h2 { margin: 0 0 4px; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-2);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 107, 53, 0.22);
}

/* =============== Hero =============== */

.hero {
  display: grid;
  gap: 14px;
  text-align: center;
  padding: 18px 0 36px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 107, 53, 0.20);
  border-radius: var(--r-pill);
}
.hero h1 { max-width: 760px; margin: 0 auto; color: var(--ink); }
.hero p { max-width: 620px; margin: 8px auto 0; color: var(--ink-soft); font-size: 18px; line-height: 1.6; }

/* =============== Step indicator =============== */

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: rgba(10, 10, 10, 0.06);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mute);
  transition: all .2s var(--ease-out);
}
.step-dot .num {
  display: grid;
  place-content: center;
  width: 24px; height: 24px;
  background: rgba(10, 10, 10, 0.10);
  color: var(--ink-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}
.step-dot.is-active {
  background: var(--ink);
  color: #fff;
}
.step-dot.is-active .num { background: var(--accent); color: #fff; }
.step-dot.is-done .num::before {
  content: '✓'; color: var(--success); font-weight: 900;
}
.step-dot.is-done .num { background: rgba(46, 125, 50, 0.15); color: transparent; }
.step-dot .divider { width: 32px; height: 2px; background: var(--line-strong); }

/* =============== Form =============== */

.form-grid { display: grid; gap: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; gap: 18px; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.field label .req { color: var(--accent-2); margin-left: 3px; font-weight: 800; }
.field .hint { font-size: 13px; color: var(--ink-mute); }

.input, .select, .textarea {
  font-family: inherit;
  font-size: 18px;       /* Outdoor-friendly */
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 16px 18px;
  width: 100%;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
  -webkit-appearance: none;
  min-height: 56px;       /* Touch-target */
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }

.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-mute); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
  background: #fff;
}

.input.error, .select.error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.15); }
.field-error { font-size: 13px; color: var(--danger); margin-top: 2px; display: none; font-weight: 500; }
.field.has-error .field-error { display: block; }

.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }

.select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 22px) 54%, calc(100% - 17px) 54%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 44px;
}

.input-group {
  position: relative;
}
.input-group .prefix {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  font-size: 18px;
  pointer-events: none;
}
.input-group input { padding-left: 50px; }

/* Checkbox / radio */
.check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: all .15s var(--ease-out);
}
.check:hover { border-color: var(--ink-mute); }
.check input[type="checkbox"] {
  appearance: none;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink-faint);
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  margin-top: 1px;
  transition: all .15s var(--ease-out);
}
.check input[type="checkbox"]:hover { border-color: var(--accent); }
.check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
  content: '✓';
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.check input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.check .check-body { flex: 1; font-size: 16px; color: var(--ink); line-height: 1.5; }
.check .check-body strong { color: var(--ink); }
.check.is-checked { border-color: var(--accent); background: var(--accent-soft); }

/* =============== Buttons =============== */

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 28px;
  border-radius: var(--r-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s var(--ease-spring), box-shadow .15s var(--ease-out), background .15s, border-color .15s;
  white-space: nowrap;
  min-height: 56px;        /* Touch-target */
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.btn:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(10, 10, 10, 0.30);
}
.btn-primary:hover { background: #000; box-shadow: 0 10px 26px -6px rgba(10, 10, 10, 0.40); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -4px rgba(255, 107, 53, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-accent:hover { background: var(--accent-2); box-shadow: 0 10px 28px -6px rgba(255, 107, 53, 0.55); transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-color: var(--line-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: #fff; border-color: var(--ink-mute); }

.btn-secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: #ECEAE3; }

.btn-danger {
  background: rgba(196, 30, 58, 0.08);
  color: var(--danger);
  border-color: rgba(196, 30, 58, 0.30);
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { font-size: 14px; padding: 10px 18px; min-height: 40px; }
.btn-icon { padding: 8px; min-height: 44px; width: 44px; }
.btn-xl { font-size: 19px; padding: 20px 36px; min-height: 64px; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* =============== Tabs (admin) =============== */

.tabs {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 2px;
}
.tab {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .15s var(--ease-out);
  min-height: 44px;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.15);
}

/* =============== Pills / badges =============== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-pill);
  background: rgba(10, 10, 10, 0.06);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pill-accent { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(255, 107, 53, 0.22); }
.pill-success { background: rgba(46, 125, 50, 0.12); color: var(--success); border-color: rgba(46, 125, 50, 0.25); }
.pill-warn { background: rgba(200, 136, 75, 0.14); color: #8b5a25; border-color: rgba(200, 136, 75, 0.25); }
.pill-danger { background: rgba(196, 30, 58, 0.10); color: var(--danger); border-color: rgba(196, 30, 58, 0.22); }
.pill-info { background: rgba(32, 92, 140, 0.12); color: var(--info); border-color: rgba(32, 92, 140, 0.22); }

/* =============== Product Search + Tags =============== */

.product-picker { position: relative; }
.product-picker .results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 30;
  display: none;
}
.product-picker.open .results { display: block; }
.product-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
  min-height: 64px;
}
.product-row:last-child { border-bottom: none; }
.product-row:hover, .product-row.focused { background: var(--accent-soft); }
.product-row img {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: var(--bg-canvas-2);
  object-fit: cover;
  flex: 0 0 auto;
}
.product-row .meta { flex: 1; min-width: 0; }
.product-row .title { font-weight: 700; color: var(--ink); font-size: 15px; line-height: 1.3; }
.product-row .sub { font-size: 13px; color: var(--ink-mute); }
.product-row .price { font-weight: 700; color: var(--accent-2); font-size: 15px; flex: 0 0 auto; }

.tag-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--ink);
  max-width: 100%;
}
.tag .tag-img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.tag .tag-close {
  width: 28px; height: 28px;
  border: none;
  background: rgba(10, 10, 10, 0.08);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-content: center;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
}
.tag .tag-close:hover { background: var(--danger); color: #fff; }

/* =============== Toast =============== */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  pointer-events: auto;
  background: var(--glass-bg-strong);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  animation: toast-in .3s var(--ease-spring);
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--info); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* =============== Status indicators =============== */

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--ink-faint);
  flex: 0 0 auto;
}
.status-dot.is-online { background: var(--success); box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.18); animation: pulse 2s ease-in-out infinite; }
.status-dot.is-offline { background: var(--warn); }
.status-dot.is-error { background: var(--danger); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(46, 125, 50, 0); }
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  backdrop-filter: blur(8px);
}

/* Language Flag Buttons */
.lang-flags {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
}
.lang-flag {
  font-size: 22px;
  line-height: 1;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  transition: all .15s var(--ease-out);
  filter: grayscale(0.55) opacity(0.65);
  -webkit-tap-highlight-color: transparent;
}
.lang-flag:hover {
  filter: grayscale(0) opacity(1);
  transform: scale(1.06);
}
.lang-flag.is-active {
  background: var(--ink);
  filter: grayscale(0) opacity(1);
  box-shadow: 0 2px 8px rgba(10,10,10,0.25);
}
.lang-flag:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* =============== Spinner =============== */

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============== Success / Thank-You =============== */

.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 20px;
}
.success-screen .logo-anim {
  width: 100%;
  max-width: 420px;
  border-radius: var(--r-lg);
}
.success-screen h2 { font-size: clamp(28px, 4.4vw, 40px); }
.success-screen p { font-size: 18px; max-width: 520px; }

/* =============== Admin =============== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  padding: 22px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-mute);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.kpi-delta { font-size: 13px; margin-top: 4px; color: var(--ink-mute); }
.kpi-delta.up { color: var(--success); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.toolbar .search {
  flex: 1; min-width: 240px;
  background: var(--bg-soft);
}

.leads-table-wrap {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.leads-table thead th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  font-size: 10px;
  vertical-align: middle;
}
.leads-table thead th.sorted .sort-arrow { opacity: 1; color: var(--accent-2); }

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.leads-table thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-mute);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 2;
  cursor: pointer;
  user-select: none;
}
.leads-table thead th:hover { color: var(--ink); }
.leads-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
.leads-table tbody tr { transition: background .12s; cursor: pointer; }
.leads-table tbody tr:hover { background: var(--accent-soft); }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-mute);
}
.empty-state h3 { color: var(--ink-soft); margin-bottom: 6px; }

/* =============== Drawer =============== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  animation: fade-in .2s ease;
}
.drawer-backdrop.open { display: block; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: 720px;
  background: #FFFFFF;
  border-left: 1px solid var(--line);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .3s var(--ease-out);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 2;
}
.drawer-body { padding: 26px 28px 100px; }
.drawer-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  position: sticky;
  bottom: 0;
}

@media (max-width: 720px) {
  .drawer { max-width: 100%; }
}

/* =============== Helpers =============== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.shrink-0 { flex-shrink: 0; }
.grow { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .bg-ambient { display: none; }
  .card, .glass { box-shadow: none; border-color: #ddd; }
}

/* =============== Mobile responsive overrides =============== */
@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .app-header { padding: 12px 0; }
  .app-header-inner { gap: 8px; flex-wrap: wrap; }
  .brand { gap: 8px; }
  .brand img { height: 36px; }
  .brand .badge { display: none; }  /* save space on phone */
  .header-actions { gap: 6px; flex-shrink: 0; }
  .header-actions .connection-pill { display: none; }
  .header-actions .btn-sm, .header-actions .select { font-size: 12px; padding: 6px 10px; min-height: 34px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .card-pad, .glass-strong { padding: 16px 14px; }
  .input, .select, .textarea { font-size: 16px; padding: 14px 14px; min-height: 50px; }
  .check { padding: 14px; }
  .btn-xl { font-size: 16px; padding: 14px 22px; min-height: 52px; }
  .steps { gap: 4px; }
  .step-dot { padding: 6px 10px; font-size: 12px; }
  .step-dot .num { width: 20px; height: 20px; }
  .step-dot .divider { width: 12px; }
  /* Force any form-row to stack on mobile */
  .form-row { grid-template-columns: 1fr !important; gap: 14px; }
  /* Admin table needs horizontal scroll */
  .leads-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .leads-table { min-width: 760px; }
  .toolbar { padding: 10px; }
  .toolbar .search { min-width: 100%; }
}
