/* Eigenbau-Mailserver Admin – polished dark SaaS UI */
:root {
  --sidebar-w: 17rem;
  --bg: #050814;
  --panel: rgba(12, 18, 34, 0.72);
  --panel-border: rgba(148, 163, 184, 0.1);
  --ink: #e8eefc;
  --muted: #8b9bb8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 1.1rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: 0.01em;
}

.font-display {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.02em;
}

/* Atmosphere */
.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 8% -10%, rgba(99, 102, 241, 0.16), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(34, 211, 238, 0.08), transparent 50%),
    radial-gradient(700px 380px at 70% 110%, rgba(16, 185, 129, 0.08), transparent 45%),
    linear-gradient(180deg, #070b16 0%, #050814 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
}

.app-shell > * { position: relative; z-index: 1; }

/* Brand mark */
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #4f46e5 0%, #0891b2 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 24px rgba(79, 70, 229, 0.28);
  flex-shrink: 0;
}
.brand-mark svg { width: 1.15rem; height: 1.15rem; color: white; }

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  background: rgba(5, 8, 20, 0.78);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-radius: 0.75rem;
  color: #a8b4cc;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
  color: #e8eefc;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  color: #e0e7ff;
  box-shadow: inset 3px 0 0 #818cf8;
}
.nav-ico {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.4rem;
  display: grid;
  place-items: center;
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.nav-item.active .nav-ico {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.topbar {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(5, 8, 20, 0.65);
  backdrop-filter: blur(18px);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 12px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.panel-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 48px rgba(0, 0, 0, 0.3);
}

.panel-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.terminal {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: linear-gradient(180deg, #030712 0%, #070b16 100%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: currentColor;
  opacity: 0.9;
}
.badge-green { background: rgba(16, 185, 129, 0.12); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28); }
.badge-red { background: rgba(244, 63, 94, 0.12); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.28); }
.badge-amber { background: rgba(245, 158, 11, 0.12); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.28); }
.badge-indigo { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.28); }
.badge-slate { background: rgba(148, 163, 184, 0.1); color: #94a3b8; box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22); }

.quota-bar {
  height: 0.55rem;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.quota-bar > span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  padding: 0.62rem 1.05rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s var(--ease), transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  color: white;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #0e7490 140%);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.38);
  filter: brightness(1.06);
}
.btn-ghost {
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.btn-ghost:hover { background: rgba(51, 65, 85, 0.85); }
.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.22); }

.input {
  width: 100%;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(71, 85, 105, 0.75);
  border-radius: 0.75rem;
  padding: 0.68rem 0.9rem;
  color: #e2e8f0;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.input::placeholder { color: #64748b; }

.score-ring {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(5, 8, 20, 0.95) 58%, transparent 59%),
    conic-gradient(#34d399 0 90%, rgba(51, 65, 85, 0.55) 90% 100%);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 12px 40px rgba(16, 185, 129, 0.12);
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.live-dot { animation: pulse-soft 1.5s ease-in-out infinite; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise {
  animation: rise-in 0.55s var(--ease) both;
}
.rise-d1 { animation-delay: 0.05s; }
.rise-d2 { animation-delay: 0.1s; }
.rise-d3 { animation-delay: 0.15s; }
.rise-d4 { animation-delay: 0.2s; }
.rise-d5 { animation-delay: 0.25s; }
.rise-d6 { animation-delay: 0.3s; }

.login-card {
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #818cf8, #22d3ee, transparent);
}

.modal-backdrop {
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
}
