@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #14181c;
  --paper: #f4f6f5;
  --panel: #ffffff;
  --line: #e3e7e5;
  --accent: #1a5f4a;
  --accent-light: #e6f0ec;
  --warn: #b4530a;
  --warn-light: #fdf1e6;
  --danger: #b13a3a;
  --danger-light: #fbeaea;
  --muted: #6b7570;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

h1, h2, h3, .brand { font-family: 'Space Grotesk', sans-serif; }

a { color: var(--accent); }

/* ---- Auth pages ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.auth-card .brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.auth-card .subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }

/* ---- App shell ---- */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  color: #cdd6d1;
  flex-shrink: 0;
  padding: 24px 16px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}
.sidebar .brand {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0 8px 24px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade9a; display: inline-block; }
.sidebar nav a {
  display: block;
  color: #b7c1bc;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .foot {
  position: absolute;
  bottom: 20px;
  left: 16px;
  right: 16px;
  font-size: 0.8rem;
  color: #8a948f;
}
.sidebar .foot a { color: #cdd6d1; }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px 60px;
  max-width: 1100px;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; margin: 0 0 4px; }
.page-header p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* ---- Components ---- */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.flash.success { background: var(--accent-light); color: var(--accent); border-color: #cde3d8; }
.flash.error { background: var(--danger-light); color: var(--danger); border-color: #f0cfcf; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-card .n { font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; font-weight: 700; }
.stat-card .l { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.card .desc { color: var(--muted); font-size: 0.87rem; margin: 0 0 16px; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.action-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fbfcfb;
}
.action-tile h3 { font-size: 0.92rem; margin: 0 0 4px; }
.action-tile p { font-size: 0.8rem; color: var(--muted); margin: 0 0 12px; }

label { display: block; font-size: 0.83rem; font-weight: 500; margin-bottom: 5px; color: #444; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 14px;
  background: #fff;
}
textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-hint { font-size: 0.78rem; color: var(--muted); margin-top: -10px; margin-bottom: 14px; }

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { opacity: 0.92; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.danger, .btn.danger { background: var(--danger); }
button.full { width: 100%; }

table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #eee;
  color: #555;
}
.badge.new { background: #e7edfb; color: #35528f; }
.badge.demo_built, .badge.pitch_written { background: #fdf1e6; color: var(--warn); }
.badge.sent, .badge.followed_up_1, .badge.followed_up_2 { background: #fef6db; color: #8a6d15; }
.badge.replied_interested, .badge.booked { background: var(--accent-light); color: var(--accent); }
.badge.replied_not_interested, .badge.opted_out { background: #eee; color: #888; }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { margin-bottom: 0; }

pre.output {
  background: #0f1214;
  color: #cdeedb;
  padding: 18px 20px;
  border-radius: 10px;
  font-size: 0.83rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }

.section-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 28px 0 10px; }
