/* ============================================================
   PORTAL DESIGN SYSTEM — CM Digital
   All CSS custom properties, reset, and shared components
   ============================================================ */

/* ============================================================
   1. ROOT VARIABLES — Design tokens
   ============================================================ */
:root {
  /* Brand Colors */
  --accent:          #2563eb;
  --accent-dark:     #1d4ed8;
  --accent-light:    #dbeafe;

  /* Layout Colors */
  --sidebar-bg:      #0f172a;
  --sidebar-width:   240px;
  --main-bg:         #f1f5f9;
  --card-bg:         #ffffff;
  --topbar-height:   56px;

  /* Text */
  --text-primary:    #0f172a;
  --text-secondary:  #64748b;
  --text-muted:      #94a3b8;
  --text-inverse:    #ffffff;

  /* Borders */
  --border:          #e2e8f0;
  --border-focus:    #2563eb;

  /* Border Radius */
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;

  /* Shadows */
  --shadow-sm:       0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:       0 4px 16px rgba(0, 0, 0, 0.10);

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

  /* Status Colors */
  --status-new:       #2563eb;
  --status-contacted: #7c3aed;
  --status-qualified:  #d97706;
  --status-converted:  #16a34a;
  --status-lost:       #dc2626;

  /* Spacing Scale */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
}

/* ============================================================
   2. RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================================
   3. LAYOUT — Portal Shell
   ============================================================ */
.portal-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  position: sticky;
  top: 0;
  height: 100vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-mark svg {
  width: 16px;
  height: 16px;
  color: white;
}

.sidebar-logo-text {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
  padding: var(--space-4) var(--space-5) var(--space-2);
  margin-top: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-5);
  color: rgba(255,255,255,0.6);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.25);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item.muted {
  color: rgba(255,255,255,0.35);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  letter-spacing: 0.02em;
}

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: var(--space-3) 0;
}

/* ============================================================
   5. TOPBAR
   ============================================================ */
.portal-topbar {
  grid-area: topbar;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition);
}

.hamburger:hover {
  background: var(--main-bg);
}

.hamburger svg {
  width: 20px;
  height: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
}

.topbar-user-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============================================================
   6. CONTENT AREA
   ============================================================ */
.portal-content {
  grid-area: content;
  padding: var(--space-6);
  overflow-x: hidden;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ============================================================
   7. CARDS
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  gap: var(--space-3);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-5);
}

.card + .card {
  margin-top: var(--space-4);
}

/* ============================================================
   8. KPI STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-trend {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up {
  color: var(--status-converted);
}

.stat-trend.down {
  color: var(--status-lost);
}

/* ============================================================
   9. TABLES
   ============================================================ */
.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrap table {
  min-width: 600px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table th {
  background: var(--main-bg);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table tbody tr:last-child td {
  border-bottom: none;
}

table tbody tr:hover td {
  background: #f8fafc;
}

.table-empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
  font-size: 14px;
}

.table-empty svg {
  width: 40px;
  height: 40px;
  color: var(--border);
  margin: 0 auto var(--space-3);
}

/* ============================================================
   10. STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.4;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-new {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-contacted {
  background: #f5f3ff;
  color: #6d28d9;
}

.badge-qualified {
  background: #fffbeb;
  color: #b45309;
}

.badge-converted {
  background: #f0fdf4;
  color: #15803d;
}

.badge-lost {
  background: #fef2f2;
  color: #b91c1c;
}

.badge-active {
  background: #f0fdf4;
  color: #15803d;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.badge-draft {
  background: #f1f5f9;
  color: #64748b;
}

.badge-soon {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.badge-event-page_view {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-event-form_submit {
  background: #f0fdf4;
  color: #15803d;
}

.badge-event-button_click {
  background: #f5f3ff;
  color: #6d28d9;
}

.badge-event-book_click {
  background: #fffbeb;
  color: #b45309;
}

/* ============================================================
   11. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--main-bg);
  border-color: #cbd5e1;
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--main-bg);
  color: var(--text-primary);
}

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
}

/* ============================================================
   12. FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--status-lost);
  margin-left: 2px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}

.form-checkbox-label {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}

.form-checkbox-label small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ============================================================
   13. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(2px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover {
  background: var(--main-bg);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ============================================================
   14. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--text-primary);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.25s ease forwards;
}

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

.toast svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.toast-success {
  background: #15803d;
}

.toast-error {
  background: #b91c1c;
}

.toast-info {
  background: var(--accent-dark);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}

/* ============================================================
   15. PLACEHOLDER PAGES
   ============================================================ */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  min-height: 420px;
}

.placeholder-icon {
  width: 72px;
  height: 72px;
  background: var(--main-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.placeholder-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

.placeholder-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: var(--space-4);
}

.placeholder-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.placeholder-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* ============================================================
   16. DEMO MODE BANNER
   ============================================================ */
.demo-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--accent-light);
  border: 1px solid #93c5fd;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: var(--space-6);
  font-size: 13.5px;
  color: #1e40af;
}

.demo-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}

.demo-banner strong {
  font-weight: 700;
}

/* ============================================================
   17. RESPONSIVE — Sidebar collapses at 768px
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 90;
}

.sidebar-overlay.open {
  display: block;
}

@media (max-width: 768px) {
  .portal-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: flex;
  }

  .portal-content {
    padding: var(--space-4);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    max-width: 100%;
  }
}

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

  .portal-content {
    padding: var(--space-3);
  }

  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    bottom: var(--space-3);
  }

  .toast {
    min-width: unset;
    width: 100%;
  }
}

/* ============================================================
   18. UTILITY CLASSES
   ============================================================ */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1; }

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }

.mt-2   { margin-top: var(--space-2); }
.mt-3   { margin-top: var(--space-3); }
.mt-4   { margin-top: var(--space-4); }
.mt-6   { margin-top: var(--space-6); }
.mb-4   { margin-bottom: var(--space-4); }
.mb-6   { margin-bottom: var(--space-6); }

.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm        { font-size: 13px; }
.text-xs        { font-size: 11.5px; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }
.font-mono      { font-family: 'Courier New', Courier, monospace; letter-spacing: 0.04em; }

.w-full         { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.filter-row .form-select,
.filter-row .form-input {
  width: auto;
  min-width: 160px;
}

.info-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-box strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.section-gap {
  margin-bottom: var(--space-6);
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

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

.funnel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.funnel-row:last-child {
  border-bottom: none;
}

.funnel-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.funnel-bar-wrap {
  flex: 2;
  height: 8px;
  background: var(--main-bg);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.funnel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 32px;
  text-align: right;
}
