/* ============================================================
   Convio — Design System
   ============================================================ */

:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #818CF8;
  --primary-bg: #EEF2FF;
  --primary-bg-strong: #E0E7FF;
  --accent: #8B5CF6;

  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-muted: #F1F5F9;
  --bg-elevated: #FFFFFF;

  --sidebar-bg: #0F172A;
  --sidebar-bg-gradient: linear-gradient(180deg, #0F172A 0%, #1E1B4B 100%);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --text-on-dark: #E2E8F0;
  --text-on-dark-muted: #94A3B8;

  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-dark: rgba(255, 255, 255, 0.08);

  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --sidebar-w: 240px;
  --topbar-h: 64px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

p { margin: 0; }
ul, ol { padding-left: 1.25rem; margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

code, pre, .mono { font-family: var(--font-mono); font-size: 13px; }
pre {
  background: #0F172A;
  color: #E2E8F0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0;
  line-height: 1.6;
}
:not(pre) > code {
  background: var(--bg-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

/* ============================================================
   APP LAYOUT (sidebar + content)
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg-gradient);
  color: var(--text-on-dark);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 24px 8px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.brand-mark svg { width: 18px; height: 18px; color: white; }
.brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-section {
  margin-top: 14px;
}
.nav-section-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.45);
  padding: 0 10px 6px;
}
.nav {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(226,232,240,0.85);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-item.active {
  background: rgba(99,102,241,0.16);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--primary-light);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.9; }
.nav-item .badge-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background var(--transition);
}
.user-card:hover { background: rgba(255,255,255,0.08); }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name {
  font-size: 13px; font-weight: 600;
  color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-card-meta {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   CONTENT
   ============================================================ */

.content {
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 24px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-search {
  flex: 1; max-width: 460px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px 0 36px;
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color var(--transition), background var(--transition);
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.topbar-search svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--text-tertiary);
}

.topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: grid; place-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--bg-muted); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}
.icon-btn-wrap { position: relative; }

.page {
  padding: 32px 40px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px 0;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   CARDS / SECTIONS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: 16px 18px; }
.card-lg { padding: 28px 32px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  margin: 0;
}
.card-subtitle {
  font-size: 13px; color: var(--text-secondary);
  margin: 4px 0 0 0;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page { padding: 24px 20px; }
  :root { --sidebar-w: 0; }
  .sidebar { display: none; }
  .app-shell { grid-template-columns: 1fr; }
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  right: -12px; top: -12px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.04));
}
.stat-label {
  font-size: 12.5px; color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.stat-value {
  font-size: 28px; font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.stat-delta {
  font-size: 12px; font-weight: 500;
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-muted); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-muted); color: var(--text-primary); }
.btn-danger {
  background: var(--danger); color: #fff;
  border-color: #DC2626;
}
.btn-danger:hover { background: #DC2626; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn svg { width: 15px; height: 15px; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.help {
  font-size: 12px;
  color: var(--text-secondary);
}
.input, .select, .textarea {
  height: 40px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.16);
}
.textarea {
  height: auto;
  padding: 12px;
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}
.input-error {
  border-color: var(--danger);
}
.field-error {
  font-size: 12px; color: var(--danger);
  margin-top: 2px;
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.badge-success { background: var(--success-bg); color: #047857; }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-danger { background: var(--danger-bg); color: #B91C1C; }
.badge-info { background: var(--info-bg); color: #1D4ED8; }
.badge-primary { background: var(--primary-bg); color: var(--primary-dark); }
.badge-muted { background: var(--bg-muted); color: var(--text-secondary); }
.badge svg { width: 11px; height: 11px; }

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* ============================================================
   TABLE
   ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.data-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-muted);
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-muted); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .cell-strong { font-weight: 600; color: var(--text-primary); }

/* ============================================================
   SKELETON
   ============================================================ */

.skel {
  background: linear-gradient(90deg, #E2E8F0 0%, #F1F5F9 50%, #E2E8F0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: 6px;
}
.skel-line { height: 14px; }
.skel-line-sm { height: 10px; }
.skel-card { height: 90px; border-radius: 12px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--primary-bg);
  color: var(--primary);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { color: var(--text-primary); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.empty-desc { font-size: 13px; max-width: 360px; }

/* ============================================================
   TOAST
   ============================================================ */

.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px; max-width: 420px;
  background: #0F172A;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px;
  animation: slide-in 220ms ease;
}
.toast.success { background: #064E3B; }
.toast.danger { background: #7F1D1D; }
.toast.warning { background: #78350F; }
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 16px; height: 16px; }
@keyframes slide-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 480px; width: 100%;
  padding: 24px 28px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal h2 { font-size: 18px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent;
  cursor: pointer;
  color: var(--text-tertiary);
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--bg-muted); }

/* ============================================================
   ALERT / BANNER
   ============================================================ */

.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid;
  font-size: 13.5px;
}
.alert-icon { flex-shrink: 0; }
.alert-icon svg { width: 18px; height: 18px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-info {
  background: var(--info-bg);
  border-color: #BFDBFE;
  color: #1E40AF;
}
.alert-warning {
  background: var(--warning-bg);
  border-color: #FDE68A;
  color: #92400E;
}
.alert-danger {
  background: var(--danger-bg);
  border-color: #FECACA;
  color: #991B1B;
}
.alert-success {
  background: var(--success-bg);
  border-color: #A7F3D0;
  color: #065F46;
}
.alert-beta {
  background: linear-gradient(135deg, #FAF5FF 0%, #F5F3FF 100%);
  border-color: #DDD6FE;
  color: #5B21B6;
}

/* ============================================================
   LANDING / AUTH (no sidebar layouts)
   ============================================================ */

.landing-nav {
  height: 72px;
  display: flex; align-items: center;
  padding: 0 40px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.landing-nav .brand { padding: 0; }
.landing-nav .brand-name { color: var(--text-primary); }
.landing-nav-links {
  margin-left: 48px;
  display: flex; gap: 28px;
}
.landing-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.landing-nav-links a:hover { color: var(--text-primary); }
.landing-nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.hero {
  padding: 96px 40px 64px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(139, 92, 246, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(99, 102, 241, 0.10), transparent),
    var(--bg-app);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: var(--primary-bg);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--primary-bg-strong);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 52px;
  letter-spacing: -0.03em;
  line-height: 1.1;
  max-width: 760px;
  margin: 0 auto 20px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.55;
}
.hero-cta {
  display: inline-flex; gap: 12px; align-items: center;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 920px;
  margin: 72px auto 0;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 0;
  box-shadow: var(--shadow-md);
}
.hero-stat { text-align: center; padding: 0 20px; border-right: 1px solid var(--border); }
.hero-stat:last-child { border-right: none; }
.hero-stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.hero-stat-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }

.section {
  padding: 80px 40px;
}
.section-light { background: var(--bg-app); }
.section-tinted { background: linear-gradient(180deg, #FAFAFE, #fff); }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.section-title { font-size: 36px; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 16px; }
.section-sub { font-size: 16px; color: var(--text-secondary); max-width: 560px; }

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.feature {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 18px; height: 18px; }
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature-desc { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }

.logo-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 56px;
  padding: 40px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.logo-strip-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); width: 100%; text-align: center; margin-bottom: 12px;
}
.logo-strip .logo {
  font-weight: 700;
  color: var(--text-tertiary);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.cta-band {
  padding: 64px 40px;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { font-size: 36px; color: #fff; margin-bottom: 14px; letter-spacing: -0.02em; }
.cta-band p { color: rgba(255,255,255,0.85); font-size: 16px; max-width: 520px; margin: 0 auto 28px; }
.cta-band .btn-primary { background: #fff; color: var(--primary-dark); border-color: #fff; }
.cta-band .btn-primary:hover { background: #F1F5F9; color: var(--primary-dark); }

.footer {
  padding: 48px 40px;
  background: #fff;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* Auth pages */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-app);
}
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
.auth-form-side {
  display: flex; flex-direction: column;
  padding: 32px 56px;
  justify-content: center;
}
.auth-form-wrap {
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}
.auth-back { font-size: 13px; color: var(--text-secondary); }
.auth-form-side .brand { padding: 0; margin-bottom: 28px; }
.auth-form-side .brand-name { color: var(--text-primary); }
.auth-title { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-sub { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.auth-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 24px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 30px); height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-aside {
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(139,92,246,0.4), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(99,102,241,0.5), transparent 60%),
    linear-gradient(135deg, #1E1B4B 0%, #0F172A 100%);
  padding: 64px 56px;
  display: flex; flex-direction: column;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.aside-quote {
  font-size: 22px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 460px;
  margin-bottom: 28px;
}
.aside-author {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
}
.aside-author .avatar { background: linear-gradient(135deg, var(--primary-light), var(--accent)); }

/* ============================================================
   NOTES UI
   ============================================================ */

.notes-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 70vh;
}
.notes-list {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: #FCFCFD;
  overflow-y: auto;
  max-height: 80vh;
}
.notes-list-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.notes-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notes-item:hover { background: var(--bg-muted); }
.notes-item.active { background: var(--primary-bg); border-left: 3px solid var(--primary); padding-left: 13px; }
.notes-item-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text-primary); }
.notes-item-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-tertiary);
}
.notes-detail {
  padding: 32px 40px;
  overflow-y: auto;
  max-height: 80vh;
}
.notes-detail-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.notes-detail-title { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 8px; }
.notes-detail-meta {
  display: flex; gap: 16px; align-items: center;
  font-size: 12.5px; color: var(--text-secondary);
}
.notes-detail-body {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}
.notes-detail-body code { background: #FEF3C7; padding: 1px 6px; border-radius: 4px; color: #78350F; }
.notes-detail-body strong { font-weight: 600; }

/* ============================================================
   MEMBERS / APPS GRID
   ============================================================ */

.member-card, .app-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.member-card:hover, .app-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.member-card-info { flex: 1; min-width: 0; }
.member-card-name { font-weight: 600; font-size: 14px; }
.member-card-meta { font-size: 12.5px; color: var(--text-secondary); }
.member-card-role {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   API DOCS
   ============================================================ */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 980px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-toc {
  position: sticky; top: calc(var(--topbar-h) + 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.docs-toc-title {
  font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.docs-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.docs-toc a:hover { background: var(--bg-muted); color: var(--text-primary); }

.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.endpoint-head {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}
.method {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.method.get { background: #DBEAFE; color: #1E40AF; }
.method.post { background: #D1FAE5; color: #065F46; }
.method.patch { background: #FEF3C7; color: #78350F; }
.method.delete { background: #FEE2E2; color: #991B1B; }
.endpoint-path { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.endpoint-body {
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.6;
}
.endpoint-body h4 {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary);
  margin: 16px 0 8px 0;
  font-weight: 600;
}
.endpoint-body h4:first-child { margin-top: 0; }
.endpoint-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}
.endpoint-body td, .endpoint-body th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.endpoint-body th { font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.endpoint-body td:first-child { font-family: var(--font-mono); color: var(--primary-dark); font-size: 12.5px; }
.endpoint-body tr.highlight td { background: linear-gradient(90deg, rgba(139,92,246,0.06) 0%, transparent 100%); }

/* ============================================================
   MISSION CARD (dashboard)
   ============================================================ */

.mission {
  background: linear-gradient(135deg, #1E1B4B 0%, #0F172A 100%);
  border-radius: 16px;
  padding: 28px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.mission::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,0.4), transparent 70%);
}
.mission::after {
  content: '';
  position: absolute;
  bottom: -50px; left: 20%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(99,102,241,0.3), transparent 70%);
}
.mission-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #C7D2FE;
  background: rgba(99,102,241,0.18);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  position: relative;
}
.mission-title {
  font-size: 22px;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 8px;
  position: relative;
}
.mission-subtitle {
  color: rgba(226,232,240,0.75);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  position: relative;
}
.mission-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  position: relative;
}
.mission-field {
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  border-radius: 10px;
}
.mission-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(199,210,254,0.8);
  margin-bottom: 4px;
}
.mission-field-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
  word-break: break-all;
}
.mission-complete {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--success);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  margin-top: 16px;
}

/* ============================================================
   FLAG SUBMIT
   ============================================================ */

.flag-card {
  max-width: 580px;
  margin: 0 auto;
}
.flag-card .input {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.01em;
}
.flag-result {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  display: none;
}
.flag-result.show { display: block; }
.flag-result.success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0;
}
.flag-result.error {
  background: var(--danger-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.flex-1 { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.hidden { display: none; }
.spacer { flex: 1; }
