/* ==========================================================================
   CHUQUAN AUTONOMOUS F&B BUSINESS OS — OWNER COCKPIT & BAS ENGINE STYLES
   ========================================================================== */

:root {
  --cq-cockpit-bg: #0B132B;
  --cq-card-bg: rgba(255, 255, 255, 0.98);
  --cq-card-dark: #1C2541;
  --cq-accent-green: #10B981;
  --cq-accent-blue: #2563EB;
  --cq-accent-purple: #7C3AED;
  --cq-accent-amber: #F59E0B;
  --cq-accent-rose: #E11D48;
  --cq-border: #E2E8F0;
  --cq-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --cq-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --cq-shadow-lg: 0 16px 36px rgba(11, 19, 43, 0.14);
}

/* Master Cockpit Container */
.cq-autonomous-cockpit {
  margin: 0 0 28px 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  color: #0F172A;
}

.cq-cockpit-data-status {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #D7E4EE;
  border-radius: 10px;
  background: #F8FAFC;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

.cq-cockpit-data-status[data-status="stale"] {
  border-color: #F2C98B;
  background: #FFFBEB;
  color: #92400E;
}

.cq-cockpit-data-status[data-status="unknown"],
.cq-cockpit-data-status[data-status="missing"] {
  border-color: #CBD5E1;
  background: #F8FAFC;
  color: #64748B;
}

/* Hero Status Banner */
.cq-cockpit-hero {
  background: linear-gradient(135deg, #0B132B 0%, #1C2541 60%, #1E3A8A 100%);
  border-radius: 18px;
  padding: 24px 28px;
  color: #FFFFFF;
  box-shadow: var(--cq-shadow-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cq-cockpit-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.cq-hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 14px;
}

.cq-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cq-hero-icon {
  font-size: 26px;
  background: rgba(255, 255, 255, 0.12);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cq-hero-title h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-hero-title p {
  font-size: 13px;
  color: #94A3B8;
  margin: 2px 0 0 0;
}

.cq-hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cq-autopilot-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cq-autopilot-pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.cq-autopilot-pill.kill {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.cq-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: cqPulse 1.8s infinite;
}

@keyframes cqPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-killswitch {
  background: rgba(239, 68, 68, 0.18);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-killswitch:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-scan-trigger {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #FFFFFF;
  border: none;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-scan-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

/* 4 Core Signals Grid */
.cq-signals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.cq-signal-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s, background 0.2s;
}

.cq-signal-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.cq-signal-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cq-signal-value {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.cq-signal-sub {
  font-size: 11px;
  color: #CBD5E1;
  margin-top: 5px;
}

.cq-health-badge {
  color: #34D399;
  font-size: 26px;
}

/* Dual Column Layout: Decision + Attention vs Glass-Box Stream */
.cq-cockpit-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .cq-cockpit-body {
    grid-template-columns: 1fr;
  }
}

/* Executive Decision & Attention Section */
.cq-panel-card {
  background: var(--cq-card-bg);
  border-radius: 16px;
  border: 1px solid var(--cq-border);
  box-shadow: var(--cq-shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cq-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 12px;
}

.cq-panel-head h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-badge-count {
  background: #EFF6FF;
  color: #2563EB;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #DBEAFE;
}

/* 1-Tap Action Card */
.cq-action-box {
  background: linear-gradient(135deg, #FEF2F2, #FFF1F2);
  border: 1.5px solid #FECDD3;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.06);
}

.cq-action-box.approved {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.cq-action-tier {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #E11D48;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.cq-action-title {
  font-size: 15px;
  font-weight: 800;
  color: #9F1239;
  margin: 0 0 6px 0;
}

.cq-action-desc {
  font-size: 13px;
  color: #4B5563;
  line-height: 1.45;
  margin-bottom: 14px;
}

.cq-action-impact {
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #DCFCE7;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 14px;
}

.cq-action-buttons {
  display: flex;
  gap: 10px;
}

.btn-cockpit-approve {
  flex: 1;
  background: linear-gradient(135deg, #059669, #047857);
  color: #FFFFFF;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-cockpit-approve:hover {
  background: #047857;
  transform: translateY(-1px);
}

.btn-cockpit-reject {
  background: #FFFFFF;
  color: #64748B;
  border: 1px solid #CBD5E1;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cockpit-reject:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* Attention Items */
.cq-attention-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cq-attention-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 4px solid #F59E0B;
  border-radius: 10px;
  padding: 12px 14px;
}

.cq-attention-item.low {
  border-left-color: #3B82F6;
}

.cq-att-title {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 3px;
}

.cq-att-remedy {
  font-size: 12px;
  color: #64748B;
  line-height: 1.4;
}

/* Glass-Box Live Activity Stream */
.cq-stream-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.cq-stream-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #F1F5F9;
  transition: background 0.15s;
}

.cq-stream-item:hover {
  background: #F1F5F9;
}

.cq-stream-badge {
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.cq-agent-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: #DBEAFE;
  color: #1E40AF;
  white-space: nowrap;
}

.cq-agent-step {
  font-size: 9px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}

.cq-stream-content {
  flex: 1;
}

.cq-stream-text {
  font-size: 12px;
  color: #1E293B;
  line-height: 1.4;
  margin: 0;
}

.cq-stream-meta {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-stream-impact {
  font-weight: 700;
  color: #059669;
}

/* ==========================================================================
   BUSINESS AUTONOMY SCORE (BAS) SCANNER MODAL
   ========================================================================== */
.cq-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 43, 0.75);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.cq-modal-dialog {
  background: #FFFFFF;
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: cqModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cqModalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.cq-modal-header {
  padding: 20px 26px;
  background: linear-gradient(135deg, #0B132B, #1C2541);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cq-modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cq-modal-header p {
  font-size: 12px;
  color: #94A3B8;
  margin: 3px 0 0 0;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #FFFFFF;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.cq-modal-body {
  padding: 24px 26px;
  overflow-y: auto;
  flex: 1;
}

/* Question List */
.cq-scan-q {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #F1F5F9;
}

.cq-scan-q label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 6px;
}

.cq-scan-q-sub {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 10px;
}

.cq-slider-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cq-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: #2563EB;
}

.cq-slider-val {
  min-width: 48px;
  text-align: right;
  font-weight: 800;
  font-size: 13px;
  color: #2563EB;
}

/* Result Presentation */
.cq-bas-result-card {
  background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
  border: 1.5px solid #BFDBFE;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.cq-bas-score-dial {
  font-size: 56px;
  font-weight: 900;
  color: #1E3A8A;
  line-height: 1;
  margin: 10px 0;
}

.cq-bas-level-pill {
  display: inline-block;
  background: #DBEAFE;
  color: #1E40AF;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.cq-leakage-alert {
  background: #FEF2F2;
  border: 1px solid #FECDD3;
  color: #9F1239;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  margin: 14px 0;
}

/* 8 Pillars Progress Bars */
.cq-pillars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  text-align: left;
}

.cq-pillar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cq-pillar-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.cq-progress-bg {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

.cq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* Recommendations List */
.cq-recs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-top: 14px;
}

.cq-rec-item {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 14px;
}

.cq-rec-phase {
  font-size: 11px;
  font-weight: 800;
  color: #2563EB;
  text-transform: uppercase;
}

.cq-rec-title {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  margin: 2px 0 4px 0;
}

.cq-rec-desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.4;
  margin: 0;
}

.cq-modal-footer {
  padding: 16px 26px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #475569;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border: none;
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: #1D4ED8;
}
