@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

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

:root {
  --bg:          #0A0A12;
  --fg:          #00CC00;
  --fg-bright:   #55FF55;
  --fg-dim:      #00CC00aa;
  --cyan:        #55FFFF;
  --yellow:      #FFFF55;
  --red:         #FF5555;
  --orange:      #FFAA33;
  --white:       #FFFFFF;
  --white-cc:    #FFFFFFcc;
  --white-dim:   #FFFFFF66;
  --border:      #00CC0033;
  --border-hl:   #00CC0055;
  --font:        'IBM Plex Mono', 'Consolas', 'DejaVu Sans Mono', monospace;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

/* CRT scanline overlay */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════════════════
   AUTH SCREEN (DemoVersionPanel intro style)
   ══════════════════════════════════════════════════════════════════════════ */

.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #000;
}

.lotus-logo {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
  white-space: pre;
}
.l-bright {
  color: rgba(232,121,249,0.95);
  text-shadow: 0 0 8px rgba(232,121,249,0.8), 0 0 18px rgba(192,132,252,0.4);
}
.l-dim {
  color: rgba(192,132,252,0.45);
}
.l-gold {
  color: rgba(255,223,100,0.95);
  text-shadow: 0 0 8px rgba(255,223,100,0.7), 0 0 14px rgba(255,180,50,0.3);
}

.auth-company {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 12px rgba(255,255,255,0.25);
  margin-bottom: 4px;
}

.auth-slogan {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: rgba(74,222,128,0.80);
  text-shadow: 0 0 6px rgba(74,222,128,0.4);
  margin-bottom: 28px;
  text-transform: uppercase;
}

.auth-terminal {
  width: min(300px, 80vw);
  text-align: left;
  border: 1px solid rgba(74,222,128,0.35);
  border-radius: 4px;
  padding: 10px 12px;
  box-shadow: 0 0 12px rgba(74,222,128,0.15);
  background: rgba(0,0,0,0.4);
}

.term-line {
  display: flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.term-prompt {
  color: #16a34a;
  margin-right: 6px;
  flex-shrink: 0;
}

#token-input {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(74,222,128,0.95);
  text-shadow: 0 0 5px rgba(74,222,128,0.5);
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.08em;
  width: 100%;
  caret-color: rgba(74,222,128,0.95);
}
#token-input::placeholder {
  color: rgba(74,222,128,0.30);
  text-shadow: none;
}

.term-error {
  display: flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--red);
  text-shadow: 0 0 8px rgba(255,85,85,0.5);
  margin-top: 6px;
  animation: error-flash 0.5s step-end 3;
}

@keyframes error-flash {
  50% { opacity: 0; }
}

.error { color: var(--red); }

/* ══════════════════════════════════════════════════════════════════════════
   DASHBOARD — DemoVersionPanel open-phase style
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Header (matches DemoVersionPanel header) ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-logo {
  font-size: 6px;
  line-height: 1.2;
  white-space: pre;
  margin: 0;
  color: #FF55FF;
  flex-shrink: 0;
  user-select: none;
}
.topbar-logo .logo-gold {
  color: rgba(255,223,100,0.95);
}

.topbar-company {
  color: var(--white);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.topbar-sub {
  color: var(--fg-dim);
  font-size: 8px;
  margin-top: 1px;
}

.topbar-center {
  font-size: 8px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--fg-dim);
  flex-shrink: 0;
}
.topbar-center span {
  color: #00CC00dd;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-time {
  font-size: 9px;
  font-weight: 300;
  text-align: right;
  line-height: 1.5;
}
.topbar-time .time-val {
  color: var(--white);
}
.topbar-time .date-val {
  color: #FFFFFFaa;
}

.badge-mock {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid var(--orange);
  color: var(--orange);
  border-radius: 2px;
  letter-spacing: 0;
}

.badge-env {
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  border-radius: 2px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(255,255,85,0.4);
}

.topbar-refresh {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  padding: 2px 6px;
  border: 1px solid #00CC0088;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}
.topbar-refresh:hover {
  color: var(--fg-bright);
  border-color: var(--fg);
  background: #00CC0022;
}
.topbar-refresh:active {
  background: #00CC0044;
}
.topbar-refresh.spinning {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Demo banner ── */
.demo-banner {
  background: #440000;
  border-bottom: 1px solid var(--red);
  color: var(--red);
  text-align: center;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  padding: 3px 12px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255,85,85,0.5);
}

/* ── Two-column layout ── */
.columns {
  display: flex;
  height: calc(100vh - 38px);
  overflow: hidden;
}

.col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-left {
  flex: 1;
  border-right: 1px solid var(--border);
}

.col-right {
  flex: 1;
}

/* ── Sections (replaces panel boxes) ── */
.section {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.section.flex-grow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.section-title {
  padding: 5px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.section-body {
  padding: 6px 12px;
  font-size: 10px;
}

.section.flex-grow .section-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hl) transparent;
}

/* ── Status rows ── */
.s-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
  font-size: 10px;
  font-weight: 300;
}

.s-label { color: var(--fg-dim); }
.s-val { text-align: right; color: var(--white-cc); }

.c-green  { color: var(--fg-bright) !important; }
.c-yellow { color: var(--yellow) !important; }
.c-red    { color: var(--red) !important; }
.c-cyan   { color: var(--cyan) !important; }
.c-white  { color: var(--white) !important; }
.c-dim    { color: var(--white-dim) !important; }
.c-orange { color: var(--orange) !important; }

/* ── Progress bars ── */
.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.bar-label {
  width: 36px;
  color: var(--cyan);
  font-weight: 400;
  font-size: 9px;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 12px;
  background: #111118;
  border: 1px solid var(--border);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  transition: width 0.6s ease-out;
  position: relative;
}

.bar-fill.green  { background: linear-gradient(90deg, #004400, #00CC00); }
.bar-fill.yellow { background: linear-gradient(90deg, #444400, #CCCC00); }
.bar-fill.red    { background: linear-gradient(90deg, #440000, #CC0000); }

.bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: currentColor;
  opacity: 0.6;
  filter: blur(2px);
}

.bar-pct {
  width: 48px;
  text-align: right;
  font-size: 9px;
  flex-shrink: 0;
}

.bar-detail {
  color: var(--white-dim);
  font-size: 8px;
  width: 90px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Spark graphs ── */
.spark-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 3px 0;
}

.spark-label {
  width: 36px;
  color: var(--cyan);
  font-weight: 400;
  font-size: 9px;
  text-align: right;
  flex-shrink: 0;
  align-self: center;
}

.spark-graph {
  flex: 1;
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.spark-graph.green  { color: var(--fg); }
.spark-graph.cyan   { color: #00CCCC; }
.spark-graph.yellow { color: var(--yellow); }
.spark-graph.orange { color: var(--orange); }

.spark-value {
  width: 72px;
  text-align: right;
  font-size: 9px;
  flex-shrink: 0;
  align-self: center;
}

/* ── Buttons ── */
.term-btn {
  font-family: var(--font);
  font-size: 9px;
  font-weight: 400;
  padding: 4px 12px;
  border: 1px solid;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.06em;
}

.term-btn.green {
  color: var(--fg-bright);
  border-color: #00CC00cc;
}
.term-btn.green:hover {
  background: #00CC0022;
  color: var(--fg-bright);
  border-color: var(--fg);
}

.term-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

#payment-result {
  margin-top: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border-hl);
  word-break: break-all;
  font-size: 9px;
}
#payment-result a {
  color: var(--fg-bright);
  text-decoration: underline;
}

/* ── Tables ── */
.term-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  font-weight: 300;
}

.term-table th {
  text-align: left;
  color: var(--fg);
  border-bottom: 1px solid var(--border-hl);
  padding: 3px 6px 3px 0;
  font-weight: 400;
  font-size: 8px;
}

.term-table td {
  padding: 2px 6px 2px 0;
  color: var(--white-cc);
  border-bottom: 1px solid rgba(0, 204, 0, 0.04);
}

.term-table .succeeded { color: var(--fg-bright); }
.term-table .pending   { color: var(--yellow); }
.term-table .canceled  { color: var(--red); }

/* ── Service status indicators ── */
.svc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  font-size: 10px;
  font-weight: 300;
}

.svc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.svc-dot.on  { background: var(--fg-bright); box-shadow: 0 0 4px var(--fg); }
.svc-dot.off { background: var(--red); box-shadow: 0 0 4px var(--red); }
.svc-dot.warn { background: var(--yellow); box-shadow: 0 0 4px var(--yellow); }

.svc-name { color: var(--white-cc); }
.svc-detail { color: var(--white-dim); margin-left: auto; font-size: 9px; }

/* ── Server info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 10px;
  font-size: 9px;
  font-weight: 300;
}

.info-grid .k { color: var(--fg-dim); }
.info-grid .v { color: var(--white-cc); }
.info-grid .v.highlight { color: var(--fg-bright); }

/* ── Responsive ── */
@media (max-width: 900px) {
  html, body { overflow-y: auto; height: auto; }
  .columns { flex-direction: column; height: auto; overflow: visible; }
  .col { overflow: visible; }
  .col-left { border-right: none; border-bottom: 1px solid var(--border); }
  .topbar-center { display: none; }
  .topbar-logo { display: none; }
  .topbar-company { font-size: 9px; }
  .topbar-sub { font-size: 7px; }
  .topbar { padding: 4px 10px; }
  .section-body { padding: 5px 10px; }
  .section-title { padding: 4px 10px; }
  .bar-detail { width: auto; font-size: 7px; }
  .info-grid .v { word-break: break-all; }
  .info-grid .v.highlight { font-size: 8px; }
}
