/* ADELEV8 — Minimalist Executive Theme */
:root {
  --bg-app: #090a0f;
  --bg-panel: #11131a;
  --bg-subtle: #161822;
  --bg-hover: #1c1f2b;
  --border-main: #212433;
  --border-light: #2d3142;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --c-emerald: #10b981;
  --c-emerald-bg: rgba(16, 185, 129, 0.08);
  --c-amber: #f59e0b;
  --c-amber-bg: rgba(245, 158, 11, 0.08);
  --c-blue: #3b82f6;
  --c-blue-bg: rgba(59, 130, 246, 0.08);
  --c-rose: #f43f5e;
  --c-rose-bg: rgba(244, 63, 94, 0.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

body.theme-light {
  --bg-app: #f8fafc;
  --bg-panel: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;
  --border-main: #e2e8f0;
  --border-light: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Typography Utilities */
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 600; }
.font-sm { font-size: 0.8rem; }
.font-lg { font-size: 1.15rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--c-emerald); }
.text-amber { color: var(--c-amber); }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* Minimal Header */
.app-header {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-main);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.divider {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.brand-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.meta-item {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--c-emerald);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
  cursor: pointer;
  background: var(--bg-panel);
  color: var(--text-main);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--border-light);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

body.theme-light .btn-primary {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-main);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* Context Bar */
.context-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-main);
}

.context-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.context-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.context-text strong {
  color: var(--text-main);
}

.context-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
}

/* Main Layout */
.main-layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin: 0.2rem 0;
}

.metric-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Badges & Tags */
.metric-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.metric-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--bg-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.status-received { background: var(--c-emerald-bg); color: var(--c-emerald); border: 1px solid rgba(16,185,129,0.2); }
.status-active { background: var(--c-blue-bg); color: var(--c-blue); border: 1px solid rgba(59,130,246,0.2); }
.status-pending { background: var(--c-amber-bg); color: var(--c-amber); border: 1px solid rgba(245,158,11,0.2); }
.status-loss { background: var(--c-rose-bg); color: var(--c-rose); border: 1px solid rgba(244,63,94,0.2); }

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.nav-tab.active {
  background: var(--bg-panel);
  border-color: var(--border-main);
  color: var(--text-main);
  font-weight: 600;
}

.tab-count {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Panel Card */
.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.panel-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-search {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  min-width: 220px;
}

.input-search:focus {
  outline: none;
  border-color: var(--border-light);
}

.panel-footer {
  padding: 0.75rem 1.35rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-main);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Minimal Table */
.table-container {
  overflow-x: auto;
  width: 100%;
}

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

.minimal-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-main);
}

.minimal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-main);
  color: var(--text-main);
  vertical-align: middle;
}

.minimal-table tr:hover td {
  background: var(--bg-hover);
}

.table-total-row td {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: none;
  padding: 0.85rem 1rem;
}

/* Layout Splits */
.split-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 1.5rem;
}

/* Summary Banner */
.summary-banner {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.summary-banner-title {
  font-size: 0.95rem;
  color: var(--text-main);
}

.summary-banner-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Simulator Layout */
.simulator-layout {
  padding: 1.35rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
}

.simulator-control {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
}

.minimal-slider {
  width: 100%;
  accent-color: #ffffff;
  cursor: pointer;
}

body.theme-light .minimal-slider {
  accent-color: #0f172a;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.simulator-output {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}

.sim-total-row {
  border-top: 1px solid var(--border-main);
  padding-top: 0.5rem;
  margin-top: 0.2rem;
}

/* Policy Grid */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.policy-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.policy-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.policy-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.policy-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Balance Sheet Statement Layout */
.statement-grid {
  padding: 1.35rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 1.5rem;
}

.statement-col {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.statement-head {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-main);
  margin-bottom: 0.85rem;
}

.statement-subhead {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.statement-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
}

body.theme-light .statement-line {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.statement-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-main);
  margin-top: 0.4rem;
  color: var(--text-muted);
}

.statement-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
}

/* Timeline Components */
.timeline-list {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.timeline-bullet {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-heading {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.4;
}

.timeline-detail code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  background: var(--bg-subtle);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
}

/* Charter Grid */
.charter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.charter-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.charter-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.65rem;
}

.charter-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.charter-bullets li strong {
  color: var(--text-main);
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-main);
  margin-top: 3rem;
  padding: 1.25rem 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Print Styles */
@media print {
  body { background: #ffffff !important; color: #000000 !important; }
  .app-header, .context-bar, .nav-tabs, .panel-actions, #exportAllCsvBtn, #themeToggleBtn { display: none !important; }
  .tab-panel { display: block !important; margin-bottom: 2rem; page-break-after: always; }
  .panel-card, .metric-card, .statement-col { background: #ffffff !important; border: 1px solid #cccccc !important; color: #000000 !important; }
  .minimal-table th, .minimal-table td { color: #000000 !important; border-bottom: 1px solid #dddddd !important; }
}

/* Responsiveness */
@media (max-width: 768px) {
  .main-layout { padding: 1rem; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-meta { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .split-layout { grid-template-columns: 1fr; }
  .simulator-layout { grid-template-columns: 1fr; }
  .statement-grid { grid-template-columns: 1fr; }
}
