/* ============================================================
   RTC1 NeuralOps Detached Finance — Futuristic White Lofi
   ============================================================ */

:root {
  --bg-root: #FAFAF8;
  --bg-surface: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-strong: rgba(255, 255, 255, 0.88);
  --bg-muted: #F4F3F0;
  --lofi-lavender: #C4B5E8;
  --lofi-sage: #A8C5B5;
  --lofi-peach: #F5D0C5;
  --lofi-dusty-blue: #9BB5CE;
  --lofi-mauve: #B8A9C9;
  --lofi-blush: #E8D5E0;
  --accent: #7B9FD4;
  --accent-deep: #5A7FAD;
  --text-primary: #1A1A1E;
  --text-secondary: #5C5C66;
  --text-muted: #8E8E93;
  --border: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 4px 24px rgba(26, 26, 30, 0.04);
  --shadow-glass: 0 8px 32px rgba(155, 181, 206, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', monospace;
  --gradient-progress: linear-gradient(90deg, var(--lofi-lavender), var(--lofi-dusty-blue));
  --gradient-hero: radial-gradient(ellipse 70% 50% at 15% 20%, rgba(196, 181, 232, 0.18) 0%, transparent 55%),
                   radial-gradient(ellipse 60% 45% at 85% 75%, rgba(155, 181, 206, 0.14) 0%, transparent 55%),
                   radial-gradient(ellipse 50% 40% at 50% 50%, rgba(168, 197, 181, 0.08) 0%, transparent 60%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection {
  background: rgba(196, 181, 232, 0.35);
  color: var(--text-primary);
}

/* ===== BACKGROUND GRID ===== */
.df-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--gradient-hero);
}

.df-grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(155, 181, 206, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 181, 206, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 75%);
}

.df-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ===== HEADER ===== */
.df-header {
  text-align: center;
  margin-bottom: 32px;
}

.df-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.df-eyebrow .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lofi-sage);
  box-shadow: 0 0 8px rgba(168, 197, 181, 0.8);
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

h1 .mono-tag {
  font-family: var(--font-mono);
  font-size: 0.55em;
  font-weight: 500;
  color: var(--accent);
  vertical-align: middle;
  margin-right: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto 6px;
}

.subtitle a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.subtitle a:hover { text-decoration: underline; }

h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 .stage-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(196, 181, 232, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-deep);
}

h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* ===== CONTROL DECK ===== */
.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.btn {
  font-family: var(--font-sans);
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn.stop {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn.stop:hover:not(:disabled) {
  background: rgba(245, 208, 197, 0.35);
  border-color: var(--lofi-peach);
}

.btn.secondary {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--lofi-lavender);
  box-shadow: var(--shadow-glass);
}

.btn-ghost {
  padding: 7px 14px;
  font-size: 13px;
}

/* ===== PROGRESS ===== */
.progress-wrap {
  margin-bottom: 20px;
}

.progress {
  width: 100%;
  height: 4px;
  background: rgba(155, 181, 206, 0.2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-progress);
  width: 0%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--lofi-lavender);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== STEPPER ===== */
#stageNav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.stage-btn {
  position: relative;
  background: transparent !important;
  color: var(--text-muted) !important;
  border: none !important;
  padding: 8px 6px !important;
  font-size: 0 !important;
  margin: 0 !important;
  min-width: 32px;
  height: 32px;
  border-radius: 50% !important;
  box-shadow: none !important;
  transform: none !important;
}

.stage-btn::before {
  content: attr(data-step);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.stage-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(100% - 2px);
  width: 20px;
  height: 1px;
  background: var(--border-medium);
  transform: translateY(-50%);
}

.stage-btn:last-child::after { display: none; }

.stage-btn:hover:not(.active) {
  background: rgba(196, 181, 232, 0.2) !important;
}

.stage-btn.active {
  background: var(--lofi-lavender) !important;
  box-shadow: 0 0 0 3px rgba(196, 181, 232, 0.35), var(--shadow-glass) !important;
  transform: scale(1.08) !important;
}

.stage-btn.active::before { color: var(--text-primary); }

.stage-btn.guardrail-btn.active {
  background: var(--lofi-mauve) !important;
  box-shadow: 0 0 0 3px rgba(184, 169, 201, 0.35) !important;
}

.complete-badge {
  display: none;
  text-align: center;
  padding: 12px 18px;
  margin-bottom: 20px;
  background: rgba(168, 197, 181, 0.25);
  border: 1px solid rgba(168, 197, 181, 0.5);
  border-radius: var(--radius-md);
  color: #3D6B55;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.complete-badge.show { display: block; }

/* ===== STAGE PANELS ===== */
.stage {
  display: none;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-glass);
  animation: stageIn 0.28s ease-out;
}

.stage.active { display: block; }

@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.df-stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.df-stage-top h2 { margin-bottom: 0; }

.df-stage-actions {
  display: flex;
  gap: 8px;
}

/* ===== WHATSAPP / NEURAL LINK ===== */
.wa-fullpage {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.wa-header {
  background: linear-gradient(135deg, rgba(123, 159, 212, 0.9) 0%, rgba(196, 181, 232, 0.85) 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}

.wa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.wa-info h3 {
  margin: 0;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
}

.wa-status {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.92;
  color: rgba(255, 255, 255, 0.9);
}

.wa-status.typing { color: #E8F4FF; font-style: italic; }

.wa-messages {
  padding: 18px;
  min-height: 340px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--bg-muted);
  background-image:
    linear-gradient(rgba(155, 181, 206, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 181, 206, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.wa-message {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.wa-message-left { align-items: flex-start; }
.wa-message-right { align-items: flex-end; }

.wa-bubble {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: var(--shadow-soft);
}

.wa-message-left .wa-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.wa-message-right .wa-bubble {
  background: rgba(196, 181, 232, 0.35);
  border: 1px solid rgba(196, 181, 232, 0.4);
  border-top-right-radius: 4px;
}

.wa-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.wa-ticks { color: var(--lofi-dusty-blue); font-size: 10px; }
.wa-ticks.read { color: var(--accent); }

.wa-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 11px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-top-left-radius: 4px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.wa-typing.visible { display: flex; }

.wa-typing-dot {
  width: 7px;
  height: 7px;
  background: var(--lofi-mauve);
  border-radius: 50%;
  animation: waTypingBounce 1.4s infinite ease-in-out both;
}

.wa-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.wa-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes waTypingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===== DASHBOARD ===== */
.dashboard-grid,
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.dashboard-card,
.report-card {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover,
.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glass);
}

.dashboard-card h3,
.report-card h3 {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.metric-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.sparkline {
  height: 28px;
  margin: 10px 0 4px;
  opacity: 0.7;
}

.status-ready { color: #4A8F6E; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.status-active { color: var(--accent); font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

.module-panel { margin-top: 20px; }

.module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}

.module-row .name { font-weight: 500; }
.module-row .bar {
  flex: 1;
  max-width: 120px;
  height: 4px;
  background: rgba(155, 181, 206, 0.25);
  border-radius: 99px;
  overflow: hidden;
}

.module-row .bar span {
  display: block;
  height: 100%;
  background: var(--gradient-progress);
  border-radius: 99px;
}

.upload-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

/* ===== TAGS ===== */
.tag-valid,
.tag-invalid,
.tag-review {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.tag-valid { background: rgba(168, 197, 181, 0.35); color: #3D6B55; }
.tag-invalid { background: rgba(245, 208, 197, 0.5); color: #9A4A3A; }
.tag-review { background: rgba(196, 181, 232, 0.35); color: #5A4A7A; }

/* ===== UPLOAD & JOB ===== */
.upload-list {
  background: var(--bg-muted);
  border: 2px dashed rgba(155, 181, 206, 0.45);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 16px;
}

.upload-list ul { list-style: none; }

.upload-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
}

.upload-list li:last-child { border-bottom: none; }

.job-info {
  background: rgba(155, 181, 206, 0.12);
  border: 1px solid rgba(155, 181, 206, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 8px; }

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: lowercase;
}

.timeline-item.done {
  background: rgba(168, 197, 181, 0.2);
  border-color: rgba(168, 197, 181, 0.35);
}

.timeline-item.current {
  background: rgba(196, 181, 232, 0.2);
  border-color: rgba(196, 181, 232, 0.4);
  box-shadow: var(--shadow-soft);
}

.timeline-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.timeline-icon.done { background: var(--lofi-sage); color: #fff; }
.timeline-icon.current { background: var(--lofi-lavender); color: var(--text-primary); }
.timeline-icon.pending { background: var(--border-medium); color: var(--text-muted); }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; margin-bottom: 20px; }

table,
.forensic-table,
.calc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  background: rgba(244, 243, 240, 0.9);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td.amount,
td[style*="text-align:right"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

tr.need-review { background: rgba(245, 208, 197, 0.2); }

tr.total td,
tr[style*="background:#e8f5e9"] td {
  font-weight: 700;
  background: rgba(168, 197, 181, 0.25) !important;
  color: #3D6B55;
}

tr.deficit td,
tr[style*="background:#ffeb3b"] td {
  font-weight: 700;
  background: rgba(245, 208, 197, 0.35) !important;
  color: #6B4035;
}

.report-card .icon { font-size: 24px; margin-bottom: 8px; opacity: 0.85; }

/* ===== GUARDRAILS ===== */
.guardrails {
  background: var(--bg-muted);
  border-left: 3px solid var(--lofi-lavender);
  padding: 20px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
}

.guardrails ul { list-style: none; }

.guardrails li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  gap: 12px;
}

.guardrails li::before {
  content: attr(data-n);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 24px;
}

.guardrails li:last-child { border-bottom: none; }

.disclaimer {
  background: rgba(245, 208, 197, 0.2);
  border: 1px solid rgba(245, 208, 197, 0.45);
  padding: 16px;
  border-radius: var(--radius-sm);
  color: #6B4035;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 30, 0.35);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 2147483647;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px);
  padding: 28px;
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-glass);
}

/* ===== TAX CALCULATOR ===== */
.tax-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tax-card {
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.tax-card h4 {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tax-card .value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.tax-card .value.positive { color: #4A8F6E; }
.tax-card .value.negative { color: #9A4A3A; }
.tax-card .value.warning { color: #8A6A3A; }
.tax-card .sub { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.tax-card.good { background: rgba(168, 197, 181, 0.2); border-color: rgba(168, 197, 181, 0.4); }
.tax-card.monitor { background: rgba(196, 181, 232, 0.15); }
.tax-card.review { background: rgba(245, 208, 197, 0.2); }
.tax-card.critical { background: rgba(245, 208, 197, 0.35); }

.tax-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.tax-field label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.tax-field input,
.tax-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg-surface);
  font-family: var(--font-mono);
}

.tax-field input:focus,
.tax-field select:focus {
  outline: none;
  border-color: var(--lofi-lavender);
  box-shadow: 0 0 0 3px rgba(196, 181, 232, 0.25);
}

.tax-field .source { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

.bracket-config { overflow-x: auto; margin-bottom: 20px; }

.bracket-config table { font-size: 12px; }

.bracket-config input {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
}

.export-bar {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.export-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s;
}

.export-btn:hover { border-color: var(--lofi-lavender); }
.export-btn.primary { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.status-badge.good { background: rgba(168, 197, 181, 0.35); color: #3D6B55; }
.status-badge.monitor { background: rgba(196, 181, 232, 0.35); color: #5A4A7A; }
.status-badge.review { background: rgba(245, 208, 197, 0.4); color: #8A5A45; }
.status-badge.critical { background: rgba(245, 208, 197, 0.55); color: #9A4A3A; }
.status-badge.na { background: var(--bg-muted); color: var(--text-muted); }

.warning-box {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 12px;
}

.warning-box.warn { background: rgba(196, 181, 232, 0.2); border: 1px solid rgba(196, 181, 232, 0.4); }
.warning-box.info { background: rgba(155, 181, 206, 0.15); border: 1px solid rgba(155, 181, 206, 0.3); }
.warning-box.danger { background: rgba(245, 208, 197, 0.3); border: 1px solid rgba(245, 208, 197, 0.5); }
.warning-box.na { background: var(--bg-muted); border: 1px solid var(--border); }

.calc-table tr.total td { font-weight: 700; background: rgba(168, 197, 181, 0.2); }
.calc-table tr.total-light td { font-weight: 600; background: var(--bg-muted); }

.section-note {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ===== SPEED CONTROL ===== */
.speed-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 10px 18px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-wrap: wrap;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.speed-control label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.speed-control input[type="range"] {
  flex: 1;
  min-width: 140px;
  max-width: 220px;
  accent-color: var(--lofi-lavender);
  cursor: pointer;
}

.speed-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 42px;
  text-align: right;
}

.speed-hint {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== NARRATOR ===== */
.narrator-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(196, 181, 232, 0.12);
  border: 1px solid rgba(196, 181, 232, 0.28);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  animation: narratorIn 0.4s ease-out;
}

.narrator-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.narrator-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

@keyframes narratorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TERMINAL LOG ===== */
.terminal-panel {
  margin-top: 8px;
}

.terminal-panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.terminal {
  background: #1e293b;
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  height: 200px;
  overflow-y: auto;
  margin: 0 0 16px;
}

.terminal-line {
  margin-bottom: 5px;
  font-size: 13px;
}

.terminal-system { color: #93c5fd; }
.terminal-stage { color: #a7f3d0; }
.terminal-alert { color: #fcd34d; }
.terminal-action { color: #fca5a5; }

/* ===== PRINT ===== */
@media print {
  body { background: #fff; padding: 0; }
  .df-grid-bg, .controls, .speed-control, .narrator-bar, .terminal-panel, .progress-wrap, #stageNav, .export-bar, .btn, .stage-btn, .df-stage-actions { display: none !important; }
  .stage { display: block !important; border: none; box-shadow: none; padding: 10px; page-break-after: always; }
  .tax-card { break-inside: avoid; }
}

@media (max-width: 768px) {
  .df-shell { padding: 16px 14px 40px; }
  .dashboard-grid, .reports-grid, .tax-cards, .tax-form { grid-template-columns: 1fr; }
  #stageNav { gap: 4px; padding: 10px; }
  .stage-btn::after { width: 10px; }
  .stage { padding: 18px 14px; }
  .narrator-text { font-size: 13px; }
}