/* ==========================================================================
   KEYAUTH — OBSIDIAN IMPERIAL AURORA DESIGN SYSTEM
   Grand, Luxurious, High-Contrast Dark Glass UI
   ========================================================================== */

:root {
  --bg-0: #04010c;
  --bg-1: #090218;
  --bg-2: #12052d;

  --surface: rgba(17, 7, 36, 0.72);
  --surface-strong: rgba(14, 5, 30, 0.88);
  --surface-elevated: rgba(26, 11, 54, 0.82);
  --surface-input: rgba(6, 2, 16, 0.78);

  --violet: #8b5cf6;
  --violet-deep: #6d28d9;
  --violet-light: #c4b5fd;
  --orchid: #e879f9;
  --magenta: #d946ef;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --emerald: #34d399;
  --rose: #fb7185;

  --txt: #f8f5ff;
  --txt-soft: #d8c8f7;
  --muted: #9b88c4;
  --muted-2: #68558f;

  --border: rgba(167, 139, 250, 0.22);
  --border-bright: rgba(196, 181, 253, 0.45);
  --border-subtle: rgba(167, 139, 250, 0.12);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 28px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

@property --spin {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--txt);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(1000px 620px at 12% -12%, rgba(109, 40, 217, 0.44), transparent 62%),
    radial-gradient(880px 560px at 92% 10%, rgba(217, 70, 239, 0.24), transparent 60%),
    radial-gradient(760px 520px at 50% 112%, rgba(34, 211, 238, 0.16), transparent 60%),
    linear-gradient(165deg, #04010c 0%, #0b0320 48%, #04010c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 3, 20, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 70, 239, 0.55);
}

button, input, select {
  font-family: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: all 0.24s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
  flex-shrink: 0;
}

/* ==========================================================================
   COSMIC ARCHITECTURAL BACKDROP
   ========================================================================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Perspective architectural grid */
.aurora-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 18%, transparent 78%);
  transform: perspective(700px) rotateX(22deg) scale(1.12);
  transform-origin: 50% 20%;
  opacity: 0.85;
}

/* Floating nebula orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.42;
  will-change: transform;
}
.orb-1 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0) 70%);
  top: -140px;
  left: -100px;
  animation: orbFloat1 18s ease-in-out infinite alternate;
}
.orb-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #d946ef 0%, rgba(217, 70, 239, 0) 70%);
  bottom: -180px;
  right: -120px;
  animation: orbFloat2 22s ease-in-out infinite alternate;
}
.orb-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #22d3ee 0%, rgba(34, 211, 238, 0) 70%);
  top: 42%;
  left: 55%;
  opacity: 0.22;
  animation: orbFloat3 26s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(70px, 50px, 0) scale(1.18); }
}
@keyframes orbFloat2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-80px, -45px, 0) scale(1.15); }
}
@keyframes orbFloat3 {
  from { transform: translate3d(-30px, 20px, 0) scale(0.95); }
  to   { transform: translate3d(40px, -60px, 0) scale(1.2); }
}

/* Starfield Canvas */
#cosmicCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Subtle Film Grain Texture (CSP-safe data URI) */
.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Cursor Ambient Spotlight */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.22), rgba(217, 70, 239, 0.08) 42%, transparent 68%);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* ==========================================================================
   PAGE VISIBILITY (Fixed Specificity)
   ========================================================================== */
.page {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 3;
}

.page.active {
  display: block;
  animation: pageReveal 0.55s var(--ease-spring) both;
}

#loginPage.page {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

#loginPage.page.active {
  display: flex;
}

@keyframes pageReveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   BRAND EMBLEM
   ========================================================================== */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #a855f7 0%, #6d28d9 58%, #4c1d95 100%);
  color: #fff;
  box-shadow:
    0 10px 28px rgba(139, 92, 246, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  animation: emblemShine 4.5s ease-in-out infinite;
}

@keyframes emblemShine {
  0%, 55% { transform: translateX(-100%) rotate(15deg); }
  100%    { transform: translateX(120%) rotate(15deg); }
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(95deg, #ffffff 0%, #e9d5ff 48%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.brand.small {
  gap: 12px;
}
.brand.small .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.brand.small .brand-mark svg {
  width: 20px;
  height: 20px;
}
.brand.small .brand-text h1 {
  font-size: 17px;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.32);
  border-radius: 99px;
  vertical-align: middle;
}

/* ==========================================================================
   LOGIN VAULT EXPERIENCE
   ========================================================================== */
.login-shell {
  width: 100%;
  max-width: 460px;
  position: relative;
  perspective: 1200px;
}

/* Ambient halo behind login card */
.login-halo {
  position: absolute;
  inset: -28px;
  border-radius: 40px;
  background:
    radial-gradient(circle at 20% 10%, rgba(139, 92, 246, 0.35), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(217, 70, 239, 0.30), transparent 55%);
  filter: blur(36px);
  z-index: 0;
  pointer-events: none;
  animation: haloPulse 6s ease-in-out infinite alternate;
}

@keyframes haloPulse {
  from { opacity: 0.65; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1.04); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 36px 34px 32px;
  background: linear-gradient(165deg, rgba(22, 9, 46, 0.84) 0%, rgba(11, 4, 26, 0.90) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.14) inset;
  overflow: hidden;
  transition: transform 0.25s var(--ease);
  transform-style: preserve-3d;
}

/* Animated Prismatic Rotating Conic Border */
.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-2xl);
  padding: 1.5px;
  background: conic-gradient(
    from var(--spin),
    transparent 0deg,
    transparent 210deg,
    #8b5cf6 260deg,
    #e879f9 305deg,
    #22d3ee 335deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: borderSpin 6s linear infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes borderSpin {
  to { --spin: 360deg; }
}

/* Subtle Glass Sheen Sweep */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: skewX(-22deg);
  animation: cardSweep 7.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes cardSweep {
  0%, 62% { left: -80%; }
  100%    { left: 150%; }
}

.login-card > * {
  position: relative;
  z-index: 2;
}

.login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vault-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.vault-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulseDot 2.2s infinite;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.35), transparent);
  margin: 22px 0;
}

.login-title {
  margin-bottom: 24px;
}

.login-title h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: var(--txt);
  margin-bottom: 6px;
}

.login-title p {
  font-size: 13.5px;
  color: var(--muted);
}

.login-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted-2);
}

.login-footer-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-footer-item svg {
  width: 14px;
  height: 14px;
  color: var(--violet-light);
}

/* ==========================================================================
   FORM INPUTS & CONTROLS
   ========================================================================== */
.input-group {
  margin-bottom: 18px;
}

.input-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted-2);
  pointer-events: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.input-wrap:focus-within .input-icon {
  color: var(--orchid);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select {
  width: 100%;
  height: 46px;
  background: var(--surface-input);
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: var(--r-md);
  color: var(--txt);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input-wrap input {
  padding-left: 42px;
}

.input-wrap.has-toggle input {
  padding-right: 44px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.input-toggle:hover {
  background: rgba(167, 139, 250, 0.14);
  color: var(--txt);
}

.input-toggle svg {
  width: 17px;
  height: 17px;
}

input::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

input:hover, select:hover {
  border-color: rgba(196, 181, 253, 0.45);
}

input:focus, select:focus {
  border-color: var(--orchid);
  background: rgba(13, 5, 29, 0.96);
  box-shadow:
    0 0 0 3px rgba(217, 70, 239, 0.16),
    0 0 24px rgba(139, 92, 246, 0.28);
}

input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

select {
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23c4b5fd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

select option {
  background: #100526;
  color: var(--txt);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 48%, #ec4899 100%);
  background-size: 200% 200%;
  border-radius: var(--r-md);
  box-shadow:
    0 12px 30px rgba(124, 58, 237, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  position: relative;
  overflow: hidden;
  animation: gradFlow 6s ease infinite;
}

@keyframes gradFlow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.primary-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -85%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-24deg);
  transition: left 0.65s var(--ease);
  pointer-events: none;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 38px rgba(217, 70, 239, 0.52),
    0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

.primary-btn:hover::after {
  left: 145%;
}

.primary-btn:active {
  transform: translateY(0) scale(0.985);
}

.primary-btn.full {
  width: 100%;
  height: 48px;
  font-size: 14.5px;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.primary-btn svg,
.secondary-btn svg,
.danger-btn svg,
.logout svg {
  width: 17px;
  height: 17px;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-soft);
  background: rgba(139, 92, 246, 0.11);
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 11px;
}

.secondary-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--border-bright);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.24);
}

.secondary-btn:active {
  transform: scale(0.98);
}

.secondary-btn.emerald-tint {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.25);
}
.secondary-btn.emerald-tint:hover {
  background: rgba(52, 211, 153, 0.20);
  border-color: rgba(52, 211, 153, 0.48);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(52, 211, 153, 0.22);
}

.secondary-btn.amber-tint {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.25);
}
.secondary-btn.amber-tint:hover {
  background: rgba(251, 191, 36, 0.20);
  border-color: rgba(251, 191, 36, 0.48);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.20);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);
  border-radius: 11px;
  box-shadow: 0 10px 26px rgba(244, 63, 94, 0.40);
}

.danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(244, 63, 94, 0.55);
}

.danger-btn:active {
  transform: scale(0.98);
}

.icon-square-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--violet-light);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

.icon-square-btn:hover {
  background: rgba(139, 92, 246, 0.24);
  border-color: var(--border-bright);
  color: #fff;
  transform: translateY(-2px);
}

.icon-square-btn.spinning svg {
  animation: spinOnce 0.7s var(--ease);
}

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

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 74px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(7, 2, 18, 0.74);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sys-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 99px;
  background: rgba(17, 7, 36, 0.78);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sys-pill .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.sys-pill strong {
  color: var(--txt-soft);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.11);
  border: 1px solid rgba(167, 139, 250, 0.22);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.admin-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--orchid));
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  animation: pulseDot 2.4s var(--ease) infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22); }
  50%      { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.05); }
}

.logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fda4af;
  background: rgba(251, 113, 133, 0.09);
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: 10px;
}

.logout:hover {
  color: #ffffff;
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.5);
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.28);
}

/* ==========================================================================
   DASHBOARD CONTAINER & GRAND HERO BANNER
   ========================================================================== */
.dashboard {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 32px 72px;
  position: relative;
  z-index: 3;
}

.hero-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  margin-bottom: 24px;
  border-radius: var(--r-2xl);
  background:
    radial-gradient(620px 260px at 0% 0%, rgba(139, 92, 246, 0.26), transparent 65%),
    radial-gradient(500px 240px at 100% 100%, rgba(217, 70, 239, 0.20), transparent 65%),
    linear-gradient(145deg, rgba(22, 9, 46, 0.80) 0%, rgba(12, 4, 28, 0.88) 100%);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  overflow: hidden;
  flex-wrap: wrap;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-2xl);
  padding: 1px;
  background: linear-gradient(120deg, rgba(168, 85, 247, 0.55), rgba(232, 121, 249, 0.35), rgba(34, 211, 238, 0.4), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.hero-left {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orchid);
  background: rgba(232, 121, 249, 0.12);
  border: 1px solid rgba(232, 121, 249, 0.28);
  padding: 4px 11px;
  border-radius: 99px;
  margin-bottom: 12px;
}

.hero-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 8px;
  background: linear-gradient(92deg, #ffffff 0%, #e9d5ff 46%, #f0abfc 78%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-banner p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Active Health Progress Meter */
.health-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.health-track {
  width: 220px;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.16);
}

.health-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--orchid), var(--emerald));
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.55);
  transition: width 0.8s var(--ease-spring);
}

.health-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-soft);
}

.health-label strong {
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   MEGA KPI STAT CARDS
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 20px;
  background: linear-gradient(160deg, rgba(22, 9, 46, 0.78) 0%, rgba(12, 4, 28, 0.84) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: transform 0.28s var(--ease-spring), border-color 0.28s ease, box-shadow 0.28s ease;
}

/* Interactive cursor spotlight inside stat card */
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    var(--card-glow, rgba(168, 85, 247, 0.18)),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.stat:hover::before {
  opacity: 1;
}

/* Luminous top bar */
.stat::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: var(--card-accent, linear-gradient(90deg, transparent, var(--violet), transparent));
  opacity: 0.75;
}

.stat:hover {
  transform: translateY(-4px);
  border-color: var(--border-bright);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.5),
    0 0 40px var(--card-shadow, rgba(139, 92, 246, 0.20));
}

.stat.accent-violet {
  --card-glow: rgba(139, 92, 246, 0.22);
  --card-shadow: rgba(139, 92, 246, 0.22);
  --card-accent: linear-gradient(90deg, transparent, #a855f7, transparent);
}
.stat.accent-emerald {
  --card-glow: rgba(52, 211, 153, 0.20);
  --card-shadow: rgba(52, 211, 153, 0.18);
  --card-accent: linear-gradient(90deg, transparent, #34d399, transparent);
}
.stat.accent-amber {
  --card-glow: rgba(251, 191, 36, 0.20);
  --card-shadow: rgba(251, 191, 36, 0.18);
  --card-accent: linear-gradient(90deg, transparent, #fbbf24, transparent);
}
.stat.accent-cyan {
  --card-glow: rgba(34, 211, 238, 0.20);
  --card-shadow: rgba(34, 211, 238, 0.18);
  --card-accent: linear-gradient(90deg, transparent, #22d3ee, transparent);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 21px;
  height: 21px;
}

.stat-icon.blue {
  background: rgba(139, 92, 246, 0.18);
  color: var(--violet-light);
  border: 1px solid rgba(167, 139, 250, 0.28);
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.28);
}

.stat-icon.green {
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.28);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.25);
}

.stat-icon.orange {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
  border: 1px solid rgba(251, 191, 36, 0.28);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.22);
}

.stat-icon.purple {
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.22);
}

.stat-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-body {
  position: relative;
  z-index: 1;
}

.stat-body span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--txt);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   LICENSE MANAGEMENT PANEL & TOOLBAR
   ========================================================================== */
.panel {
  background: linear-gradient(170deg, rgba(19, 8, 40, 0.78) 0%, rgba(11, 4, 26, 0.88) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 13px;
}

.panel-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: var(--orchid);
}

.panel-badge-icon svg {
  width: 20px;
  height: 20px;
}

.panel-head h3 {
  font-family: var(--font-display);
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--txt);
}

.panel-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.bulk {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Search & Filter Toolbar */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 26px;
  background: rgba(7, 2, 18, 0.45);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1 1 280px;
  max-width: 380px;
}

.search-box input {
  height: 40px;
  padding-left: 40px;
  padding-right: 14px;
  font-size: 13px;
  border-radius: 11px;
  background: rgba(6, 2, 16, 0.72);
}

.search-box .input-icon {
  left: 13px;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.filter-tab:hover {
  color: var(--txt);
  background: rgba(139, 92, 246, 0.14);
}

.filter-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(217, 70, 239, 0.45));
  border-color: rgba(232, 121, 249, 0.45);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.32);
}

.filter-tab .count {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--txt-soft);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   DATA TABLE (100% Matched with script.js)
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  text-align: left;
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(139, 92, 246, 0.06);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

thead th:first-child { padding-left: 26px; }
thead th:last-child  { padding-right: 26px; text-align: right; }

tbody tr {
  transition: background 0.2s var(--ease);
  animation: rowFadeIn 0.35s var(--ease-spring) both;
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.09);
  color: var(--txt-soft);
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

tbody td:first-child { padding-left: 26px; }
tbody td:last-child  { padding-right: 26px; }

tbody tr:hover {
  background: rgba(139, 92, 246, 0.09);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* License Key Cell + Copy Button */
.key-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.license-key {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #f5ecff;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.28);
  padding: 6px 11px;
  border-radius: 9px;
  letter-spacing: 0.03em;
  display: inline-block;
  user-select: all;
}

.copy-mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.14);
}

.copy-mini svg {
  width: 14px;
  height: 14px;
}

.copy-mini:hover {
  color: #fff;
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(196, 181, 253, 0.45);
}

.copy-mini.copied {
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
}

/* Status Pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status.active {
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.13);
  border: 1px solid rgba(52, 211, 153, 0.28);
}
.status.active .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulseDot 2.2s infinite;
}

.status.paused {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.13);
  border: 1px solid rgba(251, 191, 36, 0.28);
}
.status.paused .status-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.status.expired {
  color: var(--rose);
  background: rgba(251, 113, 133, 0.13);
  border: 1px solid rgba(251, 113, 133, 0.28);
}
.status.expired .status-dot {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
}

/* Duration / Lifetime */
.lifetime-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fde68a;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(34, 211, 238, 0.14));
  border: 1px solid rgba(251, 191, 36, 0.34);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.14);
}

.duration-main {
  font-weight: 700;
  color: var(--txt);
  font-size: 13px;
}

.duration-main.is-expired {
  color: var(--rose);
}

.duration-sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

/* HWID Badge */
.hwid {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hwid.empty {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
}

.date-cell {
  font-size: 12.5px;
  color: var(--muted);
}

/* Row Action Buttons */
.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--txt-soft);
}

.action svg {
  width: 13px;
  height: 13px;
}

.action.blue {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
}
.action.blue:hover {
  color: #ffffff;
  background: rgba(139, 92, 246, 0.30);
  border-color: rgba(196, 181, 253, 0.55);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.30);
}

.action.cyan {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.10);
  border-color: rgba(34, 211, 238, 0.24);
}
.action.cyan:hover {
  color: #ffffff;
  background: rgba(34, 211, 238, 0.25);
  border-color: rgba(103, 232, 249, 0.52);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.28);
}

.action.orange {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.24);
}
.action.orange:hover {
  color: #ffffff;
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(252, 211, 77, 0.52);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.26);
}

.action.green {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.24);
}
.action.green:hover {
  color: #ffffff;
  background: rgba(52, 211, 153, 0.26);
  border-color: rgba(110, 231, 183, 0.52);
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.26);
}

.action.red {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.10);
  border-color: rgba(251, 113, 133, 0.24);
}
.action.red:hover {
  color: #ffffff;
  background: rgba(244, 63, 94, 0.30);
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.32);
}

/* Empty State */
.empty-state {
  padding: 72px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.20), rgba(217, 70, 239, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.30);
  color: var(--orchid);
  box-shadow: 0 0 36px rgba(139, 92, 246, 0.28);
}

.empty-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 360px;
}

/* ==========================================================================
   MODALS (Supports BOTH .show and .open)
   ========================================================================== */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 1, 12, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s var(--ease), visibility 0.26s var(--ease);
}

.modal-bg.show,
.modal-bg.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 470px;
  padding: 32px 30px 28px;
  position: relative;
  background: linear-gradient(165deg, rgba(24, 10, 50, 0.94) 0%, rgba(12, 4, 28, 0.97) 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-2xl);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.75),
    0 0 70px rgba(139, 92, 246, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.34s var(--ease-spring);
}

.modal-bg.show .modal,
.modal-bg.open .modal {
  transform: translateY(0) scale(1);
}

.modal.small-modal {
  max-width: 410px;
  text-align: center;
}

.close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.close:hover {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.35);
  color: #fff;
}

.modal-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.25), rgba(217, 70, 239, 0.18));
  border: 1px solid rgba(196, 181, 253, 0.35);
  color: var(--orchid);
  margin-bottom: 18px;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.32);
}

.modal-icon svg,
.warning-icon svg {
  width: 24px;
  height: 24px;
}

.warning-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(251, 113, 133, 0.16);
  border: 1px solid rgba(251, 113, 133, 0.35);
  color: var(--rose);
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.28);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--txt);
  margin-bottom: 6px;
}

.modal-description {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.55;
}

.key-row {
  display: flex;
  gap: 8px;
}
.key-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
}
.key-row .secondary-btn {
  height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

.duration-row {
  display: flex;
  gap: 8px;
}
.duration-row input {
  flex: 1;
  min-width: 0;
}
.duration-row select {
  width: 138px;
  flex-shrink: 0;
}

/* Preset Duration Chips */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.preset-chip {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--txt-soft);
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.22);
}

.preset-chip:hover {
  color: #fff;
  background: rgba(168, 85, 247, 0.28);
  border-color: var(--orchid);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.small-modal .modal-actions {
  justify-content: center;
}

/* ==========================================================================
   SUCCESS / ERROR NOTIFY MODAL
   ========================================================================== */
.success {
  width: 100%;
  max-width: 390px;
  padding: 36px 32px 30px;
  text-align: center;
  background: linear-gradient(165deg, rgba(24, 10, 50, 0.95) 0%, rgba(12, 4, 28, 0.98) 100%);
  border: 1px solid rgba(52, 211, 153, 0.38);
  border-radius: var(--r-2xl);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.78),
    0 0 70px rgba(52, 211, 153, 0.22);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.34s var(--ease-spring);
}

.success.error-mode {
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.78),
    0 0 70px rgba(244, 63, 94, 0.24);
}

.modal-bg.show .success,
.modal-bg.open .success {
  transform: translateY(0) scale(1);
}

.check {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
}

.check svg {
  width: 100%;
  height: 100%;
}

.check circle {
  fill: rgba(52, 211, 153, 0.10);
  stroke: var(--emerald);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.55));
}

.check path {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success.error-mode .check circle {
  fill: rgba(251, 113, 133, 0.12);
  stroke: var(--rose);
  filter: drop-shadow(0 0 12px rgba(244, 63, 94, 0.55));
}

.success.error-mode .check path {
  stroke: var(--rose);
}

.success h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 7px;
}

.success p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 26px;
  line-height: 1.55;
}

/* ==========================================================================
   TOAST NOTIFICATION STACK
   ========================================================================== */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(18, 7, 38, 0.94);
  border: 1px solid rgba(167, 139, 250, 0.35);
  backdrop-filter: blur(16px);
  color: var(--txt);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(139, 92, 246, 0.25);
  animation: toastIn 0.32s var(--ease-spring) both;
  pointer-events: auto;
}

.toast.is-success {
  border-color: rgba(52, 211, 153, 0.42);
}

.toast.is-success .toast-dot {
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orchid);
  box-shadow: 0 0 10px var(--orchid);
}

.toast.out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.dash-footer {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-2);
  flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1040px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar-center {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 18px;
    height: 66px;
  }
  .dashboard {
    padding: 22px 16px 56px;
  }
  .hero-banner {
    padding: 22px 20px;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions .primary-btn {
    flex: 1;
  }
  .panel-head,
  .panel-toolbar {
    padding-left: 18px;
    padding-right: 18px;
  }
  .bulk {
    width: 100%;
  }
  .bulk button {
    flex: 1;
  }
  .search-box {
    max-width: none;
  }
  .admin span:not(.online-dot) {
    display: none;
  }
  .admin {
    padding: 5px 10px 5px 6px;
  }
  .login-card {
    padding: 28px 22px 24px;
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 26px 20px 22px;
  }
  .key-row,
  .duration-row {
    flex-direction: column;
  }
  .duration-row select {
    width: 100%;
  }
  .toast-stack {
    right: 14px;
    left: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
