:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --accent: #14b8a6;
  --bg-ivory: #fafaf7;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg-ivory); color: var(--text); }

/* Buttons */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn { border-radius: 10px; font-weight: 500; }

/* Cards */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--bg-white); }
.card:hover { box-shadow: var(--shadow-md); transition: box-shadow .2s; }

/* Landing */
.landing-body { background: linear-gradient(180deg,#fafaf7 0%,#f0f4ff 100%); min-height: 100vh; }
.hero { padding: 60px 0; }
.gradient-text { background: linear-gradient(90deg,#4f46e5,#14b8a6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badge-soft { display: inline-block; padding: 6px 14px; background: rgba(79,70,229,.1); color: var(--primary); border-radius: 99px; font-size: 12px; font-weight: 600; }
.card-float { background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(79,70,229,.15); padding: 32px; }
.mini-stat { background: #f8faff; border-radius: 14px; padding: 20px; }
.mini-stat small { color: var(--text-muted); font-size: 12px; }
.mini-stat h3 { font-size: 28px; font-weight: 700; margin: 6px 0; }
.feature-card { transition: transform .25s, box-shadow .25s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(79,70,229,.12); }
.feature-icon { font-size: 32px; width: 56px; height: 56px; display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg,#eef2ff,#f0fdfa); border-radius: 14px; }

/* Auth */
.auth-body { background: linear-gradient(135deg,#fafaf7,#eef2ff); min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 20px; padding: 40px 32px; }
.auth-logo { font-size: 24px; font-weight: 800; color: var(--text); text-decoration: none; }

/* Dashboard */
.dash-body { background: #fafaf7; }
.dash-header {
  display: flex; align-items: center; padding: 14px 24px;
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand-mini { font-weight: 800; font-size: 20px; text-decoration: none; color: var(--text); }
.btn-sidebar-toggle { background: none; border: 0; font-size: 20px; padding: 4px 10px; cursor: pointer; }
.global-search { background: #f8f8f5; border-color: var(--border); }
.icon-btn { text-decoration: none; font-size: 18px; color: var(--text); }
.user-chip { background: none; border: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.user-chip:hover { background: #f3f4f6; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#4f46e5,#14b8a6); color:#fff; display:grid; place-items:center; font-weight:700; font-size:14px; }

.dash-shell { display: flex; min-height: calc(100vh - 61px); }
.dash-sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--border);
  padding: 20px 12px;
  overflow-y: auto;
}
.dash-sidebar .nav-link {
  padding: 9px 14px; border-radius: 10px; color: var(--text-muted); font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
}
.dash-sidebar .nav-link:hover { background: #f5f5ff; color: var(--primary); }
.dash-sidebar .nav-link.active { background: linear-gradient(90deg,#eef2ff,#f0fdfa); color: var(--primary); font-weight: 600; }
.dash-main { flex: 1; min-width: 0; }
.dash-container { padding: 28px 32px; max-width: 1400px; margin: 0 auto; }
.dash-footer { padding: 24px 0; text-align: center; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); margin-top: 40px; }

/* Sidebar mobile */
@media (max-width: 768px) {
  .dash-sidebar {
    position: fixed; top: 61px; left: -260px; bottom: 0; z-index: 99;
    transition: left .25s; box-shadow: 0 20px 60px rgba(0,0,0,.15);
  }
  body.sidebar-open .dash-sidebar { left: 0; }
  .dash-container { padding: 20px; }
}

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }

/* KPI cards */
.kpi-card { transition: transform .15s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-value { font-size: 26px; font-weight: 700; margin: 0; }
.kpi-icon { font-size: 22px; opacity: .85; }

/* Empty states */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-illustration { font-size: 48px; margin-bottom: 12px; }

/* Ad preview */
.preview-box { background: #fafaff; border: 1px dashed var(--border); border-radius: 12px; padding: 20px; }
.ad-preview { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; max-width: 320px; }

/* Format tiles */
.format-tile { display: block; cursor: pointer; padding: 12px; border: 1px solid var(--border); border-radius: 10px; text-align: center; font-size: 13px; font-weight: 500; transition: all .2s; }
.format-tile:hover { border-color: var(--primary); background: #f5f5ff; }
.format-tile input { display: none; }
.format-tile input:checked + span { color: var(--primary); }
.format-tile:has(input:checked) { border-color: var(--primary); background: #eef2ff; }