/* CAPS production visual skin: dark navy / electric blue / violet */

:root {
  color-scheme: dark !important;
}

html,
body,
#root {
  background: #020a14 !important;
  color: #f8fafc !important;
}

body {
  background:
    radial-gradient(circle at 82% 10%, rgba(37, 99, 235, 0.16), transparent 28%),
    radial-gradient(circle at 58% 35%, rgba(124, 58, 237, 0.10), transparent 32%),
    linear-gradient(135deg, #020915 0%, #04101f 42%, #020812 100%) !important;
}

.co-brand-lockup,
.security-brand-row {
  display: inline-flex !important;
}

.brand-mark {
  background: linear-gradient(135deg, #0f2b68, #5b21b6) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  box-shadow: 0 0 28px rgba(37, 99, 235, 0.28) !important;
}

.brand-divider {
  background: rgba(148, 163, 184, 0.25) !important;
}

.micro-ai-mark,
.micro-ai-mark strong {
  color: #dbeafe !important;
}

.login-page,
.center-page {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.22), transparent 34%),
    radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.16), transparent 38%),
    #020914 !important;
}

.login-card,
.security-card {
  background: linear-gradient(180deg, rgba(7, 22, 43, 0.98), rgba(3, 14, 29, 0.98)) !important;
  border: 1px solid rgba(96, 165, 250, 0.18) !important;
  color: #f8fafc !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 45px rgba(37, 99, 235, 0.08) !important;
}

.login-card .muted,
.security-card .muted,
.security-note,
.security-secret,
.managed-by {
  color: #8fa7c3 !important;
}

.login-form input,
.code-input {
  color: #f8fafc !important;
  background: #07162a !important;
  border: 1px solid #17375d !important;
}

.login-form input:focus,
.code-input:focus {
  border-color: #4f7cff !important;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.18), 0 0 20px rgba(79, 124, 255, 0.12) !important;
}

.security-note,
.security-secret code {
  background: rgba(10, 31, 58, 0.85) !important;
  border: 1px solid rgba(96, 165, 250, 0.12) !important;
  color: #b9c9dc !important;
}

.primary-button {
  background: linear-gradient(135deg, #5b21b6 0%, #2563eb 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(129, 140, 248, 0.3) !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.24) !important;
}

.secondary-button {
  background: #081a31 !important;
  color: #dbeafe !important;
  border: 1px solid #21466f !important;
}

.text-button,
.text-button.light {
  color: #8eb8ff !important;
}

.app-shell {
  background:
    radial-gradient(circle at 82% 10%, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(140deg, #020812 0%, #051322 52%, #020812 100%) !important;
}

.sidebar {
  background: linear-gradient(180deg, #020a17 0%, #03101f 52%, #020814 100%) !important;
  border-right: 1px solid rgba(96, 165, 250, 0.14) !important;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.25) !important;
}

.sidebar-company {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.sidebar-powered,
.sidebar-footer,
.sidebar-managed,
.tenant-switcher {
  color: #6f8dad !important;
}

.tenant-switcher select {
  background: #07162a !important;
  border: 1px solid #17375d !important;
  color: #dbeafe !important;
}

.nav-item {
  color: #b9c9dc !important;
  border: 1px solid transparent !important;
  transition: 160ms ease !important;
}

.nav-item:hover {
  color: #fff !important;
  background: rgba(30, 64, 175, 0.22) !important;
  border-color: rgba(96, 165, 250, 0.16) !important;
}

.nav-item.active {
  color: #fff !important;
  background: linear-gradient(90deg, #6d28d9 0%, #4f46e5 58%, #2563eb 100%) !important;
  border-color: rgba(196, 181, 253, 0.18) !important;
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.28), inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

.content,
.inbox-content {
  background: transparent !important;
  color: #f8fafc !important;
}

.page-heading h1,
.page-heading h2,
.page-heading h3,
h1,
h2,
h3 {
  color: #f8fafc !important;
}

.page-heading .muted,
.muted {
  color: #8ca3bf !important;
}

.eyebrow {
  color: #8fb5ea !important;
}

.heading-brand-block .co-brand-lockup {
  background: rgba(5, 19, 36, 0.82) !important;
  border: 1px solid rgba(96, 165, 250, 0.16) !important;
}

.status-pill {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #6ee7b7 !important;
  border: 1px solid rgba(52, 211, 153, 0.22) !important;
}

.status-pill.uat {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.24) !important;
}

.metric-grid {
  gap: 14px !important;
}

.metric-card,
.panel {
  background: linear-gradient(180deg, rgba(7, 27, 51, 0.96), rgba(4, 19, 37, 0.96)) !important;
  border: 1px solid rgba(91, 148, 203, 0.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 12px 30px rgba(0, 0, 0, 0.18) !important;
}

.metric-card {
  position: relative !important;
  overflow: hidden !important;
  min-height: 112px !important;
  padding: 20px 20px 18px 78px !important;
}

.metric-card::before {
  content: '' !important;
  position: absolute !important;
  left: 18px !important;
  top: 20px !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #7c3aed, #2563eb) !important;
  box-shadow: 0 0 24px rgba(79, 70, 229, 0.40) !important;
}

.metric-card:nth-child(2)::before { background: linear-gradient(135deg, #0ea5e9, #2563eb) !important; }
.metric-card:nth-child(3)::before { background: linear-gradient(135deg, #22c55e, #16a34a) !important; }
.metric-card:nth-child(4)::before { background: linear-gradient(135deg, #fb923c, #f97316) !important; }
.metric-card:nth-child(5)::before { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }

.metric-card span {
  color: #b8c9dc !important;
}

.metric-card strong {
  color: #ffffff !important;
  font-size: 30px !important;
  font-weight: 650 !important;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.10) !important;
}

.status-list {
  color: #b7c8da !important;
}

.done-dot {
  background: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45) !important;
}

.pending-dot {
  background: #3b82f6 !important;
}

.detail-list div,
.intel-list div {
  border-bottom-color: rgba(96, 165, 250, 0.10) !important;
}

.detail-list dt,
.intel-list dt {
  color: #7995b5 !important;
}

.detail-list dd,
.intel-list dd {
  color: #f8fafc !important;
}

.table-panel {
  background: rgba(5, 20, 39, 0.96) !important;
}

table {
  color: #dbeafe !important;
}

th {
  background: #07182d !important;
  color: #8fb5ea !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.14) !important;
}

td {
  color: #d7e4f4 !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.08) !important;
}

tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06) !important;
}

.empty-state,
.queue-empty,
.chat-empty {
  color: #7892ae !important;
}

.empty-state strong {
  color: #e8f2ff !important;
}

.error-text,
.form-message {
  color: #fda4af !important;
}

/* Inbox */
.inbox-shell {
  background: #04101f !important;
  border: 1px solid rgba(82, 132, 184, 0.22) !important;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.30), 0 0 50px rgba(37, 99, 235, 0.04) !important;
}

.conversation-queue {
  background: #051322 !important;
  border-right: 1px solid rgba(96, 165, 250, 0.12) !important;
}

.queue-search-wrap,
.queue-filters {
  background: #061629 !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.12) !important;
}

.queue-search {
  color: #eef6ff !important;
  background: #071a31 !important;
  border: 1px solid #173a61 !important;
}

.queue-search::placeholder {
  color: #67829f !important;
}

.queue-search:focus {
  border-color: #4f7cff !important;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.14) !important;
}

.queue-filter {
  color: #8ea8c4 !important;
}

.queue-filter strong {
  background: #0c2440 !important;
  color: #91b8ea !important;
}

.queue-filter.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.88), rgba(37, 99, 235, 0.78)) !important;
  border: 1px solid rgba(147, 197, 253, 0.18) !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.16) !important;
}

.queue-filter.active strong {
  background: rgba(3, 11, 24, 0.48) !important;
  color: #fff !important;
}

.queue-card {
  background: #051322 !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.08) !important;
}

.queue-card:hover {
  background: #081b31 !important;
}

.queue-card.selected {
  background: linear-gradient(90deg, rgba(67, 56, 202, 0.18), rgba(5, 19, 34, 0.98)) !important;
  box-shadow: inset 3px 0 0 #7c3aed, inset 0 0 30px rgba(37, 99, 235, 0.04) !important;
}

.queue-card-top strong {
  color: #f8fafc !important;
}

.queue-card-top span,
.queue-card-vehicle,
.queue-card-bottom {
  color: #7893b0 !important;
}

.priority-dot {
  background: #3b82f6 !important;
  box-shadow: 0 0 9px rgba(59, 130, 246, 0.44) !important;
}

.priority-dot.high { background: #f59e0b !important; box-shadow: 0 0 9px rgba(245, 158, 11, 0.46) !important; }
.priority-dot.urgent { background: #ef4444 !important; box-shadow: 0 0 9px rgba(239, 68, 68, 0.46) !important; }

.owner-chip,
.owner-badge {
  border: 1px solid rgba(96, 165, 250, 0.16) !important;
}

.owner-chip.ai,
.owner-badge.ai {
  background: rgba(16, 185, 129, 0.10) !important;
  color: #6ee7b7 !important;
}

.owner-chip.human,
.owner-badge.human {
  background: rgba(245, 158, 11, 0.10) !important;
  color: #fbbf24 !important;
}

.chat-workspace {
  background:
    radial-gradient(circle at 50% 20%, rgba(37, 99, 235, 0.05), transparent 35%),
    #030d1a !important;
}

.chat-header {
  background: rgba(5, 20, 38, 0.96) !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.11) !important;
}

.chat-header strong {
  color: #ffffff !important;
}

.chat-header span {
  color: #7893b0 !important;
}

.handover-banner {
  background: rgba(245, 158, 11, 0.10) !important;
  color: #fbbf24 !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.16) !important;
}

.message-list {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(96, 165, 250, 0.08) 1px, transparent 0) !important;
  background-size: 22px 22px !important;
}

.message-bubble {
  border: 1px solid rgba(96, 165, 250, 0.14) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16) !important;
}

.message-row.inbound .message-bubble {
  background: #07192e !important;
  color: #eff6ff !important;
}

.message-row.outbound .message-bubble,
.message-bubble.ai {
  background: linear-gradient(145deg, rgba(30, 64, 175, 0.30), rgba(15, 118, 110, 0.16)) !important;
  color: #f0fdf4 !important;
  border-color: rgba(52, 211, 153, 0.18) !important;
}

.message-sender,
.message-bubble time {
  color: #7da0c4 !important;
}

.chat-actions {
  background: #051322 !important;
  border-top: 1px solid rgba(96, 165, 250, 0.12) !important;
}

.composer-disabled {
  background: #07182d !important;
  border: 1px solid #17375d !important;
  color: #7893b0 !important;
}

.intelligence-panel {
  background: #051322 !important;
  border-left: 1px solid rgba(96, 165, 250, 0.12) !important;
}

.intel-section {
  border-bottom: 1px solid rgba(96, 165, 250, 0.10) !important;
}

.intel-section h3,
.intel-title h3,
.summary-section strong {
  color: #f8fafc !important;
}

.intel-title span {
  color: #7191b6 !important;
}

.summary-section p,
.handover-card p {
  color: #a9bdd2 !important;
}

.next-action {
  background: #071a31 !important;
  border: 1px solid rgba(96, 165, 250, 0.10) !important;
  color: #c9daee !important;
}

.handover-card {
  background: linear-gradient(145deg, rgba(91, 33, 182, 0.10), rgba(37, 99, 235, 0.08)) !important;
}

.priority-label.normal {
  color: #93c5fd !important;
}

.priority-label.high {
  color: #fbbf24 !important;
}

.priority-label.urgent {
  color: #f87171 !important;
}

.action-message {
  color: #93c5fd !important;
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .inbox-shell { grid-template-columns: minmax(230px, 0.8fr) minmax(420px, 1.4fr) !important; }
  .intelligence-panel { grid-column: 1 / -1 !important; border-left: 0 !important; border-top: 1px solid rgba(96,165,250,0.12) !important; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr !important; }
  .sidebar { position: relative !important; width: 100% !important; height: auto !important; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .content,
  .inbox-content { padding: 18px !important; }
  .metric-grid,
  .two-column-grid,
  .inbox-shell { grid-template-columns: 1fr !important; }
  .conversation-queue,
  .intelligence-panel { border: 0 !important; border-bottom: 1px solid rgba(96,165,250,0.12) !important; }
}
