/* ============================================================
   FAIRSHIFT EXPO CAPTURE — LIQUID GLASS THEME
   Full-screen Spline hero + action cards + flow dialog
   ============================================================ */

:root {
  --bg: #020817;
  --bg-2: #080f1e;
  --surface: rgba(6, 12, 28, 0.72);
  --surface-light: rgba(255,255,255,0.07);
  --border: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(0, 212, 255, 0.55);
  --cyan: #00d4ff;
  --cyan-dim: rgba(0, 212, 255, 0.7);
  --cyan-glow: rgba(0, 212, 255, 0.18);
  --cyan-glow-strong: rgba(0, 212, 255, 0.35);
  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.2);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.18);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #22d3a0;
  --success-bg: rgba(34, 211, 160, 0.12);
  --warning: #ffaa00;
  --warning-bg: rgba(255, 170, 0, 0.12);
  --error: #ff4466;
  --error-bg: rgba(255, 68, 102, 0.12);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   MAIN SCREEN — Full-screen Spline hero
   ============================================================ */

#main-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, #0a2a4a 0%, #020817 60%);
  transition: filter 0.35s ease;
}

#main-screen.dialog-open {
  filter: blur(4px) brightness(1.3);
}

spline-viewer.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  --spline-viewer-background: transparent;
}

spline-viewer.hero-bg::part(watermark),
spline-viewer.hero-bg::part(logo) {
  display: none !important;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(2, 8, 23, 0.5) 0%,
    rgba(2, 8, 23, 0.1) 35%,
    rgba(2, 8, 23, 0.65) 100%
  );
}

/* ============================================================
   TOP BAR
   ============================================================ */

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 52px 20px 16px;
  z-index: 20;
}

.app-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  text-shadow: 0 0 24px rgba(0,212,255,0.5);
}

.app-wordmark span { color: var(--cyan); }

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.network-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 12, 28, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.network-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
}

.network-dot.offline {
  background: var(--error);
  box-shadow: 0 0 6px var(--error);
}

/* Burger button */
.burger-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}

.burger-btn:active { transform: scale(0.9); }
.burger-btn svg { width: 20px; height: 20px; }

/* ============================================================
   HOME ACTION ICONS — bottom dock
   ============================================================ */

.home-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 36px;
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  pointer-events: none; /* let children be clickable, not the container */
}

@keyframes icon-appear {
  from { opacity: 0; transform: translateY(24px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.action-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  animation: icon-appear 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
  pointer-events: auto;
}

.action-icon-btn:nth-child(1) { animation-delay: 0.10s; }
.action-icon-btn:nth-child(2) { animation-delay: 0.22s; }
.action-icon-btn:nth-child(3) { animation-delay: 0.34s; }

.action-icon-btn:active .action-icon-circle {
  transform: scale(0.88);
}

.action-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s ease;
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.action-icon-circle svg { width: 28px; height: 28px; }

.voice-color {
  background: rgba(0,212,255,0.15);
  color: var(--cyan);
  box-shadow: 0 0 28px rgba(0,212,255,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.scan-color {
  background: rgba(139,92,246,0.15);
  color: var(--violet);
  box-shadow: 0 0 28px rgba(139,92,246,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.manual-color {
  background: rgba(245,158,11,0.15);
  color: var(--amber);
  box-shadow: 0 0 28px rgba(245,158,11,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
}

.action-icon-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ============================================================
   BURGER DRAWER
   ============================================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 1999;
  pointer-events: none;
  transition: background 0.3s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.drawer-overlay.open {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.burger-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: rgba(6, 10, 22, 0.92);
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  border-left: 1px solid rgba(255,255,255,0.1);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.burger-drawer.open { transform: translateX(0); }

.drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 22px 12px;
}

.drawer-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.drawer-logo span { color: var(--cyan); }

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.drawer-close-btn:active { transform: scale(0.9); }
.drawer-close-btn svg { width: 16px; height: 16px; }

/* Exhibitor identity chip (locked) */
.drawer-exhibitor {
  margin: 4px 22px 0;
  padding: 14px 16px;
  background: rgba(0,212,255,0.07);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-exhibitor-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.drawer-exhibitor-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.drawer-exhibitor-code {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 500;
}

.drawer-stats-row {
  display: flex;
  gap: 10px;
  padding: 16px 22px;
}

.drawer-stat {
  flex: 1;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.drawer-stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  text-shadow: 0 0 20px var(--cyan-glow-strong);
}

.drawer-stat-num.warning {
  color: var(--warning);
  text-shadow: 0 0 20px rgba(255,170,0,0.3);
}

.drawer-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  width: 100%;
  transition: background 0.15s;
  position: relative;
}

.drawer-item:active { background: var(--surface-light); }
.drawer-item svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }

.drawer-item-danger { color: var(--error); }
.drawer-item-danger svg { color: var(--error); }

.drawer-badge {
  margin-left: auto;
  background: var(--warning);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ============================================================
   DIALOG OVERLAY + SHEETS
   ============================================================ */

#dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 900;
  pointer-events: none;
  transition: background 0.35s ease;
}

#dialog-overlay.active {
  background: rgba(0,0,0,0.45);
  pointer-events: auto;
}

.dialog {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(72px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(72px) saturate(200%) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  box-shadow:
    0 -8px 50px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.dialog.active { transform: translateY(0); }

.dialog.dialog-fullscreen {
  max-height: 100vh;
  border-radius: 0;
  border: none;
  background: rgba(6, 10, 22, 0.78);
  backdrop-filter: blur(60px) saturate(180%);
  -webkit-backdrop-filter: blur(60px) saturate(180%);
}

.dialog-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 14px auto 0;
  flex-shrink: 0;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.dialog-close {
  width: 36px;
  height: 36px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.dialog-close:active { transform: scale(0.88); background: var(--error-bg); }
.dialog-close svg { width: 16px; height: 16px; }

.dialog-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   FLOW DIALOG — Special overrides
   ============================================================ */

.dialog-flow { max-height: 92vh; }

.flow-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.flow-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.flow-back-btn:active { transform: scale(0.9); }
.flow-back-btn svg { width: 18px; height: 18px; }

.flow-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* Step indicator */
.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px 4px;
  gap: 0;
  flex-shrink: 0;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.flow-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.3s ease;
}

.flow-step.active .flow-step-dot {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow-strong);
}

.flow-step.done .flow-step-dot {
  background: var(--success);
  border-color: var(--success);
}

.flow-step-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

.flow-step.active .flow-step-label { color: var(--cyan); font-weight: 700; }
.flow-step.done .flow-step-label { color: var(--success); }

.flow-step-line {
  width: 44px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 6px;
  margin-bottom: 20px;
  transition: background 0.3s;
  flex-shrink: 0;
}

.flow-step-line.done { background: rgba(34, 211, 160, 0.5); }

/* Panels */
.flow-panel {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.flow-panel .dialog-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Footer nav */
.flow-footer {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* ============================================================
   LOGIN DIALOG
   ============================================================ */

.login-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  gap: 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Push content up when keyboard opens on iOS */
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.login-logo {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.logo-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--cyan), #0080ff);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 50px rgba(0,212,255,0.35), 0 8px 32px rgba(0,0,0,0.4);
}

.logo-circle svg { width: 40px; height: 40px; color: #000; }

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -8px;
}

.login-fields {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-label .req { color: var(--error); margin-left: 3px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 52px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-textarea {
  min-height: 90px;
  padding: 14px 16px;
  resize: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-input.error { border-color: var(--error); }

.form-error {
  font-size: 12px;
  color: var(--error);
  display: none;
}

.form-error.visible { display: block; }

.form-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  width: 100%;
}

.btn:active { transform: scale(0.96); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 4px 24px var(--cyan-glow-strong);
}

.btn-primary:active { background: #00b8d9; }

.btn-secondary {
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(255,68,102,0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

/* ============================================================
   VOICE RECORDER
   ============================================================ */

.voice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 20px;
  gap: 20px;
}

.voice-status { text-align: center; }

.voice-status h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.voice-status p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.voice-timer {
  font-size: 52px;
  font-weight: 800;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  text-shadow: 0 0 30px var(--cyan-glow-strong);
}

.waveform {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
}

.waveform-bar {
  width: 3px;
  background: var(--cyan);
  border-radius: 2px;
  height: 6px;
  opacity: 0.35;
  transition: height 0.1s ease;
}

.waveform.recording .waveform-bar {
  opacity: 1;
  animation: wave 0.8s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 34px; }
}

.waveform.recording .waveform-bar:nth-child(1)  { animation-delay: 0.00s; }
.waveform.recording .waveform-bar:nth-child(2)  { animation-delay: 0.10s; }
.waveform.recording .waveform-bar:nth-child(3)  { animation-delay: 0.20s; }
.waveform.recording .waveform-bar:nth-child(4)  { animation-delay: 0.30s; }
.waveform.recording .waveform-bar:nth-child(5)  { animation-delay: 0.10s; }
.waveform.recording .waveform-bar:nth-child(6)  { animation-delay: 0.25s; }
.waveform.recording .waveform-bar:nth-child(7)  { animation-delay: 0.05s; }
.waveform.recording .waveform-bar:nth-child(8)  { animation-delay: 0.15s; }
.waveform.recording .waveform-bar:nth-child(9)  { animation-delay: 0.22s; }
.waveform.recording .waveform-bar:nth-child(10) { animation-delay: 0.08s; }
.waveform.recording .waveform-bar:nth-child(11) { animation-delay: 0.18s; }
.waveform.recording .waveform-bar:nth-child(12) { animation-delay: 0.28s; }

.mic-btn {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--cyan), #0080ff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 40px var(--cyan-glow-strong), 0 8px 28px rgba(0,0,0,0.4);
  position: relative;
  flex-shrink: 0;
}

.mic-btn svg { width: 38px; height: 38px; color: #000; position: relative; z-index: 1; }
.mic-btn:active { transform: scale(0.9); }

.mic-btn.recording {
  background: linear-gradient(135deg, #ff4466, #cc0033);
  box-shadow: 0 0 40px rgba(255,68,102,0.4), 0 8px 28px rgba(0,0,0,0.4);
}

.mic-btn.recording::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(255,68,102,0.4);
  animation: pulse-ring 1.5s ease-out infinite;
}

.mic-btn.recording::after {
  content: '';
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  border: 2px solid rgba(255,68,102,0.2);
  animation: pulse-ring 1.5s ease-out infinite 0.5s;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

.playback-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: none;
  flex-direction: column;
  gap: 10px;
}

.playback-card.visible { display: flex; }

.playback-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.playback-size-chip {
  background: var(--surface-light);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.playback-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cyan-glow);
  border: 1px solid var(--border-focus);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.play-btn:active { transform: scale(0.9); }
.play-btn svg { width: 18px; height: 18px; }

.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

/* ============================================================
   CAMERA / OCR
   ============================================================ */

.camera-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 16/9;
  width: 100%;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 80%;
  border: 2px solid rgba(0,212,255,0.7);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
  pointer-events: none;
}

.camera-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-top: 10px;
}

.capture-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--cyan);
  border: 4px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 30px var(--cyan-glow-strong);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capture-btn:active { transform: scale(0.9); }
.capture-btn svg { width: 28px; height: 28px; color: #000; }

.ocr-preview-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 180px;
  object-fit: contain;
}

.ocr-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ocr-progress-text { font-size: 14px; color: var(--text-muted); }

.ocr-bar {
  width: 100%;
  height: 4px;
  background: var(--surface-light);
  border-radius: 2px;
  overflow: hidden;
}

.ocr-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #0080ff);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ============================================================
   LEAD CARDS
   ============================================================ */

.lead-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.lead-card:active { transform: scale(0.99); }
.lead-card.pending  { border-left-color: var(--warning); }
.lead-card.synced   { border-left-color: var(--success); }
.lead-card.failed   { border-left-color: var(--error); }

.lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lead-name { font-size: 16px; font-weight: 700; color: var(--text); }
.lead-company { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.sync-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}

.sync-badge.pending { background: var(--warning-bg); color: var(--warning); }
.sync-badge.synced  { background: var(--success-bg); color: var(--success); }
.sync-badge.failed  { background: var(--error-bg); color: var(--error); }

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-dim);
}

.meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }

.lead-req {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.lead-time { font-size: 12px; color: var(--text-dim); }
.lead-actions { display: flex; gap: 6px; }

.action-chip {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-light);
  color: var(--text-muted);
  font-family: var(--font);
  transition: all 0.15s;
}

.action-chip:active { transform: scale(0.92); }
.action-chip.danger { border-color: rgba(255,68,102,0.25); background: var(--error-bg); color: var(--error); }
.action-chip.warn   { border-color: rgba(255,170,0,0.25); background: var(--warning-bg); color: var(--warning); }

/* ============================================================
   SEARCH + FILTERS
   ============================================================ */

.search-wrap { position: relative; }

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 46px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  padding: 0 16px 0 42px;
  outline: none;
  transition: all 0.2s;
  font-family: var(--font);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}

.search-input::placeholder { color: var(--text-dim); }

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
  font-family: var(--font);
}

.filter-chip.active {
  background: var(--cyan-glow);
  border-color: var(--border-focus);
  color: var(--cyan);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--surface-light);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.empty-icon svg { width: 28px; height: 28px; color: var(--text-dim); }
.empty-title { font-size: 17px; font-weight: 700; color: var(--text); }
.empty-desc { font-size: 14px; color: var(--text-muted); max-width: 260px; line-height: 1.5; }

/* ============================================================
   DETAIL SHEET
   ============================================================ */

.detail-row { display: flex; flex-direction: column; gap: 4px; }

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.detail-value { font-size: 16px; color: var(--text); }
.detail-card-img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: 6px; }

/* ============================================================
   ATTACHMENT BANNERS (in form)
   ============================================================ */

.attachment-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.attachment-banner.audio {
  background: rgba(0,212,255,0.06);
  border-color: rgba(0,212,255,0.2);
}

.attachment-banner.scan {
  background: rgba(139,92,246,0.06);
  border-color: rgba(139,92,246,0.25);
}

.attachment-banner svg { width: 20px; height: 20px; color: var(--cyan); flex-shrink: 0; }
.attachment-banner.scan svg { color: var(--violet); }
.attachment-label { font-size: 13px; font-weight: 600; color: var(--text); }
.attachment-sub   { font-size: 12px; color: var(--text-muted); }

.autofill-badge {
  background: var(--cyan-glow);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================
   TOAST
   ============================================================ */

#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 400px;
}

.toast {
  background: rgba(8,14,30,0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 17px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.25s ease;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  width: 100%;
}

.toast.success { border-color: rgba(34,211,160,0.4); }
.toast.error   { border-color: rgba(255,68,102,0.4); }
.toast.warning { border-color: rgba(255,170,0,0.4); }

.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast.success svg { color: var(--success); }
.toast.error   svg { color: var(--error); }
.toast.warning svg { color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   CONFIRM + LOADING
   ============================================================ */

.overlay-dark {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 6000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-dark.active { display: flex; }

.confirm-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: pop-in 0.2s ease;
}

@keyframes pop-in {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.confirm-title { font-size: 18px; font-weight: 700; color: var(--text); }
.confirm-msg { font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.confirm-btns { display: flex; gap: 10px; }
.confirm-btns .btn { min-height: 48px; font-size: 15px; }

.loading-full {
  position: fixed;
  inset: 0;
  background: rgba(2,8,23,0.8);
  backdrop-filter: blur(4px);
  z-index: 7000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-full.active { display: flex; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { font-size: 15px; color: var(--text-muted); }

/* ============================================================
   SYNC BANNER + OFFLINE STRIP
   ============================================================ */

.sync-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(0,212,255,0.08);
  border-bottom: 1px solid var(--border);
  padding: 11px 20px;
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 800;
}

.sync-banner.visible { display: flex; }
.sync-banner-text { font-size: 14px; color: var(--cyan); flex: 1; }

.offline-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255,68,102,0.12);
  border-bottom: 1px solid rgba(255,68,102,0.3);
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
  z-index: 800;
  display: none;
}

.offline-strip.visible { display: block; }

/* ============================================================
   INSTALL PROMPT
   ============================================================ */

.install-prompt {
  position: fixed;
  bottom: 30px;
  left: 20px;
  right: 20px;
  background: rgba(8,14,30,0.95);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius);
  padding: 20px;
  z-index: 1500;
  display: none;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 30px rgba(0,212,255,0.1);
  animation: slide-up 0.3s ease;
}

.install-prompt.visible { display: flex; }

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.install-title { font-size: 16px; font-weight: 700; color: var(--text); }
.install-desc  { font-size: 14px; color: var(--text-muted); }
.install-btns  { display: flex; gap: 10px; }
.install-btns .btn { flex: 1; min-height: 48px; font-size: 14px; }

/* ============================================================
   URGENCY DOT
   ============================================================ */

.urgency-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.urgency-dot.high   { background: var(--error); }
.urgency-dot.medium { background: var(--warning); }
.urgency-dot.low    { background: var(--success); }
