:root {
  color-scheme: dark;
  --bg: #0A0E1A;
  --panel: rgba(0, 200, 255, 0.06);
  --border: rgba(0, 200, 255, 0.2);
  --border-strong: rgba(0, 200, 255, 0.42);
  --cyan: #00C8FF;
  --green: #00FF88;
  --red: #FF3B30;
  --text: #EAF8FF;
  --muted: rgba(234, 248, 255, 0.68);
  --quiet: rgba(234, 248, 255, 0.42);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Exo 2", system-ui, sans-serif;
  font-size: 1.05rem;
}

button {
  min-height: 44px;
  color: inherit;
  font: inherit;
}

.dashboard-shell {
  width: min(1400px, calc(100vw - 64px));
  height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  overflow: hidden;
}

.topbar {
  height: 28px;
  color: var(--muted);
  font-family: Orbitron, sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-align: left;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 24px;
  height: calc(100vh - 92px);
}

.jarvis-card,
.modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.jarvis-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 28px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Orbitron, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

h1 {
  font-size: min(1.6rem, 2vw);
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.12rem;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.label {
  margin-bottom: 8px;
  color: var(--quiet);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  min-width: 72px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--cyan);
  font-family: Orbitron, sans-serif;
  font-size: 0.86rem;
  text-align: center;
}

.status-pill.success {
  color: var(--green);
}

.lesson-layout,
.core-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px;
  flex: 1;
  min-height: 0;
}

.metric-ring {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}

.metric-ring strong,
.number {
  color: var(--text);
  font-family: Orbitron, sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
}

.metric-ring span {
  color: var(--quiet);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn,
.icon-btn {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn {
  min-width: 112px;
  padding: 0 16px;
}

.btn:hover,
.btn:focus-visible,
.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: var(--cyan);
  outline: none;
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-green {
  border-color: var(--green);
  color: var(--green);
}

.btn-red {
  border-color: var(--red);
  color: var(--red);
}

.btn-grey {
  border-color: rgba(234, 248, 255, 0.22);
  color: var(--muted);
}

.core-layout {
  grid-template-columns: auto 1fr;
}

.core-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
}

.core-orb svg {
  position: absolute;
  width: 180px;
  height: 180px;
  opacity: 0.4;
}

.core-orb circle {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
}

.core-orb span {
  position: relative;
  color: var(--text);
  font-family: Orbitron, sans-serif;
  font-size: 1.2rem;
  text-align: center;
}

.core-orb.is-pulsing {
  animation: corePulse 0.3s ease 3;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  margin-top: 16px;
  opacity: 0;
}

.waveform.is-active {
  opacity: 1;
}

.waveform span {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: var(--cyan);
  animation: wave 0.3s ease infinite alternate;
}

.waveform span:nth-child(2) { animation-delay: 0.05s; }
.waveform span:nth-child(3) { animation-delay: 0.1s; }
.waveform span:nth-child(4) { animation-delay: 0.15s; }
.waveform span:nth-child(5) { animation-delay: 0.2s; }

.list-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.table-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-top: 1px solid rgba(0, 200, 255, 0.12);
  color: var(--muted);
}

.trade-table .table-row {
  grid-template-columns: 0.8fr 0.8fr 0.8fr 0.7fr 100px;
}

.property-table .table-row {
  grid-template-columns: minmax(0, 1.4fr) 0.7fr 0.55fr 0.78fr 100px;
  min-height: 60px;
}

.table-row.header {
  min-height: 34px;
  border-top: 0;
  color: var(--quiet);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-row strong {
  color: var(--text);
  font-family: Orbitron, sans-serif;
  font-size: 1rem;
}

.table-row.approved {
  border-left: 3px solid var(--green);
  padding-left: 10px;
}

.table-row.rejected {
  opacity: 0.5;
}

.review-btn {
  width: 90px;
  min-width: 90px;
  min-height: 44px;
  border: 1px solid var(--cyan);
  border-radius: 9px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(1, 4, 10, 0.78);
  padding: 32px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 64px);
  padding: 28px;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--muted);
}

.modal-section {
  border-top: 1px solid rgba(0, 200, 255, 0.12);
  padding: 16px 0;
}

.modal-section:first-child {
  border-top: 0;
}

.modal-section h3 {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 1rem;
}

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

.number-box {
  border: 1px solid rgba(0, 200, 255, 0.14);
  border-radius: 10px;
  padding: 12px;
}

.number-box span {
  display: block;
  color: var(--quiet);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.checklist {
  display: grid;
  gap: 8px;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--muted);
}

.checklist input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@keyframes corePulse {
  50% { opacity: 0.7; transform: scale(1.04); }
}

@keyframes wave {
  from { transform: scaleY(0.6); }
  to { transform: scaleY(1.6); }
}

@media (max-width: 1200px) {
  body {
    overflow: auto;
  }

  .dashboard-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .jarvis-card {
    min-height: 360px;
  }

  .numbers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
