/* ===========================================================
   NovaLicense — Tema oscuro futurista, acentos azul celeste
   =========================================================== */

:root {
  --bg: #070b14;
  --bg-elev: #0d1424;
  --bg-card: #0f1828;
  --border: #1c2840;
  --border-soft: #16203400;
  --text: #e8eefc;
  --text-dim: #8a98b8;
  --text-mute: #5d6b88;
  --accent: #38bdf8; /* sky-400 */
  --accent-bright: #7dd3fc; /* sky-300 */
  --accent-deep: #0ea5e9; /* sky-500 */
  --accent-glow: rgba(56, 189, 248, 0.25);
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Fondos decorativos */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.18;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  z-index: 0;
}
.bg-glow {
  position: fixed;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  height: 540px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

/* Auth modal styles */
.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,12,0.6);
  z-index: 60;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.4rem;
  border-radius: 12px;
  width: 360px;
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}
.auth-card {
  width: 540px; /* un poco más ancho para reducir la sensación cuadrada */
  max-width: calc(100% - 40px);
  min-height: 400px; /* mantener proporción agradable */
  border-radius: 14px;
  padding: 1.8rem 1.6rem;
  background: linear-gradient(180deg, rgba(12,18,30,0.9), rgba(9,14,22,0.95));
  border: 1px solid rgba(255,255,255,0.03);
  box-shadow: 0 30px 60px rgba(2,6,12,0.7), 0 4px 18px rgba(14,165,233,0.04);
  animation: popIn 360ms cubic-bezier(.2,.9,.3,1);
  position: relative;
}

/* Top row inside auth card: logo + header block */
.login-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 8px 14px;
}

.logo-glass {
  width: 96px; /* más ancho y aplanado */
  height: 52px;
  border-radius: 12px;
  display: block;
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 30px rgba(2,8,15,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(8px) saturate(120%);
  overflow: hidden;
  box-sizing: border-box;
}

.logo-glass .login-logo-img{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  height: 86%; /* agranda visualmente el logo dentro del cuadrito */
  width: auto;
  object-fit: contain;
}

.login-header { flex-direction: row; align-items: center; gap: 8px; width:100%; justify-content:flex-start; padding-left:0 }
.login-header .header-right { display:flex; flex-direction:column; align-items:flex-start; gap:4px; color:var(--text); margin-left:0 }
.brand-small { font-size:11px; color:var(--text-dim); letter-spacing:1.6px; text-transform:uppercase }
.brand-title { font-size:24px; font-weight:800; color:var(--text) }
.auth-modal{ padding-top:90px }

/* Header (top-centered) for dedicated login page */
.login-header {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.auth-card{ position: relative }
.logo-glass {
  width: 96px;
  height: 52px;
  border-radius: 12px;
  display: block;
  position: relative;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(2, 8, 15, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px) saturate(120%);
}
.page-title { font-size: 20px; font-weight:800; color: var(--text); }

.login-top { display:flex; align-items:center; gap:16px; padding: 18px 18px 0 18px }
.login-header { flex-direction: row; align-items: center; gap: 12px; width:100%; justify-content:flex-start; padding-left:0 }
.login-header .header-right { display:flex; flex-direction:column; align-items:flex-start; gap:4px; color:var(--text); margin-left:0 }
.brand-small { font-size:10px; color:var(--text-dim); letter-spacing:1.6px; text-transform:uppercase }
.brand-title { font-size:22px; font-weight:800; color:var(--text) }
.header-buttons { display:flex; gap:8px; margin-top:6px }
.btn-pill { padding:10px 18px; border-radius:14px; border:1px solid rgba(255,255,255,0.06); background:transparent; color:var(--text); font-weight:700; cursor:pointer }
.btn-pill.is-active { background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep)); color: var(--bg); box-shadow: 0 8px 24px rgba(2,6,12,0.6) }
.btn-pill:hover { filter:brightness(1.03) }

/* Make header fit on small screens */
@media (max-width:820px){ .login-header{ left:20px; transform:none; } .header-right{ align-items:flex-start } }

/* Ensure header sits inside the auth-card (not fixed) - override earlier fixed rules */
.login-header { position: relative !important; top: auto !important; left: auto !important; transform: none !important; z-index: auto !important; margin-bottom: 12px; width:100%; justify-content:flex-start; }

.auth-card h2 {
  display:flex;
  align-items:center;
  gap:0.8rem;
  margin-bottom:0.6rem;
}
.login-title { font-family: 'Space Grotesk', sans-serif; font-size:1.6rem; font-weight:700; color:var(--text); margin:0 }
.login-sub { font-size:0.8rem; color:var(--text-dim); margin-top:2px }
.auth-card .brand-mark {
  width:40px;height:40px;border-radius:8px;background:linear-gradient(145deg,var(--accent-bright),var(--accent-deep));display:inline-flex;align-items:center;justify-content:center;box-shadow:0 6px 20px -6px var(--accent-glow);
}
.auth-card .brand-mark img{width:26px;height:26px}

/* Adjust mini container and scale up logo (container slightly larger, not flattened) */
.logo-glass {
  width: 110px !important; /* a bit wider */
  height: 72px !important; /* taller to avoid flattened look */
  border-radius: 14px !important;
  overflow: hidden !important;
  display: block !important;
  position: relative !important;
}
.logo-glass .login-logo-img {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%,-50%) !important;
  height: 200% !important; /* larger visual logo */
  width: auto !important;
  object-fit: cover !important;
  max-width: none !important;
  max-height: none !important;
}

@keyframes popIn {
  from { transform: translateY(12px) scale(.99); opacity: 0 }
  to { transform: translateY(0) scale(1); opacity: 1 }
}

.auth-tabs { gap:0.6rem }
.auth-tabs button { padding:0.6rem 0.9rem; border-radius: 999px; font-weight:700; background:transparent; color:var(--text); border:1px solid rgba(255,255,255,0.02) }
.auth-tabs button.is-active { background: var(--bg); color: var(--accent); box-shadow: 0 6px 18px -6px var(--accent-glow); border-color: transparent }

/* Smooth transition for switching between login and register */
.field { transition: opacity 220ms ease, transform 220ms ease, max-height 260ms ease; }
.field.is-hidden { opacity: 0; transform: translateY(-6px); max-height: 0; overflow: hidden; padding-top:0; padding-bottom:0; margin-top:0; margin-bottom:0 }
.field.is-visible { opacity: 1; transform: translateY(0); max-height: 260px }

.btn-pill { transition: background-color 180ms ease, color 180ms ease, transform 160ms ease }
.btn-pill.is-active { transform: translateY(-2px) }

/* Inputs focus glow */
.auth-card input {
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
  background: rgba(255,255,255,0.02);
}
.auth-card input:focus { box-shadow: 0 8px 30px -12px var(--accent-glow); border-color: var(--accent-deep); }

/* password toggle inside input - position relative to the input wrapper */
.field.password {
  position: static;
}
.input-wrap { position: relative; }
.input-wrap input { display: block; padding-right: 52px; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  z-index: 6;
  pointer-events: auto;
}
.password-toggle:hover { color: var(--accent); background: rgba(56,189,248,0.04) }

/* Buttons polish */
.auth-card .btn-primary { padding: 0.9rem 1.4rem; border-radius: 12px; font-size: 1rem; background: linear-gradient(145deg,var(--accent-bright),var(--accent-deep)); color: #03202a; box-shadow: 0 8px 28px -12px var(--accent-glow); border: none }
.auth-card .btn-ghost { padding: 0.82rem 1rem }
.auth-card .btn-block { display:block; width:100%; text-align:center }

/* ensure inputs/buttons have matching visual height */
.auth-card input { height: 48px }
.auth-card label { font-size:0.78rem; color:var(--text-dim); margin-bottom:6px }

/* responsive */
@media (max-width:760px){
  .auth-card{ width: 92%; padding:1.2rem }
}
.auth-tabs { display:flex; gap:0.5rem; margin-bottom:0.8rem }
.auth-tabs button {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}
.auth-tabs button.is-active {
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  color: var(--bg);
  box-shadow: 0 6px 18px -6px var(--accent-glow);
  border-color: transparent;
}
.auth-card .field { margin-bottom: 0.6rem }
.auth-card input { padding: 0.64rem 0.9rem }
.auth-card h2 { margin:0 0 0.6rem }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
/* Sidebar layout (left panel with logo and vertical nav) */
.sidebar {
  position: fixed;
  left: 1.5rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 220px;
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 20;
}
.brand-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-shrink: 0;
}
.brand-mark-inner {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  padding: 0;
  overflow: visible;
}
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 56px; /* keep it visually balanced in the sidebar */
  max-width: 100%;
  object-fit: contain;
  filter: none;
}
.brand-info .brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand-info .brand-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.tabs.vertical {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.tabs.vertical .tab {
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}

.tab-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.6rem;
  vertical-align: middle;
  color: var(--text-dim);
  flex-shrink: 0;
}
.tab {
  display: inline-flex;
  align-items: center;
}
.tab.is-active .tab-icon {
  color: var(--bg);
}

/* Tab icons: keep neutral color; follow text on hover/active (no blue) */
.tab-icon {
  font-size: 18px;
  margin-right: 0.6rem;
  color: var(--text-dim);
  width: 18px;
  text-align: center;
  transition: color 0.12s ease;
}
.tabs .tab:hover .tab-icon,
.tabs .tab:focus .tab-icon,
.tabs .tab.is-active .tab-icon {
  color: var(--text);
}

/* make icon follow text hover color */
.tabs .tab:hover,
.tabs .tab:focus {
  color: var(--text);
}
.tabs .tab:hover .tab-icon,
.tabs .tab:focus .tab-icon {
  color: var(--text);
}

/* Shift main content when sidebar present */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  margin-left: 260px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.topbar .brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 18px var(--accent-glow);
  position: relative;
}
.topbar .brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background: var(--bg);
}
.topbar .brand-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-name span {
  color: var(--accent);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-elev);
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab:hover {
  color: var(--text);
}
.topbar .tab.is-active {
  color: var(--bg);
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Sidebar vertical active style — only apply when JS marks the page ready to avoid initial flash */
.tabs.vertical .tab.is-active {
  /* keep neutral appearance before JS runs */
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.ready .tabs.vertical .tab.is-active {
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  color: var(--bg);
  box-shadow: 0 6px 18px -6px var(--accent-glow);
  border-radius: 10px;
}

/* Layout */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.view {
  display: none;
  animation: fade 0.3s ease;
}
.view.is-active {
  display: block;
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.hero {
  margin-bottom: 2rem;
}
.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.hero-title .accent {
  color: var(--accent);
}
.hero-sub {
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0;
  text-wrap: pretty;
}

/* Grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
}

/* Welcome overlay when user must login on entry */
#welcomeCard.login-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100% - 64px));
  z-index: 80;
  box-shadow: 0 30px 80px rgba(2,6,12,0.7);
}

/* Dim and disable interactions with page when login overlay active */
body.login-active .container > *:not(#welcomeCard) {
  opacity: 0.22;
  pointer-events: none;
  user-select: none;
  transform: translateY(4px);
}
.span-2 {
  grid-column: span 2;
}
/* Ensure extra spacing between stacked containers/cards */
.container + .container,
.card + .card {
  margin-top: 1.2rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

/* Fields */
.field-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-end;
}
.field-row.wrap {
  flex-wrap: wrap;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field-grow {
  flex: 1;
  min-width: 160px;
}
.field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
}
input,
textarea {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
input:focus,
textarea:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea {
  resize: vertical;
  font-family: "Space Grotesk", monospace;
  letter-spacing: 0.04em;
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.15rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease,
    opacity 0.18s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  color: var(--bg);
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 6px 20px -6px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 26px -6px var(--accent-glow);
}
.btn-accent {
  color: var(--bg);
  background: var(--accent);
}
.btn-accent:hover:not(:disabled) {
  background: var(--accent-bright);
}
.btn-ghost {
  background: var(--bg-elev);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent-deep);
}
.btn-block {
  width: 100%;
}
.btn-mini {
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  background: var(--bg-elev);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-mini:hover {
  color: var(--accent);
  border-color: var(--accent-deep);
}
.btn-danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.12);
}
.btn-warn {
  background: transparent;
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--warning);
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
}
.btn-warn:hover {
  background: rgba(251, 191, 36, 0.12);
}

/* Hint / messages */
.hint {
  font-size: 0.8rem;
  color: var(--text-mute);
  margin: 0.85rem 0 0;
}
.hint.is-error {
  color: var(--danger);
}
.hint.is-success {
  color: var(--success);
}

/* Status dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-mute);
  box-shadow: 0 0 0 4px rgba(93, 107, 136, 0.12);
}
.status-dot[data-state="on"] {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}
.status-dot[data-state="banned"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.15);
}

/* Subscription / badges */
.sub-state {
  margin-bottom: 0.85rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-muted {
  color: var(--text-mute);
  background: var(--bg-elev);
}
.badge-active {
  color: var(--success);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}
.badge-expired {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}
.badge-banned {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

/* Key-value list */
.kv {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.kv li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--border);
}
.kv li:last-child {
  border-bottom: none;
}
.kv .k {
  color: var(--text-dim);
}
.kv .v {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

/* HWID box */
.hwid-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  overflow-x: auto;
}
.hwid-box code {
  font-family: "Space Grotesk", monospace;
  color: var(--accent-bright);
  letter-spacing: 0.05em;
  font-size: 0.9rem;
}

/* Lock screen */
.lock {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}
.lock-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.lock-icon {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  box-shadow: 0 0 22px var(--accent-glow);
  margin-bottom: 1rem;
  position: relative;
}
.lock-icon::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 13px;
  border: 3px solid var(--bg);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}
.lock-icon::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 16px;
  background: var(--bg);
  border-radius: 4px;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
}
.lock-card h2 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0 0 0.4rem;
}
.lock-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 1.3rem;
}
.lock-card .field {
  margin-bottom: 0.9rem;
}

/* Admin */
.admin-panel {
  animation: fade 0.3s ease;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
}

/* Key output */
.key-output {
  margin-top: 1rem;
}
.key-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Table */
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 720px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}
.ta-right {
  text-align: right;
}
.row-actions {
  display: inline-flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.mono {
  font-family: "Space Grotesk", monospace;
  color: var(--accent-bright);
  font-size: 0.8rem;
}
.empty {
  text-align: center;
  color: var(--text-mute);
  padding: 1.5rem !important;
}

/* Toasts */
.toasts {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 340px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
}
.toast.is-success {
  border-left-color: var(--success);
}
.toast.is-error {
  border-left-color: var(--danger);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sidebar user card */
.sidebar .user-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent-deep));
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.user-meta { flex: 1; min-width: 0 }
.user-name { font-weight: 700; font-size: 0.95rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.user-role { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px }
.sidebar .btn-mini { padding: 0.45rem; border-radius: 8px }

/* role edit dropdown */
.role-edit { position: relative; display: inline-block }
.role-label { min-width: 84px }
.role-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow);
  display: none; /* hidden by default, JS toggles */
  flex-direction: column;
  gap: 6px;
  z-index: 9999;
  white-space: nowrap;
}
.role-item {
  background: transparent;
  border: none;
  padding: 6px 10px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
}
.role-item:hover { background: rgba(56,189,248,0.06); color: var(--accent) }

/* Responsive */
@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-row {
    flex-direction: column;
    align-items: stretch;
  }
  .field-row .btn {
    width: 100%;
  }
  .topbar {
    justify-content: center;
  }
  .container {
    margin-left: 0;
    padding-top: 1rem;
  }
  .sidebar {
    display: none;
  }
}

/* Mobile top (visible when sidebar is hidden) */
.mobile-top {
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.mobile-brand { display:flex; align-items:center; gap:0.6rem }
.mobile-logo { width:40px; height:40px; object-fit:contain; border-radius:8px }

/* Additional breakpoints for tablets and medium screens */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
    left: 1rem;
    right: auto;
  }
  .container {
    margin-left: 220px;
    max-width: 1000px;
    padding: 1.8rem 1rem 3rem;
  }
}

@media (max-width: 880px) {
  .sidebar { display: none }
  .container { margin-left: 0; padding: 1rem; max-width: 100%; }
  .mobile-top { display: flex }
  .hero-sub { max-width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .data-table { min-width: 0; }
}

/* Mobile menu button and dropdown */
.mobile-actions { display:flex; align-items:center; gap:8px }
.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn:focus { outline: none; box-shadow: 0 6px 18px -6px var(--accent-glow) }
.mobile-menu { display: none; position: fixed; right: 12px; top: 84px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 8px; min-width: 180px; z-index: 9999; }
.mobile-menu.open { display: flex; flex-direction: column; gap: 6px }
.mobile-menu-item { background: transparent; border: none; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer }
.mobile-menu-item:hover { background: rgba(56,189,248,0.04); color: var(--accent) }

/* Hide inline mobile tabs when using dropdown to save space */
.tabs.mobile { display: none }
@media (min-width: 640px) {
  .tabs.mobile { display: flex }
  .mobile-menu-btn { display: none }
}

/* Mobile menu user block */
.mobile-menu-user { padding: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.02); background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent); display:flex; flex-direction:column; gap:8px }
.mobile-menu-user-inner { display:flex; gap:8px; align-items:center }
.mobile-avatar { width:44px; height:44px; border-radius:10px; background:linear-gradient(145deg, var(--accent-bright), var(--accent-deep)); color:var(--bg); display:flex; align-items:center; justify-content:center; font-weight:700 }
.mobile-user-meta .mobile-user-name { font-weight:700 }
.mobile-user-meta .mobile-user-role { color:var(--text-dim); font-size:0.85rem }
.mobile-menu-nav { display:flex; flex-direction:column; gap:6px; padding-top:6px }
.mobile-logout-btn { align-self:flex-end }

/* Large screens: allow wider layout */
@media (min-width: 1400px) {
  .container { max-width: 1300px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .span-2 { grid-column: span 2; }
}
