/* ============================================================
   BlackPost — Light + Dark Theme (Pencil Design)
   Fonts: Space Grotesk (headings), IBM Plex Mono (body)
   Accent: #d90000
   ============================================================ */

/* Google Fonts loaded in base.html */

/* ------------------------------------------------------------
   1. CSS Custom Properties — Light theme (default)
   ------------------------------------------------------------ */
:root {
  --primary: #d90000;
  --primary-hover: #b80000;
  --primary-dark: #a80000;
  --primary-bg: rgba(217, 0, 0, 0.06);
  --primary-glow: rgba(217, 0, 0, 0.1);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-bg: rgba(239, 68, 68, 0.08);
  --success: #16a34a;
  --success-hover: #15803d;
  --success-bg: rgba(22, 163, 74, 0.08);
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.08);

  /* Light palette */
  --bg: #f7f7f8;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #fafafa;
  --surface: #fff0f0;
  --text: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --input-bg: #ffffff;
  --input-border: #d0d0d0;
  --input-focus: #d90000;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --overlay: rgba(0,0,0,0.4);
  --navbar-bg: #ffffff;
  --navbar-border: #e8e8e8;
  --footer-bg: #111111;

  /* Risk */
  --risk-clean: #16a34a;
  --risk-low: #65a30d;
  --risk-medium: #f59e0b;
  --risk-high: #f97316;
  --risk-critical: #ef4444;

  /* Layout */
  --container-max: 1280px;
  --navbar-height: 64px;
  --radius: 4px;
  --radius-sm: 2px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Typography */
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Mono', monospace;
  --font-mono: 'IBM Plex Mono', 'Fira Code', Consolas, monospace;
}

/* ------------------------------------------------------------
   1b. Dark theme override
   ------------------------------------------------------------ */
body.dark-theme {
  --primary-hover: #ff1a1a;
  --primary-bg: rgba(217, 0, 0, 0.1);
  --primary-glow: rgba(217, 0, 0, 0.15);
  --danger-bg: rgba(239, 68, 68, 0.12);
  --success: #22c55e;
  --success-hover: #16a34a;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning-bg: rgba(245, 158, 11, 0.12);
  --info-bg: rgba(59, 130, 246, 0.12);

  --bg: #0A0A0A;
  --bg-elevated: #0e0e0e;
  --card: #141414;
  --card-hover: #1a1a1a;
  --surface: #1a0000;
  --text: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;
  --border: #2A2A2A;
  --border-light: #1e1e1e;
  --input-bg: #0A0A0A;
  --input-border: #2A2A2A;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
  --overlay: rgba(0,0,0,0.7);
  --navbar-bg: #0A0A0A;
  --navbar-border: #2A2A2A;
  --footer-bg: #0A0A0A;
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
[id] { scroll-margin-top: 80px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 0.75em; }
p:last-child { margin-bottom: 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

code, pre { font-family: var(--font-mono); font-size: 0.875rem; }
code { background: var(--primary-bg); padding: 0.15em 0.4em; border-radius: var(--radius-sm); color: var(--primary); }
pre { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; color: var(--text); }

::selection { background: var(--primary); color: #fff; }

/* ------------------------------------------------------------
   3. Layout
   ------------------------------------------------------------ */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 80px; }
.main-content { flex: 1; }

@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* Blog article global fixes */
.article-body { overflow-wrap: break-word; word-wrap: break-word; }
.article-body .article-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-body p, .article-body li { font-family: var(--font-heading), sans-serif; }
.article-infographic { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100vw; }
  .article-container { display: block !important; padding: 24px 16px 56px !important; max-width: 100%; box-sizing: border-box; }
  .article-body { font-size: 0.92rem; max-width: 100% !important; width: 100%; box-sizing: border-box; }
  .article-body h2 { font-size: 1.3rem; }
  .article-body h3 { font-size: 1.05rem; }
  .article-hero .container { padding: 0 16px; }
  .article-toc { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 0 16px; }
  .article-toc ol { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .article-infographic { margin-left: -16px; margin-right: -16px; padding: 0 16px; overflow-x: auto; }
  .infographic-bars { gap: 8px; min-width: 360px; }
  .infographic-bar { width: 48px; min-width: 48px; }
  .infographic-bar-label { font-size: 0.65rem; }
  .article-stats { display: grid !important; grid-template-columns: 1fr !important; }
  .article-stat { box-sizing: border-box; }
  .article-table { font-size: 0.75rem; }
  .article-table th, .article-table td { padding: 6px 8px; }
}

/* ------------------------------------------------------------
   4. Navbar
   ------------------------------------------------------------ */
.navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  height: var(--navbar-height);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.navbar-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text) !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.navbar-brand:hover { color: var(--text) !important; }
.brand-icon { flex-shrink: 0; color: var(--text); }
.brand-accent { color: var(--primary); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.navbar-nav a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}
.navbar-nav a:hover { color: var(--text); }
.navbar-nav a.active { color: var(--text); }

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-dropdown-trigger svg {
  transition: transform 0.2s;
}
.nav-dropdown:hover .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  min-width: 200px;
  z-index: 100;
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-elevated);
  color: var(--text) !important;
}
.nav-dropdown-menu a.active {
  color: var(--primary) !important;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.navbar-avatar,
.navbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.navbar-avatar:hover,
.navbar-icon-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.navbar-user {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile-only nav items — hidden on desktop */
.nav-mobile-logout,
.nav-mobile-auth { display: none; }

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}
.navbar-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; }
  .navbar-toggle { display: block; order: -1; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    flex-direction: column;
    padding: 8px 16px;
    gap: 0;
    z-index: 99;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
  }
  .navbar-nav a:last-child { border-bottom: none; }
  .nav-dropdown {
    border-bottom: 1px solid var(--border-light);
  }
  .nav-dropdown-trigger {
    padding: 10px 0;
    font-size: 14px;
    width: 100%;
  }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 8px 20px;
    min-width: auto;
    display: block;
  }
  .nav-dropdown-menu a {
    padding: 6px 0 !important;
    font-size: 13px !important;
    color: var(--text-muted) !important;
    border-bottom: none !important;
  }
  /* Hide auth icons on mobile — already have Кабінет/Вийти in menu */
  .navbar-avatar,
  .navbar-icon-btn { display: none; }
  .navbar-right .btn { display: none; }
  .navbar-right { gap: 4px; }
  .navbar-user { display: none; }
  /* Show mobile-only nav items */
  .nav-mobile-logout,
  .nav-mobile-auth { display: block; }
  .nav-mobile-logout {
    color: var(--primary) !important;
  }
}

/* ------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }

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

.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); color: #fff; }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: var(--success-hover); color: #fff; }

.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn--xs svg { width: 12px; height: 12px; }
.btn--block { width: 100%; }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg svg { width: 20px; height: 20px; }

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

/* Google button */
.btn--google {
  background: #ffffff;
  color: #333;
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn--google:hover { background: #f8f8f8; box-shadow: 0 2px 6px rgba(0,0,0,0.1); color: #333; }
body.dark-theme .btn--google { background: #1a1a1a; color: #e8e8e8; box-shadow: none; }
body.dark-theme .btn--google:hover { background: #222; color: #fff; }
.btn--google svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------
   6. Forms
   ------------------------------------------------------------ */
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.required { color: var(--primary); }

.form-input {
  width: 100%;
  padding: 7px 14px;
  height: 36px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--transition);
  line-height: 1.5;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input--lg { height: 48px; padding: 12px 18px; font-size: 15px; }
.form-textarea { resize: vertical; min-height: 60px; height: auto; }

select.form-input { appearance: auto; }

.form-row { display: flex; gap: 16px; }
.form-row--two > .form-group { flex: 1; }
.form-row--three > .form-group { flex: 1; }
.form-group--half { flex: 1; }

@media (max-width: 768px) {
  .form-row { flex-direction: column; }
}

.form-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.form-description { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }

/* Radio group */
.radio-group { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.radio-label:hover { color: var(--text); }
.radio-input { accent-color: var(--primary); }
.radio-input:checked + .radio-text { color: var(--text); }

/* Toggle buttons (phone/surname search) */
.toggle-group {
  display: flex;
  width: 100%;
  height: 40px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-btn.active {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
}
.toggle-btn:hover:not(.active) { color: var(--text-secondary); }

/* ------------------------------------------------------------
   7. Cards
   ------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Auth card */
.auth-section { display: flex; justify-content: center; padding: 80px 0; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card--wide { max-width: 560px; }
.auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
}
.auth-form { margin-bottom: 16px; }
.auth-links {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-link { color: var(--primary); font-weight: 500; }
.auth-separator { margin: 0 8px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Search card */
.search-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  width: 500px;
  max-width: 100%;
}

/* Form card */
.form-card {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 640px;
  margin: 0 auto;
}

/* Check form card (backwards compat) */
.check-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------
   8. Alerts
   ------------------------------------------------------------ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert--error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert--success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.alert--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.alert--info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.2); }
.error-list { list-style: disc; padding-left: 16px; }

/* Result blocks */
.result-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  width: 560px;
  max-width: 100%;
}
.result-block--danger {
  background: var(--surface);
  border: 1px solid var(--primary);
}
.result-block--success {
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid var(--success);
}
.result-icon { font-size: 20px; flex-shrink: 0; }
.result-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   9. Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--primary { background: var(--primary-bg); color: var(--primary); }
.badge--lg { padding: 8px 20px; font-size: 14px; }

/* ------------------------------------------------------------
   10. Hero Section (Landing)
   ------------------------------------------------------------ */
.hero {
  background: radial-gradient(ellipse 160% 140% at 50% 25%, var(--primary-bg) 0%, var(--bg) 60%);
  padding: 48px 0 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-bg);
  border: 1px solid rgba(217, 0, 0, 0.2);
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
}
.hero-badge svg {
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  max-width: 900px;
  line-height: 1.1;
}
.hero-subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.5;
}

/* Delivery services strip */
.hero-services {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.hero-service-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  opacity: 0.8;
  transition: opacity 0.2s;
}
.hero-service-item:hover {
  opacity: 1;
}
.hero-service-item svg {
  flex-shrink: 0;
}

/* Stats Row */
.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 620px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.stat-card:hover {
  border-color: var(--text-muted);
}
.stat-card-icon {
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-card-number {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.stat-card-label {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
}
/* Accent stat card (shops) */
.stat-card--accent {
  border-color: rgba(255, 132, 0, 0.2);
  background: linear-gradient(180deg, rgba(255, 132, 0, 0.04) 0%, var(--surface) 100%);
}
.stat-card--accent .stat-card-number {
  color: #FF8400;
}
.stat-card--accent .stat-card-icon {
  color: #FF8400;
}

/* Search input wrap */
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 0 16px;
  height: 52px;
}
.search-input-wrap .form-input {
  border: none;
  background: none;
  padding: 0;
  height: 100%;
  flex: 1;
}

/* Section header with accent line */
.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.section-accent {
  width: 60px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.section-subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}
.section-subtitle-sm {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -2px;
}

@media (max-width: 768px) {
  .hero { padding: 48px 0; gap: 24px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 14px; }
  .hero-services { gap: 16px; }
  .hero-service-item { font-size: 12px; gap: 6px; }
  .hero-service-item svg { width: 18px; height: 18px; }
  .hero-stats-row { grid-template-columns: 1fr; max-width: 300px; gap: 12px; }
  .stat-card-number { font-size: 28px; }
  .search-card { width: 100%; padding: 24px; }
  .search-input-wrap { height: 48px; }
}

/* ------------------------------------------------------------
   11. Add Buyer Section
   ------------------------------------------------------------ */
.add-section {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}
.add-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.add-section .section-header {
  margin-bottom: 0;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 768px) {
  .add-section { padding: 48px 0; }
  .section-title { font-size: 24px; }
  .form-card { padding: 24px; }
}

/* ------------------------------------------------------------
   12. How It Works Section
   ------------------------------------------------------------ */
.how-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 80px 0;
}
.how-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.step-icon-wrap {
  width: 56px;
  height: 56px;
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-icon-wrap svg { width: 28px; height: 28px; color: var(--primary); }
.step-number {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.step-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}
.step-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .how-section { padding: 48px 0; }
  .steps-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   12b. Integrations Section (index page)
   ------------------------------------------------------------ */
.integrations-section {
  padding: 64px 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 32px auto 0;
}
.integ-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.integ-card--active:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.integ-card--soon {
  opacity: 0.5;
  pointer-events: none;
}
.integ-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.integ-info { flex: 1; min-width: 0; }
.integ-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.integ-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.integ-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.integ-badge--ready {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.3);
}
.integ-badge--api {
  background: rgba(59,130,246,0.1);
  color: #3b82f6;
  border: 1px solid rgba(59,130,246,0.3);
}
.integ-badge--soon {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.integ-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}
.integ-card--active:hover .integ-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

@media (max-width: 640px) {
  .integrations-grid { grid-template-columns: 1fr; }
  .integrations-section { padding: 48px 0; }
}

/* ------------------------------------------------------------
   13. Stats Section
   ------------------------------------------------------------ */
.stats-section { padding: 48px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   14. Footer
   ------------------------------------------------------------ */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: auto;
  color: rgba(255,255,255,0.7);
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.footer-nav {
  display: flex;
  gap: 24px;
}
.footer-nav a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-nav a:hover { color: #fff; }

.footer-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
.footer-email {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* Old footer compat */
.footer-stats { display: flex; gap: 20px; }
.footer-stat { display: flex; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.footer-stat-value { font-weight: 700; color: var(--text); }

@media (max-width: 768px) {
  .footer-inner { padding: 0 20px; }
  .footer-top, .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
  .footer-nav { flex-wrap: wrap; justify-content: center; }
}

/* ------------------------------------------------------------
   15. Buyer Detail Page
   ------------------------------------------------------------ */
.buyer-detail { padding: 32px 0; }
.buyer-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.buyer-header-gauge { flex-shrink: 0; }
.buyer-header-info { flex: 1; }
.buyer-header-info h1 { margin-bottom: 4px; }
.buyer-header-info .buyer-phone { font-size: 1.1rem; }

/* Risk gauge */
.risk-gauge { width: 100px; height: 100px; flex-shrink: 0; }
.risk-gauge-svg { width: 100%; height: 100%; }
.risk-gauge-value { font-size: 28px; font-weight: 800; fill: currentColor; }
.risk-gauge-label { font-size: 10px; fill: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.risk-gauge--clean { color: var(--risk-clean); }
.risk-gauge--low { color: var(--risk-low); }
.risk-gauge--medium { color: var(--risk-medium); }
.risk-gauge--high { color: var(--risk-high); }
.risk-gauge--critical { color: var(--risk-critical); }

.buyer-card--clean { border-top: 3px solid var(--risk-clean); }
.buyer-card--low { border-top: 3px solid var(--risk-low); }
.buyer-card--medium { border-top: 3px solid var(--risk-medium); }
.buyer-card--high { border-top: 3px solid var(--risk-high); }
.buyer-card--critical { border-top: 3px solid var(--risk-critical); }

/* Record cards */
.record-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
}
.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.record-date { font-size: 13px; color: var(--text-muted); }
.record-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.record-field-label { font-size: 12px; color: var(--text-muted); }
.record-field-value { font-size: 14px; color: var(--text); }

/* Buyer card (search results) */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.buyer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.buyer-card:hover { border-color: var(--text-muted); }
.buyer-card-header { display: flex; gap: 20px; padding: 24px; align-items: center; }
.buyer-card-info { flex: 1; min-width: 0; }
.buyer-phone { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.buyer-name { font-size: 14px; color: var(--text-secondary); }
.buyer-status { margin-top: 6px; }

.buyer-card-stats { display: flex; border-top: 1px solid var(--border); }
.buyer-stat { flex: 1; text-align: center; padding: 14px 12px; }
.buyer-stat + .buyer-stat { border-left: 1px solid var(--border); }
.buyer-stat-value { display: block; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--text); }
.buyer-stat-label { display: block; font-size: 12px; color: var(--text-muted); }

.buyer-card-losses {
  padding: 10px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
}
.buyer-losses-label { color: var(--text-muted); }
.buyer-losses-value { font-weight: 700; font-family: var(--font-mono); color: #ef4444; }

.buyer-card-recommendation {
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.recommendation--safe { color: var(--success); }
.recommendation--proceed_with_caution { color: var(--warning); }
.recommendation--consider_prepayment { color: var(--warning); }
.recommendation--prepayment_required { color: var(--danger); }
.recommendation--do_not_ship { color: var(--danger); background: var(--danger-bg); }

.buyer-card-actions { padding: 12px 24px 16px; display: flex; gap: 8px; }

.buyer-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.buyer-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}
.buyer-tab:hover { color: var(--text); }
.buyer-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ------------------------------------------------------------
   16. Check Section
   ------------------------------------------------------------ */
.check-section { padding: 32px 0; }
.page-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.check-empty {
  text-align: center;
  padding: 48px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-hint { color: var(--text-secondary); font-size: 14px; margin-top: 12px; }

/* ------------------------------------------------------------
   17. Dashboard & Admin
   ------------------------------------------------------------ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.dashboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.dashboard-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dashboard-card-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* User dashboard (cabinet) */
.dashboard-section { padding-bottom: 40px; }
.dashboard-section .page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s;
}
.dash-card:hover { border-color: var(--primary); }
.dash-card--link { text-decoration: none; color: inherit; cursor: pointer; }
.dash-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-card-icon--blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.dash-card-icon--orange { background: rgba(249,115,22,0.12); color: #f97316; }
.dash-card-icon--yellow { background: rgba(234,179,8,0.12); color: #eab308; }
.dash-card-icon--green { background: rgba(34,197,94,0.12); color: #22c55e; }
.dash-card-icon--red { background: rgba(239,68,68,0.12); color: #ef4444; }
.dash-card-body { flex: 1; }
.dash-card-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text);
}
.dash-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-block-title {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.dash-block-title svg { color: var(--text-muted); }

.dash-quick-form {
  display: flex;
  gap: 10px;
}
.dash-quick-form .form-input { flex: 1; }
@media (max-width: 600px) {
  .dash-quick-form { flex-direction: column; }
}

.dash-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.dash-empty svg { margin-bottom: 12px; }
.dash-empty p { margin-bottom: 12px; }

.dash-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.dash-link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}
.dash-link-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.dash-link-card svg { color: var(--primary); }

/* ------------------------------------------------------------
   18. Tables
   ------------------------------------------------------------ */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--card-hover); }

/* ------------------------------------------------------------
   19. API Docs
   ------------------------------------------------------------ */
.api-docs-section { padding: 32px 0; }

/* API Docs — layout */
.api-docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}
.api-docs-nav {
  position: sticky;
  top: calc(var(--navbar-height) + 24px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.api-docs-nav-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.api-docs-nav-list { list-style: none; padding: 0; margin: 0; }
.api-docs-nav-list li { margin-bottom: 2px; }
.api-nav-link {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  text-decoration: none;
  transition: all var(--transition);
}
.api-nav-link:hover { color: var(--text); background: var(--bg-secondary); }
.api-nav-link.active {
  color: var(--primary);
  background: var(--primary-bg);
  font-weight: 600;
}
.api-docs-content { min-width: 0; }

/* API Docs — sections */
.api-section {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.api-section:last-child { border-bottom: none; }
.api-section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.api-subtitle {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text);
}
.api-section p { margin: 8px 0; line-height: 1.6; }
.api-section ol { padding-left: 24px; margin: 8px 0; }
.api-section ol li { margin-bottom: 6px; line-height: 1.5; }

/* API method badge */
.api-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 14px;
}
.method-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.method-badge--get { background: rgba(34,197,94,0.15); color: #16a34a; }
.method-badge--post { background: rgba(59,130,246,0.15); color: #2563eb; }
.method-badge--put { background: rgba(234,179,8,0.15); color: #ca8a04; }
.method-badge--delete { background: rgba(239,68,68,0.15); color: #dc2626; }

/* API params table */
.api-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0;
}
.api-params-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}
.api-params-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.api-params-table tr:last-child td { border-bottom: none; }
.api-params-table code {
  background: var(--primary-bg);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.api-note {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin: 6px 0;
}

/* Code blocks */
.code-block {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-header {
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--card);
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* API response */
.api-response {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.api-response .code-header {
  background: rgba(34,197,94,0.08);
  color: #16a34a;
}
.api-response pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--card);
  overflow-x: auto;
}
.api-response code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* API info box */
.api-info-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.api-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.api-info-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.api-info-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
}
.api-info-row code {
  font-size: 13px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
}

/* API warning */
.api-warning {
  background: rgba(234,179,8,0.08);
  border: 1px solid rgba(234,179,8,0.25);
  border-left: 3px solid #eab308;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 16px 0;
}

/* Table responsive */
.table-responsive {
  overflow-x: auto;
  margin: 8px 0;
}

@media (max-width: 768px) {
  .api-docs-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .api-docs-nav {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
  }
  .api-docs-nav-title { display: none; }
  .api-docs-nav-list {
    display: flex;
    gap: 4px;
    white-space: nowrap;
  }
  .api-docs-nav-list li { margin: 0; }
  .api-method { flex-wrap: wrap; }
}

.api-endpoint {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.api-endpoint-header:hover { background: var(--card-hover); }
.api-method {
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.api-method--get { background: var(--success-bg); color: var(--success); }
.api-method--post { background: var(--info-bg); color: var(--info); }
.api-method--put { background: var(--warning-bg); color: var(--warning); }
.api-method--delete { background: var(--danger-bg); color: var(--danger); }
.api-path { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.api-desc { font-size: 13px; color: var(--text-secondary); margin-left: auto; }
.api-endpoint-body { padding: 16px 20px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------
   20. Toast Notifications
   ------------------------------------------------------------ */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease;
  min-width: 260px;
}
.toast.fade-out { animation: slideOut 0.3s ease forwards; }
.toast-icon svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 13px; color: var(--text-secondary); }
.toast-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.toast-close svg { width: 16px; height: 16px; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ------------------------------------------------------------
   21. Modal
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ------------------------------------------------------------
   22. Dropdown
   ------------------------------------------------------------ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 50;
  display: none;
  padding: 4px;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--primary-bg); color: var(--primary); text-decoration: none; }

/* ------------------------------------------------------------
   23. Sections compat
   ------------------------------------------------------------ */
.report-section, .dispute-section, .check-section { padding: 32px 0; }
.features-section { padding: 48px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color var(--transition);
}
.feature-card:hover { border-color: var(--text-muted); }
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  margin-bottom: 16px;
}
.feature-icon svg { width: 28px; height: 28px; }
.feature-title { font-family: var(--font-heading); font-size: 1rem; margin-bottom: 8px; }
.feature-text { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
}

.cta-section {
  padding: 64px 0;
  text-align: center;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.cta-title { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; margin-bottom: 12px; }
.cta-text { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }

/* ------------------------------------------------------------
   24. Webhook / API Keys / Other pages
   ------------------------------------------------------------ */
.api-keys-section, .webhooks-section, .stats-page-section, .my-reports-section { padding: 32px 0; }

.key-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .15s;
}
.key-card:hover { border-color: var(--primary); }
.key-card--disabled { opacity: .5; }
.key-card--disabled:hover { border-color: var(--border); }
.key-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.keys-list { margin-top: 8px; }
.key-info { flex: 1; min-width: 0; }
.key-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.key-prefix { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.key-prefix code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.key-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.key-actions { display: flex; gap: 8px; flex-shrink: 0; }
.copied { color: var(--success) !important; border-color: var(--success) !important; }
.btn--danger-outline { color: var(--danger); border-color: var(--danger); }
.btn--danger-outline:hover { background: var(--danger); color: #fff; }

/* Key reveal modal */
.key-reveal-warning {
  display: flex; align-items: center; gap: 10px;
  background: #fff3cd; color: #856404;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; margin-bottom: 16px;
}
[data-theme="dark"] .key-reveal-warning { background: #433200; color: #ffc107; }
.key-reveal-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.key-reveal-code {
  flex: 1; min-width: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--primary);
  word-break: break-all;
  user-select: all;
}

/* Empty state card */
.empty-state-card {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
}
.empty-state-title { font-size: 18px; font-weight: 600; margin: 16px 0 4px; }
.empty-state-text { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* API hint card */
.api-hint-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}
.api-hint-icon { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.api-hint-body { flex: 1; }
.api-hint-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.api-hint-text { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.api-hint-text code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.api-hint-link { font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 500; }
.api-hint-link:hover { text-decoration: underline; }

/* Plan limits bar */
.plan-limits-bar {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
}
.plan-limits-item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.plan-limits-label { color: var(--text-muted); }
.plan-limits-value { font-weight: 600; }
.badge--default {
  background: var(--bg); color: var(--text-muted);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}

/* Key usage progress bar */
.key-usage-bar {
  height: 4px; background: var(--bg); border-radius: 2px;
  margin-top: 8px; overflow: hidden; max-width: 200px;
}
.key-usage-fill {
  height: 100%; background: var(--success); border-radius: 2px;
  transition: width .3s;
}
.key-usage-fill--warning { background: var(--warning); }
.key-usage-fill--exhausted { background: var(--danger); }

/* Form fieldset */
.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.form-legend {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  padding: 0 8px;
}

/* ------------------------------------------------------------
   25. Utility classes
   ------------------------------------------------------------ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}
.theme-toggle:hover { color: var(--text); }
.icon-sun { display: none; }
.icon-moon { display: block; }
body.dark-theme .icon-sun { display: block; }
body.dark-theme .icon-moon { display: none; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   SEO Article Section
   ------------------------------------------------------------ */
.seo-article {
  padding: 80px 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}
.seo-article .seo-h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 24px 0;
  line-height: 1.3;
}
.seo-article h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 24px 0;
  line-height: 1.2;
}
.seo-article h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 16px 0;
  line-height: 1.3;
}
.seo-article p {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 16px 0;
}
.seo-article ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}
.seo-article ul li {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 12px 0 12px 24px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.seo-article ul li:last-child { border-bottom: none; }
.seo-article ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.seo-article ul li strong {
  color: var(--text);
}
.seo-article strong {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------
   FAQ Section
   ------------------------------------------------------------ */
.faq-section {
  padding: 80px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item:first-child {
  border-top: 1px solid var(--border);
}
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}
.faq-item[open] .faq-question::after {
  content: '−';
  color: var(--primary);
}
.faq-question:hover {
  color: var(--primary);
}
.faq-answer {
  padding: 0 0 20px 0;
}
.faq-answer p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 768px) {
  .seo-article { padding: 48px 0; }
  .seo-article h2 { font-size: 24px; }
  .seo-article h3 { font-size: 18px; }
  .faq-section { padding: 48px 0; }
  .faq-question { font-size: 14px; padding: 16px 0; }
}

/* Print */
@media print {
  .navbar, .footer, .toast-container { display: none; }
  body { background: #fff; color: #000; }
  .main-content { padding: 0; }
}

/* ── Check Result Two-Column Layout ────────── */
.check-result-row {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
.check-result-left .buyer-card {
  position: sticky;
  top: 80px;
}
.check-result-left .buyer-card-actions { display: none; }

/* Detail panel (right side) */
.detail-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.detail-panel-title svg { color: var(--text-muted); flex-shrink: 0; }
.detail-panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 12px;
}

/* Report items */
.detail-reports-list { padding: 0; }
.detail-report-item {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.detail-report-item:last-child { border-bottom: none; }
.detail-report-item:hover { background: var(--bg); }

.detail-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-report-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.detail-report-date svg { color: var(--text-muted); }

.detail-report-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}
.detail-report-service {
  display: flex;
  align-items: center;
  gap: 5px;
}
.detail-report-service svg { color: var(--text-muted); }
.detail-report-amount {
  font-weight: 600;
  color: var(--text);
}
.detail-report-comment {
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--warning);
}

/* Empty state in detail panel */
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Panel footer */
.detail-panel-footer {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Badge xs */
.badge--xs { font-size: 11px; padding: 2px 8px; }
.badge--default { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* Check empty */
.check-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
}
.check-empty-icon { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .check-result-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .check-result-left .buyer-card {
    position: static;
  }
  .detail-report-item { padding: 14px 16px; }
  .detail-panel-title { padding: 16px; }
  .detail-panel-footer { padding: 12px 16px; }
}

/* ── Gauge label fix (smaller text for long labels) ────── */
.risk-gauge-label-sm {
  font-size: 8px;
  fill: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* ── Report detail fields ────── */
.detail-report-body { margin-top: 6px; }
.detail-report-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
}
.detail-report-field-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.detail-report-ttn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
  transition: opacity 0.15s;
}
.detail-report-ttn-link:hover { opacity: 0.75; }
.detail-report-ttn-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}
.dispute-ttn-btn {
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.detail-report-shop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 13px;
}
.detail-report-shop svg { color: var(--text-muted); }
.detail-report-shop-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.detail-report-shop-link:hover {
  text-decoration: underline;
}
.detail-report-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.detail-report-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.detail-report-service-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.detail-report-ttn-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */

/* Admin page layout */
.admin-page { padding: 0 0 40px; }
.admin-page .page-header { margin-bottom: 32px; }
.admin-page .page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14px; }

/* Admin nav (sub-navigation) */
.admin-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  overflow-x: auto;
}
.admin-nav a {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-nav a:hover { background: var(--bg-secondary); color: var(--text); }
.admin-nav a.active { background: var(--primary); color: #fff; }
.admin-nav .nav-badge {
  background: rgba(255,255,255,0.25);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.admin-nav a:not(.active) .nav-badge {
  background: var(--danger);
  color: #fff;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s;
}
.admin-stat-card:hover { border-color: var(--primary); }
.admin-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-stat-icon svg { width: 24px; height: 24px; }
.admin-stat-icon--blue { background: rgba(59,130,246,0.12); color: #3b82f6; }
.admin-stat-icon--green { background: rgba(34,197,94,0.12); color: #22c55e; }
.admin-stat-icon--orange { background: rgba(249,115,22,0.12); color: #f97316; }
.admin-stat-icon--red { background: rgba(239,68,68,0.12); color: #ef4444; }
.admin-stat-icon--purple { background: rgba(168,85,247,0.12); color: #a855f7; }
.admin-stat-icon--cyan { background: rgba(6,182,212,0.12); color: #06b6d4; }
.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text);
}
.admin-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick links */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.quick-link-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
  position: relative;
}
.quick-link-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.quick-link-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.quick-link-text { flex: 1; }
.quick-link-title { font-weight: 600; font-size: 14px; display: block; }
.quick-link-desc { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }
.quick-link-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.quick-link-badge--danger { background: var(--danger); }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  overflow-x: auto;
}
.filter-tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab:hover { background: var(--bg-secondary); color: var(--text); }
.filter-tab--active { background: var(--primary); color: #fff; }

/* Data tables */
.table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead { border-bottom: 2px solid var(--border); }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--bg-secondary);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.td-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.td-phone { font-family: var(--font-mono); font-weight: 500; }
.td-ttn { font-family: var(--font-mono); font-size: 12px; }
.td-date { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.td-center { text-align: center; }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin-right: 4px; }
.td-email a { color: var(--primary); text-decoration: none; }
.td-email a:hover { text-decoration: underline; }
.td-api-keys { white-space: nowrap; }
.api-keys-stat { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.api-keys-count { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.api-keys-count svg { color: var(--text-muted); flex-shrink: 0; }
.api-keys-requests { color: var(--text-muted); font-size: 11px; }
.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px !important;
  font-style: italic;
}
.ttn-number { font-family: var(--font-mono); }
.ttn-badge--verified {
  background: var(--success);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 700;
}

/* Status / category / delivery / plan / role badges */
.status-badge, .category-badge, .delivery-badge, .plan-badge, .role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge--pending { background: rgba(249,115,22,0.15); color: #f97316; }
.status-badge--verified { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-badge--rejected { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-badge--disputed { background: rgba(168,85,247,0.15); color: #a855f7; }
.status-badge--open { background: rgba(249,115,22,0.15); color: #f97316; }
.status-badge--under_review { background: rgba(59,130,246,0.15); color: #3b82f6; }
.status-badge--resolved_clear { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-badge--resolved_reject { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-badge--active { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-badge--cleared { background: rgba(34,197,94,0.15); color: #22c55e; }

.category-badge--non_pickup { background: rgba(249,115,22,0.15); color: #f97316; }
.category-badge--fraud { background: rgba(239,68,68,0.15); color: #ef4444; }
.category-badge--address_switch { background: rgba(168,85,247,0.15); color: #a855f7; }
.category-badge--product_swap { background: rgba(239,68,68,0.15); color: #ef4444; }

.plan-badge--free { background: var(--bg-secondary); color: var(--text-muted); }
.plan-badge--basic { background: rgba(59,130,246,0.15); color: #3b82f6; }
.plan-badge--pro { background: rgba(168,85,247,0.15); color: #a855f7; }
.plan-badge--enterprise { background: rgba(249,115,22,0.15); color: #f97316; }

.role-badge--admin { background: rgba(239,68,68,0.15); color: #ef4444; }
.role-badge--moderator { background: rgba(59,130,246,0.15); color: #3b82f6; }
.role-badge--user { background: var(--bg-secondary); color: var(--text-muted); }

/* Active dot */
.active-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.active-dot--yes { background: #22c55e; }
.active-dot--no { background: var(--text-muted); opacity: 0.4; }

/* Actions group */
.actions-group { display: flex; gap: 4px; flex-wrap: nowrap; }

/* Submitter info */
.submitter-info { display: flex; flex-direction: column; }
.submitter-name { font-weight: 500; }
.submitter-phone { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* Shop info */
.shop-info { display: flex; flex-direction: column; }
.shop-name { font-weight: 500; }
.shop-url { font-size: 12px; color: var(--primary); text-decoration: none; }
.shop-url:hover { text-decoration: underline; }

/* Rejection reason */
.rejection-reason { font-size: 12px; color: var(--text-muted); cursor: help; }

/* Section title */
.admin-section { margin-top: 32px; }
.admin-section .section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

/* Admin pagination */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
  padding: 12px;
}
.admin-pagination a, .admin-pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--card);
}
.admin-pagination a:hover { background: var(--bg-secondary); border-color: var(--primary); }
.admin-pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.admin-pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Risk score bar (small inline) */
.risk-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
.risk-bar-fill {
  width: 40px; height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.risk-bar-fill span { display: block; height: 100%; border-radius: 3px; }
.risk-bar--clean .risk-bar-fill span { background: #22c55e; }
.risk-bar--low .risk-bar-fill span { background: #eab308; }
.risk-bar--medium .risk-bar-fill span { background: #f97316; }
.risk-bar--high .risk-bar-fill span { background: #ef4444; }
.risk-bar--critical .risk-bar-fill span { background: #991b1b; }

/* Admin search bar */
.admin-search {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.admin-search .form-input { flex: 1; max-width: 400px; }

/* Admin info card (buyer detail) */
.admin-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.admin-info-item { }
.admin-info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; }
.admin-info-value { font-size: 15px; font-weight: 500; color: var(--text); }
.admin-info-value.mono { font-family: var(--font-mono); }

/* Table summary line */
.table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* btn--danger */
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #dc2626; color: #fff; }

/* btn--secondary */
.btn--secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--border); }

/* form-control (textarea in modals) */
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,0,0,0.1); }

/* text-muted helper */
.text-muted { color: var(--text-muted); }

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-nav { flex-wrap: nowrap; }
  .quick-links { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ── Legal pages (terms, privacy) ───────────────────── */
.legal-section {
  padding: 48px 0 80px;
  font-family: var(--font-heading);
}
.legal-header {
  text-align: center;
  margin-bottom: 48px;
}
.legal-header .page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-updated {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-body);
  background: var(--primary-bg);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.75;
  font-size: 0.95rem;
}
.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-bg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-content h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}
.legal-content h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 10px;
}
.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.legal-content ul {
  margin: 10px 0 18px 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
}
.legal-content li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}
.legal-content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}
.legal-content a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.legal-content a:hover {
  border-bottom-color: var(--primary);
}
.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

/* Legal highlight box */
.legal-highlight {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 20px 0;
}
.legal-highlight p {
  margin-bottom: 0;
  color: var(--text);
}

/* Legal table of contents */
.legal-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 40px;
}
.legal-toc-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.legal-toc ol {
  margin: 0;
  padding: 0 0 0 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  columns: 2;
  column-gap: 32px;
}
.legal-toc li {
  margin-bottom: 6px;
}
.legal-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.legal-toc a:hover { color: var(--primary); }

@media (max-width: 768px) {
  .legal-header .page-title { font-size: 1.5rem; }
  .legal-toc ol { columns: 1; }
  .legal-content { font-size: 0.9rem; }
}

/* Footer legal links */
.footer-legal {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-legal a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color .2s;
}
.footer-legal a:hover { color: var(--text); }

/* ── Limit wall (rate limit for unauthenticated) ───────── */
.limit-wall {
  text-align: center;
  padding: 48px 24px;
  margin: 32px 0;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: var(--card);
}
.limit-wall-icon { margin-bottom: 16px; }
.limit-wall-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.limit-wall-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
}
.limit-wall-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== TTN Lookup (report form) ===== */
.input-with-btn {
  display: flex;
  gap: 6px;
}
.input-with-btn .form-input { flex: 1; }
.input-with-btn .btn { flex-shrink: 0; padding: 8px 12px; }

.ttn-lookup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.ttn-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 8px;
}
.ttn-status svg { flex-shrink: 0; }
.ttn-status--info { background: rgba(59,130,246,0.1); color: #2563eb; border: 1px solid rgba(59,130,246,0.2); }
.ttn-status--success { background: rgba(34,197,94,0.1); color: #16a34a; border: 1px solid rgba(34,197,94,0.2); }
.ttn-status--warning { background: rgba(234,179,8,0.1); color: #ca8a04; border: 1px solid rgba(234,179,8,0.2); }
.ttn-status--error { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dark-theme .ttn-status--info { background: rgba(59,130,246,0.15); }
.dark-theme .ttn-status--success { background: rgba(34,197,94,0.15); }
.dark-theme .ttn-status--warning { background: rgba(234,179,8,0.15); }
.dark-theme .ttn-status--error { background: rgba(239,68,68,0.15); }

/* ===== Consent checkbox ===== */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}
.consent-label:hover {
  border-color: var(--primary);
}
.consent-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.consent-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.consent-text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-text a:hover {
  color: var(--primary-hover);
}
