/* ==================== CSS RESET & VARIABLES ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0066FF;
  --primary-dark: #0052CC;
  --primary-light: #E8F0FF;
  --secondary: #00C853;
  --danger: #FF3D00;
  --warning: #FF9800;
  --bg: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-surface: #F8F9FA;
  --border: #E8ECF1;
  --text-primary: #1A1A2E;
  --text-secondary: #6C757D;
  --text-muted: #9CA3AF;
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; line-height: 1.3; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: 'Inter', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Inter', sans-serif; }
* { outline: none; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==================== LAYOUT ==================== */
#app { min-height: 100vh; }
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar-logo {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #0066FF, #0052CC);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: 0 2px 8px rgba(0,102,255,0.3);
}
.logo-text { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 16px; color: var(--text-primary); }
.logo-text span { color: var(--primary); }
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-item svg { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role { font-size: 11px; color: var(--text-muted); }
.signout-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 12px;
  background: none; border: none;
  color: var(--danger);
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.signout-btn:hover { background: #fff0ec; }

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--bg-surface);
}
.page-topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.page-title-h { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-content { padding: 28px; }

/* ==================== CARDS ==================== */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ==================== STAT CARDS ==================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
}
.stat-card.green::before { background: var(--secondary); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--text-primary); line-height: 1; margin-bottom: 6px; }
.stat-trend { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--secondary); }
.stat-trend.down { color: var(--danger); }
.stat-icon { position: absolute; right: 18px; top: 22px; opacity: 0.12; }
.stat-icon svg { width: 40px; height: 40px; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #0066FF, #0052CC);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,102,255,0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0,102,255,0.4);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: #eaecef; }
.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 8px rgba(255,61,0,0.2);
}
.btn-danger:hover { opacity: 0.9; }
.btn-success {
  background: var(--secondary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,200,83,0.2);
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-icon { padding: 8px; border-radius: 8px; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); }
.btn-icon:hover { background: var(--border); }

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-active { background: #dcfce7; color: #16a34a; }
.badge-paused { background: #fef9c3; color: #a16207; }
.badge-draft { background: #f1f5f9; color: #64748b; }
.badge-rejected { background: #fee2e2; color: #dc2626; }
.badge-pending { background: #fff7ed; color: #c2410c; }
.badge-completed { background: #dbeafe; color: #1d4ed8; }
.badge-approved { background: #dcfce7; color: #16a34a; }
.badge-processing { background: #ede9fe; color: #7c3aed; }
.badge-admin { background: #fce7f3; color: #be185d; }
.badge-client { background: #dbeafe; color: #1d4ed8; }
.badge-publisher { background: #dcfce7; color: #16a34a; }
.badge-suspended { background: #fee2e2; color: #dc2626; }
.badge-flagged { background: #fff7ed; color: #c2410c; }

/* ==================== TABLES ==================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--bg-surface); }
th {
  padding: 11px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text-primary); }
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #FAFBFC; }
tbody tr:hover { background: var(--primary-light); cursor: pointer; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-primary); }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
label .req { color: var(--danger); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="number"], input[type="url"], input[type="date"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}
input.error, select.error, textarea.error { border-color: var(--danger); }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.char-counter { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 2px; }
.char-counter.warn { color: var(--warning); }
.char-counter.over { color: var(--danger); }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.checkbox-item:hover { border-color: var(--primary); background: var(--primary-light); }
.checkbox-item input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-item label { cursor: pointer; margin: 0; font-weight: 400; font-size: 13.5px; }
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; }
.toggle {
  position: relative;
  width: 44px; height: 24px;
  display: inline-block;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  bottom: 3px; left: 3px;
  transition: 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ==================== WIZARD / STEPS ==================== */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 50%; right: -50%;
  top: 16px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step-item.completed:not(:last-child)::after { background: var(--primary); }
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  position: relative;
}
.step-item.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,102,255,0.3);
}
.step-item.completed .step-circle {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}
.step-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 6px; text-align: center; }
.step-item.active .step-label { color: var(--primary); }
.step-item.completed .step-label { color: var(--secondary); }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-secondary); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--bg-surface); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ==================== TABS ==================== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; gap: 4px; }
.tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--text-primary); background: var(--bg-surface); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ==================== FILTERS / SEARCH ==================== */
.filter-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search-input {
  position: relative; flex: 1; min-width: 200px; max-width: 320px;
}
.search-input input {
  padding-left: 36px;
  width: 100%;
}
.search-input .search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
select.filter-select {
  width: auto; min-width: 140px; padding: 9px 13px;
}

/* ==================== LOGIN PAGE ==================== */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #EBF3FF 0%, #F0F7FF 50%, #EBF3FF 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  width: 100%; max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,102,255,0.1);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-mark { justify-content: center; }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 28px; }
.auth-note { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 20px; }
.auth-note code { font-family: monospace; background: #e8ecf1; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.alert { padding: 12px 15px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ==================== SETUP PAGE ==================== */
.setup-page {
  min-height: 100vh;
  background: var(--bg-surface);
  padding: 40px 20px;
}
.setup-container { max-width: 700px; margin: 0 auto; }
.setup-header { text-align: center; margin-bottom: 32px; }
.setup-header h1 { font-size: 26px; margin-bottom: 8px; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }
.role-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.role-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,102,255,0.1); }
.role-card.selected { border-color: var(--primary); background: var(--primary-light); }
.role-card-icon { font-size: 36px; margin-bottom: 12px; }
.role-card h3 { font-size: 17px; margin-bottom: 6px; }
.role-card p { font-size: 13px; color: var(--text-secondary); }

/* ==================== CHART CONTAINERS ==================== */
.chart-container { position: relative; height: 260px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 24px; }

/* ==================== CODE BLOCKS ==================== */
.code-block {
  background: #1e2330;
  border-radius: 10px;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #a8c4e0;
  overflow-x: auto;
  line-height: 1.7;
  white-space: pre;
  position: relative;
}
.code-copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ccc;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.2); }

/* ==================== MISC UTILITIES ==================== */
.d-flex { display: flex; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 18px; }
.text-muted { color: var(--text-secondary); font-size: 13px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--secondary); }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.progress-bar-wrap { background: var(--border); border-radius: 4px; height: 6px; }
.progress-bar { background: var(--primary); height: 100%; border-radius: 4px; transition: width 0.3s; }
.info-card { background: var(--primary-light); border: 1px solid #b3d1ff; border-radius: 10px; padding: 14px 18px; }
.info-card p { font-size: 13.5px; color: #1a4fa3; }
.warning-card { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px 18px; }
.warning-card p { font-size: 13.5px; color: #9a3412; }
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.select-multi { min-height: 100px; }
.iframe-page { display: none; }
.legal-content { max-width: 860px; margin: 0 auto; }
.legal-content h1 { font-size: 28px; margin-bottom: 8px; }
.legal-content h2 { font-size: 18px; margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.legal-content h3 { font-size: 15px; margin: 16px 0 6px; color: var(--text-primary); }
.legal-content p, .legal-content li { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 10px; }
.legal-content ul, .legal-content ol { padding-left: 22px; margin-bottom: 12px; }
.legal-content ul li::marker { color: var(--primary); }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); gap: 10px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.tag.selected { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.textarea-domains { min-height: 80px; font-family: monospace; font-size: 12px; }
.ad-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--bg-surface);
  margin-top: 8px;
}
.ad-preview-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.review-section { background: var(--bg-surface); border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; }
.review-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px; }
.review-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.review-row:last-child { border-bottom: none; }
.review-row .label { color: var(--text-secondary); }
.review-row .val { font-weight: 600; }
.site-key-box { background: var(--bg-surface); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; font-family: monospace; font-size: 13px; color: var(--primary); letter-spacing: 0.05em; }
.steps-guide { counter-reset: step; }
.steps-guide li {
  counter-increment: step;
  display: flex; gap: 14px; margin-bottom: 18px;
  list-style: none;
}
.steps-guide li::before {
  content: counter(step);
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.audit-detail { font-size: 12px; color: var(--text-muted); font-family: monospace; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slider-wrap { display: flex; align-items: center; gap: 14px; }
input[type="range"] { flex: 1; accent-color: var(--primary); }
.slider-val { font-weight: 700; font-size: 16px; color: var(--primary); min-width: 40px; text-align: center; }
.feature-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.feature-toggle-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.feature-toggle-info h4 { font-size: 14px; font-weight: 600; }
.feature-toggle-info p { font-size: 12px; color: var(--text-muted); }
.overrides-table { font-size: 13.5px; }
.test-result { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; }
.test-result.pass { background: #dcfce7; color: #16a34a; }
.test-result.fail { background: #fee2e2; color: #dc2626; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.period-selector { padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; color: var(--text-primary); cursor: pointer; }
.breadcrumb { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-primary); font-weight: 600; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

/* ==================== VALIDATION ==================== */
.field-error-input {
  border-color: #FF3D00 !important;
  box-shadow: 0 0 0 2px rgba(255,61,0,0.15) !important;
}
.error-message {
  color: #FF3D00;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}
.field-success {
  border-color: #00C853 !important;
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6C757D;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.empty-state h3 {
  color: #1A1A2E;
  margin-bottom: 8px;
  font-size: 18px;
}
.empty-state p {
  margin-bottom: 24px;
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #E8ECF1;
  border-top-color: #0066FF;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: #6C757D;
}

/* ==================== BADGE POLISH ==================== */
.badge-paid { background: #E8F5E9; color: #2E7D32; }
.badge-issued { background: #FFF3E0; color: #E65100; }
.badge-processing { background: #FFF3E0; color: #E65100; }
.badge-failed { background: #FFEBEE; color: #C62828; }
.badge-overdue { background: #FFEBEE; color: #C62828; }
.badge-requires_review { background: #FFF8E1; color: #F57F17; }

/* ==================== TABLE IMPROVEMENTS ==================== */
.data-table tbody tr:hover {
  background-color: #F0F7FF;
}
.data-table td, .data-table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* ==================== TOAST SYSTEM ==================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  max-width: 400px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  pointer-events: all;
}
.toast-success { background: #00C853; }
.toast-error { background: #FF3D00; }
.toast-info { background: #0066FF; }
.toast-warn { background: #FF9800; }
@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; }
}

/* ==================== RESPONSIVE MOBILE ==================== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
  color: var(--text-primary);
  cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1000;
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex !important; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
  .sidebar-overlay.open { display: block; }
}

/* ==================== CHART IMPROVEMENTS ==================== */
.chart-container { position: relative; min-height: 300px; }

/* ==================== LANDING PAGE ==================== */

/* Base */
.landing-page {
  background: #fff;
  width: 100%;
  overflow-x: hidden;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Container */
.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Section scroll animation */
.landing-section {
  padding: 88px 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.landing-section.visible { opacity: 1; }

/* Alternating backgrounds */
.alt-bg { background: #f8f9fa; }

/* ---- HERO ---- */
.landing-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 60px;
}

.landing-hero-left {
  flex: 0 0 60%;
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.landing-hero-right {
  flex: 0 0 40%;
  max-width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero auth card override — smaller padding */
.hero-auth-card {
  max-width: 100% !important;
  padding: 32px 36px !important;
  width: 100%;
}

/* Hero pill badge */
.hero-pill {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0,102,255,0.18);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: fit-content;
}

/* Hero headline */
.hero-headline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.12;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Hero subheadline */
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 540px;
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
}

/* Shiny primary button */
.btn-shiny {
  background: linear-gradient(135deg, #0077ff 0%, #0052CC 100%) !important;
  box-shadow: 0 4px 18px rgba(0,102,255,0.30), 0 1px 3px rgba(0,0,0,0.08) !important;
  border: none !important;
  transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}
.btn-shiny:hover {
  box-shadow: 0 6px 28px rgba(0,102,255,0.42), 0 2px 6px rgba(0,0,0,0.10) !important;
  transform: translateY(-1px);
}

/* Outline button */
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* Large button variant */
.btn-lg { padding: 13px 28px !important; font-size: 15px !important; }

/* Hero metrics */
.hero-metrics {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--text-primary);
  line-height: 1.2;
}
.hero-metric-label {
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.hero-metric-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- SECTION LABELS / TITLES ---- */
.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 12px;
}
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3vw, 40px);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}
.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 580px;
}

/* ---- LOGO BAR ---- */
.logo-bar-section {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 !important;
  background: #fff;
}
.logo-bar-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}
.logo-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #c0c7d0;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.logo-brand:hover { color: #8a929e; }

/* ---- HOW IT WORKS ---- */
.how-it-works-section .section-title,
.how-it-works-section .section-subtitle,
.how-it-works-section .section-label {
  text-align: center;
}
.how-it-works-section .section-subtitle {
  margin: 0 auto 48px;
}
.steps-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
  margin-top: 48px;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 32px 0 0;
  position: relative;
}
.step-item:last-child { padding-right: 0; }
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.step-connector {
  position: absolute;
  top: 22px;
  left: 44px;
  right: -8px;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.step-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.step-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---- TWO-COLUMN SECTIONS ---- */
.two-col-section {
  display: flex;
  align-items: flex-start;
  gap: 64px;
}
.two-col-section.reversed {
  flex-direction: row-reverse;
}
.two-col-text {
  flex: 0 0 38%;
  max-width: 38%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 8px;
}
.two-col-cards {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Feature cards */
.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.feature-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.alt-bg .feature-card { background: #fff; }
.feature-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1;
}
.feature-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.feature-card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- PLATFORM GRID (3x3) ---- */
.platform-section .section-title {
  text-align: center;
  margin-bottom: 40px;
}
.platform-section .section-label { text-align: center; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.platform-feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 22px;
  transition: box-shadow 0.18s ease;
}
.platform-feature:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.platform-feature-icon {
  font-size: 24px;
  margin-bottom: 12px;
  line-height: 1;
}
.platform-feature h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.platform-feature p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- REVENUE MODEL ---- */
.revenue-layout {
  display: flex;
  align-items: center;
  gap: 64px;
}
.revenue-text {
  flex: 0 0 42%;
}
.revenue-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.revenue-bar-wrap {
  border-radius: 12px;
  overflow: hidden;
}
.revenue-bar {
  display: flex;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
}
.revenue-bar-pub {
  flex: 60;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
}
.revenue-bar-pub span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}
.revenue-bar-plat {
  flex: 40;
  background: #1A1A2E;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
}
.revenue-bar-plat span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
}
.revenue-bar-labels {
  display: flex;
  gap: 24px;
}
.revenue-bar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.pub { background: var(--primary); }
.legend-dot.plat { background: #1A1A2E; }

/* ---- STATS SECTION ---- */
.stats-section {
  text-align: center;
}
.stats-grid {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 48px;
  border-right: 1px solid var(--border);
}
.stat-block:last-child { border-right: none; }
.stat-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 4vw, 48px);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-label {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stats-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ---- CTA SECTION ---- */
.cta-section {
  background: #fff;
}
.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.cta-inner .section-subtitle { margin: 0 auto; }
.cta-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

/* ---- FOOTER ---- */
.landing-footer {
  background: var(--text-primary);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  transition: color 0.18s ease;
  text-decoration: none;
}
.footer-links a:hover {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
}
.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.footer-powered {
  font-size: 12.5px;
  color: rgba(255,255,255,0.28);
}

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 900px) {
  .landing-hero {
    flex-direction: column;
    min-height: auto;
    padding: 60px 24px;
    gap: 40px;
  }
  .landing-hero-left,
  .landing-hero-right {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .hero-auth-card {
    padding: 28px 24px !important;
  }
  .landing-container { padding: 0 24px; }
  .landing-section { padding: 60px 0; }
}
@media (max-width: 768px) {
  .steps-flow {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .step-connector { display: none; }
  .two-col-section,
  .two-col-section.reversed {
    flex-direction: column;
    gap: 32px;
  }
  .two-col-text {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .two-col-cards { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .revenue-layout { flex-direction: column; gap: 32px; }
  .revenue-text { flex: 0 0 100%; }
  .stats-grid { gap: 0; }
  .stat-block {
    padding: 20px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .stat-block:last-child { border-bottom: none; }
  .logo-bar { gap: 24px; }
  .hero-metrics { gap: 16px; }
  .hero-metric-divider { display: none; }
}
@media (max-width: 480px) {
  .platform-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
}
