/**
 * RapidTriageME — Brand Enforcement Layer v3
 * Single source of truth. Loaded LAST so it wins every conflict.
 *
 * Primary:   #00C4D4  (electric teal)
 * BG:        #0F172A  (dark navy)
 * Surface:   #1E293B  (card surface)
 * Sidebar:   #151d2d
 * Text:      #F1F5F9
 * Muted:     #94A3B8
 * Border:    #1E293B
 * Danger:    #EF4444
 * Success:   #10B981
 * Font:      'Space Grotesk', system-ui, sans-serif
 */

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

/* ── CSS Variables reset ─────────────────────────────────── */
:root {
  --primary:        #00C4D4;
  --primary-light:  #33d6e2;
  --primary-dark:   #008fa0;
  --bg-dark:        #0F172A;
  --bg-card:        #1E293B;
  --bg-sidebar:     #151d2d;
  --text:           #F1F5F9;
  --text-muted:     #94A3B8;
  --border:         #1E293B;
  --danger:         #EF4444;
  --success:        #10B981;
  --warning:        #F59E0B;
  --rtm-cyan:       #00C4D4;
}

/* ── Typography ──────────────────────────────────────────── */
body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif !important;
  background: #0F172A !important;
  color: #F1F5F9 !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif !important;
  color: #F1F5F9;
}

/* ── Nav ─────────────────────────────────────────────────── */
nav, header nav, .navbar, [role="navigation"] {
  background: #0F172A !important;
  background-image: none !important;
  border-bottom: 1px solid rgba(0, 196, 212, 0.15) !important;
  box-shadow: 0 1px 0 rgba(0,196,212,0.1) !important;
}

/* Kill all purple gradients in nav */
nav *[style*="linear-gradient"],
header *[style*="linear-gradient"] {
  background: #0F172A !important;
  background-image: none !important;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar, [class*="sidebar"] {
  background: #151d2d !important;
  border-right: 1px solid rgba(0,196,212,0.1) !important;
}

/* ── Cards / Surfaces ────────────────────────────────────── */
.card, .stat-card, [class*="-card"], .modal-content,
.bg-white, .bg-light, [style*="background: white"],
[style*="background:#fff"], [style*="background: #fff"] {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border-color: #2d3f5c !important;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary, button.btn-primary, input[type=submit],
[class*="btn"][style*="#316"], [class*="btn"][style*="#667"],
[class*="btn"][style*="#764"] {
  background: #00C4D4 !important;
  background-image: none !important;
  color: #0F172A !important;
  border: none !important;
  font-weight: 600 !important;
}

.btn-primary:hover {
  background: #33d6e2 !important;
}

.btn-outline, .btn-secondary {
  background: transparent !important;
  border: 1px solid #00C4D4 !important;
  color: #00C4D4 !important;
}

.btn-outline:hover, .btn-secondary:hover {
  background: rgba(0,196,212,0.1) !important;
}

/* ── Purple gradient killer ──────────────────────────────── */
/* Any element using the old #667eea / #764ba2 purple palette */
*[style*="667eea"], *[style*="764ba2"],
*[style*="linear-gradient(135deg, #6"],
*[style*="linear-gradient(135deg, rgb"] {
  background: #0F172A !important;
  background-image: none !important;
}

/* ── Form inputs ─────────────────────────────────────────── */
input, textarea, select, .form-control, .input {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border: 1px solid #2d3f5c !important;
}

input:focus, textarea:focus, select:focus {
  border-color: #00C4D4 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(0,196,212,0.2) !important;
}

input::placeholder {
  color: #94A3B8 !important;
}

/* ── Links ───────────────────────────────────────────────── */
a { color: #00C4D4; }
a:hover { color: #33d6e2; }

/* ── Logo wordmark ───────────────────────────────────────── */
.rtm-logo-wordmark, .nav-logo span,
[class*="logo"][class*="wordmark"] {
  font-family: 'Space Grotesk', sans-serif !important;
  font-weight: 700 !important;
  color: #F1F5F9 !important;
}

/* ── Accent / highlight color enforcement ────────────────── */
.text-primary, .accent, [class*="text-cyan"],
[style*="color: #316"], [style*="color:#316"] {
  color: #00C4D4 !important;
}

/* ── Tables ──────────────────────────────────────────────── */
table, .table { color: #F1F5F9; }
th { color: #94A3B8 !important; border-bottom-color: #2d3f5c !important; }
tr { border-color: #2d3f5c !important; }
tr:hover { background: rgba(0,196,212,0.04) !important; }

/* ── Modals ──────────────────────────────────────────────── */
.modal { background: rgba(0,0,0,0.7) !important; }
.modal-content, .modal-header {
  background: #1E293B !important;
  border-color: #2d3f5c !important;
  color: #F1F5F9 !important;
}

/* ── Scrollbar (WebKit) ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0F172A; }
::-webkit-scrollbar-thumb { background: #2d3f5c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00C4D4; }

/* ── Selection ───────────────────────────────────────────── */
::selection { background: rgba(0,196,212,0.3); color: #F1F5F9; }

/* ── Alert/badge variants ────────────────────────────────── */
.alert-success, .badge-success { background: rgba(16,185,129,0.15) !important; color: #10B981 !important; border-color: rgba(16,185,129,0.3) !important; }
.alert-error, .alert-danger, .badge-danger { background: rgba(239,68,68,0.15) !important; color: #EF4444 !important; border-color: rgba(239,68,68,0.3) !important; }
.alert-warning, .badge-warning { background: rgba(245,158,11,0.15) !important; color: #F59E0B !important; border-color: rgba(245,158,11,0.3) !important; }
