/* ================================================================
   AiTenzo — Modern Design System v2
   Light theme only. Clean, minimal, professional.
   Brand: #2563EB (blue) → #7C3AED (violet)
   ================================================================ */

/* ── 1. Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #0F172A;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
/* CRITICAL: respect the hidden attribute (default user-agent stylesheet) */
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
a { color: #2563EB; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── 2. CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand */
  --blue:   #2563EB;
  --violet: #7C3AED;
  --grad:   linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --grad-soft: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));

  /* Semantic */
  --success: #16A34A; --warning: #D97706; --danger: #DC2626; --info: #0284C7;

  /* Surfaces */
  --bg:        #FFFFFF;
  --bg-soft:   #F8F9FF;
  --bg-muted:  #F1F5F9;
  --surface:   #FFFFFF;
  --border:    #E2E8F0;
  --border-focus: #2563EB;

  /* Text */
  --text-1: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  /* Type */
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  /* Radius */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 16px rgba(15,23,42,.08), 0 1px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 60px rgba(15,23,42,.12), 0 4px 16px rgba(15,23,42,.06);
  --shadow-brand: 0 8px 32px rgba(37,99,235,.24);
}

/* ── 3. Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  color: var(--text-1);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}
h1 { font-size: clamp(38px, 5vw, 64px); }
h2 { font-size: clamp(28px, 3.5vw, 44px); }
h3 { font-size: clamp(18px, 2vw, 24px); }
h4 { font-size: 18px; }
p  { color: var(--text-2); }

.text-gradient {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted   { color: var(--text-3); }
.text-sm      { font-size: 13px; }
.text-xs      { font-size: 12px; }
.text-center  { text-align: center; }
.font-mono    { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ── 4. Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 24px;
}
.container--sm  { max-width: 720px;  margin-inline: auto; padding-inline: 24px; }
.container--md  { max-width: 900px;  margin-inline: auto; padding-inline: 24px; }
.container--lg  { max-width: 1280px; margin-inline: auto; padding-inline: 24px; }

.section        { padding-block: 80px; }
.section--sm    { padding-block: 48px; }
.section--lg    { padding-block: 120px; }

.row            { display: flex; align-items: center; }
.row.gap-2      { gap: 8px; }
.row.gap-3      { gap: 12px; }
.row.gap-4      { gap: 16px; }
.row.gap-6      { gap: 24px; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.items-start     { align-items: flex-start; }

.grid            { display: grid; gap: 24px; }
.grid--2         { grid-template-columns: repeat(2, 1fr); }
.grid--3         { grid-template-columns: repeat(3, 1fr); }
.grid--4         { grid-template-columns: repeat(4, 1fr); }

.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.ml-auto { margin-left: auto; }

/* ── 5. Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 66px;
}
.nav__inner {
  display: flex; align-items: center; gap: 8px;
  height: 100%;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-right: 16px;
}
.nav__brand img, .nav__brand svg { height: 36px; width: auto; }
.nav__brand-name { font-size: 18px; font-weight: 800; color: var(--text-1); }

.nav__links {
  display: flex; align-items: center; gap: 2px;
  list-style: none; flex: 1;
}
.nav__links a {
  display: block; padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color .15s, background .15s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text-1); background: var(--bg-muted); }

.nav__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Mobile hamburger */
.nav__hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__mobile { display: none; }

/* ── 6. Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: all .18s;
  text-decoration: none; white-space: nowrap; line-height: 1.3;
}
.btn:focus-visible { outline: 3px solid rgba(37,99,235,.3); outline-offset: 2px; }

.btn--primary {
  background: var(--grad);
  color: #fff; border-color: transparent;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { opacity: .88; box-shadow: 0 12px 40px rgba(37,99,235,.32); text-decoration: none; transform: translateY(-1px); }

.btn--outline {
  background: #fff; color: var(--text-1);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn--outline:hover { border-color: #CBD5E1; background: var(--bg-muted); text-decoration: none; }

.btn--ghost { background: none; color: var(--text-2); border-color: transparent; }
.btn--ghost:hover { background: var(--bg-muted); color: var(--text-1); text-decoration: none; }

.btn--danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn--danger:hover { opacity: .88; text-decoration: none; }

.btn--sm  { padding: 7px 14px; font-size: 13px; }
.btn--lg  { padding: 14px 28px; font-size: 16px; border-radius: var(--r); }
.btn--xl  { padding: 16px 36px; font-size: 17px; border-radius: var(--r-lg); }
.btn--block { width: 100%; }

.btn:disabled { opacity: .5; pointer-events: none; }
.btn .spin { border-color: rgba(255,255,255,.3); border-top-color: #fff; }

/* ── 7. Forms ─────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-1);
}
.input, .textarea, .select {
  width: 100%; padding: 10px 14px;
  background: #fff; color: var(--text-1);
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: 14px; transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.textarea { resize: vertical; min-height: 100px; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237E89AE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input.is-error { border-color: var(--danger); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.error-msg { font-size: 12px; color: var(--danger); margin-top: 5px; }

/* ── 8. Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.card--elevated { box-shadow: var(--shadow); }
.card--flush { padding: 0; }

/* ── 9. Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge--blue    { background: #EFF6FF; color: #1D4ED8; }
.badge--violet  { background: #EDE9FE; color: #6D28D9; }
.badge--green   { background: #DCFCE7; color: #15803D; }
.badge--amber   { background: #FEF3C7; color: #92400E; }
.badge--red     { background: #FEE2E2; color: #B91C1C; }
.badge--gray    { background: #F1F5F9; color: #475569; }
.badge--success { background: #DCFCE7; color: #15803D; }
.badge--warning { background: #FEF3C7; color: #92400E; }
.badge--danger  { background: #FEE2E2; color: #B91C1C; }

/* ── 10. Section headers ──────────────────────────────────────── */
.section-label {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grad-soft); border: 1px solid rgba(37,99,235,.15);
  border-radius: var(--r-full); padding: 5px 14px;
  font-size: 13px; font-weight: 600; color: var(--blue);
  margin-bottom: 20px;
}
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h2 { margin-bottom: 16px; }
.section-header p  { font-size: 18px; max-width: 600px; margin-inline: auto; }

/* ── 11. Hero ─────────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #F8F9FF 0%, #FFFFFF 60%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(37,99,235,.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: var(--r-full); padding: 5px 16px;
  font-size: 13px; font-weight: 600; color: #1D4ED8;
  margin-bottom: 24px;
}
.hero__title {
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -.03em; margin-bottom: 24px;
}
.hero__subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-2); line-height: 1.65;
  max-width: 600px; margin-bottom: 40px;
}
.hero__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* ── 12. Feature cards ────────────────────────────────────────── */
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
  background: var(--grad-soft);
}
.feature-card { border-radius: var(--r-lg); padding: 28px; background: #fff; border: 1px solid var(--border); transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p  { font-size: 14px; }

/* ── 13. Pricing ──────────────────────────────────────────────── */
.pricing-toggle {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--bg-muted); border-radius: var(--r-full);
  padding: 4px; margin-bottom: 48px;
}
.pricing-toggle button {
  padding: 8px 20px; border-radius: var(--r-full);
  border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: all .2s;
}
.pricing-toggle button.is-active {
  background: #fff; color: var(--text-1);
  box-shadow: var(--shadow-sm);
}
.currency-toggle {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--bg-muted); border-radius: var(--r-full);
  padding: 4px;
}
.currency-toggle button {
  padding: 6px 16px; border-radius: var(--r-full);
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  transition: all .2s;
}
.currency-toggle button.is-active {
  background: #fff; color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

.pricing-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--r-xl); padding: 32px;
  position: relative; transition: transform .2s, box-shadow .2s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card--popular {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.08), var(--shadow);
}
.popular-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #fff;
  padding: 4px 18px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pricing-price {
  font-size: 48px; font-weight: 800;
  color: var(--text-1); line-height: 1; margin: 20px 0 6px;
}
.pricing-price sup { font-size: 22px; vertical-align: super; font-weight: 700; }
.pricing-period { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.pricing-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.pricing-features li::before { content: '✓'; color: var(--blue); font-weight: 700; flex-shrink: 0; }
.pricing-features li.na { color: var(--text-3); }
.pricing-features li.na::before { content: '–'; color: var(--text-3); }

/* ── 14. Progress bars ────────────────────────────────────────── */
.progress-track { height: 6px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; }
.progress-fill  { height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }

/* ── 15. Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table  { width: 100%; border-collapse: collapse; font-size: 14px; }
thead  { background: var(--bg-muted); }
th     { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); white-space: nowrap; }
td     { padding: 14px 16px; border-top: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
tbody tr:hover { background: var(--bg-soft); }

/* ── 16. Alerts & Toasts ──────────────────────────────────────── */
.alert { padding: 14px 16px; border-radius: var(--r); font-size: 14px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.alert--success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; }
.alert--error   { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; }
.alert--warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert--info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8; }

/* Toasts */
#toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 16px; font-size: 13px; font-weight: 500; color: var(--text-1);
  box-shadow: var(--shadow-lg); pointer-events: auto;
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
  animation: slideIn .25s ease; border-left: 3px solid var(--border);
}
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger);  }
.toast--warning { border-left-color: var(--warning); }
.toast--info    { border-left-color: var(--blue);    }
.toast.fade-out { animation: slideOut .25s ease forwards; }
@keyframes slideIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes slideOut { to   { opacity:0; transform:translateX(20px); } }

/* ── 17. Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 8888;
  background: rgba(15,23,42,.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .2s ease;
}
.modal-card {
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 32px;
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; animation: scaleIn .2s ease;
}
@keyframes fadeIn  { from { opacity: 0; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.95); } }

/* ── 18. Auth pages ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #F8F9FF 0%, #EFF6FF 100%);
}
.auth-card {
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: 40px;
  width: 100%; max-width: 460px;
}
.auth-card__header { text-align: center; margin-bottom: 32px; }
.auth-card__logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-divider { text-align: center; position: relative; margin: 20px 0; color: var(--text-3); font-size: 13px; }
.auth-divider::before { content:''; position:absolute; left:0; top:50%; width:42%; height:1px; background:var(--border); }
.auth-divider::after  { content:''; position:absolute; right:0; top:50%; width:42%; height:1px; background:var(--border); }

/* ── 19. Dashboard ────────────────────────────────────────────── */
.dashboard-layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 66px);
}
.sidebar-nav {
  background: var(--bg-soft); border-right: 1px solid var(--border);
  padding: 24px 12px; position: sticky; top: 66px;
  height: calc(100vh - 66px); overflow-y: auto;
}
.sidebar-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all .15s; margin-bottom: 2px;
}
.sidebar-nav__item:hover { background: var(--bg-muted); color: var(--text-1); text-decoration: none; }
.sidebar-nav__item.is-active { background: #EFF6FF; color: var(--blue); font-weight: 600; }
.sidebar-nav__section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 14px 12px 6px; }
.sidebar-nav__divider { height: 1px; background: var(--border); margin: 8px 0; }

.main-content { padding: 32px; min-width: 0; }
.page-title { font-size: 28px; font-weight: 800; color: var(--text-1); margin-bottom: 8px; }
.page-subtitle { font-size: 15px; color: var(--text-2); margin-bottom: 32px; }

.stat-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
}
.stat-card__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 8px; }
.stat-card__value { font-size: 36px; font-weight: 800; color: var(--text-1); line-height: 1; margin-bottom: 6px; }
.stat-card__sub   { font-size: 13px; color: var(--text-3); }

/* ── 20. Blog ─────────────────────────────────────────────────── */
.blog-card { border-radius: var(--r-lg); overflow: hidden; background: #fff; border: 1px solid var(--border); transition: transform .2s, box-shadow .2s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.blog-card__thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.blog-card__body  { padding: 20px; }
.blog-card__cat   { font-size: 12px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.blog-card__title { font-size: 18px; font-weight: 700; color: var(--text-1); line-height: 1.35; margin-bottom: 10px; }
.blog-card__meta  { font-size: 12px; color: var(--text-3); }

/* ── 21. Footer ───────────────────────────────────────────────── */
.footer {
  background: #0F172A; color: #94A3B8;
  padding: 64px 0 32px;
}
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer__brand-name { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer__brand-desc { font-size: 14px; line-height: 1.6; }
.footer__col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 16px; }
.footer__col ul  { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__col a   { font-size: 14px; color: #94A3B8; text-decoration: none; transition: color .15s; }
.footer__col a:hover { color: #fff; }
.footer__bottom  { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 16px; flex-wrap: wrap; }
.footer__legal   { display: flex; gap: 20px; }
.footer__legal a { color: #64748B; text-decoration: none; font-size: 13px; }
.footer__legal a:hover { color: #fff; }

/* ── 22. Skeleton loaders ─────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── 23. Spinner ──────────────────────────────────────────────── */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.spin--dark { border-color: rgba(15,23,42,.15); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 24. Misc utilities ───────────────────────────────────────── */
.hidden   { display: none !important; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divide-y > * + * { border-top: 1px solid var(--border); }
.rounded-full { border-radius: var(--r-full); }
.shadow-sm    { box-shadow: var(--shadow-sm); }
.shadow       { box-shadow: var(--shadow); }
.bg-soft      { background: var(--bg-soft); }
.bg-muted     { background: var(--bg-muted); }
.code-bg      { background: var(--bg-muted); border-radius: var(--r-sm); padding: 2px 7px; font-family: var(--font-mono); font-size: .85em; }

/* ── 25. Marquee (logos) ──────────────────────────────────────── */
.marquee-track { overflow: hidden; }
.marquee-inner { display: flex; gap: 48px; animation: marquee 28s linear infinite; width: max-content; }
.marquee-inner:hover { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── 26. Idle warning ─────────────────────────────────────────── */
#idle-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9997;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 20px 24px;
  max-width: 360px; display: none;
}
#idle-toast h4 { font-size: 15px; margin-bottom: 6px; }
#idle-toast p  { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
#idle-toast .row { gap: 10px; }

/* ── 27. Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { grid-template-columns: 200px 1fr; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell__sidebar {
    position: fixed; top: 66px; left: 0; bottom: 0;
    width: 260px; z-index: 95; background: #fff;
    transform: translateX(-100%); transition: transform .25s ease;
    height: calc(100vh - 66px); box-shadow: var(--shadow-lg);
  }
  .app-shell__sidebar.is-open { transform: translateX(0); }
  .app-shell__main { padding: 20px 16px; }
  .app-sidebar-toggle { display: inline-flex !important; }
  .app-sidebar-backdrop {
    position: fixed; inset: 66px 0 0 0; background: rgba(15,23,42,.4);
    z-index: 94; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .app-sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
}

/* ── 32. Admin panel styles ───────────────────────────────── */
.admin-shell {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 0px); background: var(--bg-soft);
}
.admin-sidebar,
.admin-side {
  background: #fff; border-right: 1px solid var(--border);
  padding: 16px 10px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.admin-sidebar a,
.admin-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all .15s;
}
.admin-sidebar a:hover,
.admin-side a:hover { background: var(--bg-muted); color: var(--text-1); text-decoration: none; }
.admin-sidebar a.is-active,
.admin-side a.is-active { background: linear-gradient(135deg, rgba(124,58,237,.1), rgba(37,99,235,.1)); color: #7C3AED; font-weight: 600; }

.admin-sidebar__title {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 14px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text-1);
}
.admin-sidebar__title-badge {
  background: linear-gradient(135deg,#7C3AED,#2563EB); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: .06em;
}
.admin-nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3); padding: 14px 10px 6px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all .15s; margin-bottom: 1px;
}
.admin-nav-item:hover { background: var(--bg-muted); color: var(--text-1); text-decoration: none; }
.admin-nav-item.is-active { background: rgba(124,58,237,.1); color: #7C3AED; font-weight: 600; }
.admin-nav-item.is-active svg { color: #7C3AED; }
.admin-nav-item svg { color: var(--text-3); transition: color .15s; flex-shrink: 0; }
.admin-nav-item:hover svg { color: var(--text-1); }

.admin-main { padding: 28px 32px; min-width: 0; max-width: 100%; }
.admin-stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
}
.admin-stat__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 8px; }
.admin-stat__value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--text-1); }
.admin-stat__sub   { font-size: 12px; color: var(--text-3); margin-top: 6px; }

/* Admin: brand for sidebar */
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; padding: 6px 12px;
}
.brand:hover { text-decoration: none; }
.brand--sm { font-size: 14px; }
.brand__logo { display: inline-flex; align-items: center; justify-content: center; }
.brand__text { font-size: 16px; font-weight: 800; color: var(--text-1); }
.brand__accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Admin: tabs / tab content panels */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; flex-wrap: nowrap;
}
/* Target ALL buttons in admin-tabs (they don't have .tab class) */
.admin-tabs button,
.admin-tabs .tab,
.tab {
  padding: 10px 16px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  cursor: pointer; border-bottom: 2.5px solid transparent;
  white-space: nowrap; transition: all .15s; flex-shrink: 0;
  margin-bottom: -1px;
}
.admin-tabs button:hover,
.admin-tabs .tab:hover,
.tab:hover { color: var(--text-1); }
.admin-tabs button.is-active,
.admin-tabs .tab.is-active,
.tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }

/* Admin: misc helpers */
.scroll-x { overflow-x: auto; max-width: 100%; }
.scroll-x table { min-width: 600px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; margin-bottom: 24px; }
.plan-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-1); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }

/* Health items */
.health-item {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.health-item--ok  { border-color: #BBF7D0; background: #F0FDF4; }
.health-item--bad { border-color: #FECACA; background: #FEF2F2; }
.health-item__label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.health-item__status {
  font-size: 14px; font-weight: 700;
  color: var(--text-1);
}
.health-item--ok  .health-item__status { color: #15803D; }
.health-item--bad .health-item__status { color: #DC2626; }

/* Admin error log */
#health-errors {
  background: #0F172A; color: #E2E8F0; border-radius: 10px;
  padding: 16px; font-family: var(--font-mono); font-size: 12px;
  line-height: 1.6; overflow-x: auto; max-height: 380px;
  overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}

.badge--gradient { background: var(--grad); color: #fff; }
.stat-card__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 18px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar,
  .admin-side { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 95; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); height: 100vh; }
  .admin-sidebar.is-open,
  .admin-side.is-open { transform: translateX(0); }
  .admin-main { padding: 20px 16px; }
  .plan-form { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .section    { padding-block: 48px; }
  .section--sm { padding-block: 32px; }
  .section--lg { padding-block: 64px; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero { padding: 56px 0 40px; }
  .hero__title { font-size: 34px; }
  .hero__subtitle { font-size: 15px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .nav__links { display: none; }
  .nav__actions { display: none; }
  .nav__hamburger { display: flex; }
  .nav__mobile { display: block; }
  .nav { height: 60px; }
  .nav__inner { padding: 0 16px; }
  .nav__brand-name { font-size: 16px; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar-nav { display: none; }
  .container { padding-inline: 16px; }
  /* Cards: tighter padding on mobile */
  .card { padding: 18px; }
  /* Pricing card responsive */
  .pricing-card { padding: 24px 20px; }
  .pricing-price { font-size: 36px; }
  /* Forms: full width on mobile */
  .field { margin-bottom: 14px; }
  /* Tables: horizontal scroll */
  .table-wrap { overflow-x: auto; }
  table { min-width: 600px; }
  /* Modals */
  .modal-card { padding: 24px 20px; }
  /* Toasts */
  #toast-container { top: 70px; right: 12px; left: 12px; }
  .toast { min-width: 0; max-width: none; }
  /* Section headers: less margin */
  .section-header { margin-bottom: 32px; }
  /* Pricing toggle: vertical on mobile */
  .currency-toggle, .pricing-toggle { font-size: 12px; }
  /* Disable hover transforms on touch */
  .feature-card:hover, .pricing-card:hover, .blog-card:hover { transform: none; }
}
@media (max-width: 480px) {
  .container { padding-inline: 14px; }
  .auth-card { padding: 24px 18px; }
  .footer__grid { grid-template-columns: 1fr; gap: 20px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer { padding: 40px 0 20px; }
  /* App-shell main: less padding */
  .app-shell__main { padding: 16px 12px; }
  /* Stats: smaller text */
  .stat-card__value { font-size: 28px; }
  /* Two-column forms collapse to single column */
  .grid--2 { grid-template-columns: 1fr !important; }
  h1 { font-size: 26px !important; }
  h2 { font-size: 22px !important; }
}

/* Mobile sidebar toggle button */
.app-sidebar-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  margin-right: 8px;
  border: 1.5px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; color: var(--text-1);
}
.app-sidebar-toggle:hover { background: var(--bg-soft); }

/* ── 28. GDPR banner ──────────────────────────────────────────── */
#gdpr-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000;
  background: #fff; border-top: 1px solid var(--border);
  padding: 16px 24px; box-shadow: 0 -4px 20px rgba(15,23,42,.08);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
#gdpr-banner p { font-size: 13px; color: var(--text-2); flex: 1; min-width: 200px; margin: 0; }

/* ── 29. Extra utility / new page elements ───────────────────── */
kbd {
  background: var(--bg-muted); padding: 2px 8px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--border);
  color: var(--text-1); font-weight: 600;
}
code {
  font-family: var(--font-mono); font-size: .9em;
  background: var(--bg-muted); padding: 2px 7px; border-radius: 4px; color: var(--text-1);
}
pre { font-family: var(--font-mono); }
.nav-dropdown.open { display: block !important; }
.nav-user-btn:hover { border-color: #CBD5E1 !important; background: var(--bg-soft); }

/* Hamburger menu icon */
.nav__hamburger:hover { background: var(--bg-muted); border-radius: var(--r-sm); color: var(--text-1); }

/* ── 30. App-style backgrounds (logged-in user pages) ─────── */
/* Add class="app-bg" to <body> on logged-in pages for soft gradient */
body.app-bg {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37,99,235,.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 30%, rgba(124,58,237,.05) 0%, transparent 50%),
    linear-gradient(180deg, #FAFBFF 0%, #FFFFFF 100%);
  background-attachment: fixed;
}

/* ── 31. Sidebar layout for app pages ────────────────────── */
.app-shell {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  min-height: calc(100vh - 66px);
}
.app-shell__sidebar {
  background: #fff; border-right: 1px solid var(--border);
  padding: 20px 12px; position: sticky; top: 66px;
  height: calc(100vh - 66px); overflow-y: auto;
}
.app-shell__main { padding: 28px 32px; min-width: 0; }

.app-nav-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-3);
  padding: 14px 12px 6px;
}
.app-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: all .15s; margin-bottom: 2px;
}
.app-nav-item:hover { background: var(--bg-muted); color: var(--text-1); text-decoration: none; }
.app-nav-item.is-active {
  background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(124,58,237,.1));
  color: var(--blue); font-weight: 600;
}
.app-nav-item.is-active svg { color: var(--blue); }
.app-nav-item svg { color: var(--text-3); transition: color .15s; }
.app-nav-item:hover svg { color: var(--text-1); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell__sidebar { display: none; }
  .app-shell__main { padding: 20px 16px; }
}

/* Container for hero stays in flow on mobile */
@media (max-width: 768px) {
  .hero__title { font-size: 38px; }
  .hero__subtitle { font-size: 16px; }
}