/* =========================================
   1. VARIABLES (Merged)
========================================= */
:root {
  /* Backgrounds & Panels */
  --bg: #07080c;
  --panel: rgba(12, 14, 20, 0.72);
  --panel2: rgba(12, 14, 20, 0.58);
  
  /* Text & Colors */
  --text: #e9edf5;
  --muted: #aab3c5;
  --accent: #7c5cff;
  --accent2: #3dd6d0;
  
  /* Status Colors */
  --ok: #3dd6d0;
  --warn: #ffb020;
  --danger: #ff5c5c;

  /* Borders & Lines */
  --stroke: rgba(255, 255, 255, 0.10);
  --stroke2: rgba(255, 255, 255, 0.14);
  --line: rgba(0, 0, 0, 0.35);
  --line2: rgba(255, 255, 255, 0.07);

  /* Geometry, Shadows & Focus */
  --radius: 16px;
  --shadow1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow2: 0 14px 44px rgba(0, 0, 0, 0.45);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  --max: 1200px;
  --focus: 0 0 0 3px rgba(124, 92, 255, 0.35);
}

/* =========================================
   2. GLOBAL RESET & BASE
========================================= */
* {
  box-sizing: border-box;
}


body, main {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
}


/* Global Background (für beide Layouts) */
body::before {
  content: "";
  position: fixed;
  height: 100vh;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% 6%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(700px 420px at 85% 16%, rgba(61, 214, 208, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg), #05060a);
}

.logo {
  display: block;
}


/* =========================================
   3. LOGIN PAGE (.login)
========================================= */
main.login {
  display: grid;
  place-items: center;
  padding: 28px 14px;
}

.card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow2);
  padding: 18px 16px 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(420px 240px at 20% 0%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(360px 220px at 80% 0%, rgba(61,214,208,.10), transparent 62%);
  pointer-events: none;
}

.card > * {
  position: relative;
}

/* Scoped Login Title */
.card .login-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6px 2px 14px;
  font-size: 20px;
  letter-spacing: 0.2px;
}
.card .login-title span {
  font-weight: 850;
  opacity: 0.95;
}

/* Login Logo Animation (Spin on Loading) */
main.login .logo-spin {
  animation: rkspin 0.8s linear infinite;
  animation-play-state: paused;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
}
main.login.loading .logo-spin {
  animation-play-state: running;
}
main.login:not(.loading) .logo-spin {
  animation: none;
  transform: rotate(0deg);
}

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

/* Login Error Box */
.login-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 120, 120, 0.18);
  background: rgba(255, 80, 80, 0.08);
  color: rgba(255, 230, 230, 0.95);
  margin: 0 0 12px;
}
.login-error svg {
  flex: 0 0 auto;
  opacity: 0.95;
}
.login-error span {
  display: block;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0.1px;
}
.login-error.hide { display: none; }
.login-error.show { display: flex; }

/* Login Fields */
.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 2px;
  padding: 0 12px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  background-clip: padding-box;
}
.field:focus-within {
  border-color: transparent;
  box-shadow:
    0 0 0 2px rgba(124, 92, 255, 0.55),
    0 0 0 6px rgba(124, 92, 255, 0.18);
}
.field .icon {
  width: 20px;
  height: 20px;
  color: rgba(170, 179, 197, 0.92);
  flex: 0 0 auto;
}
.field input {
  width: 100%;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.2px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder {
  color: rgba(170, 179, 197, 0.62);
}

/* Password Eye */
.pw-wrap { padding-right: 44px; }
#eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, background 0.18s ease;
  color: rgba(170, 179, 197, 0.82);
}
.pw-wrap:hover #eye,
.pw-wrap:focus-within #eye {
  opacity: 1;
  pointer-events: auto;
}
#eye:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.90);
}
#eye svg { width: 18px; height: 18px; display: block; }

/* Login Buttons */
main.login button {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0.2px;
}
main.login button:hover {
  color: #7c5cff;
}

#loginBtn {
  margin-top: 14px;
  position: relative;
  color: #fff;
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, rgba(124, 92, 255, 1), rgba(61, 214, 208, 0.85));
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.42);
  transition: transform 0.12s ease, filter 0.12s ease;
}
#loginBtn:hover { filter: brightness(1.03); color: #fff; }
#loginBtn:active { transform: translateY(1px); }
#loginBtn:disabled { opacity: 0.65; cursor: not-allowed; filter: saturate(0.8); }

#loginBtn .btn-label { position: relative; z-index: 1; }
#loginBtn .btn-spin { display: none; }

.btn-passkey {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 3px solid rgba(124, 92, 255, 0.24);
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow1);
  transition: background 0.14s ease, transform 0.12s ease, border-color 0.14s ease;
}
.btn-passkey:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(124, 92, 255, 0.24);
}
.btn-passkey:active { transform: translateY(1px); }
.btn-passkey:disabled { opacity: 0.65; cursor: not-allowed; }

/* Loading States & Spinner */
main.login.loading .card {
  border-color: rgba(124, 92, 255, 0.22);
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Small Devices Login */
@media (max-width: 360px) {
  .card { padding: 16px 12px; border-radius: 20px; }
  .card .login-title { font-size: 18px; }
  .field { height: 50px; border-radius: 15px; }
  #loginBtn, .btn-passkey { height: 50px; border-radius: 15px; }
}


/* =========================================
   4. ADMIN DASHBOARD (.topbar-admin)
========================================= */
.topbar-admin {
  position: sticky;
  top: 0;
  z-index: 66;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 10px;
  background: linear-gradient(180deg, #0b0d12, #090b10);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar-admin .logo {
  margin-right: 4px;
}

/* Scoped Admin Title */
.topbar-admin .login-title {
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 900;
}

/* Admin Logo Intro Animation */
.topbar-admin .logo-spin {
  animation: logo-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes logo-in {
  from { transform: scale(0.88) rotate(-8deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.topbar-admin details {
  background: rgba(10, 12, 18, 0.72);
  border: 0px solid #0b0d12;
  border-radius: 14px;
  padding: 4px;
}
.topbar-admin details summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.topbar-admin details,
.topbar-admin summary {
  padding: 0;
}

/* Navigation Layout */
nav { position: relative; }
.nav-dd { position: relative; }
.nav-dd > summary { list-style: none; }
.nav-dd > summary::-webkit-details-marker { display: none; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0px;
  background: transparent;
  color: var(--text);
  border: 0px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
.nav-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.nav-dd[open] .nav-btn {
  background: var(--panel);
}

/* Dropdown List */
.nav-list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background:
    radial-gradient(900px 500px at 12% 6%, rgba(124, 92, 255, 0.14), transparent 60%),
    radial-gradient(700px 420px at 85% 16%, rgba(61, 214, 208, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg), #05060a);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.nav-item:hover { background: var(--panel2); }
.nav-item.is-active {
  background: rgba(124, 92, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}
.nav-item.danger { color: var(--danger); }

/* Nav Indicators */
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-dot.ok { background: var(--ok); }
.nav-dot.ad { background: var(--warn); }
.nav-dot.danger { background: var(--danger); }
.nav-hint {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}
.nav-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

/* Drawer Search Inputs */
.drawer-search select,
.drawer-search input {
  height: 44px;
}
.drawer-search select {
  -webkit-appearance: none;
  appearance: none;
}
