/*
 * RidgeCrest Defense — Design System v3
 * Design language adapted from ridgecrest.de (2026)
 * Dark, high-contrast · Gold accents · Geometric · Sans-serif
 */

:root {
  --bg-app: #050505;
  --bg-panel: #0a0a0a;
  --bg-card: #111111;
  --bg-hover: #191919;
  --bg-raised: #1a1a1a;
  --border: #1d1d1d;
  --border-light: #333333;
  --border-gold: #C9A84C;
  --gold: #C9A84C;
  --gold-dim: rgba(201, 168, 76, 0.3);
  --gold-faint: rgba(201, 168, 76, 0.08);
  --text-primary: #f0f0f0;
  --text-secondary: #999999;
  --text-muted: #666666;
  --text-dim: #444444;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --font-heading: 'Inter', 'Helvetica Neue', sans-serif;
  --sidebar-w: 240px;
}

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

body {
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::selection { background: var(--gold-dim); color: #fff; }

/* ═══ MOUNTAIN BG PATTERN ═══ */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(201, 168, 76, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 60% at 20% 80%, rgba(255,255,255,0.01) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 70%, rgba(201, 168, 76, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ═══ LOGIN PAGE ═══ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--bg-app);
  position: relative;
  overflow: hidden;
}

/* Hero mountain gradient overlay */
.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60vh;
  background: linear-gradient(180deg, rgba(201,168,76,0.06) 0%, transparent 100%);
  pointer-events: none;
}

.login-panel {
  width: 420px;
  padding: 60px 48px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo svg {
  height: 36px;
  width: auto;
  opacity: 0.9;
}
.login-logo img {
  height: 36px;
  width: auto;
  opacity: 0.9;
}

.login-brand { text-align: center; margin-bottom: 44px; }
.login-brand h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text-primary);
  margin: 0 0 4px;
  text-transform: uppercase;
}
.brand-subtitle {
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 400;
}

.login-form { margin-bottom: 36px; }
.login-field { margin-bottom: 16px; }
.login-input {
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.3px;
}
.login-input:focus { border-color: var(--gold); }
.login-input::placeholder { color: var(--text-dim); }

.login-btn {
  width: 100%; padding: 14px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--font);
  font-size: 11px; letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
}
.login-btn:hover {
  background: var(--gold-faint);
  color: #f0e6c0;
  border-color: #d4b85a;
}

.login-alert {
  padding: 10px 14px; margin-bottom: 20px;
  border: 1px solid #3a1a1a;
  font-size: 12px; color: #b77;
  text-align: center;
}

.login-footer {
  text-align: center;
  font-size: 9px;
  color: var(--text-dim);
  line-height: 1.7;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ═══ DIAMOND DIVIDER ═══ */
.diamond-divider {
  display: flex; align-items: center;
  justify-content: center;
  gap: 6px; margin: 20px 0;
  color: var(--gold-dim);
  font-size: 6px;
  opacity: 0.5;
}
.diamond-divider::before,
.diamond-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.diamond-divider .diamond { font-size: 5px; }

/* ═══ LAYOUT ═══ */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
}
.sidebar-brand .brand-logo svg {
  height: 28px;
  width: auto;
}
.sidebar-brand .brand-logo img {
  height: 28px;
  width: auto;
}

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

.sidebar-nav a {
  display: flex; align-items: center;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: all 0.12s;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}
.sidebar-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: rgba(201, 168, 76, 0.3);
}
.sidebar-nav a.active {
  color: var(--gold);
  background: var(--gold-faint);
  border-left-color: var(--gold);
}
.sidebar-nav a .icon {
  width: 20px;
  margin-right: 10px;
  text-align: center;
  font-size: 11px;
  opacity: 0.6;
}
.sidebar-nav a.active .icon { opacity: 1; }
.sidebar-nav a .nav-badge {
  margin-left: auto;
  font-size: 9px;
  background: var(--bg-hover);
  color: var(--text-dim);
  padding: 1px 7px;
  border: 1px solid var(--border);
}

/* Section label in sidebar */
.sidebar-section-label {
  padding: 16px 20px 6px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.5;
}
.sidebar-footer .user-name { font-size: 12px; color: var(--text-secondary); letter-spacing: 0.3px; }
.sidebar-footer .user-role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-top: 2px;
}
.sidebar-footer .logout-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  transition: color 0.12s;
}
.sidebar-footer .logout-link:hover { color: var(--gold); }

/* ═══ MAIN CONTENT ═══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  max-width: 1440px;
  min-height: 100vh;
}

/* ═══ PAGE HEADER ═══ */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.page-header-content h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.page-header-content p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.page-header-actions { display: flex; gap: 8px; }

/* ═══ GOLD ACCENT BAR ═══ */
.accent-bar {
  width: 28px;
  height: 2px;
  background: var(--gold);
  margin-top: 8px;
  margin-bottom: 16px;
}

/* ═══ STATS GRID ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin-bottom: 32px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stat-card {
  background: var(--bg-card);
  padding: 22px 20px;
  text-align: center;
  position: relative;
}
.stat-card.stat-card-link {
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background 0.1s, border-color 0.1s;
  border: 1px solid transparent;
}
.stat-card.stat-card-link:hover {
  background: #161616;
  border-color: var(--gold-dim);
}
.stat-card.stat-card-link:hover .stat-label {
  color: var(--gold);
}
.stat-card.stat-card-alert {
  border: 1px solid rgba(255, 80, 80, 0.4) !important;
}
.stat-card.stat-card-alert .stat-value { color: #ff5555; }
.stat-card.stat-card-warn {
  border: 1px solid rgba(255, 180, 50, 0.3) !important;
}
.stat-card.stat-card-warn .stat-value { color: #ffb432; }
.stat-card .stat-diamond {
  font-size: 6px;
  color: var(--gold-dim);
  margin-bottom: 10px;
}
.stat-value {
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 6px;
  font-weight: 400;
}

/* ═══ TWO-COL ═══ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); margin-bottom: 32px; }
.two-col > * { background: var(--bg-card); }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 1px;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-light); }
.card-gold {
  border-color: var(--gold-dim);
}
.card-gold:hover {
  border-color: var(--border-gold);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header-left { display: flex; align-items: center; gap: 10px; }
.card-header-left .card-diamond { font-size: 6px; color: var(--gold); }
.card-title { font-size: 13px; font-weight: 500; color: var(--text-primary); letter-spacing: 0.3px; }
.card-body { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }

/* ═══ STAGE FUNNEL ═══ */
.stage-funnel { display: flex; flex-direction: column; gap: 4px; }
.funnel-row { display: flex; align-items: center; gap: 12px; font-size: 11px; opacity: 0.35; }
.funnel-row.has-deals { opacity: 1; }
.funnel-label { width: 130px; text-align: right; color: var(--text-secondary); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.funnel-bar-bg { flex: 1; background: var(--bg-hover); height: 8px; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--gold-dim); min-width: 2px; transition: width 0.3s; }
.funnel-bar.strong { background: var(--gold); }
.funnel-count { width: 24px; text-align: right; font-weight: 500; color: var(--text-secondary); }

/* ═══ TIMELINE ═══ */
.timeline { list-style: none; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.timeline-dot { width: 6px; height: 6px; background: var(--gold-dim); margin-top: 5px; flex-shrink: 0; transform: rotate(45deg); }
.timeline-content { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--text-secondary); }
.timeline-date { color: var(--text-dim); font-size: 10px; margin-left: auto; }

/* ═══ QUICK ACTIONS ═══ */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); }
.action-card {
  display: flex; align-items: center; gap: 10px;
  padding: 18px; background: var(--bg-card);
  color: var(--text-secondary); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.15s;
  border: none;
  font-family: var(--font);
  cursor: pointer;
}
.action-card:hover { background: var(--bg-hover); color: var(--gold); }
.action-icon { color: var(--gold-dim); font-size: 14px; }

/* ═══ KANBAN ═══ */
.kanban-board { display: flex; gap: 1px; overflow-x: auto; padding-bottom: 16px; background: var(--border); }
.kanban-column { flex: 0 0 270px; background: var(--bg-card); min-height: 400px; }
.kanban-column-rejected { flex: 0 0 220px; opacity: 0.55; background: #0a0a0a; border-left: 2px solid #2a2a2a; }
.kanban-column-rejected .kanban-column-header h3 { color: #555; }
.kanban-column-header {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.kanban-column-header h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--text-muted);
}
.kanban-count {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg-hover);
  padding: 1px 8px;
  border: 1px solid var(--border);
}
.kanban-items { padding: 8px; min-height: 60px; }
.kanban-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 6px;
  cursor: grab;
  transition: all 0.12s;
  position: relative;
}
.kanban-card:hover { border-color: var(--gold-dim); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card .name { font-size: 12px; font-weight: 500; margin-bottom: 4px; letter-spacing: 0.2px; }
.kanban-card .org { font-size: 10px; color: var(--text-dim); }
.kanban-card .meta { display: flex; gap: 8px; margin-top: 8px; font-size: 9px; color: var(--text-dim); }

/* ═══ TABLE ═══ */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 500;
}
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(29,29,29,0.5);
  color: var(--text-secondary);
}
.data-table tr:hover td { background: var(--bg-hover); }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font); font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  letter-spacing: 0.2px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--gold); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-panel); color: var(--text-primary); }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-block; padding: 10px 24px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font); font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: var(--gold-faint);
}
.btn-primary {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-faint);
  border-color: var(--border-gold);
  color: #f0e6c0;
}
.btn-sm { padding: 6px 14px; font-size: 9px; letter-spacing: 1px; }
.btn-group { display: flex; gap: 8px; }

/* ═══ STAGE BADGES ═══ */
.stage-badge {
  display: inline-block; padding: 2px 10px;
  border: 1px solid var(--border-light);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.stage-badge.active { border-color: var(--gold-dim); color: var(--gold); }
.stage-badge.from { border-color: var(--border); }
.stage-badge.to { border-color: var(--gold-dim); color: var(--gold); }

/* ═══ GOLD TAGS (ridgecrest.de style) ═══ */
.gold-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-right: 4px;
  margin-bottom: 4px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--border);
  font-size: 9px;
  color: var(--text-dim);
  margin-right: 4px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ═══ FLASH ═══ */
.flash {
  padding: 12px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.3px;
}
.flash-success {
  border-color: rgba(201,168,76,0.3);
  color: var(--gold);
  background: var(--gold-faint);
}
.flash-error {
  border-color: #3a1a1a;
  color: #b77;
  background: rgba(187,119,119,0.05);
}

/* ═══ DETAIL ═══ */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1px; background: var(--border); }
.detail-grid > * { background: var(--bg-card); padding: 24px; }
.detail-field { margin-bottom: 16px; }
.detail-field-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.detail-field-value { font-size: 13px; color: var(--text-primary); letter-spacing: 0.2px; }

/* ═══ EMPTY STATE ═══ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); font-size: 12px; }
.empty-state .empty-icon { font-size: 24px; color: var(--gold-dim); margin-bottom: 16px; }

/* ═══ RIDGECREST QUOTE BLOCK ═══ */
.quote-block {
  text-align: center;
  padding: 32px;
  margin: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
  letter-spacing: 0.2px;
}
.quote-block .quote-source {
  display: block;
  margin-top: 12px;
  font-size: 9px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
}

/* ═══ REPORT COMPONENTS ═══ */
.kv-grid { display: grid; grid-template-columns: 130px 1fr; gap: 6px; font-size: 12px; }
.kv-label { color: var(--text-muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.domain-bars { display: flex; flex-direction: column; gap: 8px; }
.domain-row { display: flex; align-items: center; gap: 12px; }
.domain-name { width: 170px; font-size: 11px; color: var(--text-secondary); }
.domain-bar-bg { flex: 1; background: var(--bg-hover); height: 8px; overflow: hidden; }
.domain-bar { height: 100%; background: var(--gold-dim); min-width: 2px; }
.domain-bar.strong { background: var(--gold); }
.domain-score { font-size: 11px; font-weight: 500; width: 28px; text-align: right; color: var(--text-secondary); }
.badge { display: inline-block; padding: 2px 8px; font-size: 9px; background: var(--bg-hover); text-transform: uppercase; letter-spacing: 0.5px; }

/* ═══ STAGE LIST ═══ */
.criteria-list { list-style: none; }
.criteria-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.criteria-list li::before {
  content: '◆';
  font-size: 5px;
  color: var(--gold-dim);
}
.criteria-list li:last-child { border-bottom: none; }

/* ═══ CONTACT LIST ═══ */
.contact-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--border); }
.contact-card { padding: 18px; background: var(--bg-card); font-size: 12px; }
.contact-card .contact-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; }

/* ═══ CONFIDENTIAL FOOTER ═══ */
.app-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.8;
}
.app-footer .footer-gold { color: var(--gold-dim); }

/* ═══ OPPORTUNITY CARDS (deck style) ═══ */
.opp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 18px;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opp-card:hover { border-color: var(--gold-dim); }
.opp-card .opp-header {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.opp-card .opp-name { font-size: 14px; font-weight: 600; letter-spacing: 0.2px; }
.opp-card .opp-org { font-size: 11px; color: var(--text-muted); }
.opp-card .opp-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.opp-card .opp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ═══ PARTNER CARD (ridgecrest.de style) ═══ */
.partner-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  padding: 24px;
}
.partner-card .partner-category {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 12px;
}
.partner-card .partner-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.partner-card .gold-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }

/* ═══ INTAKE QUEUE ═══ */
.intake-item {
  padding: 14px;
  border: 1px solid var(--border);
  margin-bottom: 4px;
  background: var(--bg-card);
  transition: border-color 0.15s;
}
.intake-item:hover { border-color: var(--gold-dim); }
.intake-item .intake-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.intake-item .intake-title { font-size: 13px; font-weight: 500; }
.intake-item .intake-meta { font-size: 10px; color: var(--text-dim); }

/* ═══ UTILITY ═══ */
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-align-center { align-items: center; }
.flex-gap { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.mono { font-family: var(--font-mono); font-size: 11px; }
.font-small { font-size: 11px; }
.good { color: #8a9a7a; }
.risk { color: #b77; }

/* ═══ GRID ═══ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.grid-2 > * { background: var(--bg-card); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--border); }
.grid-3 > * { background: var(--bg-card); }

/* ═══ ENTITY LINK ═══ */
.entity-link {
  color: var(--text-primary);
  transition: color 0.12s;
  font-weight: 400;
}
.entity-link:hover {
  color: var(--gold);
}

/* ═══ SIDEBAR COLLAPSE ═══ */
.sidebar-collapse-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 8px;
  padding: 2px 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.sidebar-collapse-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Collapsed sidebar */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-brand { padding: 20px 12px; }
.sidebar.collapsed .sidebar-brand .brand-logo img,
.sidebar.collapsed .sidebar-brand .brand-logo svg { height: 24px; }
.sidebar.collapsed .sidebar-nav a { padding: 10px 12px; justify-content: center; }
.sidebar.collapsed .sidebar-nav a .icon { margin-right: 0; }
.sidebar.collapsed .sidebar-nav a span:not(.icon),
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-section-label { display: none; }
.main.sidebar-collapsed { margin-left: 56px; }

/* ═══ SIDEBAR TOGGLE (hamburger - mobile) ═══ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sidebar-toggle:hover { border-color: var(--text-muted); }
.sidebar-toggle .toggle-line {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text-muted);
  transition: all 0.2s;
}

/* ═══ SIDEBAR OVERLAY (mobile) ═══ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 15;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 20;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { width: var(--sidebar-w); }
  .sidebar.collapsed .sidebar-nav a { justify-content: flex-start; }
  .sidebar.collapsed .sidebar-nav a .icon { margin-right: 10px; }
  .sidebar.collapsed .sidebar-nav a span:not(.icon) { display: inline; }
  .sidebar.collapsed .sidebar-footer { display: block; }
  .main { margin-left: 0; padding: 60px 20px 20px; }
  .main.sidebar-collapsed { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main { padding: 56px 14px 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .main { padding: 56px 10px 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Mobile Lesbarkeit (global, max-width:760px) ───
   Verbessert Schriftgröße, Zeilenhöhe, Tabellen-Scroll, Umbruch langer
   Wörter, Tap-Höhe der Buttons und Kontraste – ohne Desktop zu verändern. */
@media (max-width: 760px) {
  /* Größere Basis-Schrift & bessere Zeilenhöhe */
  body {
    font-size: 15px;
    line-height: 1.5;
  }
  p, li, .detail-field-value, .card-body {
    line-height: 1.5;
  }

  /* Tabellen scrollen horizontal statt abzuschneiden */
  .card,
  .table-wrap,
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .data-table {
    min-width: 560px;
  }
  .data-table th,
  .data-table td {
    font-size: 13px;
    line-height: 1.5;
  }

  /* Lange Wörter, Claims, Firmennamen, Links umbrechen */
  .name-cell,
  .name-cell a,
  .card-title,
  .detail-field-value,
  .detail-field-value a,
  td a,
  p, li, h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Buttons mind. 40px Tap-Höhe */
  .btn,
  .btn-sm,
  .btn-primary,
  .btn-secondary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Wichtige Sekundärtexte: besserer Kontrast (--text-secondary statt --text-muted) */
  .text-muted {
    color: var(--text-secondary);
  }
}