/* ===== ShootAds Design System ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;

  --bg: #0f0f17;
  --bg-card: #16161f;
  --bg-card2: #1e1e2e;
  --border: #2a2a3e;
  --border-light: #35354a;

  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --sidebar-w: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; }

/* ===== LAYOUT ===== */
.app-layout .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}

.app-layout .main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.sidebar-brand { padding: 20px; }
.brand-link {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text);
  text-decoration: none;
}

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 4px 12px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; font-size: 13.5px;
  transition: all 0.15s; margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-card2); color: var(--text); }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--primary-light); }

.sidebar-bottom { padding: 16px; border-top: 1px solid var(--border); }
.balance-chip {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card2); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 10px;
}
.balance-label { font-size: 12px; color: var(--text-muted); }
.balance-amount { font-weight: 700; color: var(--success); font-size: 15px; }
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 13px; padding: 8px 4px;
  transition: color 0.15s;
}
.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover { color: var(--danger); }

.top-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  background: var(--bg-card); position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 17px; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }
.menu-toggle svg { width: 22px; height: 22px; }

.page-body { padding: 28px; flex: 1; }

/* ===== PUBLIC LAYOUT ===== */
.public-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,15,23,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.public-header .container {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.pub-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text);
}
.pub-nav { display: flex; align-items: center; gap: 24px; }
.pub-nav a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
.pub-nav a:hover { color: var(--text); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

.public-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand span { font-size: 17px; font-weight: 700; }
.footer-brand p { color: var(--text-muted); font-size: 13px; }
.footer-col h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 13px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.indigo { background: rgba(99,102,241,0.15); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon.blue { background: rgba(14,165,233,0.15); color: var(--secondary); }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: var(--purple); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  border: none; transition: all 0.15s; text-decoration: none;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-ghost { background: var(--bg-card2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); }
.btn svg { width: 16px; height: 16px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-card2); }
th { padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; text-align: left; }
td { padding: 13px 16px; font-size: 13.5px; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== BADGES ===== */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-active, .badge-completed { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-paused { background: rgba(100,116,139,0.15); color: #64748b; }
.badge-rejected, .badge-suspended { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-advertiser { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.badge-publisher { background: rgba(14,165,233,0.15); color: var(--secondary); }
.badge-admin { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-banner { background: rgba(16,185,129,0.12); color: #10b981; }
.badge-pop { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-both { background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.15)); color: var(--primary-light); border: 1px solid rgba(99,102,241,0.2); }

.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted);
  padding: 12px 12px 4px; margin-top: 4px;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 13.5px;
}
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-info { background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.3); color: #7dd3fc; }
.alert ul { margin-left: 16px; }

/* ===== AUTH PAGES ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo a { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--text); }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 13px; }

/* ===== HOME PAGE ===== */
.hero {
  text-align: center; padding: 90px 24px 60px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25);
  color: var(--primary-light); padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(32px, 5vw, 58px); font-weight: 800; line-height: 1.1; margin-bottom: 20px; }
.hero h1 span { background: linear-gradient(135deg, #6366f1, #8b5cf6, #0ea5e9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 17px; color: var(--text-dim); max-width: 560px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features { padding: 70px 0; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 34px; font-weight: 700; margin-bottom: 12px; }
.section-header p { color: var(--text-dim); font-size: 16px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.feature-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.7; }

.pricing { padding: 70px 0; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; max-width: 800px; margin: 0 auto; }
.pricing-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center;
}
.pricing-card.featured { border-color: var(--primary); background: rgba(99,102,241,0.05); }
.pricing-name { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.pricing-rate { font-size: 36px; font-weight: 800; margin-bottom: 4px; }
.pricing-rate span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.pricing-desc { font-size: 13px; color: var(--text-muted); }

.how-it-works { padding: 70px 0; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; counter-reset: steps; }
.step { counter-increment: steps; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; margin-bottom: 14px;
}
.step h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 13.5px; }

.cta-section {
  padding: 80px 24px; text-align: center;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(99,102,241,0.1) 0%, transparent 70%);
}
.cta-section h2 { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.cta-section p { color: var(--text-dim); font-size: 16px; margin-bottom: 32px; }

/* ===== AD CODE BOX ===== */
.code-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  font-family: 'Courier New', monospace; font-size: 12px;
  color: #a5f3fc; overflow-x: auto; white-space: pre-wrap;
  word-break: break-all;
}
.copy-btn { margin-top: 12px; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 18px; font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 13.5px; margin-bottom: 20px; }

/* ===== SECTION SEPARATOR ===== */
.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 14px; color: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app-layout .sidebar {
    transform: translateX(-100%); transition: transform 0.25s;
  }
  .app-layout.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .app-layout .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .top-bar { padding: 14px 18px; }
  .page-body { padding: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 60px 20px 40px; }
}

/* ===== NOTIFICATION BELL ===== */
.notif-wrap { position: relative; }
.notif-btn { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; cursor: pointer; color: var(--text-dim); display: flex; align-items: center; position: relative; transition: border-color 0.15s; }
.notif-btn:hover { border-color: var(--primary); color: var(--text); }
.notif-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.notif-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); z-index: 999; overflow: hidden; }
.notif-dropdown.open { display: block; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 16px; text-decoration: none; color: var(--text); transition: background 0.15s; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-card2); }
.notif-item.unread { background: rgba(99,102,241,0.06); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.notif-dot-success { background: #10b981; }
.notif-dot-danger  { background: #ef4444; }
.notif-dot-warning { background: #f59e0b; }
.notif-dot-info    { background: #6366f1; }

/* ===== SUPPORT TICKET ===== */
.ticket-msg { padding: 14px 18px; border-radius: 10px; margin-bottom: 12px; max-width: 80%; }
.ticket-msg.user  { background: var(--bg-card2); margin-right: auto; }
.ticket-msg.admin { background: rgba(99,102,241,0.15); margin-left: auto; border: 1px solid rgba(99,102,241,0.3); }
.priority-urgent { color: #ef4444; }
.priority-high   { color: #f59e0b; }
.priority-normal { color: #94a3b8; }
.priority-low    { color: #475569; }

/* ===== INVOICE ===== */
@media print {
  .sidebar, .top-bar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; }
  .page-body { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .invoice-box { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ===== LIGHT MODE ===== */
body.light-mode {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card2: #f8fafc;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #475569;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}
body.light-mode .sidebar { background: #1e1e2e; } /* keep sidebar dark */
body.light-mode .stat-card { background: #fff; border-color: #e2e8f0; }
body.light-mode .table-wrap { background: #fff; }
body.light-mode .form-control { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
body.light-mode .top-bar { background: #ffffff; border-bottom: 1px solid #e2e8f0; }
body.light-mode .notif-dropdown { background: #fff; }
body.light-mode .notif-item:hover { background: #f8fafc; }
body.light-mode code { background: #e2e8f0 !important; color: #334155 !important; }

/* Theme toggle button */
.theme-toggle { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; color: var(--text-dim); font-size: 16px; transition: border-color 0.15s; }
.theme-toggle:hover { border-color: var(--primary); }

/* ===== 2FA styles ===== */
.otp-input { letter-spacing: 8px; font-size: 24px; font-weight: 700; text-align: center; font-family: monospace; }
.qr-wrap { text-align: center; padding: 20px; background: #fff; border-radius: 12px; display: inline-block; }
