/* =====================================================
   ATLAS V32 SHARED DESIGN SYSTEM
   Loaded last on every V32 page.
===================================================== */

:root {
  --atlas-bg-0: #020506;
  --atlas-bg-1: #071011;
  --atlas-bg-2: #111006;

  --atlas-surface: rgba(7, 20, 25, 0.97);
  --atlas-surface-raised: rgba(12, 31, 39, 0.98);
  --atlas-surface-soft: rgba(255, 255, 255, 0.035);

  --atlas-border: rgba(255, 216, 74, 0.17);
  --atlas-border-soft: rgba(148, 163, 184, 0.13);

  --atlas-text: #f8fafc;
  --atlas-muted: #98a4b5;
  --atlas-faint: #6f7c8e;

  --atlas-gold: #ffd84a;
  --atlas-orange: #ff9f1a;
  --atlas-green: #22c55e;
  --atlas-red: #ff5570;
  --atlas-blue: #38bdf8;
  --atlas-teal: #72f7df;

  --atlas-radius-xs: 11px;
  --atlas-radius-sm: 15px;
  --atlas-radius-md: 19px;
  --atlas-radius-lg: 24px;
  --atlas-radius-xl: 29px;

  --atlas-space-1: 4px;
  --atlas-space-2: 8px;
  --atlas-space-3: 12px;
  --atlas-space-4: 16px;
  --atlas-space-5: 20px;
  --atlas-space-6: 24px;

  --atlas-shadow:
    0 20px 60px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --atlas-font:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

/* ---------- Global foundation ---------- */

html,
body.atlas-v32 {
  margin: 0;
  min-height: 100%;
  font-family: var(--atlas-font) !important;
  color: var(--atlas-text);
  background:
    radial-gradient(
      circle at 50% -8%,
      rgba(255, 216, 74, 0.13),
      transparent 34%
    ),
    radial-gradient(
      circle at 100% 20%,
      rgba(255, 159, 26, 0.06),
      transparent 28%
    ),
    linear-gradient(
      180deg,
      var(--atlas-bg-2) 0%,
      var(--atlas-bg-1) 42%,
      var(--atlas-bg-0) 100%
    ) !important;
}

body.atlas-v32 {
  padding-bottom: 102px !important;
  color: var(--atlas-text) !important;
  font-size: 14px;
  line-height: 1.45;
}

body.atlas-v32 *,
body.atlas-v32 *::before,
body.atlas-v32 *::after {
  box-sizing: border-box;
}

body.atlas-v32 main,
body.atlas-v32 #app,
body.atlas-v32 .page,
body.atlas-v32 .container {
  width: 100%;
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
}

/* ---------- Typography ---------- */

body.atlas-v32 h1,
body.atlas-v32 h2,
body.atlas-v32 h3,
body.atlas-v32 h4 {
  margin-top: 0;
  color: var(--atlas-text);
  font-family: var(--atlas-font) !important;
  font-weight: 1000;
  letter-spacing: -0.055em;
}

body.atlas-v32 h1 {
  font-size: clamp(31px, 8vw, 44px);
  line-height: 0.96;
}

body.atlas-v32 h2 {
  font-size: clamp(25px, 6.5vw, 34px);
  line-height: 1;
}

body.atlas-v32 h3 {
  font-size: 20px;
  line-height: 1.1;
}

body.atlas-v32 p {
  color: var(--atlas-muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

body.atlas-v32 .eyebrow,
body.atlas-v32 .kicker,
body.atlas-v32 [class*="eyebrow"],
body.atlas-v32 [class*="kicker"] {
  color: var(--atlas-gold) !important;
  font-family: var(--atlas-font) !important;
  font-size: 10px !important;
  font-weight: 1000 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase !important;
}

/* ---------- Shared cards ---------- */

body.atlas-v32 section,
body.atlas-v32 .card,
body.atlas-v32 .panel,
body.atlas-v32 .premium-card,
body.atlas-v32 .hero,
body.atlas-v32 .command-center {
  border-color: var(--atlas-border) !important;
}

body.atlas-v32 .atlas-card,
body.atlas-v32 .card,
body.atlas-v32 .panel,
body.atlas-v32 .premium-card {
  border: 1px solid var(--atlas-border);
  border-radius: var(--atlas-radius-lg);
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(255, 216, 74, 0.065),
      transparent 36%
    ),
    linear-gradient(
      180deg,
      var(--atlas-surface-raised),
      var(--atlas-surface)
    );
  box-shadow: var(--atlas-shadow);
}

body.atlas-v32 .atlas-card-compact {
  padding: 14px;
  border-radius: var(--atlas-radius-md);
}

body.atlas-v32 .atlas-card-standard {
  padding: 18px;
}

body.atlas-v32 .atlas-card-header,
body.atlas-v32 .card-head,
body.atlas-v32 .section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--atlas-space-3);
}

/* ---------- Buttons ---------- */

body.atlas-v32 button,
body.atlas-v32 .button,
body.atlas-v32 .btn,
body.atlas-v32 .primary-btn,
body.atlas-v32 .cta {
  min-height: 42px;
  padding: 10px 15px;
  border: 0;
  border-radius: var(--atlas-radius-sm);
  font-family: var(--atlas-font) !important;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    border-color 140ms ease;
}

body.atlas-v32 button:active,
body.atlas-v32 .button:active,
body.atlas-v32 .btn:active {
  transform: scale(0.98);
}

body.atlas-v32 .atlas-button-primary,
body.atlas-v32 .primary-btn,
body.atlas-v32 .cta {
  color: #211600 !important;
  background:
    linear-gradient(
      135deg,
      var(--atlas-gold),
      var(--atlas-orange)
    ) !important;
  box-shadow:
    0 10px 28px rgba(255, 159, 26, 0.18);
}

body.atlas-v32 .atlas-button-secondary {
  color: var(--atlas-gold);
  border: 1px solid rgba(255, 216, 74, 0.22);
  background: rgba(255, 216, 74, 0.07);
}

body.atlas-v32 .atlas-button-ghost {
  color: var(--atlas-muted);
  border: 1px solid var(--atlas-border-soft);
  background: rgba(255, 255, 255, 0.025);
}

/* ---------- Inputs ---------- */

body.atlas-v32 input,
body.atlas-v32 select,
body.atlas-v32 textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--atlas-border-soft);
  border-radius: var(--atlas-radius-sm);
  outline: none;
  color: var(--atlas-text);
  background: rgba(4, 15, 22, 0.96);
  font-family: var(--atlas-font) !important;
  font-size: 13px;
  font-weight: 800;
}

body.atlas-v32 input:focus,
body.atlas-v32 select:focus,
body.atlas-v32 textarea:focus {
  border-color: rgba(255, 216, 74, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 216, 74, 0.075);
}

/* ---------- Badges and statuses ---------- */

body.atlas-v32 .atlas-badge,
body.atlas-v32 .badge,
body.atlas-v32 .pill,
body.atlas-v32 .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 27px;
  padding: 6px 9px;
  border: 1px solid var(--atlas-border-soft);
  border-radius: 999px;
  font-family: var(--atlas-font) !important;
  font-size: 10px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

body.atlas-v32 .status-ready,
body.atlas-v32 .badge-ready {
  color: var(--atlas-green) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  background: rgba(34, 197, 94, 0.1) !important;
}

body.atlas-v32 .status-watching,
body.atlas-v32 .badge-watching {
  color: var(--atlas-blue) !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
  background: rgba(56, 189, 248, 0.085) !important;
}

body.atlas-v32 .status-building,
body.atlas-v32 .badge-building {
  color: var(--atlas-gold) !important;
  border-color: rgba(255, 216, 74, 0.28) !important;
  background: rgba(255, 216, 74, 0.085) !important;
}

body.atlas-v32 .status-invalid,
body.atlas-v32 .badge-invalid {
  color: var(--atlas-red) !important;
  border-color: rgba(255, 85, 112, 0.3) !important;
  background: rgba(255, 85, 112, 0.09) !important;
}

/* ---------- Direction colours ---------- */

body.atlas-v32 .long,
body.atlas-v32 .green,
body.atlas-v32 [data-direction="LONG"] {
  color: var(--atlas-green) !important;
}

body.atlas-v32 .short,
body.atlas-v32 .red,
body.atlas-v32 [data-direction="SHORT"] {
  color: var(--atlas-red) !important;
}

body.atlas-v32 .blue {
  color: var(--atlas-blue) !important;
}

body.atlas-v32 .gold {
  color: var(--atlas-gold) !important;
}

/* ---------- Shared metric tiles ---------- */

body.atlas-v32 .atlas-metric-grid,
body.atlas-v32 .stats,
body.atlas-v32 .tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

body.atlas-v32 .atlas-metric,
body.atlas-v32 .stat,
body.atlas-v32 .summary-tile {
  min-width: 0;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--atlas-border-soft);
  border-radius: var(--atlas-radius-md);
  background:
    linear-gradient(
      180deg,
      rgba(15, 46, 63, 0.94),
      rgba(5, 18, 27, 0.99)
    );
}

body.atlas-v32 .atlas-metric-label,
body.atlas-v32 .stat span,
body.atlas-v32 .summary-tile span {
  display: block;
  margin-bottom: 8px;
  color: var(--atlas-muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

body.atlas-v32 .atlas-metric-value,
body.atlas-v32 .stat strong,
body.atlas-v32 .summary-tile strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--atlas-text);
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -0.035em;
}

/* ---------- Tables ---------- */

body.atlas-v32 .atlas-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--atlas-border);
  border-radius: var(--atlas-radius-md);
  background: var(--atlas-surface);
}

body.atlas-v32 .atlas-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--atlas-text);
  font-family: var(--atlas-font);
}

body.atlas-v32 .atlas-table th,
body.atlas-v32 .atlas-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  white-space: nowrap;
}

body.atlas-v32 .atlas-table th {
  color: var(--atlas-muted);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.atlas-v32 .atlas-table td {
  font-size: 12px;
  font-weight: 850;
}

/* ---------- Shared spacing utilities ---------- */

body.atlas-v32 .atlas-stack {
  display: grid;
  gap: var(--atlas-space-3);
}

body.atlas-v32 .atlas-row {
  display: flex;
  align-items: center;
  gap: var(--atlas-space-3);
}

body.atlas-v32 .atlas-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--atlas-space-3);
}

body.atlas-v32 .atlas-hidden {
  display: none !important;
}

/* ---------- V32 development marker ---------- */

body.atlas-v32::before {
  content: "V32 DESIGN SYSTEM";
  position: fixed;
  z-index: 2147483001;
  top: 7px;
  right: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 216, 74, 0.3);
  border-radius: 999px;
  color: #211600;
  background:
    linear-gradient(
      135deg,
      var(--atlas-gold),
      var(--atlas-orange)
    );
  box-shadow:
    0 8px 24px rgba(255, 159, 26, 0.18);
  font-size: 7px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0.12em;
  pointer-events: none;
}

/* ---------- Mobile adjustments ---------- */

@media (max-width: 430px) {
  body.atlas-v32 {
    font-size: 13px;
  }

  body.atlas-v32 h1 {
    font-size: 32px;
  }

  body.atlas-v32 h2 {
    font-size: 27px;
  }

  body.atlas-v32 .atlas-metric,
  body.atlas-v32 .stat,
  body.atlas-v32 .summary-tile {
    min-height: 70px;
    padding: 11px;
  }

  body.atlas-v32 .atlas-metric-value,
  body.atlas-v32 .stat strong,
  body.atlas-v32 .summary-tile strong {
    font-size: 22px;
  }
}
