:root {
  /* Paleta inspirada en la BIOS/memory card manager de PS1 y los 4 colores
     de los simbolos (triangulo cian, circulo rosa, equis indigo, cuadrado
     verde), modernizada: sin pixelado literal, con glow y bisel sutil. */
  --bg: #0a0912;
  --bg-panel: #12101f;
  --bg-card: #181528;
  --border: #35304d;
  --border-bright: #55507a;
  --text: #eae6f5;
  --text-dim: #8d87ad;

  --ps-cyan: #4dd9e8;
  --ps-pink: #ff5c9e;
  --ps-indigo: #7c8cff;
  --ps-green: #8be86a;

  --accent: var(--ps-indigo);
  --accent-dim: #3a3d7a;
  --danger: var(--ps-pink);
  --ok: var(--ps-green);

  font-family: ui-sans-serif, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

/* Textura sutil de scanlines + vinieta, puramente decorativa y no interactiva */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.35) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.018) 0px,
      rgba(255,255,255,0.018) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 3px
    );
  mix-blend-mode: overlay;
}

a { color: var(--ps-cyan); text-decoration: none; }

.centered {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(124,140,255,0.10), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(255,92,158,0.08), transparent 40%),
    var(--bg);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 28px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.05),
    inset -1px -1px 0 rgba(0,0,0,0.45),
    0 0 0 1px rgba(0,0,0,0.3);
  position: relative;
}

/* barra diagonal de 4 colores, guino sutil al logo clasico de arranque */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, var(--ps-cyan) 0 25%, var(--ps-pink) 25% 50%, var(--ps-indigo) 50% 75%, var(--ps-green) 75% 100%);
}

.login-card { width: 340px; }

.brand {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Courier New", monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.brand span { color: var(--ps-cyan); text-shadow: 0 0 12px rgba(77,217,232,0.45); }

.subtitle { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; letter-spacing: 0.02em; }

label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--ps-cyan);
  box-shadow: 0 0 0 3px rgba(77,217,232,0.18);
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--accent);
  color: #08070f;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.35),
    inset -1px -1px 0 rgba(0,0,0,0.3);
  transition: filter 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
button:hover { filter: brightness(1.12); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.3), 0 0 14px rgba(124,140,255,0.35); }
button:active { transform: translateY(1px); }
button.secondary {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-bright);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.05);
}
button.secondary:hover { border-color: var(--ps-cyan); box-shadow: 0 0 10px rgba(77,217,232,0.25); }
button.danger { background: var(--danger); color: #1a0510; }
button.danger:hover { box-shadow: inset 1px 1px 0 rgba(255,255,255,0.35), inset -1px -1px 0 rgba(0,0,0,0.3), 0 0 14px rgba(255,92,158,0.4); }
button:disabled { opacity: 0.4; cursor: not-allowed; filter: none; box-shadow: none; }

.error { color: var(--ps-pink); font-size: 13px; margin-top: 10px; min-height: 16px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.sidebar::after {
  content: "";
  position: absolute;
  top: 0; right: -1px; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ps-cyan), var(--ps-pink), var(--ps-indigo), var(--ps-green));
  opacity: 0.55;
}

.sidebar .brand { padding: 0 8px 20px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--bg-card); color: var(--text); border-left-color: var(--border-bright); }
.nav-item.active {
  background: var(--bg-card);
  color: var(--text);
  border-left-color: var(--ps-cyan);
  box-shadow: inset 0 0 16px rgba(77,217,232,0.10);
}
.nav-item.active::before { content: "▸ "; color: var(--ps-cyan); }
.nav-item.disabled { opacity: 0.35; cursor: default; }
.nav-item.disabled:hover { background: none; color: var(--text-dim); border-left-color: transparent; }

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(124,140,255,0.05), transparent);
}
.topbar strong { text-transform: uppercase; letter-spacing: 0.05em; font-size: 14px; }

.content { flex: 1; padding: 24px; overflow: auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ps-indigo);
  border-radius: 6px;
  padding: 20px;
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.tile:nth-of-type(4n+1) { border-top-color: var(--ps-cyan); }
.tile:nth-of-type(4n+2) { border-top-color: var(--ps-pink); }
.tile:nth-of-type(4n+3) { border-top-color: var(--ps-indigo); }
.tile:nth-of-type(4n+4) { border-top-color: var(--ps-green); }
.tile h3 { margin: 0 0 6px; letter-spacing: 0.02em; }
.tile p { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-panel);
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
}
.badge::before { content: "●"; font-size: 8px; }
.badge.ok { color: var(--ok); border-color: var(--ok); text-shadow: 0 0 8px rgba(139,232,106,0.5); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--ps-cyan); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
tr:hover td { background: rgba(124,140,255,0.04); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,4,12,0.75);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal { width: 380px; }

#terminal, #desktop-canvas { width: 100%; height: 100%; }
.full-pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.full-pane .content { padding: 0; }

/* Ventana de una app (Terminal, Escritorio, ...): sin sidebar de la
   plataforma, solo un header propio con boton de vuelta a AlmaOs. */
.app-window { display: flex; flex-direction: column; height: 100vh; }
.app-header-left { display: flex; align-items: center; gap: 14px; }
.app-header-right { display: flex; align-items: center; gap: 10px; }
#app-back-btn::before { content: "◂ "; }

