/* ═══════════════════════════════════════════════════
   NIGHT CITY OS // App Hub — Cyberpunk Stylesheet
   Shares the visual identity of SubTrack.
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --surface: #11131c;
  --surface-2: #181b27;
  --surface-3: #1f2331;

  --text: #e8f3ff;
  --muted: #8a93a8;
  --dim: #5a6173;

  --border: #2a3148;
  --border-strong: #3a4365;

  --neon-cyan: #00f0ff;
  --neon-magenta: #ff00d6;
  --neon-yellow: #fffb00;
  --neon-lime: #00ff9d;
  --neon-pink: #ff2e93;
  --neon-orange: #ff8a00;

  --primary: var(--neon-cyan);
  --primary-glow: rgba(0, 240, 255, 0.5);
  --primary-soft: rgba(0, 240, 255, 0.1);

  --shadow: 0 4px 24px rgba(0, 240, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.6);
  --shadow-strong: 0 0 30px rgba(0, 240, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.8);
  --radius: 4px;
  --radius-lg: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color-scheme: dark;
}

body {
  font-family: 'Rajdhani', 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 240, 255, 0.14) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 100%, rgba(255, 0, 214, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 255, 157, 0.05) 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ─── Ambient Effects ─────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 240, 255, 0.025) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: overlay;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* Decorative moving lines in the background */
.bg-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.bg-lines span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.45), transparent);
  opacity: 0;
  animation: bgline 9s linear infinite;
}
.bg-lines span:nth-child(1) { top: 18%; animation-delay: 0s; }
.bg-lines span:nth-child(2) { top: 52%; animation-delay: 3s; background: linear-gradient(90deg, transparent, rgba(255, 0, 214, 0.45), transparent); }
.bg-lines span:nth-child(3) { top: 78%; animation-delay: 6s; background: linear-gradient(90deg, transparent, rgba(0, 255, 157, 0.45), transparent); }

@keyframes bgline {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.7; }
  100% { transform: translateX(100%); opacity: 0; }
}

h1, h2, h3 {
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
p { margin: 0; }

/* ─── HUD top bar ─────────────────────── */
.hud-top {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(12, 14, 22, 0.9) 0%, rgba(7, 8, 13, 0.7) 100%);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 0 rgba(0, 240, 255, 0.1);
}

.hud-top__left { display: flex; align-items: center; gap: 14px; }
.hud-top__center { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hud-top__right { display: flex; gap: 16px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: #06070b;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  font-family: 'Orbitron', sans-serif;
  box-shadow: 0 0 20px var(--primary-glow), inset 0 0 8px rgba(255,255,255,0.3);
  position: relative;
}

.brand-name {
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--text);
  position: relative;
  display: inline-block;
}
.brand-name span {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--primary-glow);
}
.brand-name::before,
.brand-name::after {
  content: "NightCityOS";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}
.brand-name::before {
  color: var(--neon-magenta);
  text-shadow: 2px 0 var(--neon-magenta);
  animation: glitch-flash-1 7s steps(1) infinite;
}
.brand-name::after {
  color: var(--neon-cyan);
  text-shadow: -2px 0 var(--neon-cyan);
  animation: glitch-flash-2 7s steps(1) infinite;
}

.brand-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--neon-magenta);
  letter-spacing: 0.15em;
  padding: 2px 6px;
  border: 1px solid var(--neon-magenta);
  border-radius: 2px;
  background: rgba(255, 0, 214, 0.08);
  text-transform: uppercase;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: rgba(0, 240, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.04);
}
.hud-pill--ghost { background: transparent; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}
.dot--cyan    { background: var(--neon-cyan);    box-shadow: 0 0 8px var(--neon-cyan); }
.dot--lime    { background: var(--neon-lime);    box-shadow: 0 0 8px var(--neon-lime); }
.dot--magenta { background: var(--neon-magenta); box-shadow: 0 0 8px var(--neon-magenta); }
.dot--yellow  { background: var(--neon-yellow);  box-shadow: 0 0 8px var(--neon-yellow); }
.dot--pink    { background: var(--neon-pink);    box-shadow: 0 0 8px var(--neon-pink); }
.dot--orange  { background: var(--neon-orange);  box-shadow: 0 0 8px var(--neon-orange); }

.dot.blink { animation: blink 1.4s steps(2) infinite; }
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

.hud-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.hud-meta__label {
  color: var(--neon-cyan);
  font-size: 10.5px;
  opacity: 0.7;
}
.hud-meta__value {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.hud-meta--time .hud-meta__value {
  color: var(--neon-lime);
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.5);
  min-width: 76px;
  display: inline-block;
}

/* ─── Hub shell + hero ─────────────────── */
.hub-shell {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px 60px;
}

.hero {
  position: relative;
  padding: 32px 36px 28px;
  margin-bottom: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 19, 28, 0.9) 0%, rgba(12, 14, 22, 0.9) 100%);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-strong), inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 30%, rgba(0, 240, 255, 0.15), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 214, 0.12), transparent 45%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 4px);
  pointer-events: none;
  opacity: 0.4;
}

.hero__corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.hero__corner--tl { top: -1px; left: -1px;  border-top: 2px solid var(--neon-cyan); border-left: 2px solid var(--neon-cyan); }
.hero__corner--tr { top: -1px; right: -1px; border-top: 2px solid var(--neon-magenta); border-right: 2px solid var(--neon-magenta); }
.hero__corner--bl { bottom: -1px; left: -1px;  border-bottom: 2px solid var(--neon-magenta); border-left: 2px solid var(--neon-magenta); }
.hero__corner--br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--neon-cyan); border-right: 2px solid var(--neon-cyan); }

.hero__breadcrumb {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.hero__breadcrumb .sep { color: var(--dim); }
.hero__breadcrumb .hl { color: var(--neon-cyan); text-shadow: 0 0 8px var(--primary-glow); }

.hero__title {
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: 0.08em;
  margin: 0 0 12px;
  position: relative;
  color: var(--text);
}

.hero__sub {
  position: relative;
  color: var(--muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  margin-bottom: 22px;
  max-width: 640px;
  letter-spacing: 0.05em;
}

.hero__stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.hero-stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(7, 8, 13, 0.6);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 18px; height: 1px;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
}
.hero-stat__label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--neon-cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.8;
}
.hero-stat__value {
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* ─── Glitch titles ─────────────────────── */
.glitch {
  position: relative;
  display: inline-block;
  text-shadow:
    0 0 10px rgba(0, 240, 255, 0.35),
    1px 0 0 rgba(255, 0, 214, 0.4),
    -1px 0 0 rgba(0, 255, 157, 0.4);
}
.glitch[data-text]::before,
.glitch[data-text]::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
}
.glitch[data-text]::before {
  color: var(--neon-magenta);
  text-shadow: 2px 0 var(--neon-magenta);
  animation: glitch-flash-1 5s steps(1) infinite;
}
.glitch[data-text]::after {
  color: var(--neon-cyan);
  text-shadow: -2px 0 var(--neon-cyan);
  animation: glitch-flash-2 5s steps(1) infinite;
}
.glitch:hover {
  animation: glitch-shake 0.28s steps(2) infinite;
}
.glitch:hover::before { animation: glitch-slice-1 0.55s steps(1) infinite !important; opacity: 1 !important; }
.glitch:hover::after  { animation: glitch-slice-2 0.55s steps(1) infinite !important; opacity: 1 !important; }

@keyframes glitch-shake {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2px, 1px); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, -2px); }
  80%  { transform: translate(1px, 2px); }
  100% { transform: translate(0, 0); }
}
@keyframes glitch-slice-1 {
  0%   { clip-path: inset(0 0 85% 0); transform: translate(-3px, 0); }
  10%  { clip-path: inset(40% 0 35% 0); transform: translate(2px, 0); }
  20%  { clip-path: inset(70% 0 10% 0); transform: translate(-4px, 1px); }
  30%  { clip-path: inset(15% 0 60% 0); transform: translate(3px, -1px); }
  40%  { clip-path: inset(50% 0 30% 0); transform: translate(-2px, 0); }
  50%  { clip-path: inset(5% 0 80% 0); transform: translate(4px, 0); }
  60%  { clip-path: inset(80% 0 5% 0); transform: translate(-3px, 1px); }
  70%  { clip-path: inset(25% 0 55% 0); transform: translate(2px, -1px); }
  80%  { clip-path: inset(60% 0 25% 0); transform: translate(-4px, 0); }
  90%  { clip-path: inset(35% 0 50% 0); transform: translate(3px, 0); }
  100% { clip-path: inset(0 0 90% 0); transform: translate(-2px, 0); }
}
@keyframes glitch-slice-2 {
  0%   { clip-path: inset(75% 0 10% 0); transform: translate(3px, 1px); }
  10%  { clip-path: inset(20% 0 65% 0); transform: translate(-2px, -1px); }
  20%  { clip-path: inset(55% 0 30% 0); transform: translate(4px, 0); }
  30%  { clip-path: inset(5% 0 80% 0); transform: translate(-3px, 1px); }
  40%  { clip-path: inset(40% 0 45% 0); transform: translate(2px, 0); }
  50%  { clip-path: inset(70% 0 15% 0); transform: translate(-4px, -1px); }
  60%  { clip-path: inset(10% 0 75% 0); transform: translate(3px, 0); }
  70%  { clip-path: inset(50% 0 30% 0); transform: translate(-2px, 1px); }
  80%  { clip-path: inset(85% 0 5% 0); transform: translate(4px, 0); }
  90%  { clip-path: inset(30% 0 55% 0); transform: translate(-3px, -1px); }
  100% { clip-path: inset(60% 0 25% 0); transform: translate(2px, 0); }
}
@keyframes glitch-flash-1 {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
  93% { opacity: 1; clip-path: inset(15% 0 65% 0); transform: translate(-3px, 0); }
  94% { opacity: 1; clip-path: inset(55% 0 25% 0); transform: translate(3px, 0); }
  95% { opacity: 0; }
  96% { opacity: 1; clip-path: inset(70% 0 10% 0); transform: translate(-2px, 1px); }
  97% { opacity: 1; clip-path: inset(30% 0 50% 0); transform: translate(2px, -1px); }
}
@keyframes glitch-flash-2 {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
  93% { opacity: 1; clip-path: inset(50% 0 30% 0); transform: translate(3px, 0); }
  94% { opacity: 1; clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); }
  95% { opacity: 0; }
  96% { opacity: 1; clip-path: inset(10% 0 75% 0); transform: translate(2px, -1px); }
  97% { opacity: 1; clip-path: inset(60% 0 20% 0); transform: translate(-2px, 1px); }
}

/* ─── Apps section ─────────────────────── */
.apps-section { margin-top: 8px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 22px;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.section-sub {
  color: var(--muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon-cyan);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.section-actions { display: flex; gap: 10px; }

/* Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* App Card */
.app-card {
  --accent: var(--neon-cyan);
  --accent-glow: rgba(0, 240, 255, 0.45);

  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(17, 19, 28, 0.94) 0%, rgba(12, 14, 22, 0.94) 100%);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
  overflow: hidden;
  isolation: isolate;
  /* Cyberpunk corner cut */
  clip-path: polygon(
    0 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% 100%,
    18px 100%,
    0 calc(100% - 18px)
  );
}

/* Inner border simulating the cut corners */
.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, var(--accent) 0%, transparent 16%) top left/20px 20px no-repeat,
    linear-gradient(315deg, var(--accent) 0%, transparent 16%) bottom right/20px 20px no-repeat;
  opacity: 0.35;
  transition: opacity 0.18s ease;
  z-index: 1;
}

/* Glow overlay activated on hover */
.app-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, var(--accent-glow), transparent 50%),
    radial-gradient(circle at 100% 100%, var(--accent-glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}

.app-card:hover,
.app-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--accent),
    0 0 28px var(--accent-glow);
}
.app-card:hover::before,
.app-card:focus-within::before { opacity: 1; }
.app-card:hover::after,
.app-card:focus-within::after { opacity: 0.18; }

/* Card meta line */
.app-card__meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.app-card__id {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}
.app-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-card__status .dot { width: 7px; height: 7px; }

.app-card__status[data-status="online"]    { color: var(--neon-lime); }
.app-card__status[data-status="online"] .dot { background: var(--neon-lime); box-shadow: 0 0 8px var(--neon-lime); animation: blink 1.6s steps(2) infinite; }
.app-card__status[data-status="offline"]   { color: var(--dim); }
.app-card__status[data-status="offline"] .dot { background: var(--dim); box-shadow: none; }
.app-card__status[data-status="beta"]      { color: var(--neon-yellow); }
.app-card__status[data-status="beta"] .dot { background: var(--neon-yellow); box-shadow: 0 0 8px var(--neon-yellow); }
.app-card__status[data-status="maintenance"] { color: var(--neon-orange); }
.app-card__status[data-status="maintenance"] .dot { background: var(--neon-orange); box-shadow: 0 0 8px var(--neon-orange); }
.app-card__status[data-status="checking"]  { color: var(--neon-cyan); opacity: 0.85; }
.app-card__status[data-status="checking"] .dot {
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: status-ping 1s ease-in-out infinite;
}

@keyframes status-ping {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.6); }
}

/* Header: icon + name */
.app-card__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.app-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: #06070b;
  background: linear-gradient(135deg, var(--accent), var(--neon-magenta));
  box-shadow:
    0 0 18px var(--accent-glow),
    inset 0 0 8px rgba(255, 255, 255, 0.3);
  letter-spacing: 0;
  flex-shrink: 0;
  position: relative;
}
.app-card__icon::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid var(--accent);
  opacity: 0.35;
  border-radius: calc(var(--radius) + 2px);
  pointer-events: none;
}
.app-card__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
  color: var(--text);
  position: relative;
}
.app-card__title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 28px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: width 0.28s ease;
}
.app-card:hover .app-card__title::after { width: 100%; }

.app-card__category {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
  letter-spacing: 0.12em;
}

.app-card__desc {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  margin-bottom: 18px;
  flex-grow: 1;
}

.app-card__tags {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.app-card__tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 240, 255, 0.06);
  color: var(--text);
  border-radius: 2px;
}

.app-card__footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.app-card__footer-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.app-card__footer-meta strong {
  color: var(--text);
  font-weight: 600;
  margin-left: 4px;
}

.btn-access {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #06070b;
  background: linear-gradient(135deg, var(--accent), var(--neon-magenta));
  border: 1px solid var(--accent);
  padding: 9px 16px;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
  box-shadow:
    0 0 12px var(--accent-glow),
    inset 0 0 6px rgba(255,255,255,0.25);
  clip-path: polygon(
    0 0,
    calc(100% - 8px) 0,
    100% 50%,
    calc(100% - 8px) 100%,
    0 100%
  );
}
.btn-access:hover,
.btn-access:focus-visible {
  transform: translateX(2px);
  filter: brightness(1.1);
  box-shadow:
    0 0 18px var(--accent-glow),
    inset 0 0 6px rgba(255,255,255,0.4);
  outline: none;
}
.btn-access[data-disabled="true"] {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(0.4);
}
.btn-access .arrow {
  display: inline-block;
  transform: translateX(0);
  transition: transform 0.18s ease;
  font-family: 'Share Tech Mono', monospace;
}
.btn-access:hover .arrow { transform: translateX(3px); }

/* Empty state if config has no apps */
.apps-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.1em;
}

/* Brief hover glitch effect on the title */
.app-card:hover .app-card__title {
  animation: glitch-shake 0.32s steps(2) 1;
}

/* ─── Footer ─────────────────────────── */
.hub-footer {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-top: 1px solid var(--border-strong);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.footer-label { color: var(--neon-cyan); }
.footer-sep { color: var(--dim); margin: 0 8px; }

/* ─── Focus ─────────────────────────── */
:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

/* ─── Manage trigger button ────────────── */
.manage-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--neon-cyan);
  border-radius: 2px;
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
  box-shadow:
    0 0 12px rgba(0, 240, 255, 0.18),
    inset 0 0 0 1px rgba(0, 240, 255, 0.08);
}
.manage-trigger:hover,
.manage-trigger:focus-visible {
  background: rgba(0, 240, 255, 0.18);
  color: #06070b;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
}
.manage-trigger__icon {
  font-size: 14px;
  line-height: 1;
}

/* ─── Manage panel (drawer) ────────────── */
.manage-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.manage-overlay[data-open="true"] {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.manage-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.7);
  backdrop-filter: blur(4px);
}

.manage-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 100vw);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(17, 19, 28, 0.98) 0%, rgba(7, 8, 13, 0.98) 100%);
  border-left: 1px solid var(--border-strong);
  box-shadow:
    -8px 0 40px rgba(0, 0, 0, 0.7),
    inset 1px 0 0 0 rgba(0, 240, 255, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.manage-overlay[data-open="true"] .manage-panel {
  transform: translateX(0);
}

.manage-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(0, 240, 255, 0.05) 0%, transparent 100%);
}
.manage-panel__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  letter-spacing: 0.12em;
  margin: 0 0 4px;
  color: var(--text);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}
.manage-panel__subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
}
.manage-panel__close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 0, 214, 0.08);
  color: var(--neon-magenta);
  border: 1px solid var(--neon-magenta);
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  transition: background 0.15s ease, transform 0.15s ease;
}
.manage-panel__close:hover {
  background: rgba(255, 0, 214, 0.25);
  transform: scale(1.05);
}

.manage-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Toolbar with NEW / RESET */
.manage-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.manage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: rgba(0, 240, 255, 0.04);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.manage-btn:hover,
.manage-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
}
.manage-btn--primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  color: #06070b;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}
.manage-btn--primary:hover { filter: brightness(1.1); }
.manage-btn--ghost {
  background: transparent;
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}
.manage-btn--ghost:hover {
  background: rgba(0, 240, 255, 0.12);
}
.manage-btn--small {
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
}
.manage-btn--danger {
  color: var(--neon-pink);
  border-color: var(--neon-pink);
  background: rgba(255, 46, 147, 0.06);
}
.manage-btn--danger:hover {
  background: rgba(255, 46, 147, 0.2);
  color: #fff;
}
.manage-btn--icon {
  padding: 4px 8px;
  min-width: 28px;
  font-size: 11px;
  letter-spacing: 0;
}
.manage-btn[disabled],
.manage-btn[disabled]:hover,
.manage-btn[disabled]:focus-visible {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  background: rgba(0, 240, 255, 0.04);
  color: var(--dim);
  border-color: var(--border-strong);
  box-shadow: none;
  filter: none;
}

/* List of apps inside the panel */
.manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.manage-row {
  --accent: var(--neon-cyan);
  --accent-glow: rgba(0, 240, 255, 0.45);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(12, 14, 22, 0.7);
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.manage-row:hover {
  background: rgba(17, 19, 28, 0.95);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.manage-row.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.manage-row.is-dragging .manage-row__handle { cursor: grabbing; }
/* Drop indicator: a glowing neon bar above or below the target row. */
.manage-row.is-drop-before::before,
.manage-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 18px var(--accent-glow);
  border-radius: 2px;
  pointer-events: none;
}
.manage-row.is-drop-before::before { top: -6px; }
.manage-row.is-drop-after::after  { bottom: -6px; }

.manage-row__handle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 38px;
  cursor: grab;
  color: var(--dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -3px;
  user-select: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.manage-row:hover .manage-row__handle {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}
.manage-row__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: #06070b;
  background: linear-gradient(135deg, var(--accent), var(--neon-magenta));
  box-shadow: 0 0 10px var(--accent-glow);
}
.manage-row__body {
  flex: 1;
  min-width: 0;
}
.manage-row__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.manage-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.manage-row__id { color: var(--accent); }
.manage-row__sep { color: var(--dim); }
.manage-row__href {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.manage-row__status[data-status="online"]      { color: var(--neon-lime); }
.manage-row__status[data-status="offline"]     { color: var(--dim); }
.manage-row__status[data-status="beta"]        { color: var(--neon-yellow); }
.manage-row__status[data-status="maintenance"] { color: var(--neon-orange); }
.manage-row__status[data-status="checking"]    { color: var(--neon-cyan); opacity: 0.85; }

.manage-row__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.manage-empty {
  padding: 32px 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.1em;
  font-size: 13px;
}

/* Form */
.manage-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.manage-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.manage-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.manage-field__label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}
.manage-field__hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.06em;
}
.manage-input {
  width: 100%;
  padding: 9px 11px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--text);
  background: rgba(7, 8, 13, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  letter-spacing: 0.04em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.manage-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 0 1px var(--neon-cyan), 0 0 12px rgba(0, 240, 255, 0.25);
}
.manage-input--area {
  resize: vertical;
  min-height: 70px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
}
select.manage-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--neon-cyan) 50%),
                    linear-gradient(135deg, var(--neon-cyan) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.manage-form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

/* ─── Responsive ─────────────────────── */
@media (max-width: 1024px) {
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-top { grid-template-columns: 1fr 1fr; }
  .hud-top__center { display: none; }
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hud-top {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  .hud-top__right { justify-content: flex-start; gap: 12px; }
  .hub-shell { padding: 24px 16px 40px; }
  .hero { padding: 24px 22px 22px; }
  .hero__title { font-size: 38px; }
  .apps-grid { grid-template-columns: 1fr; gap: 14px; }
  .app-card { padding: 20px 18px 16px; }
  .app-card__icon { width: 48px; height: 48px; font-size: 19px; }
  .app-card__title { font-size: 18px; }
  .app-card__footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .btn-access { width: 100%; justify-content: center; }
  .hub-footer { flex-direction: column; align-items: flex-start; }
  .manage-form__grid { grid-template-columns: 1fr; }
  .manage-panel__body { padding: 18px 18px 28px; }
  .manage-panel__head { padding: 18px 18px 14px; }
  .manage-row { flex-wrap: wrap; }
  .manage-row__actions { width: 100%; justify-content: flex-end; }
}

/* Utility */
.hidden { display: none !important; }

/* ─── ADMIN MODE chip (top bar) ───────────────────────── */
.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 0, 214, 0.55);
  border-radius: 999px;
  background: linear-gradient(120deg,
      rgba(255, 0, 214, 0.15),
      rgba(0, 240, 255, 0.10));
  color: #ff00d6;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(255, 0, 214, 0.55);
  box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.4) inset,
      0 0 12px rgba(255, 0, 214, 0.35);
  cursor: default;
  user-select: none;
  white-space: nowrap;
}
.admin-chip__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff00d6;
  box-shadow: 0 0 8px #ff00d6, 0 0 16px rgba(255, 0, 214, 0.6);
  animation: admin-chip-pulse 1.6s ease-in-out infinite;
}
@keyframes admin-chip-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.55; }
}
