/* ═══════════════════════════════════════════════════════
   STATSPACK ANALYZER — Design System
   Aesthetic: Industrial Control Room / DBA War Room
   Fonts: JetBrains Mono (data) + Rajdhani (UI)
═══════════════════════════════════════════════════════ */

:root {
  --bg:          #080b11;
  --surface:     #0d1421;
  --surface2:    #111d2e;
  --surface3:    #162235;
  --border:      #1a2d45;
  --border2:     #223550;

  --amber:       #f59e0b;
  --amber-dim:   #92600a;
  --amber-glow:  rgba(245,158,11,0.12);
  --amber-glow2: rgba(245,158,11,0.06);

  --cyan:        #22d3ee;
  --cyan-dim:    #0891b2;
  --cyan-glow:   rgba(34,211,238,0.08);

  --green:       #10b981;
  --green-glow:  rgba(16,185,129,0.1);
  --yellow:      #fbbf24;
  --yellow-glow: rgba(251,191,36,0.1);
  --red:         #f87171;
  --red-dim:     #991b1b;
  --red-glow:    rgba(248,113,113,0.12);

  --text:        #dde6f0;
  --text2:       #8aa3be;
  --text3:       #4a6480;

  --mono:        'JetBrains Mono', 'Courier New', monospace;
  --ui:          'Rajdhani', 'Segoe UI', sans-serif;

  --sw: 256px;
  --ease: cubic-bezier(.25,.46,.45,.94);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── UTILITY ──────────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════
   UPLOAD SCREEN
═══════════════════════════════════════════════════════ */
#upload-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}

.upload-bg {
  position: absolute; inset: 0; overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245,158,11,0.06) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 100%, rgba(34,211,238,0.04) 0%, transparent 60%),
              var(--bg);
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(26,45,69,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,45,69,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 40%, transparent 100%);
}

.scan-line {
  position: absolute; left: 0; right: 0; height: 120px;
  background: linear-gradient(transparent, rgba(245,158,11,0.03), transparent);
  animation: scan 6s linear infinite;
  pointer-events: none;
}

@keyframes scan { from { top: -120px; } to { top: 100%; } }

.upload-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 2.5rem; padding: 2rem;
  max-width: 640px; width: 100%;
}

.upload-header { text-align: center; }

.brand {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  line-height: 1;
}

.brand-bracket { color: var(--text3); }
.brand-name    { color: var(--amber); }
.brand-sep     { color: var(--text3); margin: 0 0.1em; }
.brand-sub     { color: var(--cyan); }

.brand-tagline {
  font-family: var(--ui);
  font-size: 0.85rem;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.6rem;
}

/* Drop Zone */
.drop-zone {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--surface);
  padding: 3rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  position: relative;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--amber);
  background: var(--surface2);
  box-shadow: 0 0 40px var(--amber-glow), inset 0 0 40px var(--amber-glow2);
}

.drop-icon-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber);
  background: var(--surface2);
  transition: all 0.2s;
}

.drop-zone:hover .drop-icon-ring { border-color: var(--amber); box-shadow: 0 0 20px var(--amber-glow); }

.drop-title {
  font-family: var(--ui); font-weight: 700; font-size: 1.2rem;
  color: var(--text); letter-spacing: 0.03em;
}

.drop-hint {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--text3); text-align: center;
}

.drop-actions { margin-top: 0.5rem; }

.btn-upload {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: var(--amber); color: #000;
  font-family: var(--ui); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: none; border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
}

.btn-upload:hover { background: #fbbf24; box-shadow: 0 0 20px var(--amber-glow); }

.drop-privacy {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text3);
  display: flex; align-items: center; gap: 0.4em;
}

.upload-features {
  display: flex; gap: 2rem; flex-wrap: wrap; justify-content: center;
}

.feature-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text2);
  font-family: var(--ui); letter-spacing: 0.04em;
}

.fi-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); flex-shrink: 0;
  box-shadow: 0 0 6px var(--amber);
}

/* ═══════════════════════════════════════════════════════
   LOADING SCREEN
═══════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}

.loading-box {
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  min-width: 300px;
}

.loading-logo {
  font-family: var(--mono); font-size: 1.6rem; font-weight: 700;
  color: var(--amber); letter-spacing: 0.15em;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.loading-bar-wrap {
  width: 100%; height: 3px;
  background: var(--border);
  border-radius: 2px; overflow: hidden;
}

.loading-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  border-radius: 2px;
  transition: width 0.3s var(--ease);
  box-shadow: 0 0 8px var(--amber);
}

.loading-text {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text3); letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════════════ */
#dashboard-screen {
  display: flex; min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sw); min-width: var(--sw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  font-family: var(--mono); font-weight: 700; font-size: 0.9rem;
  color: var(--amber); letter-spacing: 0.1em;
}

.btn-new {
  font-family: var(--ui); font-weight: 600; font-size: 0.75rem;
  letter-spacing: 0.06em;
  background: transparent; border: 1px solid var(--border2);
  color: var(--text2); border-radius: 3px;
  padding: 0.25rem 0.6rem; cursor: pointer;
  transition: all 0.15s;
}

.btn-new:hover { border-color: var(--amber); color: var(--amber); }

.sidebar-meta {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text3); line-height: 1.8;
}

.sidebar-meta strong { color: var(--amber); }

.sidebar-nav {
  padding: 0.75rem 0;
  flex: 1;
}

.nav-group {
  font-family: var(--ui); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text3); padding: 0.8rem 1rem 0.3rem;
}

.nav-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.38rem 1rem 0.38rem 1.25rem;
  font-family: var(--ui); font-size: 0.84rem; font-weight: 500;
  color: var(--text2); text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  position: relative;
}

.nav-link:hover { color: var(--text); background: var(--surface2); }

.nav-link.active {
  color: var(--amber);
  border-left-color: var(--amber);
  background: var(--amber-glow2);
}

.nav-star { color: var(--amber) !important; font-weight: 700; }
.nav-star:hover { background: var(--amber-glow2) !important; }
.nav-star.active { border-left-color: var(--amber); }

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  border-radius: 10px; padding: 0 5px; height: 16px; min-width: 16px;
  margin-left: auto;
}

/* ── MAIN CONTENT ────────────────────────────────────── */
.main-content {
  margin-left: var(--sw);
  flex: 1;
  padding: 2rem;
  max-width: calc(100% - var(--sw));
}

/* ── SECTIONS ────────────────────────────────────────── */
.sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sec-featured {
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 1px var(--amber-dim), 0 0 30px var(--amber-glow);
}

.sec-hdr {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sec-title {
  font-family: var(--ui); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text);
}

.sec-badge {
  font-family: var(--mono); font-size: 0.68rem;
  color: var(--amber); background: var(--amber-glow);
  padding: 0.2rem 0.6rem; border-radius: 3px;
  border: 1px solid var(--amber-dim);
}

.sec-hint {
  font-family: var(--mono); font-size: 0.7rem; color: var(--text3);
  margin-left: auto;
}

.sub-title {
  font-family: var(--ui); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text2); margin-bottom: 0.75rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border2);
}

/* ═══════════════════════════════════════════════════════
   SUMMARY GRID
═══════════════════════════════════════════════════════ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  transition: border-color 0.15s;
}

.metric-card:hover { border-color: var(--border2); }

.metric-label {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); margin-bottom: 0.4rem;
}

.metric-value {
  font-family: var(--mono); font-weight: 700; font-size: 1.35rem;
  color: var(--amber); line-height: 1.1;
}

.metric-value.v-cyan { color: var(--cyan); }
.metric-value.v-text { color: var(--text); font-size: 0.95rem; }
.metric-value.v-ok   { color: var(--green); }
.metric-value.v-warn { color: var(--yellow); }
.metric-value.v-crit { color: var(--red); }

.metric-sub {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text3); margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════════════
   DIAGNOSTICS
═══════════════════════════════════════════════════════ */
#diagnostics-list { display: flex; flex-direction: column; gap: 0.6rem; }

.diag-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  font-family: var(--ui); font-size: 0.875rem;
  line-height: 1.4;
}

.diag-item.ok     { border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.04); }
.diag-item.warn   { border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.05); }
.diag-item.crit   { border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.06); }

.diag-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }
.diag-ok   .diag-icon { color: var(--green); }
.diag-warn .diag-icon { color: var(--yellow); }
.diag-crit .diag-icon { color: var(--red); }

.diag-body strong { font-weight: 700; }
.diag-body p { color: var(--text2); font-size: 0.8rem; margin-top: 0.15rem; }

.diag-item.ok   { --ic: '✓'; }
.diag-item.warn { --ic: '⚠'; }
.diag-item.crit { --ic: '✖'; }

/* ═══════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════ */
.data-table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 0.75rem;
}

table.data-table th {
  font-family: var(--ui); font-weight: 700; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
  cursor: pointer; user-select: none;
}

table.data-table th:hover { color: var(--text2); }
table.data-table th.sort-asc::after  { content: ' ↑'; color: var(--amber); }
table.data-table th.sort-desc::after { content: ' ↓'; color: var(--amber); }

table.data-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(26,45,69,0.5);
  color: var(--text2); vertical-align: top;
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--surface2); color: var(--text); }
table.data-table td.num { text-align: right; color: var(--text); }
table.data-table td.amber { color: var(--amber); font-weight: 700; }
table.data-table td.red   { color: var(--red); }
table.data-table td.green { color: var(--green); }
table.data-table td.yellow{ color: var(--yellow); }
table.data-table td.changed { background: rgba(251,191,36,0.06); }

/* kv table (key→value pairs) */
table.kv-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.78rem; }
table.kv-table td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }
table.kv-table td:first-child { color: var(--text3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; width: 220px; }
table.kv-table td:last-child { color: var(--amber); font-weight: 700; }
table.kv-table tr:hover td { background: var(--surface2); }

/* ═══════════════════════════════════════════════════════
   HOST CARDS
═══════════════════════════════════════════════════════ */
.host-grid { display: flex; flex-wrap: wrap; gap: 1rem; }

.host-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.9rem 1.2rem; min-width: 150px;
}

.host-card-label {
  font-family: var(--ui); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); margin-bottom: 0.3rem;
}

.host-card-value {
  font-family: var(--mono); font-weight: 700; font-size: 1.1rem;
  color: var(--cyan);
}

.host-card-value.v-large {
  font-size: 0.85rem; color: var(--text);
}

/* ═══════════════════════════════════════════════════════
   EFFICIENCY GRID
═══════════════════════════════════════════════════════ */
.efficiency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.eff-item {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.9rem 1rem;
}

.eff-label {
  font-family: var(--ui); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text3); margin-bottom: 0.5rem;
}

.eff-value-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.5rem;
}

.eff-val {
  font-family: var(--mono); font-weight: 700; font-size: 1.25rem;
}

.eff-val.ok   { color: var(--green); }
.eff-val.warn { color: var(--yellow); }
.eff-val.crit { color: var(--red); }

.eff-target {
  font-family: var(--mono); font-size: 0.65rem; color: var(--text3);
}

.eff-bar {
  height: 4px; border-radius: 2px;
  background: var(--border); overflow: hidden;
}

.eff-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.8s var(--ease);
}

.eff-bar-fill.ok   { background: var(--green); }
.eff-bar-fill.warn { background: var(--yellow); }
.eff-bar-fill.crit { background: var(--red); }

/* ═══════════════════════════════════════════════════════
   TOP 5 TIMED EVENTS
═══════════════════════════════════════════════════════ */
#top5-content { display: flex; flex-direction: column; gap: 0.6rem; }

.top5-item {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center; gap: 1rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.9rem 1rem;
  transition: border-color 0.15s;
}

.top5-item:hover { border-color: var(--border2); }
.top5-item.rank-1 { border-color: var(--amber-dim); }

.top5-rank {
  font-family: var(--mono); font-weight: 700; font-size: 0.85rem;
  color: var(--text3); text-align: center;
}

.top5-rank.r1 { color: var(--amber); }

.top5-event { flex: 1; }

.top5-name {
  font-family: var(--mono); font-weight: 700; font-size: 0.82rem;
  color: var(--text); margin-bottom: 0.4rem;
}

.top5-diag {
  font-family: var(--ui); font-size: 0.75rem;
  color: var(--text3); font-style: italic;
}

.top5-bar-wrap {
  width: 140px;
}

.top5-bar-bg {
  height: 6px; border-radius: 3px; background: var(--border);
  overflow: hidden; margin-bottom: 0.25rem;
}

.top5-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
}

.top5-pct {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--amber); text-align: right;
}

.top5-stats {
  text-align: right;
}

.top5-time {
  font-family: var(--mono); font-weight: 700; font-size: 0.9rem;
  color: var(--amber);
}

.top5-meta {
  font-family: var(--mono); font-size: 0.65rem; color: var(--text3);
}

/* ═══════════════════════════════════════════════════════
   TWO-COLUMN LAYOUT
═══════════════════════════════════════════════════════ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

.chart-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  position: relative;
}

/* ═══════════════════════════════════════════════════════
   SQL TABS
═══════════════════════════════════════════════════════ */
.sql-tabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 1rem;
}

.sql-tab {
  padding: 0.4rem 0.85rem;
  font-family: var(--ui); font-weight: 600; font-size: 0.75rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 4px; cursor: pointer;
  transition: all 0.12s;
}

.sql-tab:hover { border-color: var(--border2); color: var(--text); }
.sql-tab.active { background: var(--amber-glow); border-color: var(--amber); color: var(--amber); }

/* SQL text expandable */
.sql-text-wrap {
  position: relative;
}

.sql-text {
  font-family: var(--mono); font-size: 0.65rem; color: var(--text3);
  white-space: pre-wrap; word-break: break-all;
  max-height: 2.6em; overflow: hidden;
  cursor: pointer;
  transition: max-height 0.3s;
  line-height: 1.5;
}

.sql-text.expanded { max-height: 200px; overflow-y: auto; color: var(--cyan); }
.sql-text::after {
  content: '…'; position: absolute; bottom: 0; right: 0;
  background: linear-gradient(90deg, transparent, var(--surface));
  padding-left: 1rem; color: var(--text3); font-size: 0.65rem;
}
.sql-text.expanded::after { display: none; }

/* ═══════════════════════════════════════════════════════
   SEARCH INPUT
═══════════════════════════════════════════════════════ */
.search-wrap { margin-bottom: 1rem; }

.search-input {
  width: 100%; max-width: 400px;
  padding: 0.5rem 0.85rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text);
  font-family: var(--mono); font-size: 0.78rem;
  outline: none; transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--amber); }
.search-input::placeholder { color: var(--text3); }

/* ═══════════════════════════════════════════════════════
   ADVISORY GRID
═══════════════════════════════════════════════════════ */
.advisory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.advisory-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem;
}

.advisory-title {
  font-family: var(--ui); font-weight: 700; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text2); margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════
   SHARED POOL CARDS
═══════════════════════════════════════════════════════ */
.sp-grid { display: flex; flex-wrap: wrap; gap: 1rem; }

.sp-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem 1.25rem; min-width: 180px;
}

.sp-label {
  font-family: var(--ui); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); margin-bottom: 0.5rem;
}

.sp-vals {
  display: flex; gap: 1rem; align-items: center;
}

.sp-begin, .sp-end {
  font-family: var(--mono); font-size: 0.8rem;
}

.sp-begin { color: var(--text2); }
.sp-end { color: var(--cyan); font-weight: 700; }
.sp-arrow { color: var(--text3); font-size: 0.7rem; }

/* ═══════════════════════════════════════════════════════
   MEMORY DISPLAY
═══════════════════════════════════════════════════════ */
.mem-grid { display: flex; flex-wrap: wrap; gap: 1rem; align-items: start; }

.mem-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem 1.25rem;
}

.mem-bar-section { flex: 1; min-width: 300px; }

.mem-bar-label {
  font-family: var(--ui); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text3); margin-bottom: 0.5rem;
  display: flex; justify-content: space-between;
}

.mem-bar-wrap {
  height: 22px; background: var(--border);
  border-radius: 3px; overflow: hidden;
  display: flex; margin-bottom: 0.4rem;
}

.mem-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.6rem; font-weight: 700;
  transition: width 0.8s var(--ease);
}

.mem-seg.sga { background: var(--amber); color: #000; }
.mem-seg.pga { background: var(--cyan-dim); color: #fff; }

/* ═══════════════════════════════════════════════════════
   PROGRESS BAR (generic)
═══════════════════════════════════════════════════════ */
.prog-wrap { margin-bottom: 0.5rem; }

.prog-label {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--text3); margin-bottom: 0.3rem;
}

.prog-bar {
  height: 5px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}

.prog-fill {
  height: 100%; border-radius: 3px;
  background: var(--amber);
  transition: width 0.8s var(--ease);
}

/* ═══════════════════════════════════════════════════════
   SNAPSHOT INFO LAYOUT
═══════════════════════════════════════════════════════ */
.snap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.snap-block {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 1rem;
}

.snap-block-title {
  font-family: var(--ui); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); margin-bottom: 0.75rem;
}

.snap-highlight {
  display: flex; gap: 2rem; margin-top: 1rem;
}

.snap-hl-item {
  background: var(--surface2); border: 1px solid var(--amber-dim);
  border-radius: 6px; padding: 1rem 1.5rem; text-align: center;
}

.snap-hl-val {
  font-family: var(--mono); font-weight: 700; font-size: 2rem;
  color: var(--amber);
}

.snap-hl-lbl {
  font-family: var(--ui); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text3); margin-top: 0.25rem;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR STYLING
═══════════════════════════════════════════════════════ */
.main-content::-webkit-scrollbar,
.sidebar::-webkit-scrollbar { width: 6px; }

.main-content::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track { background: transparent; }

.main-content::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   "SHOW ALL" BUTTON
═══════════════════════════════════════════════════════ */
.btn-show-all {
  display: block; width: 100%; margin-top: 0.75rem;
  padding: 0.5rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text3); font-family: var(--ui); font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 4px; cursor: pointer;
  transition: all 0.15s;
}

.btn-show-all:hover { border-color: var(--border2); color: var(--text2); }

/* ═══════════════════════════════════════════════════════
   HISTOGRAM BARS
═══════════════════════════════════════════════════════ */
.hist-table-wrap { overflow-x: auto; }

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sec { animation: fadeUp 0.35s var(--ease) both; }

.sec:nth-child(1)  { animation-delay: .05s; }
.sec:nth-child(2)  { animation-delay: .08s; }
.sec:nth-child(3)  { animation-delay: .11s; }
.sec:nth-child(4)  { animation-delay: .14s; }
.sec:nth-child(5)  { animation-delay: .17s; }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════ */
.empty-state {
  padding: 1.5rem;
  text-align: center;
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text3);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sw: 220px; }
  .main-content { padding: 1rem; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .advisory-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  #dashboard-screen { flex-direction: column; }
  .sidebar { position: fixed; width: 100%; height: auto; bottom: 0; top: auto; overflow-x: auto; flex-direction: row; }
  .main-content { margin-left: 0; padding: 0.75rem; }
  .snap-grid { grid-template-columns: 1fr; }
}
