/* ================================================================
   Bodyfit Business Platform — Design System "Athletic Dark"
   Abgeleitet aus Cortex AI Business Dashboard (Teal+Gold → Navy+Orange)
   ================================================================ */

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

/* ================================================================
   CSS VARIABLEN
   ================================================================ */
:root {
  --bg-deep:    #080E1A;
  --bg-primary: #0C1526;
  --bg-mid:     #101D30;
  --bg-card:    linear-gradient(135deg, #111D32 0%, #0A1220 100%);
  --bg-sidebar: linear-gradient(180deg, #070D18 0%, #0C1828 100%);
  --body-bg:    radial-gradient(ellipse at top left, #0E2040 0%, #080E1A 60%, #060A14 100%);

  --accent-dark:   #C44B10;
  --accent-base:   #E85D20;
  --accent-warm:   #F47340;
  --accent-light:  #F9976A;
  --accent-bright: #FDB896;
  --accent-grad:   linear-gradient(135deg, #C44B10 0%, #E85D20 40%, #F47340 100%);
  --accent-grad-h: linear-gradient(90deg, #C44B10, #F47340, #C44B10);

  --text-primary:   #F47340;
  --text-secondary: #A06040;
  --text-muted:     #506070;
  --text-white:     #F0EBE5;

  --status-live:    #2D9E6B;
  --status-danger:  #B84040;
  --status-warning: #D4A020;

  --border:        rgba(232, 93, 32, 0.15);
  --border-strong: rgba(232, 93, 32, 0.4);
  --border-subtle: rgba(255, 255, 255, 0.04);

  --sidebar-width: 220px;
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    0.2s ease;
}

/* ================================================================
   RESET & BASIS
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--body-bg) !important;
  color: var(--text-white) !important;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #060A14; }
::-webkit-scrollbar-thumb { background: rgba(232,93,32,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232,93,32,0.45); }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 16px;
}

.logo-brand {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--accent-grad-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-base), transparent);
  margin: 0 16px;
  opacity: 0.35;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.sidebar-bottom {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Nav-Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.nav-item:hover {
  color: var(--accent-warm);
  background: rgba(232, 93, 32, 0.05);
}

.nav-item.active {
  color: var(--accent-light);
  background: rgba(232, 93, 32, 0.08);
  border-left-color: var(--accent-base);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Status-Dot */
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-live);
  box-shadow: 0 0 6px rgba(45,158,107,0.6);
  animation: pulse-live 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* User-Badge (von nav-roles.js in .sidebar-bottom eingefügt) */
.sidebar-user-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.sidebar-user-name {
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  font-size: 11px;
  color: rgba(80,96,112,0.7);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
  font-family: 'Inter', sans-serif;
}

.sidebar-logout-btn:hover { color: #e07070; }

/* Premium-Badge für gesperrte Nav-Einträge */
.premium-badge {
  font-size: 10px;
  background: rgba(232,93,32,0.15);
  color: var(--accent-base);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
}

.page-header { margin-bottom: 28px; }

.page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-white);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(232,93,32,0.06);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(232, 93, 32, 0.28);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6),
              0 0 0 1px rgba(232,93,32,0.1);
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 100px; height: 45px;
  background: var(--accent-grad);
  border-radius: 60% 0 0 0;
  opacity: 0.055;
  pointer-events: none;
}

/* ================================================================
   METRICS
   ================================================================ */
.metric-label {
  font-size: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.metric-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
}

/* Summary cards in Lead Detail */
.summary-card {
  background: rgba(8,14,26,0.5);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.border-l-primary  { border-left-color: var(--accent-base); }
.border-l-accent   { border-left-color: var(--status-live); }
.border-l-danger   { border-left-color: var(--status-danger); }
.border-l-yellow-500 { border-left-color: var(--status-warning); }

.summary-label {
  font-size: 9px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.summary-value {
  font-size: 13px;
  color: var(--text-white);
  line-height: 1.5;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  transition: box-shadow var(--transition), filter var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(232,93,32,0.35);
  filter: brightness(1.08);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-base);
  border: 1px solid rgba(232, 93, 32, 0.35);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(232, 93, 32, 0.08);
  border-color: rgba(232, 93, 32, 0.6);
  color: var(--accent-light);
}

.btn-danger {
  background: transparent;
  color: #e07070;
  border: 1px solid rgba(184, 64, 64, 0.4);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover {
  background: rgba(184, 64, 64, 0.1);
  border-color: rgba(184, 64, 64, 0.7);
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input {
  width: 100%;
  background: rgba(8, 14, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-white);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus {
  border-color: rgba(232, 93, 32, 0.6);
  box-shadow: 0 0 0 3px rgba(232, 93, 32, 0.1);
}

.input::placeholder { color: var(--text-muted); }

/* ================================================================
   TABS
   ================================================================ */
.tab {
  padding: 10px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}

.tab:hover { color: var(--accent-warm); }
.tab.active { color: var(--accent-light); border-bottom-color: var(--accent-base); }

/* ================================================================
   TABLE ROWS
   ================================================================ */
.leads-row {
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.leads-row:hover td { background: rgba(232, 93, 32, 0.04); }
.leads-row.selected td { background: rgba(232, 93, 32, 0.08); }
.leads-row td { padding: 10px 12px 10px 0; font-size: 13px; }

/* ================================================================
   STATUS BADGES
   ================================================================ */
.badge-new {
  display: inline-flex; align-items: center;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(80,96,112,0.5);
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

.badge-processing {
  display: inline-flex; align-items: center;
  background: rgba(212,160,32,0.12);
  color: #D4A020;
  border: 1px solid rgba(212,160,32,0.3);
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

.badge-replied {
  display: inline-flex; align-items: center;
  background: rgba(45,158,107,0.12);
  color: #3ECF8E;
  border: 1px solid rgba(45,158,107,0.3);
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

.badge-success {
  display: inline-flex; align-items: center;
  background: rgba(45,158,107,0.12);
  color: #3ECF8E;
  border: 1px solid rgba(45,158,107,0.3);
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em;
}

.badge-danger {
  display: inline-flex; align-items: center;
  background: rgba(184,64,64,0.12);
  color: #e07070;
  border: 1px solid rgba(184,64,64,0.3);
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em;
}

.badge-info {
  display: inline-flex; align-items: center;
  background: rgba(232,93,32,0.12);
  color: var(--accent-light);
  border: 1px solid rgba(232,93,32,0.3);
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-family: 'Montserrat', sans-serif;
  font-weight: 600; letter-spacing: 0.05em;
}

/* ================================================================
   ALERTS
   ================================================================ */
.alert-success {
  background: rgba(45,158,107,0.1);
  border-left: 3px solid var(--status-live);
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: #3ECF8E; font-size: 13px;
}

.alert-error {
  background: rgba(184,64,64,0.1);
  border-left: 3px solid var(--status-danger);
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: #e07070; font-size: 13px;
}

.alert-info {
  background: rgba(232,93,32,0.08);
  border-left: 3px solid var(--accent-base);
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--accent-light); font-size: 13px;
}

/* ================================================================
   DONE-CHECK (Leads Tabelle)
   ================================================================ */
.done-check {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; line-height: 1;
  padding: 2px 4px; border-radius: 4px;
  transition: transform 0.1s;
}

.done-check:hover { transform: scale(1.2); }
.done-check.open  { color: #374151; }
.done-check.open:hover { color: var(--status-live); }
.done-check.done  { color: var(--status-live); }

/* ================================================================
   SPINNER
   ================================================================ */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(232,93,32,0.2);
  border-top-color: var(--accent-base);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ================================================================
   DRAG & DROP ZONE
   ================================================================ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  color: var(--text-muted);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-base);
  background: rgba(232,93,32,0.04);
  color: var(--accent-light);
}

/* ================================================================
   TOAST
   ================================================================ */
#toastContainer {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  background: linear-gradient(135deg, #111D32, #080E1A);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px; color: var(--text-white);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease;
}

.toast.success { border-left: 3px solid var(--status-live); }
.toast.error   { border-left: 3px solid var(--status-danger); }
.toast.info    { border-left: 3px solid var(--accent-base); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ================================================================
   DIVIDER
   ================================================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-base), transparent);
  border: none; margin: 20px 0; opacity: 0.3;
}

/* ================================================================
   MONO UTILITY
   ================================================================ */
.mono { font-family: 'JetBrains Mono', monospace; }

/* ================================================================
   QUICK ACCESS CARDS (Dashboard)
   ================================================================ */
.quick-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative; overflow: hidden;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4),
              inset 0 1px 0 rgba(232,93,32,0.06);
}

.quick-card:hover {
  border-color: rgba(232, 93, 32, 0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6),
              0 0 0 1px rgba(232,93,32,0.15);
  transform: translateY(-2px);
}

.quick-card::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 80px; height: 36px;
  background: var(--accent-grad);
  border-radius: 60% 0 0 0;
  opacity: 0.07;
  pointer-events: none;
}

.quick-card-icon {
  font-size: 22px;
  margin-bottom: 10px;
  display: block;
}

.quick-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 4px;
}

.quick-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-wrap {
  /* Nur auf body-Ebene — Layout via Tailwind flex/items-center/justify-center */
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--accent-grad-h);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.login-logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6),
              inset 0 1px 0 rgba(232,93,32,0.08);
}

.login-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 24px;
}

.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 24px;
  letter-spacing: 0.03em;
}

/* ================================================================
   TAILWIND COMPATIBILITY OVERRIDES
   (Für Tailwind-Klassen die noch in HTML verwendet werden)
   ================================================================ */

/* Text colors */
.text-gray-100 { color: var(--text-white) !important; }
.text-gray-200 { color: rgba(240,235,229,0.85) !important; }
.text-gray-300 { color: rgba(240,235,229,0.7) !important; }
.text-gray-400 { color: var(--text-muted) !important; }
.text-gray-500 { color: rgba(80,96,112,0.7) !important; }
.text-gray-600 { color: rgba(80,96,112,0.5) !important; }
.text-primary  { color: var(--accent-base) !important; }
.text-accent   { color: var(--status-live) !important; }
.text-danger   { color: #e07070 !important; }

/* Background colors */
.bg-bg      { background: transparent !important; }
.bg-sidebar { background: transparent !important; }
.bg-card    { background: var(--bg-card) !important; }

/* Border colors */
.border-gray-700 { border-color: var(--border) !important; }
.border-gray-800 { border-color: var(--border) !important; }
.border-primary  { border-color: var(--accent-base) !important; }

/* Hover border for quick cards */
.hover\:border-primary:hover { border-color: var(--accent-base) !important; }

/* Focus states */
.focus\:border-primary:focus { border-color: var(--accent-base) !important; }

/* Input fields in Tailwind context */
.bg-bg.border { background: rgba(8,14,26,0.7) !important; }
