/* ═══════════════════════════════════════════════════════════════
   AP FRAUD SENTINEL — MODERN GLASSMORPHIC DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-base: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(28, 36, 56, 0.9);
  --bg-input: rgba(13, 17, 27, 0.95);
  --bg-modal: rgba(15, 20, 32, 0.98);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-subtle: rgba(255, 255, 255, 0.05);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #ec4899;
  
  --color-green: #10b981;
  --color-green-bg: rgba(16, 185, 129, 0.12);
  --color-orange: #f59e0b;
  --color-orange-bg: rgba(245, 158, 11, 0.12);
  --color-red: #ef4444;
  --color-red-bg: rgba(239, 68, 68, 0.12);
  --color-purple: #8b5cf6;
  --color-purple-bg: rgba(139, 92, 246, 0.12);
  --color-blue: #3b82f6;
  --color-blue-bg: rgba(59, 130, 246, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.08), transparent);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ═══════════════════════════ HEADER ═══════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Navigation Tabs ── */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.tab-count-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.badge-red {
  background: var(--color-red) !important;
  color: white !important;
}

/* ── Header Right Badges & Auth ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.supabase-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.supabase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.engine-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

.engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #818cf8;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem 0.25rem 0.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.7rem;
}

.user-email-text {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 4px;
}
.signout-btn:hover {
  color: var(--color-red);
}

/* ═══════════════════════════ MAIN LAYOUT ═══════════════════════════ */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Typography & Headings ── */
.dash-heading {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.dash-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.dash-action-bar, .vendor-header-bar, .hitl-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.dash-action-right, .vendor-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Cards & Containers ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--color-red);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--color-green);
  color: white;
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

.btn-full {
  width: 100%;
}

/* ── Telemetry Grid ── */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.tcard:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.tcard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.tcard-blue::before   { background: var(--color-blue); }
.tcard-green::before  { background: var(--color-green); }
.tcard-orange::before { background: var(--color-orange); }
.tcard-red::before    { background: var(--color-red); }
.tcard-purple::before { background: var(--color-purple); }
.tcard-indigo::before { background: #818cf8; }

.tcard-icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.tcard-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tcard-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.tcard-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #ec4899);
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
  margin-top: 0.4rem;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.results-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.results-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.empty-row td {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.badge-clean {
  background: var(--color-green-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-elevated {
  background: var(--color-orange-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-hold {
  background: var(--color-red-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-purple {
  background: var(--color-purple-bg);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.score-high   { color: #ef4444; }
.score-medium { color: #f59e0b; }
.score-low    { color: #10b981; }

/* ── Form Controls & Search ── */
.search-input-wrap {
  position: relative;
}

.input-search, .input-field, .select-filter, .textarea-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.input-search:focus, .input-field:focus, .select-filter:focus, .textarea-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.select-filter {
  width: auto;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-helper {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ── Vendor Registry Specifics ── */
.vendor-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vstat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.vstat-num {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.vstat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.text-green  { color: var(--color-green); }
.text-orange { color: var(--color-orange); }
.text-red    { color: var(--color-red); }

.bank-info-cell {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.bank-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Single Audit Layout ── */
.single-audit-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}

.result-placeholder {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.verdict-tier-badge {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-md);
}

.tier-hold {
  background: var(--color-red-bg);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.tier-elevated {
  background: var(--color-orange-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tier-clean {
  background: var(--color-green-bg);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.verdict-score-num {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  text-align: right;
  line-height: 1;
}

.verdict-score-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.verdict-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.vmetric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.vmetric-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.vmetric-val {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}

.verdict-section {
  margin-bottom: 1.25rem;
}

.verdict-sec-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.verdict-summary-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.risk-factors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.risk-factor-item {
  font-size: 0.8rem;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid #ef4444;
}

.hitl-callout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.oob-text {
  font-size: 0.82rem;
  color: #fecaca;
  margin-bottom: 0.5rem;
}

.verified-phone-box {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.verdict-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Pipeline Diagram ── */
.pipeline-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 1rem 0;
}

.pipe-node {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  min-width: 140px;
  flex: 1;
  transition: all 0.2s;
}

.pipe-node:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.pipe-node-icon { font-size: 1.25rem; margin-bottom: 0.25rem; }
.pipe-node-label { font-size: 0.78rem; font-weight: 600; }
.pipe-node-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.15rem; }
.pipe-node-stat { font-size: 0.7rem; font-family: var(--font-mono); color: #34d399; margin-top: 0.35rem; }

.pipe-arrow {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
}

.trace-log {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-height: 140px;
  overflow-y: auto;
  margin-top: 1rem;
}

/* ── HITL Desk Cards ── */
.hitl-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
}

.hitl-card {
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1);
}

.hitl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hitl-card-amount {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #f87171;
}

.hitl-card-vendor {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hitl-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.empty-hitl-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.vendor-modal { max-width: 680px; }
.auth-modal { max-width: 420px; }
.settings-modal { max-width: 540px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

/* ── Auth Tabs ── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.auth-tab {
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.auth-tab.active {
  color: white;
  background: var(--accent-primary);
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.auth-footer-note {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

/* ── Settings ── */
.settings-section {
  margin-bottom: 1.5rem;
}

.settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.settings-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #93c5fd;
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* ── Upload Card ── */
.upload-zone {
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(99, 102, 241, 0.02);
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.06);
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.upload-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.upload-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideUp 0.25s ease forwards;
}

.toast-success { border-left: 4px solid var(--color-green); }
.toast-error   { border-left: 4px solid var(--color-red); }
.toast-info    { border-left: 4px solid var(--color-blue); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Paid & Spoofed Badges & Payout Button ── */
.badge-paid {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-spoofed {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  animation: pulseAlert 2s infinite;
}

@keyframes pulseAlert {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.btn-pay {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
}

.btn-pay:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.spin-icon {
  display: inline-block;
  animation: spinAnim 1s linear infinite;
}

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.precheck-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.precheck-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.precheck-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .single-audit-layout {
    grid-template-columns: 1fr;
  }
  .vendor-stat-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .vendor-stat-row {
    grid-template-columns: 1fr;
  }
}

