/* PROJECT X Admin – Hacker mode UI */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@500;700;900&display=swap');

:root {
  --bg: #050506;
  --bg-terminal: #0a0b0c;
  --surface: #0d0e10;
  --surface-hover: #141618;
  --red: #C62828;
  --red-dark: #6B4C00;
  --red-accent: #D4A017;
  --red-dim: rgba(212, 160, 23, 0.2);
  --white: #f5f5f5;
  --white-dim: #b0b0b0;
  --grey: #6a6a6a;
  --green: #00E676;
  --green-dim: rgba(0, 230, 118, 0.15);
  --cyan: #D4A017;
  --cyan-dim: rgba(212, 160, 23, 0.2);
  --amber: #FFAB00;
  --gold: #D4A017;
  --gold-dim: rgba(212, 160, 23, 0.2);
  --blood-red: #C62828;
  --app-logo-auth-size: 104px;
  /* Meniu sidebar (logo sus in admin) */
  --app-logo-sidebar-size: 76px;
  --app-logo-nav-size: 40px;
}

* { box-sizing: border-box; }

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 160, 23, 0.72) rgba(8, 10, 16, 0.85);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 160, 23, 0.72) rgba(8, 10, 16, 0.85);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.92) 0%, rgba(12, 14, 22, 0.88) 100%);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(8, 10, 16, 0.9);
  background: linear-gradient(180deg, rgba(255, 210, 90, 0.95) 0%, rgba(212, 160, 23, 0.85) 55%, rgba(140, 100, 20, 0.9) 100%);
  box-shadow: 0 0 10px rgba(212, 160, 23, 0.35);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffe082 0%, #d4a017 50%, #a67c00 100%);
  box-shadow: 0 0 14px rgba(212, 160, 23, 0.5);
}

*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #ffc83d 0%, #b8860b 100%);
}

*::-webkit-scrollbar-corner {
  background: rgba(8, 10, 16, 0.92);
}

body {
  margin: 0;
  font-family: 'Share Tech Mono', 'Consolas', 'Courier New', monospace;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========== ANIMATED BACKGROUND ========== */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: -50%;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 160, 23, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(107, 76, 0, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse 50% 30% at 20% 80%, rgba(198, 40, 40, 0.06) 0%, transparent 40%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.7; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(212, 160, 23, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 160, 23, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: gridMove 25s linear infinite;
}

@keyframes gridMove {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(32px, 32px); }
}

.bg-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  animation: scanlineDrift 8s linear infinite;
}

@keyframes scanlineDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 4px; }
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* ========== LAYOUT – Sidebar shell ========== */
.app-shell {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 100vh;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 140;
  backdrop-filter: blur(2px);
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width, 284px);
  z-index: 150;
  padding: 0.85rem;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, rgba(26, 20, 8, 0.97) 0%, rgba(8, 6, 3, 0.98) 100%);
  border: 1px solid rgba(212, 160, 23, 0.35);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  min-width: 0;
}

.sidebar-brand {
  padding: 0.9rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(212, 160, 23, 0.18);
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.sidebar-logo-stage {
  position: relative;
  width: var(--app-logo-sidebar-size);
  height: var(--app-logo-sidebar-size);
  max-width: var(--app-logo-sidebar-size);
  max-height: var(--app-logo-sidebar-size);
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  position: relative;
  z-index: 2;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: var(--app-logo-sidebar-size) !important;
  max-height: var(--app-logo-sidebar-size) !important;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: opacity;
  animation: sidebarLogoGhost 4.2s ease-in-out infinite;
}

@keyframes sidebarLogoGhost {
  0%, 100% {
    opacity: 0.28;
    filter: drop-shadow(0 0 6px rgba(212, 160, 23, 0.15));
  }
  45%, 55% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(212, 160, 23, 0.35));
  }
}

.logo-ghost-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-ghost-stage::before,
.logo-ghost-stage::after {
  content: none !important;
  display: none !important;
}

.logo-ghost-img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: opacity;
  animation: sidebarLogoGhost 4.2s ease-in-out infinite;
}

@keyframes logoRingPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

@keyframes logoRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes logoMenuFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-logo,
  .nav-logo,
  .nav-logo-ring,
  .logo-ghost-img {
    animation: none !important;
    opacity: 1 !important;
  }
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  width: 100%;
}

.sidebar-brand-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.92rem;
  color: var(--white);
  text-shadow: 0 0 20px rgba(212, 160, 23, 0.25);
}

.sidebar-brand-sub {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.65rem 0.45rem 0.75rem 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: #ffd54f rgba(212, 160, 23, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
  height: 0;
}

.sidebar-nav::-webkit-scrollbar:horizontal {
  display: none;
  height: 0;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(212, 160, 23, 0.08);
  border-radius: 999px;
  margin: 4px 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ffe082 0%, #ffd54f 45%, #d4a017 100%);
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 130, 0.45);
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.45);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #fff176 0%, #ffca28 50%, #ffb300 100%);
}

/* ── Section cards: each group has its own accent ── */
.sidebar-group {
  position: relative;
}

.sidebar-group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.35rem 0.45rem;
}

.sidebar-group-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-group-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sidebar-group-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--white);
}

.sidebar-group-desc {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--grey);
  text-transform: none;
}

.sidebar-group-panel {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  min-width: 0;
}

/* Overview — green terminal */
.sidebar-group--overview .sidebar-group-num {
  color: #04140c;
  background: linear-gradient(135deg, #00e676 0%, #00bfa5 100%);
  box-shadow: 0 0 14px rgba(0, 230, 118, 0.35);
}
.sidebar-group--overview .sidebar-group-label { color: #9dffd0; }
.sidebar-group--overview .sidebar-group-panel {
  border-color: rgba(0, 230, 118, 0.22);
  background: linear-gradient(165deg, rgba(0, 230, 118, 0.07) 0%, rgba(0, 0, 0, 0.32) 55%);
}
.sidebar-group--overview .sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.2), rgba(0, 230, 118, 0.04));
  border-color: rgba(0, 230, 118, 0.45);
  box-shadow: inset 3px 0 0 #00e676;
}

/* Data — cyan vault */
.sidebar-group--data .sidebar-group-num {
  color: #031018;
  background: linear-gradient(135deg, #00e5ff 0%, #0091ea 100%);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.35);
}
.sidebar-group--data .sidebar-group-label { color: #9ae8ff; }
.sidebar-group--data .sidebar-group-panel {
  border-color: rgba(0, 229, 255, 0.22);
  background: linear-gradient(165deg, rgba(0, 229, 255, 0.07) 0%, rgba(0, 0, 0, 0.32) 55%);
}
.sidebar-group--data .sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.04));
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: inset 3px 0 0 var(--cyan);
}

/* Server — gold command deck */
.sidebar-group--server .sidebar-group-num {
  color: #1a1200;
  background: linear-gradient(135deg, #ffd54f 0%, #d4a017 100%);
  box-shadow: 0 0 14px rgba(212, 160, 23, 0.4);
}
.sidebar-group--server .sidebar-group-label { color: #ffe082; }
.sidebar-group--server .sidebar-group-panel {
  border-color: rgba(212, 160, 23, 0.28);
  background: linear-gradient(165deg, rgba(212, 160, 23, 0.09) 0%, rgba(0, 0, 0, 0.32) 55%);
}
.sidebar-group--server .sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(212, 160, 23, 0.22), rgba(212, 160, 23, 0.05));
  border-color: rgba(212, 160, 23, 0.5);
  box-shadow: inset 3px 0 0 var(--red-accent);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--white-dim);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  border: 1px solid transparent;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.sidebar-link.is-active {
  color: var(--white);
}

.sidebar-icon-wrap {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.sidebar-icon-wrap--overview {
  border-color: rgba(0, 230, 118, 0.28);
  background: rgba(0, 230, 118, 0.08);
}
.sidebar-icon-wrap--data {
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.08);
}
.sidebar-icon-wrap--server {
  border-color: rgba(212, 160, 23, 0.32);
  background: rgba(212, 160, 23, 0.1);
}

.sidebar-icon {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
  flex-shrink: 0;
}

.sidebar-icon--sm {
  width: 0.95rem;
  height: 0.95rem;
}

.sidebar-group--overview .sidebar-icon { color: #69f0ae; }
.sidebar-group--data .sidebar-icon { color: #40c4ff; }
.sidebar-group--server .sidebar-icon { color: #ffd54f; }

.sidebar-link-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.sidebar-link-text {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: inherit;
  overflow-wrap: anywhere;
}

.sidebar-link-hint {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--grey);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sidebar-link.is-active .sidebar-link-hint {
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-actions-deck {
  margin-top: 0.15rem;
  padding: 0.55rem 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 160, 23, 0.25);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(212, 160, 23, 0.04) 0,
      rgba(212, 160, 23, 0.04) 1px,
      transparent 1px,
      transparent 8px
    ),
    rgba(0, 0, 0, 0.35);
}

.sidebar-actions-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.sidebar-actions-dot {
  display: none;
}

.sidebar-actions-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffe082;
}

.sidebar-actions-icon .sidebar-icon {
  color: #ffe082;
}

@keyframes actionsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.sidebar-actions-title {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffe082;
  font-weight: 700;
}

.sidebar-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.sidebar-actions-maint {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.sidebar-actions-maint-label {
  display: block;
  padding: 0.15rem 0.1rem 0.05rem;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
  text-align: center;
  line-height: 1.3;
}

.sidebar-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.4rem 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--white-dim);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-action-btn:hover {
  color: var(--white);
  border-color: rgba(212, 160, 23, 0.4);
}

.sidebar-action-start:hover { background: rgba(0, 230, 118, 0.12); color: var(--green); }
.sidebar-action-stop:hover { background: rgba(255, 23, 68, 0.12); color: var(--red-accent); }
.sidebar-action-restart:hover { background: rgba(0, 229, 255, 0.1); color: var(--cyan); }
.sidebar-action-maint:hover { background: rgba(212, 160, 23, 0.12); color: var(--gold); }

.sidebar-action-icon {
  width: 0.72rem;
  height: 0.72rem;
  flex-shrink: 0;
  opacity: 0.95;
}

.sidebar-action-start .sidebar-action-icon { color: var(--green); fill: var(--green); }
.sidebar-action-stop .sidebar-action-icon { color: var(--red-accent); fill: var(--red-accent); }
.sidebar-action-restart .sidebar-action-icon { color: var(--cyan); }
.sidebar-action-maint .sidebar-action-icon { color: var(--gold); }

.sidebar-footer {
  padding: 0.75rem 0.85rem 0.9rem;
  border-top: 1px solid rgba(212, 160, 23, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-lang-label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}

.sidebar-lang-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.sidebar-lang-select:hover,
.sidebar-lang-select:focus {
  border-color: var(--red-accent);
  outline: none;
}

.px-lang-detect-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.sidebar-lang-detect.px-lang-detect-wrap {
  display: flex;
  width: 100%;
}

.px-lang-detect-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  border: 1px solid rgba(212, 160, 23, 0.35);
  border-radius: 8px;
  padding: 0.38rem 0.62rem;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
  max-width: 100%;
  white-space: nowrap;
}

.px-lang-detect-btn:hover:not(:disabled),
.px-lang-detect-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
  background: rgba(212, 160, 23, 0.08);
}

.px-lang-detect-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.px-lang-detect-btn.is-error {
  border-color: rgba(255, 23, 68, 0.55);
}

.px-lang-detect-icon {
  font-size: 0.95em;
  line-height: 1;
}

.px-lang-detect-text {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.px-lang-reset-btn {
  flex-shrink: 0;
  background: rgba(13, 14, 16, 0.95);
  color: var(--gold);
  border: 1px solid rgba(212, 160, 23, 0.45);
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.px-lang-reset-btn:hover,
.px-lang-reset-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.auth-lang-detect.px-lang-detect-wrap {
  pointer-events: auto;
}

.auth-lang-detect .px-lang-detect-text {
  max-width: 9rem;
}

.nav-lang-detect.px-lang-detect-wrap {
  margin-right: 0.35rem;
}

.sidebar-logout {
  display: block;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--white-dim);
  border: 1px solid rgba(255, 23, 68, 0.35);
  background: rgba(255, 23, 68, 0.08);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-logout:hover {
  color: var(--white);
  background: rgba(255, 23, 68, 0.18);
  border-color: var(--red-accent);
}

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: calc(var(--sidebar-width, 284px) + 0.5rem);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  margin: 0.65rem 1rem 0;
  background: linear-gradient(180deg, rgba(26, 20, 8, 0.92) 0%, rgba(8, 6, 3, 0.95) 100%);
  border: 1px solid rgba(212, 160, 23, 0.28);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.sidebar-toggle {
  display: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 160, 23, 0.3);
  color: var(--white);
  font-size: 1.15rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.sidebar-toggle:hover {
  border-color: var(--red-accent);
  color: var(--red-accent);
}

.topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.topbar-prompt {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar-prompt span { color: var(--grey); }

/* "Operation project X" — solid red accent */
.operation-rgb-text {
  display: inline-block;
  font-weight: 600;
  color: #c62828;
  -webkit-text-fill-color: #c62828;
  text-shadow: 0 0 8px rgba(198, 40, 40, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .operation-rgb-text {
    color: #c62828;
    -webkit-text-fill-color: #c62828;
  }
}

.topbar-page {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-region {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.65rem;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(212, 160, 23, 0.28);
  background: rgba(212, 160, 23, 0.08);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--white-dim);
  white-space: nowrap;
  max-width: min(42vw, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-region strong {
  color: var(--gold);
  font-weight: 600;
}

.topbar-region-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.55);
  flex-shrink: 0;
}

.topbar-badge {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  background: rgba(0, 230, 118, 0.08);
}

/* Guest top bar (login / setup) */
.navbar {
  position: relative;
  z-index: 100;
  background: linear-gradient(180deg, #1a1408 0%, #0d0a03 50%, #080603 100%);
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--red-accent);
  box-shadow: 
    0 0 40px rgba(212, 160, 23, 0.25),
    0 4px 0 rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.navbar--guest {
  max-width: 980px;
  margin: 0 auto;
  width: calc(100% - 2rem);
  border-radius: 0 0 12px 12px;
  margin-top: 0.5rem;
}

.navbar a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.8rem;
  transition: color 0.2s, text-shadow 0.2s;
}

.navbar a:hover {
  color: var(--red-accent);
  text-shadow: 0 0 12px var(--red-accent);
}

.nav-lang-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.nav-lang-select {
  background: var(--surface);
  color: var(--white);
  border: 1px solid var(--red-dim);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-family: inherit;
  font-size: 0.7rem;
  margin-right: 0.5rem;
  cursor: pointer;
  min-width: 4.5rem;
  max-width: 7rem;
}
.nav-lang-select:hover, .nav-lang-select:focus { border-color: var(--red-accent); outline: none; }

/* Legacy nav classes kept for compatibility */
.nav-menu { display: none; }
.nav-menu-item { display: none; }
.nav-dropdown { display: none; }

.nav-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.nav-logo-stage {
  position: relative;
  width: var(--app-logo-nav-size);
  height: var(--app-logo-nav-size);
  flex-shrink: 0;
}

.nav-logo-ring {
  position: absolute;
  inset: -6px;
  border: 1.5px solid rgba(212, 160, 23, 0.45);
  border-radius: 50%;
  animation: logoRingPulse 3.2s ease-in-out infinite, logoRingSpin 20s linear infinite;
  pointer-events: none;
}

.nav-logo {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
  image-rendering: auto;
  filter: drop-shadow(0 0 14px rgba(212, 160, 23, 0.35));
  animation: logoMenuFloat 4.5s ease-in-out infinite;
}

.nav-prompt {
  color: var(--green);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.nav-prompt span {
  color: var(--grey);
}

.brand {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  letter-spacing: 0.22em;
  font-size: 1.05rem;
  animation: glitch 5s infinite;
}

@keyframes glitch {
  0%, 88%, 100% { text-shadow: 0 0 15px rgba(255,23,68,0.6); transform: translate(0); color: var(--white); }
  90% { text-shadow: -2px 0 var(--red-accent), 2px 0 var(--cyan); transform: translate(-1px, 1px); color: var(--red-accent); }
  92% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--red-accent); transform: translate(1px, -1px); color: var(--cyan); }
  94% { text-shadow: -2px 0 var(--red-accent), 2px 0 var(--green); transform: translate(0); color: var(--white); }
  96% { text-shadow: 0 0 20px var(--red-accent); transform: translate(0); color: var(--white); }
}

.container {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
}

.container--framed {
  margin: 0.85rem 1rem 0;
  padding: 1.35rem 1.5rem 1.75rem;
  background: linear-gradient(160deg, rgba(13, 14, 16, 0.72) 0%, rgba(5, 5, 6, 0.82) 100%);
  border: 1px solid rgba(212, 160, 23, 0.22);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  min-height: calc(100vh - 180px);
}

.app-footer {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--grey);
  letter-spacing: 0.05em;
}

.app-footer--guest {
  max-width: 980px;
}

/* ========== CARDS – Terminal / Hacker style ========== */
.card {
  background: linear-gradient(160deg, var(--surface) 0%, #08090a 100%);
  border: 1px solid rgba(212, 160, 23, 0.35);
  border-radius: 0;
  padding: 1.35rem 1.6rem;
  margin-bottom: 1.35rem;
  box-shadow: 
    0 0 0 1px rgba(0,0,0,0.4),
    0 0 25px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
  animation: cardIn 0.5s ease-out backwards;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-accent), transparent);
  opacity: 0.6;
  animation: lineGlow 3s ease-in-out infinite;
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,23,68,0.5), transparent);
}

@keyframes lineGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }

.card h2, .card h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin-top: 0;
  color: var(--white-dim);
  text-shadow: 0 0 10px var(--red-dim);
}

.card h3 .term-prefix { color: var(--red-accent); margin-right: 0.5rem; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.btn-primary {
  background: var(--red-dark);
  color: var(--white);
  border: 1px solid var(--red-accent);
  box-shadow: 0 0 15px var(--red-dim);
}

.btn-primary:hover:not(:disabled) {
  background: var(--red);
  box-shadow: 0 0 25px rgba(229, 57, 53, 0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: #3d2a15;
  color: #f5d89a;
  border: 1px solid var(--red);
}

.btn-danger:hover:not(:disabled) {
  background: #8B6914;
  box-shadow: 0 0 15px rgba(212, 160, 23, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--red-dark);
}

.btn-ghost:hover {
  background: var(--red-dim);
  border-color: var(--red-accent);
  box-shadow: 0 0 15px var(--red-dim);
  transform: translateY(-1px);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
a.btn { color: inherit; }
a.btn:hover { color: inherit; }
.btn.btn-disabled { pointer-events: none; opacity: 0.5; cursor: not-allowed; }

/* ========== INPUTS ========== */
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--red-dark);
  color: var(--white);
  padding: 0.6rem;
  border-radius: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
  width: 100%;
  max-width: 320px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--red-accent);
  box-shadow: 0 0 15px rgba(212, 160, 23, 0.2);
}

input::placeholder { color: var(--grey); }

label { display: block; margin-bottom: 0.35rem; color: var(--white-dim); font-size: 0.85rem; letter-spacing: 0.08em; }

/* ========== FLASH MESSAGES ========== */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  animation: flashIn 0.35s ease-out;
  border-left: 3px solid;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.flash.error {
  background: rgba(139, 40, 0, 0.35);
  border-left-color: var(--red-accent);
  color: #ffd6d6;
}
.flash.success {
  background: rgba(0, 230, 118, 0.12);
  border-left-color: var(--green);
  color: #c8e6c9;
}

/* ========== STATUS BADGE ========== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  animation: statusBlink 1.5s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50% { opacity: 0.9; box-shadow: 0 0 4px currentColor; }
}

.status-running {
  background: rgba(0, 230, 118, 0.12);
  color: var(--green);
  border: 1px solid var(--green);
  text-shadow: 0 0 10px var(--green-dim);
}

.status-stopped {
  background: rgba(212, 160, 23, 0.15);
  color: var(--red-accent);
  border: 1px solid var(--red-accent);
  text-shadow: 0 0 8px var(--red-dim);
}

/* ========== AUTH / LOGIN PAGE ========== */
body.page-auth .container {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

body.page-auth .bg-gradient {
  opacity: 0.35;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(212, 160, 23, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 35% at 85% 95%, rgba(107, 76, 0, 0.22) 0%, transparent 50%),
    radial-gradient(ellipse 45% 30% at 15% 85%, rgba(198, 40, 40, 0.06) 0%, transparent 45%);
}

body.page-auth .bg-grid {
  opacity: 0.22;
}

body.page-auth .bg-scanlines {
  opacity: 0.18;
}

body.page-auth .bg-vignette {
  opacity: 0.92;
}

.auth-video-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.auth-video-bg__frame {
  position: absolute;
  inset: 0;
  transform: scale(1.08);
  transform-origin: center center;
}

.auth-video-bg__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: brightness(0.48) saturate(1.2) contrast(1.08);
  will-change: auto;
  background: #050506;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.auth-video-bg__media.is-playing {
  opacity: 1;
}

.auth-video-bg__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 5, 6, 0.78) 0%, rgba(5, 5, 6, 0.38) 42%, rgba(5, 5, 6, 0.82) 100%),
    radial-gradient(ellipse 85% 70% at 50% 45%, rgba(212, 160, 23, 0.08) 0%, transparent 58%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 35%, rgba(5, 5, 6, 0.62) 100%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-video-bg__frame {
    transform: scale(1.08);
  }
}

body.page-auth .flash {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: min(420px, calc(100% - 2rem));
  margin: 0;
  text-align: center;
  animation: authFlashIn 0.45s ease backwards;
}

@keyframes authFlashIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.page-auth .app-footer--guest {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(180deg, transparent, rgba(5, 5, 6, 0.92));
  border-top: none;
  padding: 0.65rem 1rem;
  font-size: 0.68rem;
  opacity: 0.75;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.25rem 3.25rem;
  position: relative;
  z-index: 1;
}

.auth-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  z-index: 30;
  pointer-events: none;
}

.auth-topbar .auth-lang-detect.px-lang-detect-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  background: rgba(8, 8, 10, 0.78);
  border: 1px solid rgba(212, 160, 23, 0.32);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.auth-topbar .px-lang-detect-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 0;
}

.auth-topbar .px-lang-detect-btn:hover:not(:disabled),
.auth-topbar .px-lang-detect-btn:focus-visible {
  background: transparent;
  border: none;
  box-shadow: none;
}

.auth-topbar-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: auto;
}

.auth-card-locale {
  display: none;
}

.auth-lang-label {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  white-space: nowrap;
}

.auth-lang-select {
  background: rgba(13, 14, 16, 0.95);
  border: 1px solid rgba(212, 160, 23, 0.35);
  color: var(--white);
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.32rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  min-width: 7.5rem;
}

.auth-lang-select:hover,
.auth-lang-select:focus {
  border-color: var(--gold);
  outline: none;
}

.auth-card-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  animation: authShellIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.auth-card-shell--wide {
  max-width: 480px;
}

.auth-card-shell__glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 50% 40%, rgba(212, 160, 23, 0.14) 0%, transparent 58%);
  pointer-events: none;
  animation: authGlowPulse 5s ease-in-out infinite;
}

@keyframes authShellIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes authGlowPulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.35rem;
}

.auth-logo-stage {
  position: relative;
  width: var(--app-logo-auth-size);
  height: var(--app-logo-auth-size);
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo-stage::before {
  content: '';
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 196, 60, 0.38) 0%,
    rgba(212, 160, 23, 0.18) 38%,
    rgba(198, 40, 40, 0.08) 58%,
    transparent 72%
  );
  animation: authLogoHalo 3.4s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.auth-logo-stage::after {
  content: '';
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  box-shadow:
    0 0 24px rgba(212, 160, 23, 0.55),
    0 0 48px rgba(212, 160, 23, 0.28),
    0 0 72px rgba(198, 40, 40, 0.12);
  animation: authLogoHaloOuter 3.4s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes authLogoHalo {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes authLogoHaloOuter {
  0%, 100% {
    opacity: 0.45;
    box-shadow:
      0 0 18px rgba(212, 160, 23, 0.4),
      0 0 36px rgba(212, 160, 23, 0.2),
      0 0 54px rgba(198, 40, 40, 0.08);
  }
  50% {
    opacity: 0.95;
    box-shadow:
      0 0 32px rgba(255, 200, 60, 0.75),
      0 0 64px rgba(212, 160, 23, 0.42),
      0 0 96px rgba(198, 40, 40, 0.18);
  }
}

.auth-logo-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  animation: authLogoGlow 3.4s ease-in-out infinite;
}

@keyframes authLogoGlow {
  0%, 100% {
    filter:
      drop-shadow(0 0 10px rgba(212, 160, 23, 0.5))
      drop-shadow(0 0 24px rgba(212, 160, 23, 0.28))
      drop-shadow(0 0 36px rgba(198, 40, 40, 0.15));
    transform: scale(1);
  }
  50% {
    filter:
      drop-shadow(0 0 18px rgba(255, 210, 70, 0.9))
      drop-shadow(0 0 38px rgba(212, 160, 23, 0.55))
      drop-shadow(0 0 58px rgba(198, 40, 40, 0.28));
    transform: scale(1.04);
  }
}

.auth-brand-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.65rem;
  letter-spacing: 0.22em;
  margin: 0 0 0.35rem;
  color: var(--white);
  text-shadow: 0 0 28px rgba(212, 160, 23, 0.45);
}

.auth-brand-sub {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
}

.auth-brand-version {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(212, 160, 23, 0.06);
}

.auth-panel {
  background: linear-gradient(165deg, rgba(18, 16, 12, 0.96) 0%, rgba(8, 8, 10, 0.98) 100%);
  border: 1px solid rgba(212, 160, 23, 0.32);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.auth-panel-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(212, 160, 23, 0.14);
  background: rgba(0, 0, 0, 0.28);
}

.auth-panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.auth-panel-dot--red { background: #c62828; }
.auth-panel-dot--gold { background: var(--gold); }
.auth-panel-dot--green { background: var(--green); }

.auth-panel-head-text {
  margin-left: auto;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--grey);
  text-transform: uppercase;
}

.auth-form--login {
  padding: 1.35rem 1.25rem 1.25rem;
}

.auth-form--login .auth-field {
  margin-bottom: 1rem;
  text-align: left;
}

.auth-form--login label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.auth-form--login input {
  width: 100%;
  max-width: none;
  padding: 0.78rem 0.95rem;
  background: rgba(5, 5, 6, 0.85);
  border: 1px solid rgba(212, 160, 23, 0.22);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-align: left;
  transition: border-color 0.25s, box-shadow 0.25s;
  animation: none;
}

.auth-form--login input:focus {
  outline: none;
  border-color: rgba(212, 160, 23, 0.65);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.auth-form--login input::placeholder {
  color: var(--grey);
  letter-spacing: 0.04em;
}

.auth-submit-btn {
  width: 100%;
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(212, 160, 23, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(107, 76, 0, 0.55) 0%, rgba(212, 160, 23, 0.18) 100%);
  color: var(--gold);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(212, 160, 23, 0.22);
  background: linear-gradient(135deg, rgba(212, 160, 23, 0.22) 0%, rgba(107, 76, 0, 0.45) 100%);
}

.auth-submit-arrow {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}

.auth-submit-btn:hover .auth-submit-arrow {
  transform: translateX(3px);
}

a.auth-submit-btn,
a.auth-submit-btn--link {
  text-decoration: none;
  box-sizing: border-box;
}

.auth-setup-body {
  text-align: left;
}

.auth-setup-lead {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--white-dim);
}

.auth-setup-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 160, 23, 0.18);
}

.auth-setup-qr img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 6px;
  image-rendering: pixelated;
}

.auth-setup-secret--password {
  margin-bottom: 1.25rem;
  border-color: rgba(212, 160, 23, 0.45);
  background: rgba(212, 160, 23, 0.06);
}

.auth-setup-secret-value--password {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  user-select: all;
}

.auth-setup-password-warn {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--server-amber, #ffab00);
}

.auth-setup-secret {
  margin-bottom: 1.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 160, 23, 0.2);
}

.auth-setup-secret-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.auth-setup-secret-value {
  display: block;
  word-break: break-all;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--white);
  line-height: 1.5;
}

.auth-setup-form {
  margin-top: 0.25rem;
}

.auth-localhost-body {
  text-align: center;
}

.auth-localhost-note {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--white-dim);
}

.auth-code-display {
  margin: 0.5rem 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(0, 230, 118, 0.08);
  border: 1px solid rgba(0, 230, 118, 0.28);
}

.auth-code-display code {
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  color: var(--green);
  text-shadow: 0 0 16px rgba(0, 230, 118, 0.35);
}

.auth-localhost-save {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  color: var(--grey);
  line-height: 1.45;
}

.auth-links {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(212, 160, 23, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}

.auth-links-hint {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: var(--grey);
  line-height: 1.45;
}

.auth-link + .auth-links-hint {
  margin-top: 0.55rem;
  margin-bottom: 0;
}

.auth-link {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.auth-link:hover {
  border-bottom-color: var(--gold);
}

.auth-link--green { color: var(--green); }
.auth-link--green:hover { border-bottom-color: var(--green); }

.auth-localhost {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 230, 118, 0.2);
  border-radius: 10px;
  background: rgba(0, 230, 118, 0.05);
  text-align: center;
  font-size: 0.75rem;
  color: var(--green);
}

.auth-localhost p { margin: 0 0 0.45rem; }

.auth-terminal {
  margin-top: 1.15rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 230, 118, 0.12);
  font-size: 0.7rem;
  text-align: left;
  color: var(--grey);
}

.auth-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(0, 230, 118, 0.08);
}

.auth-terminal-line {
  min-height: 1.2em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.auth-terminal-suffix {
  color: var(--green);
}

.auth-terminal-domain {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
  transition: color 0.2s, text-shadow 0.2s;
}

.auth-terminal-domain:hover {
  color: var(--white);
  text-shadow: 0 0 10px rgba(212, 160, 23, 0.45);
}

.auth-terminal-credit {
  margin: 0.55rem 0 0;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--grey);
  opacity: 0.9;
}

.auth-terminal-prompt { color: var(--green); letter-spacing: 0.04em; }
.auth-terminal-prompt.operation-rgb-text,
.topbar-prompt.operation-rgb-text {
  color: #c62828;
  -webkit-text-fill-color: #c62828;
}
.auth-terminal-text { color: var(--white-dim); }
.auth-terminal-cursor {
  color: var(--gold);
  animation: cursorBlink 1s step-end infinite;
}

@media (max-width: 480px) {
  .auth-screen { padding: 4rem 1rem 3rem; }
  .auth-topbar { padding: 0.65rem 0.85rem; }
  .auth-topbar-inner { max-width: 100%; }
  .auth-brand-title { font-size: 1.25rem; letter-spacing: 0.16em; }
  .auth-logo-stage,
  .auth-logo-img { width: 88px; height: 88px; }
  .auth-form--login { padding: 1rem; }
}

/* ========== TERMINAL / LOG ========== */
.terminal-line { font-size: 0.85rem; color: var(--white-dim); }

.pre-wrap {
  background: var(--bg-terminal);
  border: 1px solid rgba(212, 160, 23, 0.4);
  border-radius: 0;
  padding: 1rem 1.25rem;
  max-height: 340px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--white-dim);
  line-height: 1.6;
  font-family: 'Share Tech Mono', 'Consolas', monospace;
  position: relative;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.3);
  animation: crtFlicker 5s ease-in-out infinite;
}

@keyframes crtFlicker {
  0%, 92%, 100% { opacity: 1; }
  94%, 97% { opacity: 0.96; }
}

.pre-wrap::after {
  content: '▌';
  animation: cursorBlink 1s step-end infinite;
  color: var(--green);
  margin-left: 3px;
  font-weight: bold;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.pre-wrap::-webkit-scrollbar { width: 6px; }
.pre-wrap::-webkit-scrollbar-track { background: var(--bg); }
.pre-wrap::-webkit-scrollbar-thumb { background: var(--red-dark); }

/* ========== DASHBOARD SPECIFIC ========== */
.dash-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--white);
  text-shadow: 0 0 20px var(--red-dim);
  animation: dashTitleIn 0.6s ease-out;
}

.dash-title .cursor { animation: cursorBlink 1s step-end infinite; color: var(--green); }

@keyframes dashTitleIn {
  from { opacity: 0; letter-spacing: 0.1em; }
  to   { opacity: 1; letter-spacing: 0.2em; }
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.log-toolbar label { margin: 0; color: var(--grey); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.log-toolbar select { width: auto; max-width: 140px; }
.log-toolbar #log-search { flex: 1; min-width: 120px; max-width: 220px; }

.config-form input { max-width: none; }
.config-form label { color: var(--cyan); font-size: 0.8rem; }
.config-form label::before { content: '$ '; color: var(--green); margin-right: 0.25rem; }

#sessions-text { color: var(--white-dim); font-size: 0.9rem; line-height: 1.6; }

/* Log highlight – terminal colors */
.log-highlight .hl-READER { color: var(--red-accent); font-weight: 600; }
.log-highlight .hl-CARD { color: var(--cyan); font-weight: 600; }
.log-highlight .hl-emv { color: var(--green); font-weight: 600; }

/* Log line types – clear colors, no long codes */
.log-line { display: block; max-width: 100%; }
.log-line.log-sys-ok { color: var(--green); font-weight: 500; }
.log-line.log-sys-stop { color: var(--grey); }
.log-line.log-sys-err { color: var(--amber); font-weight: 500; }
.log-line.log-payment { color: var(--green); }
.log-line.log-reader { color: var(--red-accent); }
.log-line.log-card { color: var(--cyan); }
.log-line.log-client { color: var(--white-dim); }
.log-line.log-other { color: var(--grey); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.log-highlight { word-break: break-all; }

/* Server status in log – frumos, colorat (online / offline / restarting) */
.log-line.log-status { font-weight: 600; letter-spacing: 0.03em; padding: 0.25rem 0; }
.log-line.log-status-online { color: var(--green); text-shadow: 0 0 12px var(--green-dim); }
.log-line.log-status-offline { color: var(--grey); }
.log-line.log-status-restarting { color: var(--amber); text-shadow: 0 0 10px rgba(255, 171, 0, 0.3); }
.log-line.log-status-error { color: var(--red-accent); font-weight: 600; }

/* Section prefixes – what each block does */
.term-prefix.term-sys { color: var(--green); }
.term-prefix.term-sessions { color: var(--cyan); }
.term-prefix.term-connect { color: var(--amber); }
.term-prefix.term-config { color: var(--grey); }
.term-prefix.term-log { color: var(--red-accent); }
.card-hint { letter-spacing: 0.02em; }
.payments-summary { color: var(--white-dim); padding: 0.75rem; background: rgba(0,0,0,0.25); border: 1px solid rgba(0, 230, 118, 0.25); border-radius: 4px; font-size: 0.85rem; }
.payments-summary strong { color: var(--green); }
.payments-table { width: 100%; border-collapse: collapse; margin-top: 0.35rem; font-size: 0.85rem; }
.payments-table th, .payments-table td { padding: 0.4rem 0.6rem; text-align: left; border-bottom: 1px solid rgba(0, 230, 118, 0.2); }
.payments-table th { color: var(--grey); font-weight: 600; letter-spacing: 0.05em; }
.payments-table td.pay-amount { color: var(--green); font-weight: 600; }
.payments-table thead tr { border-bottom: 1px solid rgba(0, 230, 118, 0.4); }

/* ========== SIDEBAR RESPONSIVE ========== */
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(calc(-100% - 1rem));
    transition: transform 0.25s ease;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-main {
    margin-left: 0;
  }

  .topbar {
    margin: 0.5rem 0.65rem 0;
    padding: 0.55rem 0.75rem;
  }

  .container--framed {
    margin: 0.65rem;
    padding: 1rem;
    min-height: calc(100vh - 150px);
  }

  .topbar-page {
    font-size: 0.72rem;
  }

  .topbar-badge {
    display: none;
  }
}

/* ========== HAMBURGER MENU (legacy / guest) ========== */
.nav-hamburger {
  display: none;
}

/* ========== RESPONSIVE: TABLET (max-width: 768px) ========== */
@media (max-width: 768px) {
  .navbar--guest {
    width: calc(100% - 1rem);
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .nav-brand-link {
    gap: 0.4rem;
  }

  .nav-logo-stage {
    width: 16px;
    height: 16px;
  }

  .nav-logo {
    width: 100%;
    height: 100%;
  }

  .brand {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
  }

  .nav-lang-select {
    font-size: 0.65rem;
    min-width: 3.5rem;
    padding: 0.2rem 0.25rem;
  }

  .container {
    padding: 1rem 0.75rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .card h2, .card h3 {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  .dash-title {
    font-size: 1rem;
    letter-spacing: 0.12em;
  }

  .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .pre-wrap {
    max-height: 250px;
    font-size: 11px;
    padding: 0.75rem;
  }

  input, select, textarea {
    max-width: none;
    font-size: 0.9rem;
  }

  .log-toolbar {
    gap: 0.35rem;
  }

  .log-toolbar select {
    max-width: 120px;
  }

  .log-toolbar #log-search {
    min-width: 80px;
    max-width: none;
    flex: 1;
  }

  /* Tables: horizontal scroll */
  .devices-table {
    font-size: 0.72rem;
  }

  .devices-table th, .devices-table td {
    padding: 0.3rem 0.4rem;
    white-space: nowrap;
  }

  .payments-table {
    font-size: 0.75rem;
  }

  .payments-table th, .payments-table td {
    padding: 0.3rem 0.4rem;
    white-space: nowrap;
  }

  .config-form input {
    max-width: none;
  }
}

/* ========== RESPONSIVE: MOBILE SMALL (max-width: 480px) ========== */
@media (max-width: 480px) {
  .navbar {
    padding: 0.4rem 0.5rem;
  }

  .nav-logo-stage {
    width: 12px;
    height: 12px;
  }

  .nav-logo {
    width: 100%;
    height: 100%;
  }

  .brand {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .nav-lang-select {
    font-size: 0.6rem;
    min-width: 3rem;
    padding: 0.15rem 0.2rem;
  }

  .container {
    padding: 0.75rem 0.5rem;
  }

  .card {
    padding: 0.75rem 0.65rem;
    margin-bottom: 0.75rem;
  }

  .card h2, .card h3 {
    font-size: 0.75rem;
  }

  .dash-title {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
  }

  .btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.35rem;
  }

  .btn + .btn {
    margin-left: 0;
  }

  .pre-wrap {
    max-height: 200px;
    font-size: 10px;
    padding: 0.5rem;
  }

  .auth-form input {
    font-size: 1rem;
    letter-spacing: 0.3em;
  }

  .status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
  }

  .devices-table th, .devices-table td {
    padding: 0.25rem 0.3rem;
    font-size: 0.65rem;
  }

  .payments-table th, .payments-table td {
    font-size: 0.65rem;
    padding: 0.25rem 0.3rem;
  }

  .log-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .log-toolbar select,
  .log-toolbar #log-search {
    max-width: none;
    width: 100%;
  }

  .app-footer {
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem 0.75rem;
  }

  /* Cards page responsive grid */
  .cards-grid {
    grid-template-columns: 1fr !important;
  }
}
