/* ═══════════════════════════════════════════════════════════════════════════
   OMNIS — index-components.css
   
   Extracted from index.html <style> block. Fixes:
   - 23+ unclosed CSS braces
   - Duplicate AI panel definitions merged
   - Duplicate risk-badge definitions merged
   - Inline style="" attributes moved to classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PAGE ENTER ────────────────────────────────────────────────────────── */
@keyframes page-enter {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:none; }
}
.app-shell { animation: page-enter .35s cubic-bezier(.16,1,.3,1) both; }


/* ── DRIVER EMERGENCY ALERT ───────────────────────────────────────────── */
.emergency-bar {
  display:none; position:fixed; top:0; left:0; right:0; z-index:9999;
  background:linear-gradient(90deg,rgba(220,20,60,.95),rgba(200,16,46,.95));
  padding:12px 20px; color:#fff;
  align-items:center; gap:12px;
  box-shadow:0 4px 24px rgba(220,20,60,.5);
  animation:emergencySlide .3s cubic-bezier(.16,1,.3,1);
}
.emergency-bar.show { display:flex; }
@keyframes emergencySlide { from { transform:translateY(-100%); } to { transform:none; } }
.emergency-bar-icon { font-size:24px; flex-shrink:0; animation:emergencyFlash .5s ease infinite alternate; }
@keyframes emergencyFlash { from { opacity:1; } to { opacity:.3; } }
.emergency-bar-text { flex:1; }
.emergency-bar-name { font-size:14px; font-weight:700; }
.emergency-bar-loc  { font-size:11px; opacity:.85; margin-top:1px; }
.emergency-bar-btn  {
  height:32px; padding:0 14px;
  background:rgba(255,255,255,.2); border:1px solid rgba(255,255,255,.4);
  border-radius:7px; color:#fff; font-family:var(--font);
  font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap;
}
.emergency-bar-btn:hover { background:rgba(255,255,255,.3); }


/* ── AI DISPATCH ASSISTANT (merged / deduplicated) ────────────────────── */
.ai-toggle {
  position:fixed; bottom:24px; right:24px; z-index:800;
  width:52px; height:52px; border-radius:50%;
  background:linear-gradient(135deg,var(--neural),#4f4de0);
  border:none; cursor:pointer;
  box-shadow:0 4px 24px rgba(220,38,38,.5);
  font-size:22px; transition:all .2s cubic-bezier(.16,1,.3,1);
  animation:aiPulse 3s ease infinite;
  display:flex; align-items:center; justify-content:center;
}
.ai-toggle:hover { transform:scale(1.08); box-shadow:0 8px 32px rgba(220,38,38,.7); }
.ai-toggle.open  { border-radius:12px; background:rgba(5,9,16,.99); border:1px solid var(--neural-border); animation:none; }
@keyframes aiPulse {
  0%,100% { box-shadow:0 4px 24px rgba(220,38,38,.5); }
  50%     { box-shadow:0 4px 32px rgba(220,38,38,.8); }
}

.ai-panel {
  display:none; position:fixed; bottom:88px; right:24px; z-index:800;
  width:380px; max-width:calc(100vw - 32px);
  background:rgba(4,6,14,.99); border:1px solid var(--neural-border);
  border-radius:16px; box-shadow:0 24px 64px rgba(0,0,0,.8);
  flex-direction:column; overflow:hidden;
  animation:aiPanelIn .2s cubic-bezier(.16,1,.3,1);
  max-height:calc(100vh - 120px);
}
.ai-panel.open { display:flex; }
@keyframes aiPanelIn {
  from { opacity:0; transform:translateY(12px) scale(.97); }
  to   { opacity:1; transform:none; }
}

.ai-head {
  padding:12px 14px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:8px; flex-shrink:0;
  background:rgba(220,38,38,.06);
}
.ai-head-icon  { font-size:16px; }
.ai-head-title { font-size:13px; font-weight:700; color:var(--ink); flex:1; }
.ai-head-badge {
  font-size:8px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:var(--neural-b); background:var(--neural-bg); border:1px solid var(--neural-border);
  padding:2px 6px; border-radius:4px;
}
.ai-close { background:none; border:none; color:var(--ink-3); cursor:pointer; font-size:14px; padding:2px; }

.ai-quick-btns {
  display:flex; gap:5px; padding:8px 10px;
  border-bottom:1px solid var(--border); flex-shrink:0;
  overflow-x:auto; scrollbar-width:none;
}
.ai-quick-btns::-webkit-scrollbar { display:none; }
.ai-quick-btn {
  height:26px; padding:0 10px; white-space:nowrap; flex-shrink:0;
  background:rgba(0,0,0,.3); border:1px solid var(--border-2); border-radius:6px;
  color:var(--ink-3); font-family:var(--font); font-size:10px; font-weight:600;
  cursor:pointer; transition:all .12s;
}
.ai-quick-btn:hover { color:var(--neural-b); border-color:var(--neural-border); background:var(--neural-bg); }

.ai-messages {
  flex:1; overflow-y:auto; padding:12px;
  display:flex; flex-direction:column; gap:10px;
  min-height:200px;
}
.ai-messages::-webkit-scrollbar { width:2px; }
.ai-messages::-webkit-scrollbar-thumb { background:rgba(120,140,200,.1); }

.ai-msg { display:flex; gap:8px; max-width:90%; }
.ai-msg.user { align-self:flex-end; flex-direction:row-reverse; }
.ai-msg-avatar {
  width:26px; height:26px; border-radius:7px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:12px;
}
.ai-msg.ai .ai-msg-avatar   { background:var(--neural-bg); border:1px solid var(--neural-border); }
.ai-msg.user .ai-msg-avatar { background:rgba(255,255,255,.06); border:1px solid var(--border-2); }
.ai-msg-bubble {
  padding:9px 12px; border-radius:10px; font-size:12px; line-height:1.55;
}
.ai-msg.ai .ai-msg-bubble   { background:rgba(220,38,38,.08); border:1px solid var(--neural-border); border-radius:2px 10px 10px 10px; }
.ai-msg.user .ai-msg-bubble { background:rgba(255,255,255,.05); border:1px solid var(--border-2); border-radius:10px 2px 10px 10px; color:var(--ink); }

.ai-typing { display:flex; gap:4px; padding:10px 14px; align-items:center; }
.ai-typing-dot {
  width:5px; height:5px; border-radius:50%; background:var(--neural);
  animation:typingBounce .9s ease infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay:.15s; }
.ai-typing-dot:nth-child(3) { animation-delay:.3s; }
@keyframes typingBounce { 0%,60%,100% { transform:none; } 30% { transform:translateY(-4px); } }

.ai-empty {
  text-align:center; padding:32px 16px; color:var(--ink-3); font-size:12px;
}
.ai-empty-icon { font-size:28px; margin-bottom:8px; opacity:.4; }

.ai-input-row {
  display:flex; gap:7px; padding:10px; border-top:1px solid var(--border); flex-shrink:0;
}
.ai-input {
  flex:1; height:38px; padding:0 12px;
  background:rgba(0,0,0,.4); border:1px solid var(--border-2); border-radius:8px;
  color:var(--ink); font-family:var(--font); font-size:12px; outline:none;
  transition:border-color .15s;
}
.ai-input:focus { border-color:var(--neural-border); }
.ai-send {
  width:38px; height:38px; border-radius:8px; flex-shrink:0;
  background:var(--neural); border:none; color:#fff; cursor:pointer;
  font-size:15px; transition:all .15s;
  display:flex; align-items:center; justify-content:center;
}
.ai-send:hover { background:#4f4de0; }
.ai-send:disabled { opacity:.4; cursor:not-allowed; }

@media(max-width:480px) { .ai-panel { width:calc(100vw - 32px); right:16px; bottom:16px; } }


/* ── RISK BADGE (merged) ──────────────────────────────────────────────── */
.risk-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size:9px; font-weight:700; padding:2px 6px; border-radius:4px;
  border:1px solid; white-space:nowrap;
}
.risk-badge.caution  { color:var(--caution); background:var(--caution-bg); border-color:var(--caution-border); }
.risk-badge.critical { color:var(--critical-b); background:var(--critical-dim); border-color:var(--critical-border); animation:critPulse 1.5s ease infinite; }


/* ── NATURAL LANGUAGE SEARCH ──────────────────────────────────────────── */
.nl-search-wrap {
  position:relative; flex:1; max-width:420px;
}
.nl-search-input {
  width:100%; height:34px; padding:0 12px 0 34px;
  background:rgba(0,0,0,.4); border:1px solid rgba(120,140,200,.12);
  border-radius:8px; color:var(--ink); font-family:var(--font);
  font-size:12px; outline:none; transition:all .15s;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(120,140,200,0.4)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:10px center;
}
.nl-search-input:focus {
  border-color:rgba(220,38,38,.4);
  background-color:rgba(220,38,38,.04);
}
.nl-search-input::placeholder { color:rgba(120,140,200,.35); }
.nl-results-panel {
  display:none; position:absolute; top:calc(100% + 6px); left:0; right:0;
  background:rgba(4,7,16,.99); border:1px solid rgba(120,140,200,.12);
  border-radius:12px; box-shadow:0 16px 48px rgba(0,0,0,.7);
  backdrop-filter:blur(20px); z-index:400; overflow:hidden;
  max-height:360px; overflow-y:auto;
}
.nl-results-panel.open { display:block; animation:fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.nl-result-head {
  padding:8px 12px; font-size:9px; font-weight:700;
  letter-spacing:.14em; text-transform:uppercase;
  color:rgba(120,140,200,.4); border-bottom:1px solid rgba(120,140,200,.06);
  display:flex; justify-content:space-between;
}
.nl-result-row {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-bottom:1px solid rgba(120,140,200,.04);
  cursor:pointer; transition:background .1s;
}
.nl-result-row:hover { background:rgba(120,140,200,.04); }
.nl-result-row:last-child { border-bottom:none; }
.nl-result-label { font-size:12px; font-weight:600; color:var(--ink); font-family:var(--mono); }
.nl-result-meta  { font-size:11px; color:rgba(120,140,200,.5); flex:1; }
.nl-result-badge { font-size:9px; font-weight:700; padding:2px 7px; border-radius:4px; border:1px solid; }
.nl-suggestion-row {
  padding:8px 12px; font-size:12px; color:rgba(120,140,200,.5);
  cursor:pointer; transition:background .1s; display:flex; align-items:center; gap:8px;
}
.nl-suggestion-row:hover { background:rgba(220,38,38,.06); color:#f87171; }
.nl-empty { padding:20px; text-align:center; color:rgba(120,140,200,.4); font-size:12px; }


/* ── DISPATCH BOARD VISIBILITY FIXES ──────────────────────────────────── */
.board        { min-height:0 !important; overflow:visible !important; flex:1 1 auto !important; height:auto !important; }
.table-wrap   { overflow:auto !important; max-height:calc(100vh - 320px) !important; height:auto !important; min-height:200px !important; }
.main-column  { overflow:auto !important; flex:1 1 0% !important; }
.layout       { display:grid !important; grid-template-columns:1fr 300px !important; height:calc(100vh - 56px) !important; overflow:hidden !important; }
.side-column  { position:relative !important; flex-shrink:0 !important; overflow:auto !important; }
#miniChat     { max-height:260px !important; overflow:auto !important; }


/* ── FAB POSITIONING ──────────────────────────────────────────────────── */
#chatFab,
.omnis-ai-btn,
#omnis-ai-btn { bottom:80px !important; right:16px !important; z-index:100 !important; }


/* ── INLINE STYLE REPLACEMENTS ────────────────────────────────────────── */
/* Replaces style="" on topbar logo container */
.topbar-logo-wrap {
  flex-shrink:0; position:relative; display:flex;
  align-items:stretch; height:100%;
}
.topbar-logo-wrap canvas {
  height:100%; width:auto; display:block;
}

/* Replaces style="" on sign-out button */
.btn-signout {
  height:30px; padding:0 12px; border-radius:7px;
  border:1px solid rgba(220,20,60,.25);
  background:rgba(220,20,60,.08);
  color:rgba(220,20,60,.7);
  font-family:var(--font); font-size:11px; font-weight:700;
  cursor:pointer; letter-spacing:.04em;
  transition:all .15s; white-space:nowrap; flex-shrink:0;
}
.btn-signout:hover {
  background:rgba(220,20,60,.18);
  color:#DC143C;
}

/* Replaces style="" on side-column aside */
.side-column {
  display:flex; flex-direction:column; gap:8px;
  min-height:0; overflow:hidden;
}

/* Replaces style="" on miniChat section */
.mini-chat-panel {
  flex:0 0 260px; display:flex; flex-direction:column;
  min-height:0; overflow:hidden;
}

/* Mini chat header row */
.mini-chat-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.mini-chat-header-left {
  display:flex; align-items:center; gap:8px;
}
.mini-chat-header-icon { font-size:13px; }
.mini-chat-header-title {
  font-size:11px; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:var(--ink-2);
}
.mini-chat-header-right {
  display:flex; align-items:center; gap:6px;
}
.mini-chat-unread {
  display:none; font-size:9px; font-weight:700;
  padding:2px 6px; border-radius:10px;
  background:var(--critical-dim); color:var(--critical-b);
  border:1px solid var(--critical-border);
}
.mini-chat-full-link {
  font-size:10px; color:rgba(220,38,38,.6);
  text-decoration:none; font-weight:600;
}
.mini-chat-full-link:hover { color:#f87171; }

/* Mini chat channels row */
.mini-chat-channels {
  padding:6px 10px; border-bottom:1px solid var(--border);
  flex-shrink:0; overflow-x:auto; white-space:nowrap;
  display:flex; gap:4px;
}

/* Mini chat messages area */
.mini-chat-messages {
  flex:1; overflow-y:auto; padding:8px 12px;
  display:flex; flex-direction:column; gap:6px; font-size:12px;
}

/* Mini chat input row */
.mini-chat-input-row {
  padding:8px 10px; border-top:1px solid var(--border);
  display:flex; gap:6px; flex-shrink:0;
}
.mini-chat-input {
  flex:1; height:32px; padding:0 10px;
  background:rgba(0,0,0,.4); border:1px solid var(--border-2);
  border-radius:7px; color:var(--ink); font-family:var(--font);
  font-size:12px; outline:none;
}
.mini-chat-input:focus { border-color:rgba(220,38,38,.4); }
.mini-chat-send-btn {
  width:32px; height:32px; border-radius:7px; border:none;
  background:var(--neural); color:#fff; cursor:pointer;
  font-size:13px; display:flex; align-items:center;
  justify-content:center; flex-shrink:0;
}

/* Version badge in topbar */
.version-badge {
  font-size:9px; font-weight:700; letter-spacing:.18em;
  text-transform:uppercase; color:var(--neural);
  background:var(--neural-bg); border:1px solid var(--neural-border);
  padding:3px 8px; border-radius:4px;
}

/* Radial glow bg elements */
.bg-glow-container {
  position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden;
}
.bg-glow-tl {
  position:absolute; top:-15%; left:-8%;
  width:min(700px,100%); height:700px;
  background:radial-gradient(circle,rgba(220,30,55,.07) 0%,transparent 65%);
  border-radius:50%;
}
.bg-glow-br {
  position:absolute; bottom:-15%; right:-8%;
  width:600px; height:600px;
  background:radial-gradient(circle,rgba(200,30,60,.05) 0%,transparent 65%);
  border-radius:50%;
}
