/* ═══════════════════════════════════════════════════════════════════════════
   dstempire.css — HUD / Sci-Fi FUI Theme
   Outfit font · Gold tokens · Dark panels · Empire Builder aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Font Import ───────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --em-gold:          #f0b429;
  --em-gold-dim:      #b8861f;
  --em-gold-glow:     rgba(240,180,41,.18);
  --em-bg:            #0b0c15;
  --em-surface:       #13151f;
  --em-surface-2:     #1a1d2e;
  --em-surface-3:     #21253a;
  --em-border:        #2a2e45;
  --em-border-light:  #363b56;
  --em-text:          #e2e4f0;
  --em-text-muted:    #8b8fa3;
  --em-text-dim:      #5a5e78;
  --em-green:         #29d97b;
  --em-green-dim:     rgba(41,217,123,.15);
  --em-amber:         #f59e0b;
  --em-amber-dim:     rgba(245,158,11,.15);
  --em-red:           #f43f5e;
  --em-red-dim:       rgba(244,63,94,.15);
  --em-blue:          #38bdf8;
  --em-blue-dim:      rgba(56,189,248,.15);
  --em-purple:        #a78bfa;

  /* Typography */
  --em-font:          'Outfit', sans-serif;
  --em-font-mono:     'JetBrains Mono', monospace;
  --em-fs-xs:         0.70rem;
  --em-fs-sm:         0.80rem;
  --em-fs-base:       0.9rem;
  --em-fs-md:         1rem;
  --em-fs-lg:         1.125rem;
  --em-fs-xl:         1.35rem;
  --em-fs-2xl:        1.7rem;
  --em-fs-3xl:        2.2rem;
  --em-track-wide:    0.08em;
  --em-track-wider:   0.15em;

  /* Spacing */
  --em-sp-1: 4px;   --em-sp-2: 8px;   --em-sp-3: 12px;
  --em-sp-4: 16px;  --em-sp-5: 24px;  --em-sp-6: 32px;
  --em-sp-7: 48px;  --em-sp-8: 64px;

  /* Radius */
  --em-r-sm: 4px;  --em-r: 8px;  --em-r-lg: 12px;  --em-r-xl: 16px;

  /* Shadows */
  --em-shadow:      0 2px 16px rgba(0,0,0,.45);
  --em-shadow-gold: 0 0 24px var(--em-gold-glow);

  /* Transitions */
  --em-t: 180ms ease;

  /* Nav */
  --em-nav-h: 60px;
}

/* ── Reset + Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--em-font);
  font-size: var(--em-fs-base);
  background: var(--em-bg);
  color: var(--em-text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--em-gold); text-decoration: none; transition: color var(--em-t); }
a:hover { color: #fff; }

img { max-width: 100%; }

/* ── Shell / Layout ───────────────────────────────────────────────────────── */
.em-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--em-sp-5) var(--em-sp-5) var(--em-sp-8);
}

.em-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--em-sp-3);
  margin-bottom: var(--em-sp-6);
}

.em-page-title {
  font-size: var(--em-fs-2xl);
  font-weight: 800;
  color: var(--em-text);
  letter-spacing: -.01em;
}

.em-page-subtitle {
  font-size: var(--em-fs-sm);
  color: var(--em-text-muted);
  font-family: var(--em-font-mono);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wider);
  margin-top: 4px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.em-nav {
  height: var(--em-nav-h);
  background: var(--em-surface);
  border-bottom: 1px solid var(--em-border);
  display: flex;
  align-items: center;
  padding: 0 var(--em-sp-5);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  gap: var(--em-sp-4);
}

.em-nav__brand {
  font-size: var(--em-fs-lg);
  font-weight: 800;
  color: var(--em-gold);
  letter-spacing: var(--em-track-wide);
  text-transform: uppercase;
  margin-right: var(--em-sp-5);
  white-space: nowrap;
  flex-shrink: 0;
}
.em-nav__brand:hover { color: var(--em-gold); }

.em-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}

.em-nav__link {
  font-size: var(--em-fs-sm);
  font-weight: 600;
  color: var(--em-text-muted);
  padding: 6px 14px;
  border-radius: var(--em-r);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wide);
  transition: all var(--em-t);
  white-space: nowrap;
}
.em-nav__link:hover { color: var(--em-text); background: var(--em-surface-2); }
.em-nav__link.active { color: var(--em-gold); background: var(--em-gold-glow); }

.em-nav__end {
  display: flex;
  align-items: center;
  gap: var(--em-sp-3);
  margin-left: auto;
  flex-shrink: 0;
}

.em-nav__user {
  font-size: var(--em-fs-sm);
  color: var(--em-text-muted);
  font-family: var(--em-font-mono);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.em-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--em-r);
  font-family: var(--em-font);
  font-size: var(--em-fs-sm);
  font-weight: 600;
  letter-spacing: var(--em-track-wide);
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--em-t);
  text-decoration: none;
  white-space: nowrap;
}
.em-btn:hover { text-decoration: none; }

.em-btn--primary {
  background: var(--em-gold);
  color: #0b0c15;
  border-color: var(--em-gold);
}
.em-btn--primary:hover { background: #f5c84a; color: #0b0c15; box-shadow: var(--em-shadow-gold); }

.em-btn--ghost {
  background: transparent;
  color: var(--em-text-muted);
  border-color: var(--em-border);
}
.em-btn--ghost:hover { color: var(--em-text); border-color: var(--em-border-light); background: var(--em-surface-2); }

.em-btn--danger {
  background: var(--em-red-dim);
  color: var(--em-red);
  border-color: var(--em-red);
}
.em-btn--danger:hover { background: var(--em-red); color: #fff; }

.em-btn--sm { padding: 5px 12px; font-size: var(--em-fs-xs); }
.em-btn--lg { padding: 12px 28px; font-size: var(--em-fs-md); }

.em-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Panel ────────────────────────────────────────────────────────────────── */
.em-panel {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-r-lg);
  overflow: hidden;
  margin-bottom: var(--em-sp-5);
}

.em-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--em-sp-4) var(--em-sp-5);
  border-bottom: 1px solid var(--em-border);
  background: var(--em-surface-2);
  flex-wrap: wrap;
  gap: var(--em-sp-2);
}

.em-panel__title {
  font-size: var(--em-fs-md);
  font-weight: 700;
  color: var(--em-text);
  letter-spacing: var(--em-track-wide);
  text-transform: uppercase;
}

.em-panel__body {
  padding: var(--em-sp-5);
}

/* ── KPI Row ──────────────────────────────────────────────────────────────── */
.em-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--em-sp-4);
  margin-bottom: var(--em-sp-6);
}

.em-kpi {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-r-lg);
  padding: var(--em-sp-5);
  position: relative;
  overflow: hidden;
}

.em-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--em-border-light);
}

.em-kpi--gold::before  { background: var(--em-gold); }
.em-kpi--green::before { background: var(--em-green); }
.em-kpi--amber::before { background: var(--em-amber); }
.em-kpi--red::before   { background: var(--em-red); }
.em-kpi--blue::before  { background: var(--em-blue); }

.em-kpi__label {
  font-size: var(--em-fs-xs);
  font-weight: 600;
  color: var(--em-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wider);
  margin-bottom: var(--em-sp-2);
}

.em-kpi__value {
  font-size: var(--em-fs-3xl);
  font-weight: 800;
  color: var(--em-text);
  line-height: 1;
  margin-bottom: 4px;
}
.em-kpi__value--gold   { color: var(--em-gold); }
.em-kpi__value--green  { color: var(--em-green); }
.em-kpi__value--amber  { color: var(--em-amber); }
.em-kpi__value--red    { color: var(--em-red); }

.em-kpi__sub {
  font-size: var(--em-fs-xs);
  color: var(--em-text-dim);
}

/* ── Table ────────────────────────────────────────────────────────────────── */
.em-table-wrap { overflow-x: auto; }

.em-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--em-fs-sm);
}

.em-table thead tr {
  border-bottom: 2px solid var(--em-border);
}

.em-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: var(--em-fs-xs);
  font-weight: 700;
  color: var(--em-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wider);
  white-space: nowrap;
}

.em-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--em-border);
  vertical-align: middle;
  color: var(--em-text);
}

.em-table tbody tr:hover { background: var(--em-surface-2); }
.em-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.em-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: var(--em-fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--em-track-wide);
  white-space: nowrap;
}

.em-badge--gold    { background: var(--em-gold-glow);  color: var(--em-gold);   border: 1px solid var(--em-gold-dim); }
.em-badge--green   { background: var(--em-green-dim);  color: var(--em-green);  border: 1px solid rgba(41,217,123,.3); }
.em-badge--amber   { background: var(--em-amber-dim);  color: var(--em-amber);  border: 1px solid rgba(245,158,11,.3); }
.em-badge--red     { background: var(--em-red-dim);    color: var(--em-red);    border: 1px solid rgba(244,63,94,.3); }
.em-badge--blue    { background: var(--em-blue-dim);   color: var(--em-blue);   border: 1px solid rgba(56,189,248,.3); }
.em-badge--neutral { background: var(--em-surface-2);  color: var(--em-text-muted); border: 1px solid var(--em-border); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.em-form-group { margin-bottom: var(--em-sp-5); }

.em-label {
  display: block;
  font-size: var(--em-fs-sm);
  font-weight: 600;
  color: var(--em-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wide);
  margin-bottom: var(--em-sp-2);
}

.em-input,
.em-select,
.em-textarea {
  display: block;
  width: 100%;
  background: var(--em-surface-2);
  border: 1px solid var(--em-border);
  border-radius: var(--em-r);
  padding: 10px 14px;
  font-family: var(--em-font);
  font-size: var(--em-fs-base);
  color: var(--em-text);
  transition: border-color var(--em-t), box-shadow var(--em-t);
  outline: none;
}
.em-input:focus,
.em-select:focus,
.em-textarea:focus {
  border-color: var(--em-gold);
  box-shadow: 0 0 0 3px var(--em-gold-glow);
}

.em-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8fa3' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.em-textarea { resize: vertical; min-height: 100px; }

.em-input::placeholder,
.em-textarea::placeholder { color: var(--em-text-dim); }

.em-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--em-sp-4); }
@media (max-width: 600px) { .em-form-row { grid-template-columns: 1fr; } }

.em-hint { font-size: var(--em-fs-xs); color: var(--em-text-dim); margin-top: 4px; }
.em-error { font-size: var(--em-fs-xs); color: var(--em-red); margin-top: 4px; }

/* ── Login Page ───────────────────────────────────────────────────────────── */
.em-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--em-sp-5);
  background: var(--em-bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(240,180,41,.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(56,189,248,.04) 0%, transparent 60%);
}

.em-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-r-xl);
  padding: var(--em-sp-7) var(--em-sp-6);
  box-shadow: var(--em-shadow);
}

.em-login-logo {
  text-align: center;
  margin-bottom: var(--em-sp-6);
}

.em-login-logo h1 {
  font-size: var(--em-fs-3xl);
  font-weight: 800;
  color: var(--em-gold);
  letter-spacing: var(--em-track-wide);
  text-transform: uppercase;
}

.em-login-logo p {
  font-size: var(--em-fs-sm);
  color: var(--em-text-muted);
  margin-top: 6px;
  font-family: var(--em-font-mono);
  text-transform: uppercase;
  letter-spacing: var(--em-track-wider);
}

.em-login-card .em-btn--primary { width: 100%; justify-content: center; margin-top: var(--em-sp-2); padding: 12px; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.em-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--em-border);
  margin-bottom: var(--em-sp-5);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.em-tab {
  padding: 10px 18px;
  font-size: var(--em-fs-sm);
  font-weight: 600;
  color: var(--em-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-transform: uppercase;
  letter-spacing: var(--em-track-wide);
  transition: all var(--em-t);
  white-space: nowrap;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--em-font);
  text-decoration: none;
  display: inline-block;
}
.em-tab:hover { color: var(--em-text); }
.em-tab.active { color: var(--em-gold); border-bottom-color: var(--em-gold); }

.em-tab-pane { display: none; }
.em-tab-pane.active { display: block; }

/* ── Wizard Stepper ───────────────────────────────────────────────────────── */
.em-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--em-sp-7);
  overflow-x: auto;
  padding: var(--em-sp-3) 0;
}

.em-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  min-width: 80px;
}

.em-step + .em-step::before {
  content: '';
  position: absolute;
  top: 16px;
  right: calc(50% + 16px);
  left: calc(-50% + 16px);
  height: 2px;
  background: var(--em-border);
}

.em-step.done + .em-step::before { background: var(--em-gold-dim); }

.em-step__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--em-border);
  background: var(--em-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--em-fs-sm);
  font-weight: 700;
  color: var(--em-text-dim);
  position: relative;
  z-index: 1;
  transition: all var(--em-t);
}

.em-step.done .em-step__dot   { border-color: var(--em-gold-dim); background: var(--em-gold-glow); color: var(--em-gold); }
.em-step.active .em-step__dot { border-color: var(--em-gold); background: var(--em-gold); color: #0b0c15; box-shadow: var(--em-shadow-gold); }

.em-step__label {
  font-size: var(--em-fs-xs);
  color: var(--em-text-dim);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--em-track-wide);
  white-space: nowrap;
}
.em-step.active .em-step__label { color: var(--em-gold); }
.em-step.done .em-step__label   { color: var(--em-text-muted); }

/* ── Alert / Flash ────────────────────────────────────────────────────────── */
.em-alert {
  padding: var(--em-sp-4) var(--em-sp-5);
  border-radius: var(--em-r);
  border: 1px solid;
  margin-bottom: var(--em-sp-5);
  font-size: var(--em-fs-sm);
}
.em-alert--success { background: var(--em-green-dim);  color: var(--em-green); border-color: rgba(41,217,123,.3); }
.em-alert--error   { background: var(--em-red-dim);    color: var(--em-red);   border-color: rgba(244,63,94,.3); }
.em-alert--warning { background: var(--em-amber-dim);  color: var(--em-amber); border-color: rgba(245,158,11,.3); }
.em-alert--info    { background: var(--em-blue-dim);   color: var(--em-blue);  border-color: rgba(56,189,248,.3); }

/* ── Disclaimer (legal) ───────────────────────────────────────────────────── */
.em-disclaimer {
  background: var(--em-surface-2);
  border-left: 3px solid var(--em-gold);
  padding: var(--em-sp-4) var(--em-sp-5);
  border-radius: 0 var(--em-r) var(--em-r) 0;
  margin-top: var(--em-sp-5);
  font-size: var(--em-fs-xs);
  color: var(--em-text-muted);
}
.em-disclaimer strong { color: var(--em-gold); }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.em-empty {
  padding: var(--em-sp-8) var(--em-sp-5);
  text-align: center;
}
.em-empty__icon { font-size: 48px; margin-bottom: var(--em-sp-3); }
.em-empty__title { font-size: var(--em-fs-xl); font-weight: 700; margin-bottom: var(--em-sp-2); }
.em-empty__body { color: var(--em-text-muted); margin-bottom: var(--em-sp-5); max-width: 400px; margin-left: auto; margin-right: auto; }

/* ── Card grid ────────────────────────────────────────────────────────────── */
.em-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--em-sp-4);
}

.em-card {
  background: var(--em-surface);
  border: 1px solid var(--em-border);
  border-radius: var(--em-r-lg);
  padding: var(--em-sp-5);
  transition: border-color var(--em-t), box-shadow var(--em-t);
  text-decoration: none;
  color: var(--em-text);
  display: block;
}
.em-card:hover { border-color: var(--em-gold-dim); box-shadow: var(--em-shadow-gold); color: var(--em-text); }

.em-card__title { font-size: var(--em-fs-md); font-weight: 700; margin-bottom: 4px; }
.em-card__sub   { font-size: var(--em-fs-xs); color: var(--em-text-muted); margin-bottom: var(--em-sp-3); font-family: var(--em-font-mono); text-transform: uppercase; letter-spacing: var(--em-track-wide); }

/* ── Section divider ──────────────────────────────────────────────────────── */
.em-divider {
  border: none;
  border-top: 1px solid var(--em-border);
  margin: var(--em-sp-5) 0;
}

/* ── Mono / code ──────────────────────────────────────────────────────────── */
.em-mono { font-family: var(--em-font-mono); font-size: var(--em-fs-xs); color: var(--em-text-muted); }

/* ── Status dot ───────────────────────────────────────────────────────────── */
.em-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--em-border-light);
  vertical-align: middle;
  margin-right: 5px;
}
.em-dot--green  { background: var(--em-green); box-shadow: 0 0 6px var(--em-green); }
.em-dot--amber  { background: var(--em-amber); }
.em-dot--red    { background: var(--em-red); }
.em-dot--blue   { background: var(--em-blue); }
.em-dot--gold   { background: var(--em-gold); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.em-foot {
  border-top: 1px solid var(--em-border);
  padding: var(--em-sp-5) var(--em-sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--em-sp-3);
}
.em-foot__copy { font-size: var(--em-fs-xs); color: var(--em-text-dim); }
.em-foot__disclaimer { font-size: var(--em-fs-xs); color: var(--em-text-dim); max-width: 500px; }

/* ── Responsive helpers ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .em-nav__links { display: none; }
  .em-shell { padding: var(--em-sp-4) var(--em-sp-4) var(--em-sp-7); }
  .em-kpi-row { grid-template-columns: 1fr 1fr; }
  .em-stepper { justify-content: flex-start; }
  .em-page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .em-kpi-row { grid-template-columns: 1fr; }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--em-bg); }
::-webkit-scrollbar-thumb { background: var(--em-border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--em-text-dim); }
