/* ==========================================================================
   Enterprise Decision Model vs Generative LLM — Evaluation Studio
   Clean, Uncluttered, Full-Width Incident Classifier
   ========================================================================== */

:root {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-muted: #e2e8f0;
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-light: #eff6ff;
  
  --jev-brand: #0284c7;
  --jev-bg: #f0f9ff;
  --jev-border: #bae6fd;
  --jev-text: #0369a1;
  
  --llm-brand: #d97706;
  --llm-bg: #fffbeb;
  --llm-border: #fde68a;
  --llm-text: #b45309;
  
  --status-emerald: #059669;
  --status-emerald-bg: #ecfdf5;
  --status-emerald-border: #a7f3d0;
  
  --status-rose: #dc2626;
  --status-rose-bg: #fef2f2;
  --status-rose-border: #fecaca;
  
  --status-amber: #d97706;
  --status-amber-bg: #fffbeb;
  --status-amber-border: #fde68a;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

body {
  background-color: var(--bg-app);
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, pre, .mono-font {
  font-family: 'JetBrains Mono', monospace;
}

/* Header Navigation */
.top-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
  width: 100%;
}

.nav-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 12px clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 600;
}

.badge-tag {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary-nav:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* Layout */
.layout-container {
  width: 100%;
  max-width: 100%;
  padding: 16px clamp(16px, 3vw, 40px) 60px;
}

/* Minimalist Portal Header */
.portal-header-card {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.portal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.portal-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Status Pill */
.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
  border: 1px solid var(--status-emerald-border);
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.pulse-circle {
  width: 8px;
  height: 8px;
  background-color: var(--status-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   1. RAW INCIDENT INPUT CARD (TITLE & DESCRIPTION ONLY)
   ========================================================================== */
.incident-input-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.input-card-label {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-generate-action {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-generate-action:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-classify-action {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.btn-classify-action:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.form-group-clean {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-field-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.input-title-field {
  width: 100%;
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.96rem;
  font-weight: 700;
  outline: none;
  transition: all 0.15s ease;
}

.input-title-field:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.input-desc-field {
  width: 100%;
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.5;
  outline: none;
  font-family: inherit;
  resize: vertical;
  transition: all 0.15s ease;
}

.input-desc-field:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   2. SIDE-BY-SIDE DUAL WINDOWS (STANDARDIZED MATCHING VIEWING FRAMES)
   ========================================================================== */
.studio-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.dual-chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  min-height: 480px;
}

@media (max-width: 992px) {
  .dual-chat-grid {
    grid-template-columns: 1fr;
  }
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.panel-jev {
  border-right: 1px solid var(--border-light);
  background: #fbfdff;
}

.panel-llm {
  background: #fffdf9;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.model-spec-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.model-link {
  color: var(--brand-blue);
  text-decoration: none;
}

.model-link:hover {
  text-decoration: underline;
}

.panel-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.panel-badge-jev {
  background: var(--jev-bg);
  color: var(--jev-text);
  border: 1px solid var(--jev-border);
}

.panel-badge-llm {
  background: var(--llm-bg);
  color: var(--llm-text);
  border: 1px solid var(--llm-border);
}

.panel-telemetry {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
}

.telemetry-item {
  color: var(--text-muted);
}

.telemetry-val {
  font-weight: 700;
}

.text-cyan { color: var(--jev-brand); }
.text-amber { color: var(--llm-brand); }
.text-emerald { color: var(--status-emerald); }

.chat-stream-container {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.awaiting-classification-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 10px;
  background: #ffffff;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  margin: auto 0;
  min-height: 420px;
}

.awaiting-icon {
  font-size: 2.2rem;
  opacity: 0.8;
}

.awaiting-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
}

.awaiting-desc {
  font-size: 0.82rem;
  max-width: 340px;
  line-height: 1.5;
}

/* ==========================================================================
   SYMMETRICAL OUTPUT CARDS (STANDARDIZED SAME-HEIGHT VIEWING FRAME)
   ========================================================================== */
.comparison-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.card-jev {
  border: 1px solid var(--jev-border);
  border-left: 4px solid var(--jev-brand);
}

.card-llm {
  border: 1px solid var(--llm-border);
  border-left: 4px solid var(--llm-brand);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
}

.card-header-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  min-height: 110px;
}

.grid-jev {
  background: var(--jev-bg);
  border: 1px solid var(--jev-border);
}

.grid-llm {
  background: var(--llm-bg);
  border: 1px solid var(--llm-border);
}

.decision-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.label-jev { color: var(--jev-text); }
.label-llm { color: var(--llm-text); }

.decision-field-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.confidence-bar-wrap {
  margin-top: 4px;
  background: #e2e8f0;
  height: 5px;
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
}

.confidence-bar-fill {
  background: var(--status-emerald);
  height: 100%;
  border-radius: 9999px;
}

.raw-output-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.raw-output-header {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* STANDARDIZED SAME-HEIGHT FOR BOTH JEV AND LLM OUTPUT BOXES */
.raw-output-box {
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-output-json {
  color: #38bdf8;
}

.raw-output-prose {
  color: #e2e8f0;
}

.telemetry-footer-bar {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-jev {
  background: var(--jev-bg);
  border: 1px solid var(--jev-border);
  color: var(--jev-text);
}

.footer-llm {
  background: var(--llm-bg);
  border: 1px solid var(--llm-border);
  color: var(--llm-text);
}

.sev-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.sev-p0 { background: var(--status-rose-bg); color: var(--status-rose); border: 1px solid var(--status-rose-border); }
.sev-p1 { background: var(--status-rose-bg); color: #e11d48; border: 1px solid #fecdd3; }
.sev-p2 { background: var(--status-amber-bg); color: var(--status-amber); border: 1px solid var(--status-amber-border); }
.sev-p3 { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border-medium); }

.queue-highlight {
  display: inline-block;
  background: var(--jev-bg);
  color: var(--jev-text);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--jev-border);
  font-weight: 700;
}

/* Variance Footer */
.studio-comparison-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
}

.delta-badge {
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
}

.delta-badge-green {
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
  border: 1px solid var(--status-emerald-border);
}

/* ==========================================================================
   3. SMALL HISTORY TABLE: GENERATED INCIDENTS & OUTPUTS
   ========================================================================== */
.dataset-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dataset-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-subtle);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.enterprise-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.83rem;
}

.enterprise-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-medium);
}

.enterprise-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.enterprise-table tbody tr:hover {
  background-color: #f8fafc;
}

.table-ticket-id {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--brand-blue);
}

.table-ticket-title {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-inspect-ticket {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.btn-inspect-ticket:hover {
  background: var(--brand-blue);
  color: #ffffff;
}

.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}
