/* ═════════════════════════════════════════════════════════
   DDH STUDIO — USER DASHBOARD (TRẮNG ĐEN + CYBER)
   ═════════════════════════════════════════════════════════ */

:root {
  --bg-void: #030304;
  --bg-panel: rgba(10, 12, 16, 0.68);
  --bg-panel-solid: #0a0c10;
  --ink-white: #f3f8ff;
  --ink-muted: #8b95a5;
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --success: #35e6a0;
  --danger: #ff4d6d;
  --warning: #ffd23f;

  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Sora', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body.light {
  --bg-void: #f5f6f8;
  --bg-panel: rgba(255, 255, 255, 0.9);
  --bg-panel-solid: #ffffff;
  --ink-white: #0a0c10;
  --ink-muted: #666;
  --border-soft: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--bg-void);
  color: var(--ink-white);
  font-family: var(--font-body);
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ═══ BACKGROUND ═══ */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 78%);
  animation: grid-drift 18s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 42px 42px, 42px 42px; }
}

.bg-scanline {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 0%, rgba(255, 255, 255, 0.04) 48%,
    rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 52%, transparent 100%);
  height: 220px;
  animation: scan-move 6s ease-in-out infinite;
}

@keyframes scan-move {
  0%   { transform: translateY(-260px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

.bg-glow {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(90px); pointer-events: none;
}
.bg-glow--a {
  width: 480px; height: 480px; top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
}
.bg-glow--b {
  width: 520px; height: 520px; bottom: -200px; right: -140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 70%);
}

/* Shooting stars */
.bg-grid::before, .bg-grid::after,
.bg-scanline::before, .bg-scanline::after {
  content: ''; position: fixed; z-index: 1;
  width: 140px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9) 85%, #ffffff 100%);
  border-radius: 999px;
  box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.35);
  transform: rotate(215deg);
  transform-origin: right center;
  opacity: 0; pointer-events: none;
}

.bg-grid::before { animation: shoot-1 7.5s linear infinite; animation-delay: 0.4s; }
.bg-grid::after  { animation: shoot-2 9.5s linear infinite; animation-delay: 3.2s; }
.bg-scanline::before { animation: shoot-3 8.5s linear infinite; animation-delay: 5.6s; }
.bg-scanline::after  { animation: shoot-4 6.8s linear infinite; animation-delay: 1.9s; }

@keyframes shoot-1 { 0% { top: 6%; left: 88%; opacity: 0; } 4% { opacity: 1; } 16% { top: 40%; left: 42%; opacity: 0; } 100% { top: 40%; left: 42%; opacity: 0; } }
@keyframes shoot-2 { 0% { top: 22%; left: 70%; opacity: 0; } 4% { opacity: 1; } 16% { top: 62%; left: 18%; opacity: 0; } 100% { top: 62%; left: 18%; opacity: 0; } }
@keyframes shoot-3 { 0% { top: 4%; left: 55%; opacity: 0; } 4% { opacity: 1; } 16% { top: 34%; left: 12%; opacity: 0; } 100% { top: 34%; left: 12%; opacity: 0; } }
@keyframes shoot-4 { 0% { top: 48%; left: 95%; opacity: 0; } 4% { opacity: 1; } 16% { top: 85%; left: 55%; opacity: 0; } 100% { top: 85%; left: 55%; opacity: 0; } }

/* ═══ HEADER ═══ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(3, 3, 4, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

.hamburger-btn {
  width: 38px; height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.hamburger-btn span {
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--ink-white);
  transition: transform 0.2s ease;
}

.hamburger-btn:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.brand-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #ffffff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.brand-logo--sm { font-size: 1.05rem; }

.brand-logo .accent {
  color: #8b95a5;
  -webkit-text-fill-color: #8b95a5;
  margin-left: 0.1em;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  color: var(--ink-white);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

/* ═══ SIDEBAR DRAWER ═══ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 21;
  width: min(320px, 84vw);
  background: #05070c;
  border-right: 1px solid var(--border-soft);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar.is-open { transform: translateX(0); }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-close {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  color: var(--ink-white);
  border-color: var(--border-strong);
}

.sidebar-nav {
  padding: 14px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--ink-white);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.nav-group__toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chevron {
  font-size: 12px;
  color: var(--ink-muted);
  transition: transform 0.25s ease;
}

.nav-group.is-open .chevron { transform: rotate(180deg); }

.nav-group__items {
  max-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-left: 12px;
  border-left: 1px solid var(--border-soft);
  margin-left: 14px;
  transition: max-height 0.3s ease;
}

.nav-group.is-open .nav-group__items { max-height: 300px; }

.nav-item {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-white);
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-white);
  font-weight: 600;
}

/* ═══ MAIN ═══ */
.main {
  position: relative;
  z-index: 2;
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 24px 80px;
}

/* ═══ PAGE VIEW ═══ */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: fade-in-up 0.4s ease both;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 24px;
}

/* ═══ CARD ═══ */
.card, .hero-card {
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  transition: all 0.25s ease;
}

.card:hover, .hero-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  margin-bottom: 20px;
}

.badge.online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(53, 230, 160, 0.1);
  color: var(--success);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  margin-top: 12px;
  border: 1px solid rgba(53, 230, 160, 0.2);
}

.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}

.muted { color: var(--ink-muted); font-size: 0.88rem; }

.version {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--ink-muted);
  opacity: 0.2;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat .label {
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat .value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}

.search {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  color: var(--ink-white);
  font-size: 0.92rem;
  margin-bottom: 18px;
  transition: all 0.2s ease;
}

.search:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.cmd-list { display: flex; flex-direction: column; gap: 12px; }

.cmd-cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin: 12px 0 6px;
}

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.cmd-item:hover {
  border-color: var(--border-strong);
  transform: translateX(2px);
}

.cmd-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
}

.cmd-desc {
  color: var(--ink-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.cmd-perm {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.row:last-child { border-bottom: none; }
.row span {
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}
.row b { font-size: 0.9rem; font-weight: 600; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .site-header { padding: 14px 16px; }
  .main { padding: 32px 18px 60px; }
  .hero-card { padding: 20px; }
  .version { font-size: 2rem; }
  .header-status { display: none; }
}