:root {
  --navy: #0F172A;
  --navy-light: #1E293B;
  --cyan: #06B6D4;
  --cyan-dark: #0891B2;
  --blue: #3B82F6;
  --indigo: #4F46E5;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow: 0 4px 12px rgba(15,23,42,.08), 0 8px 30px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand-logo { height: 52px; width: auto; display: block; max-width: 100%; }
.brand:hover { color: var(--text); }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-name { font-size: 17px; letter-spacing: -.02em; }

.topbar-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .15s ease;
}
.topbar-links a:hover { color: var(--text); background: var(--bg); }
.topbar-links a.active { color: var(--cyan-dark); background: rgba(6,182,212,.08); }
.topbar-links a.logout { color: var(--danger); }

/* ---------- Layout ---------- */
.main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }

/* ---------- Flash ---------- */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.flash-success { background: rgba(16,185,129,.1); color: #047857; border: 1px solid rgba(16,185,129,.25); }
.flash-error { background: rgba(239,68,68,.1); color: #B91C1C; border: 1px solid rgba(239,68,68,.25); }

/* ---------- Landing ---------- */
.landing-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(6,182,212,.18), transparent 60%),
              radial-gradient(900px 500px at 80% 10%, rgba(79,70,229,.14), transparent 55%),
              var(--navy);
  color: #fff;
  text-align: center;
  padding: 100px 24px 120px;
}

.landing-hero h1 {
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: -.04em;
  font-weight: 800;
  max-width: 760px;
  margin: 0 auto 24px;
}

.landing-hero h1 .gradient-text {
  background: linear-gradient(90deg, #22D3EE, #60A5FA);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero p {
  font-size: 19px;
  color: rgba(255,255,255,.78);
  max-width: 620px;
  margin: 0 auto 36px;
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .18s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  box-shadow: 0 8px 24px rgba(6,182,212,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(6,182,212,.45); color: #fff; }

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.35);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 72px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.feature-card .feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: rgba(6,182,212,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; margin-bottom: 8px; letter-spacing: -.02em; }
.feature-card p { color: var(--muted); font-size: 14.5px; }

@media (max-width: 860px) {
  .landing-hero h1 { font-size: 40px; }
  .landing-features { grid-template-columns: 1fr; }
  .topbar-links a { font-size: 13px; padding: 7px 9px; }
}

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(800px 500px at 50% 0%, rgba(6,182,212,.1), transparent 60%), var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 26px; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--navy-light); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- App pages ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-size: 28px; letter-spacing: -.03em; font-weight: 800; }
.page-desc { color: var(--muted); font-size: 15px; margin-top: 4px; max-width: 560px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.card h2 { font-size: 18px; letter-spacing: -.02em; margin-bottom: 16px; }

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

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
}
.badge-live { background: rgba(16,185,129,.12); color: #047857; }
.badge-warn { background: rgba(245,158,11,.14); color: #B45309; }
.badge-muted { background: var(--bg); color: var(--muted); }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .empty-icon { font-size: 42px; margin-bottom: 12px; }

/* ---------- Playbook ------------- */
.entry-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 12px;
  margin-bottom: 12px;
  align-items: start;
}
.entry-remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  margin-top: 4px;
}

.playbook-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.playbook-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.playbook-head h3 { font-size: 16px; }
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
}
.entry-item .objection { font-weight: 600; color: var(--danger); }
.entry-item .rebuttal { color: var(--navy-light); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
