/**
 * TaxAppeal Pro Master Stylesheet (Baseline-UI Anti-AI Slop Standards)
 * Clean spatial density, high-contrast dark theme, crisp emerald/slate borders,
 * Geist/Inter + JetBrains Mono typography.
 */

:root {
  --bg-app: #060911;
  --bg-surface: #0b1120;
  --bg-card: #0f172a;
  --bg-card-hover: #132038;
  --bg-sidebar: #050e18;
  --border-color: #1e293b;
  --border-subtle: #172033;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-emerald: #059669;
  --accent-emerald-bright: #10b981;
  --accent-blue: #0284c7;
  --accent-royal: #2563eb;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #a855f7;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-mono { font-family: var(--font-mono); }
.text-emerald { color: var(--accent-emerald-bright) !important; }
.text-royal { color: #3b82f6 !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-crimson { color: var(--accent-crimson) !important; }
.font-bold { font-weight: 700; }

.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.app-sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand-section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.brand-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 2px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 12px;
  margin-bottom: 6px;
  padding-left: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-tab.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #ffffff;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

.nav-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.sidebar-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  margin-top: auto;
  margin-bottom: 12px;
}

.sidebar-card-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-emerald-bright);
  margin-bottom: 4px;
}

.sidebar-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald-bright);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Main Workspace */
.app-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--bg-app);
  overflow: hidden;
}

.top-telemetry-bar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
}

.telemetry-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.telemetry-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
}

.telemetry-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tab Switcher in Main Area */
.view-switcher-bar {
  background: #081126;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.view-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.view-btn.active {
  background: var(--bg-card);
  border-color: var(--accent-emerald-bright);
  color: #ffffff;
}

.content-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Card Grids & Layouts */
.wizard-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.card-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select {
  background: #060e22;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-emerald-bright);
}

.form-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* Dropzone */
.dropzone-box {
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--accent-emerald-bright);
  background: rgba(16, 185, 129, 0.04);
}

.dropzone-icon {
  font-size: 38px;
  margin-bottom: 10px;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.dropzone-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.progress-container {
  background: #060e22;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 12px;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #059669, #10b981);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* Metric Cards */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.metric-card-value {
  font-size: 18px;
  font-weight: 800;
}

.metric-card-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* Table Container */
.table-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #081126;
}

.table-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.table-sub-note {
  font-size: 11px;
  color: var(--text-dim);
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  background: #081126;
  color: var(--text-muted);
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* Badges & Pills */
.badge-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-lead { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid #475569; }
.badge-contacted { background: rgba(59, 130, 246, 0.15); color: #93c5fd; border: 1px solid #3b82f6; }
.badge-contract { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid #f59e0b; }
.badge-filed { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid #a855f7; }
.badge-disbursed { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid #10b981; }
.badge-urgent { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid #ef4444; }

/* Buttons */
.btn-emerald {
  background: var(--accent-emerald);
  color: #ffffff;
  border: 1px solid #047857;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-emerald:hover {
  background: var(--accent-emerald-bright);
}

.btn-royal {
  background: var(--accent-royal);
  color: #ffffff;
  border: 1px solid #1d4ed8;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-royal:hover { background: #3b82f6; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #334155;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 10.5px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden, .hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #081126;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.terminal-card {
  background: #030712;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-header {
  background: #081126;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
}

.terminal-title {
  font-size: 11px;
  color: var(--text-muted);
}

.terminal-body {
  padding: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* =========================================================================
 * DOCUMENTATION & INTERACTIVE FAQ ACCORDION STYLES
 * ========================================================================= */
.doc-section { display: flex; flex-direction: column; gap: 20px; }
.doc-search-bar { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; }
.doc-search-input { flex: 1; background: #04140c; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px 14px; color: #ffffff; font-size: 13px; outline: none; }
.doc-search-input:focus { border-color: var(--accent-emerald-bright); }
.doc-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.doc-card-header { background: #082114; padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.doc-card-header h3 { font-size: 14px; font-weight: 800; color: #ffffff; display: flex; align-items: center; gap: 8px; }
.doc-card-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; line-height: 1.6; font-size: 13px; color: #e5e5e5; }
.widget-guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 8px; }
.widget-guide-card { background: #06180f; border: 1px solid var(--border-color); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.widget-guide-title { font-size: 13px; font-weight: 700; color: var(--accent-emerald-bright); display: flex; align-items: center; gap: 6px; }
.widget-guide-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.widget-guide-action { font-family: var(--font-mono); font-size: 11px; background: rgba(255, 255, 255, 0.04); padding: 6px 10px; border-radius: 4px; border-left: 3px solid var(--accent-emerald); color: #d1fae5; }

/* FAQ Accordion Styles */
.faq-accordion-group { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #06180f; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; transition: border-color 0.15s ease; }
.faq-item:hover { border-color: #047857; }
.faq-summary { padding: 14px 18px; font-size: 13.5px; font-weight: 700; color: #ffffff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; list-style: none; }
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after { content: "＋"; font-size: 16px; color: var(--accent-emerald-bright); font-weight: bold; }
details[open] .faq-summary::after { content: "－"; color: var(--accent-amber); }
details[open] .faq-summary { background: #0a2618; border-bottom: 1px solid var(--border-color); }
.faq-content { padding: 16px 18px; font-size: 12.5px; line-height: 1.6; color: #cbd5e1; background: #030f09; }
.faq-content strong { color: #ffffff; }
.faq-content code { font-family: var(--font-mono); font-size: 11.5px; background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald-bright); padding: 2px 6px; border-radius: 4px; }

