/* ============================================================
   NEXUS DSI — LCARS TNG STYLESHEET
   ============================================================ */

:root {
  --lcars-amber: #F89D15;
  --lcars-dark-amber: #CC7A00;
  --lcars-orange: #E66800;
  --lcars-deep-orange: #CC4400;
  --lcars-peach: #FF9966;
  --lcars-salmon: #C46438;
  --lcars-rose: #C45AA0;
  --lcars-mauve: #9B59B6;
  --lcars-lavender: #9999CC;
  --lcars-periwinkle: #7788BB;
  --lcars-blue: #5577AA;
  --lcars-sky-blue: #5599DD;
  --lcars-teal: #44AAAA;
  --lcars-red: #CC2200;
  --lcars-green: #22CC44;
  --lcars-white: #FFEECC;
  --lcars-text: #FFAA33;
  --lcars-dim: #775500;
  --lcars-bg: #000000;
  --lcars-panel-bg: #0A0A0A;
  --lcars-input-bg: #0A0A0A;
  --lcars-border: rgba(248, 157, 21, 0.15);
}

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

body {
  background: var(--lcars-bg);
  color: var(--lcars-text);
  font-family: 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
  height: 100vh;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(248,157,21,0.2); border-radius: 3px; }

/* ---- LAYOUT SHELL ---- */
.lcars-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.lcars-sidebar {
  width: 120px;
  display: flex;
  flex-direction: column;
  padding: 16px 0 16px 16px;
  gap: 3px;
  flex-shrink: 0;
}

.lcars-sidebar-cap-top {
  background: var(--lcars-rose);
  height: 48px;
  border-radius: 24px 0 0 0;
  display: flex;
  align-items: flex-end;
  padding: 0 0 6px 10px;
}

.lcars-sidebar-elbow-top {
  background: var(--lcars-amber);
  border-radius: 0 0 0 22px;
  height: 50px;
  display: flex;
  align-items: flex-end;
  padding: 0 0 6px 10px;
}

.lcars-sidebar-stem {
  background: var(--lcars-amber);
  width: 26px;
  flex: 1;
}

.lcars-sidebar-elbow-bottom {
  background: var(--lcars-lavender);
  border-radius: 22px 0 0 0;
  height: 50px;
  display: flex;
  align-items: flex-start;
  padding: 6px 0 0 10px;
}

.lcars-sidebar-cap-bottom {
  background: var(--lcars-periwinkle);
  height: 40px;
  border-radius: 0 0 0 20px;
  display: flex;
  align-items: center;
  padding: 0 0 0 10px;
}

.lcars-sidebar-spacer {
  background: var(--lcars-amber);
  height: 6px;
}

.lcars-sidebar-spacer-lav {
  background: var(--lcars-lavender);
  height: 6px;
}

.lcars-sidebar-stem-short {
  background: var(--lcars-amber);
  width: 26px;
  height: 6px;
}

/* ---- NAV BUTTONS ---- */
.lcars-nav-btn {
  height: 32px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  cursor: pointer;
  transition: filter 0.15s;
  text-decoration: none;
  border: none;
  width: 100%;
}

.lcars-nav-btn:hover { filter: brightness(1.4); }
.lcars-nav-btn.active { filter: brightness(1.6); }

.lcars-nav-btn span {
  color: #000;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1px;
}

.nav-peach { background: var(--lcars-peach); }
.nav-amber { background: var(--lcars-amber); }
.nav-dark-amber { background: var(--lcars-dark-amber); }
.nav-orange { background: var(--lcars-orange); }
.nav-salmon { background: var(--lcars-salmon); }

/* ---- MAIN CONTENT ---- */
.lcars-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 16px 8px;
  min-width: 0;
  overflow: hidden;
}

/* ---- TOP BAR ---- */
.lcars-topbar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.lcars-topbar-accent {
  background: var(--lcars-rose);
  height: 44px;
  width: 50px;
  flex-shrink: 0;
}

.lcars-topbar-title {
  background: var(--lcars-amber);
  height: 44px;
  flex: 0 0 240px;
  display: flex;
  align-items: center;
  padding-left: 16px;
}

.lcars-topbar-title h1 {
  color: #000;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 4px;
  margin: 0;
}

.lcars-topbar-fill {
  display: flex;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.lcars-topbar-fill > div { height: 44px; flex: 1; }

.lcars-topbar-clock {
  background: var(--lcars-periwinkle);
  height: 44px;
  border-radius: 0 22px 22px 0;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lcars-topbar-clock .stardate {
  color: #000;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
}

.lcars-topbar-clock .datetime {
  color: #000;
  font-size: 10px;
  letter-spacing: 1px;
}

/* ---- SECTION HEADERS ---- */
.lcars-section-header {
  height: 26px;
  border-radius: 13px 13px 0 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lcars-section-header span {
  color: #000;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
}

.section-lavender { background: var(--lcars-lavender); }
.section-rose { background: var(--lcars-rose); }
.section-amber { background: var(--lcars-amber); }
.section-dark-amber { background: var(--lcars-dark-amber); }
.section-peach { background: var(--lcars-peach); }
.section-orange { background: var(--lcars-orange); }
.section-teal { background: var(--lcars-teal); }

/* ---- SECTION BODY ---- */
.lcars-section-body {
  border: 1px solid rgba(153, 153, 204, 0.2);
  border-top: none;
  padding: 14px;
  border-radius: 0 0 6px 6px;
  margin-bottom: 16px;
}

.section-body-lavender { border-color: rgba(153,153,204,0.25); }
.section-body-rose { border-color: rgba(196,90,160,0.25); }
.section-body-amber { border-color: rgba(248,157,21,0.25); }
.section-body-dark-amber { border-color: rgba(204,122,0,0.25); }

/* ---- WELCOME BAR ---- */
.lcars-welcome {
  background: var(--lcars-lavender);
  height: 28px;
  border-radius: 14px 14px 0 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.lcars-welcome span {
  color: #000;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
}

.lcars-welcome .role-label {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 1px;
}

/* ---- CONTENT AREA ---- */
.lcars-content {
  flex: 1;
  border: 2px solid rgba(153,153,204,0.25);
  border-top: none;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0 0 0 14px;
}

/* ---- BOTTOM BAR ---- */
.lcars-bottombar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 8px;
  flex-shrink: 0;
}

.lcars-bottombar-dot {
  background: var(--lcars-rose);
  height: 18px;
  width: 18px;
  border-radius: 9px;
}

.lcars-bottombar-line {
  background: var(--lcars-dark-amber);
  flex: 1;
  height: 4px;
  border-radius: 2px;
}

.lcars-bottombar-status {
  color: var(--lcars-dim);
  font-size: 11px;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

.lcars-bottombar-badge {
  background: var(--lcars-teal);
  height: 18px;
  border-radius: 9px;
  padding: 0 12px;
  display: flex;
  align-items: center;
}

.lcars-bottombar-badge span {
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---- NODE CARDS ---- */
.node-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.node-card {
  border: 1px solid rgba(68,170,170,0.25);
  border-radius: 6px;
  padding: 10px;
  background: #050505;
}

.node-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.node-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.node-indicator.online {
  background: var(--lcars-green);
  box-shadow: 0 0 6px var(--lcars-green);
}

.node-indicator.offline {
  background: var(--lcars-red);
  box-shadow: 0 0 6px var(--lcars-red);
}

.node-name {
  color: var(--lcars-amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.node-ip { color: var(--lcars-peach); font-size: 11px; letter-spacing: 1px; }
.node-role { color: var(--lcars-dim); font-size: 10px; letter-spacing: 1px; margin-top: 2px; }
.node-hw { color: var(--lcars-dim); font-size: 9px; letter-spacing: 1px; margin-top: 1px; }

/* ---- TIER CARDS ---- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tier-card {
  text-align: center;
  padding: 8px;
  background: #050505;
  border-radius: 4px;
}

.tier-count {
  font-size: 26px;
  font-weight: 700;
}

.tier-name {
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 4px;
  opacity: 0.8;
}

.tier-port {
  color: var(--lcars-dim);
  font-size: 9px;
  margin-top: 2px;
}

/* ---- STAT CARDS ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  text-align: center;
  padding: 8px;
  background: #050505;
  border-radius: 4px;
}

.stat-value {
  color: var(--lcars-amber);
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  color: var(--lcars-peach);
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 4px;
}

.stat-sub {
  color: var(--lcars-dim);
  font-size: 9px;
  margin-top: 2px;
}

/* ---- SEARCH BAR ---- */
.lcars-search-row {
  display: flex;
  gap: 6px;
}

.lcars-input {
  flex: 1;
  padding: 9px 14px;
  background: var(--lcars-input-bg);
  border: 1px solid var(--lcars-border);
  border-radius: 3px;
  color: var(--lcars-amber);
  font-size: 15px;
  font-family: 'Arial Narrow', sans-serif;
  letter-spacing: 1px;
  outline: none;
}

.lcars-input:focus { border-color: var(--lcars-amber); }
.lcars-input::placeholder { color: rgba(68,51,0,0.25); }

.lcars-btn {
  padding: 9px 20px;
  background: var(--lcars-amber);
  border: none;
  border-radius: 0 14px 14px 0;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: 'Arial Narrow', sans-serif;
}

.lcars-btn:hover { background: var(--lcars-orange); }

/* ---- LOGIN PAGE ---- */
.login-container {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 16px 8px;
}

.login-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 560px;
}

.login-form-body {
  border: 2px solid rgba(153,153,204,0.3);
  border-top: none;
  padding: 36px 36px 28px;
  border-radius: 0 0 0 20px;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 10px 14px;
  border-radius: 4px;
  transition: all 0.4s;
}

.auth-status.pending {
  background: var(--lcars-panel-bg);
  border: 1px solid rgba(248,157,21,0.13);
}

.auth-status.granted {
  background: #002200;
  border: 1px solid rgba(34,204,68,0.3);
}

.auth-status.denied {
  background: #220000;
  border: 1px solid rgba(204,34,0,0.3);
}

.auth-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.auth-indicator.pending {
  background: var(--lcars-amber);
  box-shadow: 0 0 10px var(--lcars-amber);
  animation: pulse 2s ease infinite;
}

.auth-indicator.granted {
  background: var(--lcars-green);
  box-shadow: 0 0 10px var(--lcars-green);
}

.auth-indicator.denied {
  background: var(--lcars-red);
  box-shadow: 0 0 10px var(--lcars-red);
}

.auth-status-text {
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 700;
}

.auth-status-text.pending { color: var(--lcars-amber); }
.auth-status-text.granted { color: var(--lcars-green); }
.auth-status-text.denied { color: var(--lcars-red); }

.login-field {
  margin-bottom: 20px;
}

.login-field label {
  color: var(--lcars-peach);
  font-size: 12px;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 11px 14px;
  background: var(--lcars-input-bg);
  border: 1px solid rgba(248,157,21,0.25);
  border-radius: 3px;
  color: var(--lcars-amber);
  font-size: 18px;
  font-family: 'Arial Narrow', sans-serif;
  letter-spacing: 2px;
  outline: none;
}

.login-field input:focus { border-color: var(--lcars-amber); }
.login-field input::placeholder { color: rgba(68,51,0,0.2); }

.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--lcars-amber);
  border: none;
  border-radius: 0 18px 18px 0;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Arial Narrow', sans-serif;
  letter-spacing: 4px;
  cursor: pointer;
  margin-top: 8px;
}

.login-btn:hover { background: var(--lcars-orange); }

.login-error {
  color: var(--lcars-red);
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 12px;
}

/* ---- BOOT SEQUENCE ---- */
.boot-container {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.boot-header {
  display: flex;
  padding: 16px 16px 0;
  gap: 6px;
}

.boot-header-left {
  background: var(--lcars-rose);
  height: 44px;
  border-radius: 22px 0 0 22px;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-header-center {
  background: var(--lcars-amber);
  height: 44px;
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 20px;
}

.boot-header-right {
  background: var(--lcars-lavender);
  height: 44px;
  border-radius: 0 22px 22px 0;
  width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-header span {
  color: #000;
  font-weight: 700;
  letter-spacing: 2px;
}

.boot-subbar {
  display: flex;
  padding: 6px 16px;
  gap: 6px;
}

.boot-subbar > div { height: 6px; border-radius: 3px; }

.boot-terminal {
  flex: 1;
  padding: 20px 120px;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.9;
}

.boot-line {
  opacity: 0;
  animation: bootFade 0.3s ease forwards;
}

.boot-cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background: var(--lcars-amber);
  animation: blink 0.7s step-end infinite;
}

.boot-footer {
  padding: 0 20px 12px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--lcars-dim);
  font-family: 'Courier New', monospace;
}

.boot-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* ---- RESPONSE AREA ---- */
.response-box {
  background: #050505;
  border: 1px solid var(--lcars-border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--lcars-white);
  white-space: pre-wrap;
}

.chunk-result {
  background: #050505;
  border: 1px solid var(--lcars-border);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 8px;
}

.chunk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.chunk-dewey {
  color: var(--lcars-lavender);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.chunk-gep {
  color: var(--lcars-amber);
  font-size: 12px;
  font-weight: 700;
}

.chunk-content {
  color: var(--lcars-white);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

/* ---- MODEL TABLE ---- */
.model-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.model-table th {
  color: var(--lcars-peach);
  font-weight: 700;
  letter-spacing: 1px;
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--lcars-border);
}

.model-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(248,157,21,0.06);
  color: var(--lcars-white);
}

.model-status {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.model-status.preferred { background: rgba(34,204,68,0.15); color: var(--lcars-green); }
.model-status.available { background: rgba(248,157,21,0.15); color: var(--lcars-amber); }
.model-status.deprecated { background: rgba(204,34,0,0.15); color: var(--lcars-red); }

/* ---- ANIMATIONS ---- */
@keyframes bootFade {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes blink { 50% { opacity: 0; } }

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

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .node-grid, .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lcars-topbar-title { flex: 0 0 160px; }
  .lcars-topbar-title h1 { font-size: 16px; letter-spacing: 2px; }
  .boot-terminal { padding: 20px 40px; }
}
