/* ============================================================
   MAGNOLIA MEGAN — CLUB+ PARTNER CRM
   Design system: editorial, warm, premium, country-club inspired
   ============================================================ */

:root {
  --green: #0F2B22;
  --green-soft: #1a3d34;
  --cream: #F7F3EB;
  --cream-warm: #F0EBE0;
  --gold: #C9A66A;
  --gold-soft: #E4CFA3;
  --sage: #6B7F6A;
  --bark: #8A5E34;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e5e0d5;
  --line-soft: #f2ede2;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(15,43,34,0.06);
  --shadow: 0 2px 12px rgba(15,43,34,0.08);
  --shadow-lg: 0 8px 32px rgba(15,43,34,0.12);

  --red: #b23a3a;
  --orange: #d17a2c;
  --blue: #4a7ba4;
  --success: #4a8f6d;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Lato', -apple-system, 'Helvetica Neue', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  font-size: 15px;
}

h1, h2, h3, h4, .display {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 700;
  color: var(--green);
  margin: 0;
  line-height: 1.15;
}

h1 { font-size: 32px; letter-spacing: -0.3px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 15px; font-weight: 700; }

p { margin: 0 0 12px; }

a { color: var(--green); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--bark); }

/* ============================================================
   LAYOUT — App shell
   ============================================================ */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--green);
  color: var(--cream);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(201,166,106,0.2);
  margin-bottom: 20px;
}

.sidebar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--gold);
  line-height: 1.1;
  margin: 0;
}

.sidebar-sub {
  font-family: 'Lato', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.6);
  margin-top: 6px;
}

.nav-section {
  padding: 0 12px;
  margin-bottom: 24px;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.5);
  padding: 0 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(247,243,235,0.85);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.15s;
}

.nav-item:hover {
  background: rgba(201,166,106,0.08);
  color: var(--cream);
}

.nav-item.active {
  background: rgba(201,166,106,0.15);
  color: var(--gold);
  font-weight: 700;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid rgba(201,166,106,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: var(--cream);
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.5);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.main {
  padding: 32px 40px;
  max-width: 1400px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-title h1 {
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.page-actions {
  display: flex;
  gap: 10px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--bark);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--green);
}

.btn-secondary {
  background: var(--white);
  color: var(--green);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--cream-warm);
}

.btn-ghost {
  background: transparent;
  color: var(--green);
}

.btn-ghost:hover {
  background: var(--cream-warm);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

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

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: box-shadow 0.15s;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--green);
  margin: 0;
}

.card-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bark);
}

/* ============================================================
   METRIC CARDS (dashboard)
   ============================================================ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.metric {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border-top: 3px solid var(--gold);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.metric-value {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.metric-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.metric.urgent { border-top-color: var(--red); }
.metric.warning { border-top-color: var(--orange); }
.metric.success { border-top-color: var(--success); }

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.stage-prospect,
.pill.stage-dm-sent,
.pill.stage-interested {
  background: rgba(107,127,106,0.15); color: var(--sage);
}

.pill.stage-info-sent,
.pill.stage-follow-up,
.pill.stage-partner-confirmed {
  background: rgba(74,123,164,0.12); color: var(--blue);
}

.pill.stage-offer-pending,
.pill.stage-offer-submitted,
.pill.stage-offer-approved {
  background: rgba(201,166,106,0.18); color: var(--bark);
}

.pill.stage-content-scheduling,
.pill.stage-content-scheduled,
.pill.stage-content-captured,
.pill.stage-editing,
.pill.stage-reel-scheduled {
  background: rgba(138,94,52,0.14); color: var(--bark);
}

.pill.stage-club-plus-ready,
.pill.stage-reel-live,
.pill.stage-newsletter-scheduled,
.pill.stage-active-partner {
  background: rgba(74,143,109,0.15); color: var(--success);
}

.pill.stage-renewal-needed { background: rgba(209,122,44,0.15); color: var(--orange); }
.pill.stage-ended { background: rgba(120,120,120,0.12); color: var(--muted); }

.pill.status-confirmed { background: rgba(74,143,109,0.15); color: var(--success); }
.pill.status-pending { background: rgba(201,166,106,0.18); color: var(--bark); }
.pill.status-overdue { background: rgba(178,58,58,0.13); color: var(--red); }

/* ============================================================
   NEEDS ATTENTION LIST
   ============================================================ */

.attention-list { padding: 0; }

.attention-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  gap: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.attention-item:last-child { border-bottom: none; }

.attention-severity {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}
.attention-severity.high { background: var(--red); }
.attention-severity.medium { background: var(--orange); }
.attention-severity.low { background: var(--gold); }

.attention-body { flex: 1; min-width: 0; }
.attention-title { font-weight: 700; color: var(--green); margin-bottom: 2px; }
.attention-meta { font-size: 12px; color: var(--muted); }

.attention-action { flex-shrink: 0; }

/* ============================================================
   TABLES
   ============================================================ */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead th {
  background: var(--cream-warm);
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; cursor: pointer; }
tbody tr:hover { background: var(--cream); }

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

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,166,106,0.15);
}

.form-textarea { min-height: 100px; resize: vertical; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  padding: 20px;
}

.login-card {
  background: var(--cream);
  padding: 48px 44px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  text-align: center;
}

.login-brand {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: var(--green);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 32px;
}

/* ============================================================
   PIPELINE / KANBAN
   ============================================================ */

.kanban {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.kanban-column {
  flex-shrink: 0;
  width: 300px;
  background: var(--cream-warm);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 400px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-column-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.kanban-column-count {
  background: var(--green);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-card {
  background: var(--white);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kanban-card.overdue { border-left: 3px solid var(--red); }

.kanban-card-title {
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.kanban-card-next {
  background: var(--cream);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink);
  margin-top: 8px;
}

.kanban-card-next.overdue { background: rgba(178,58,58,0.08); color: var(--red); }

/* ============================================================
   ACTIVATION CHECKLIST
   ============================================================ */

.checklist { padding: 0; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}

.checklist-item:last-child { border-bottom: none; }

.checklist-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.checklist-checkbox.checked {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green);
}

.checklist-item.done .checklist-label {
  color: var(--muted);
  text-decoration: line-through;
}

.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.3s;
}

.progress-text {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bark);
  font-weight: 700;
}

/* ============================================================
   TABS (partner profile)
   ============================================================ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: var(--green); }
.tab.active { color: var(--green); border-bottom-color: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 20px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   UTILITY
   ============================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.text-muted { color: var(--muted); }
.text-red { color: var(--red); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }
