:root {
  --magenta: #C2185B;
  --magenta-dark: #8E0E43;
  --magenta-darker: #6B0A32;
  --magenta-light: #FDE9F1;
  --magenta-mid: #F5B8D3;
  --magenta-soft: #F9D4E5;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #FCF7FA;

  --text: #201418;
  --text-secondary: #6E5A63;
  --text-muted: #9C8A92;

  --border: #F0DDE6;
  --border-strong: #E3B9CE;

  --success: #1E8E5A;
  --success-bg: #E8F7EF;
  --warn: #B7791F;
  --warn-bg: #FDF3E3;
  --danger: #C22C3D;
  --danger-bg: #FCEAEC;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(140, 20, 70, 0.06), 0 4px 16px rgba(140, 20, 70, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--magenta); text-decoration: none; }
a:hover { color: var(--magenta-dark); }

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; color: var(--text-secondary); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--magenta); color: #fff; }
.btn-primary:hover { background: var(--magenta-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--magenta-dark); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--magenta-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F3C6CC; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-magenta { background: var(--magenta-light); color: var(--magenta-dark); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-header h3 { margin: 0; }
.card-flat { border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; background: var(--surface-alt); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Stat cards ---------- */
.stat-card { padding: 18px 20px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.stat-sub.up { color: var(--success); }
.stat-sub.down { color: var(--danger); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field { margin-bottom: 16px; }
.help { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font); color: var(--text); background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px var(--magenta-light);
}
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-chip {
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; background: #fff; font-weight: 600; color: var(--text-secondary);
}
.radio-chip input { display: none; }
.radio-chip.checked, .radio-chip:has(input:checked) { background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- Top nav (marketing) ---------- */
.topnav { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 20; }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1160px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--magenta), var(--magenta-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--magenta-dark); }
.nav-cta { display: flex; align-items: center; gap: 10px; }

/* ---------- Hero / marketing ---------- */
.hero { padding: 76px 0 56px; text-align: center; }
.eyebrow { display: inline-block; background: var(--magenta-light); color: var(--magenta-dark); font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: 46px; max-width: 780px; margin: 0 auto 16px; }
.hero p.lead { font-size: 18px; max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 44px; }
.hero-actions .btn { padding: 12px 24px; font-size: 15px; }

.section { padding: 56px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; padding: 20px 0 10px; }
.logo-chip { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--text-secondary); }
.platform-dot { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; }

.feature-card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--magenta-light); color: var(--magenta-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 14px; }

.step-row { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.step-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--magenta); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

.cta-band { background: linear-gradient(135deg, var(--magenta), var(--magenta-darker)); border-radius: var(--radius-lg); padding: 48px; text-align: center; color: #fff; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); }
.cta-band .btn-secondary { background: #fff; color: var(--magenta-dark); border-color: transparent; }

.footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px; }
.footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); font-size: 13px; }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--magenta-light); padding: 24px; }
.auth-card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px; width: 100%; max-width: 400px; border: 1px solid var(--border); }
.auth-card .brand { justify-content: center; margin-bottom: 18px; }
.auth-card h1 { font-size: 22px; text-align: center; }
.auth-card p.lead { text-align: center; font-size: 13.5px; margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 13.5px; margin-top: 16px; color: var(--text-secondary); }
.demo-hint { background: var(--surface-alt); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 12px; font-size: 12.5px; color: var(--text-secondary); margin-top: 16px; }

/* ---------- App shell (dashboard / admin) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: var(--magenta-darker); color: #fff;
  display: flex; flex-direction: column; padding: 20px 14px;
}
.sidebar .brand { color: #fff; padding: 0 8px; margin-bottom: 26px; }
.sidebar .brand-mark { background: #fff; color: var(--magenta-darker); }
.side-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.5); padding: 14px 10px 6px; font-weight: 700; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: rgba(255,255,255,.82);
  font-size: 14px; font-weight: 500; margin-bottom: 2px;
}
.side-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-link.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.side-icon { width: 18px; text-align: center; font-size: 14px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.14); font-size: 12.5px; color: rgba(255,255,255,.65); }

.main { flex: 1; min-width: 0; background: var(--bg); }
.topbar {
  height: 62px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; background: #fff; z-index: 10;
}
.topbar h2 { margin: 0; font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--magenta); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.page { padding: 26px; }

.plan-pill { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--magenta-light); color: var(--magenta-dark); text-transform: capitalize; }

/* ---------- Misc components ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--success-bg); color: var(--success); border: 1px solid #C9EDD9; }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F3C6CC; }

.progress-track { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: var(--magenta); border-radius: 999px; }

.platform-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }

.chat-bubble { padding: 14px 16px; border-radius: 14px; max-width: 80%; font-size: 14px; }
.chat-user { background: var(--magenta); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-ai { background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.chat-ai-label { font-size: 11.5px; font-weight: 700; color: var(--magenta-dark); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }

.suggestion-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.suggestion-item:last-child { border-bottom: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot-good { background: var(--success); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 4px; margin-right: 22px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: var(--magenta-dark); border-color: var(--magenta); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .feature-icon { margin: 0 auto 14px; }

.kbd { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; font-family: monospace; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .page { padding: 18px; }
}
