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

:root {
  --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  
  /* Slate Theme Palette */
  --bg: #0b1319;
  --panel: rgba(18, 30, 40, 0.7);
  --panel-solid: #121e28;
  --sidebar-bg: #090e13;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(13, 148, 136, 0.15);
  
  --ink: #f1f5f9;
  --ink-muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  
  /* Brand gradients & accents */
  --primary-gradient: linear-gradient(135deg, #0d9488, #0f766e);
  --primary: #0d9488;
  --primary-hover: #14b8a6;
  --primary-light: rgba(13, 148, 136, 0.15);
  
  /* Semantics */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  --radius: 12px;
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-shadow: 0 0 20px rgba(13, 148, 136, 0.1);
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

/* Sidebar Styling */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--ink);
  padding: 30px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 10;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 15px rgba(13, 148, 136, 0.4);
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.brand span {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  margin-top: 2px;
  font-weight: 500;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-hover);
  letter-spacing: 0.1em;
  padding: 0 16px;
  margin-bottom: 6px;
}

nav a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
}

nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--primary);
}

nav a.active {
  color: #fff;
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* Role Switcher in Sidebar */
.role-switcher {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.role-switcher select {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.role-switcher select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.2);
}

/* Main Content area */
main {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(120deg, #fff, var(--ink-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metrics-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.metrics {
  display: flex;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.metrics div {
  text-align: center;
  padding: 0 12px;
}

.metrics div:not(:last-child) {
  border-right: 1px solid var(--border);
}

.metrics strong {
  display: block;
  font-size: 18px;
  color: #fff;
  font-family: var(--font-display);
}

.metrics span {
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Client Presentation Switch */
.client-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid var(--border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background: var(--primary-gradient);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Sticky Client Banner */
#clientModeBanner {
  background: linear-gradient(90deg, #0f766e, #0d9488);
  color: #fff;
  text-align: center;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1000;
  grid-column: span 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Panels / Sections */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s;
  display: none;
}

.panel.active {
  display: block;
}

.panel:hover {
  border-color: rgba(13, 148, 136, 0.25);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.section-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.section-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Buttons */
button {
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

button.primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

button.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.3);
}

button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Campaign Brief Form styling */
.brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.brief-grid .wide {
  grid-column: 1 / -1;
}

.brief-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.brief-grid input,
.brief-grid select {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.brief-grid input:focus,
.brief-grid select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.15);
}

.brief-grid input:disabled,
.brief-grid select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255,255,255,0.01);
  border-color: var(--line);
}

/* Recommended Shortlist Card Grid */
.shortlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.creator-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.creator-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.5), 0 0 12px rgba(13, 148, 136, 0.15);
  border-color: var(--primary);
}

.creator-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.creator-top strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}

.creator-top span {
  font-size: 12px;
  color: var(--ink-muted);
}

.score {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--primary-gradient);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.3);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Custom badges */
.tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.tag.green {
  background: var(--success-bg);
  color: var(--success);
}

.tag.gold {
  background: var(--warning-bg);
  color: var(--warning);
}

.tag.red {
  background: var(--error-bg);
  color: var(--error);
}

.tag.blue {
  background: var(--info-bg);
  color: var(--info);
}

p.reason {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin: 0;
}

.warning-notes {
  border-left: 3px solid var(--error);
  background: var(--error-bg);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
}

.money {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.money div {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
}

.money span {
  display: block;
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.money strong {
  display: block;
  font-size: 14px;
  color: #fff;
  font-family: var(--font-display);
  margin-top: 2px;
}

/* Curate checkbox styled */
.curate-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Budget Tracker Bar */
.budget-tracker-bar {
  background: var(--panel-solid) !important;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary) !important;
  backdrop-filter: blur(12px);
}

/* Draft proposals / slide plans notes */
.notes {
  background: rgba(9, 14, 19, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  font-family: monospace;
  font-size: 12px;
  color: #cbd5e1;
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
}

/* Database Table wraps */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-solid);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

td strong {
  color: #fff;
  font-size: 14px;
}

td span {
  font-size: 12px;
  color: var(--ink-muted);
}

/* Automation Queue items styling */
.queue {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.queue-item {
  border: 1px solid var(--border);
  padding: 18px;
  background: var(--panel);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.queue-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--glow-shadow);
}

/* Alert Box */
.alert-box {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.alert-box.error {
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Progress bar styling */
.progress-bar-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.progress-bar-fill {
  background: var(--primary-gradient);
  height: 100%;
  width: 0%;
  transition: width 0.5s ease-in-out;
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.5);
}

.progress-bar-fill.over {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Client Presentation Mode Rules */
body.client-mode .sensitive-data,
body.client-mode .sensitive-card-info,
body.client-mode .tag.grade-badge,
body.client-mode .warning-notes,
body.client-mode #proposalNotes,
body.client-mode #deckPlan,
body.client-mode .warning-badge,
body.client-mode #navTalentSourcing,
body.client-mode #navDataSettings,
body.client-mode #discovery,
body.client-mode #automation,
body.client-mode #database {
  display: none !important;
}

/* Role Swapping Visibility Rules */
body.role-ae .sensitive-data,
body.role-ae .sensitive-card-info,
body.role-ae #addSampleBtn,
body.role-ae #database,
body.role-ae #automation,
body.role-ae #navTalentSourcing,
body.role-ae #discovery {
  display: none !important;
}

body.role-kol #matchBtn,
body.role-kol #proposalBtn,
body.role-kol #deckPlanBtn,
body.role-kol #saveShortlistBtn,
body.role-kol #brief,
body.role-kol #shortlist,
body.role-kol #navClientCampaigns {
  display: none !important;
}

body.role-finance #navTalentSourcing,
body.role-finance #discovery,
body.role-finance #automation,
body.role-finance #brief,
body.role-finance #shortlist,
body.role-finance #navClientCampaigns {
  display: none !important;
}

/* Outreach modal dark theme styling */
.modal-content input,
.modal-content textarea {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  outline: none;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.modal-content input:focus,
.modal-content textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
  body {
    display: block;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    padding-bottom: 16px;
  }

  nav {
    margin-top: 18px;
    gap: 12px;
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-label {
    grid-column: 1 / -1;
    padding: 0;
  }

  nav a {
    min-width: 0;
    padding: 10px;
  }

  .role-switcher {
    margin-top: 18px;
    padding-top: 16px;
  }

  main {
    width: 100%;
    padding: 24px 16px;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin-bottom: 24px;
  }

  .metrics-container {
    width: 100%;
    align-items: stretch;
  }

  .metrics {
    width: 100%;
    justify-content: space-between;
    padding: 10px;
  }

  .metrics div {
    flex: 1;
    min-width: 0;
    padding: 0 6px;
  }

  .client-mode-toggle {
    justify-content: space-between;
  }

  .panel {
    padding: 18px;
  }

  #emailSetupPanel,
  #autoOutreachPanel {
    grid-template-columns: 1fr !important;
  }

  #emailSetupChecklist {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #autoOutreachStatus {
    grid-column: span 1 !important;
  }
}

@media (max-width: 560px) {
  #emailSetupChecklist,
  .brief-grid,
  .shortlist-grid,
  .queue {
    grid-template-columns: 1fr !important;
  }

  .money {
    grid-template-columns: 1fr;
  }
}
