:root {
  color-scheme: dark;
  --background: linear-gradient(160deg, #0b1222 0%, #111c34 100%);
  --surface: rgba(17, 28, 52, 0.95);
  --surface-alt: rgba(23, 36, 64, 0.92);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.18);
  --danger: #f87171;
  --sidebar-width: min(280px, 80vw);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  background-attachment: fixed;
  color: var(--text);
}

.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.28), transparent 38%),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.24), transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(14, 116, 144, 0.25), transparent 45%),
    linear-gradient(160deg, #070a12 0%, #0d1224 55%, #111827 100%);
}

.auth-layout::before,
.auth-layout::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.25), transparent 70%);
  filter: blur(6px);
  opacity: 0.9;
  z-index: 0;
}

.auth-layout::before {
  top: -140px;
  left: -80px;
}

.auth-layout::after {
  bottom: -160px;
  right: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
}

.auth-main {
  width: min(980px, 100%);
  position: relative;
  z-index: 1;
}

.auth-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  align-items: stretch;
}

.auth-panel {
  background: linear-gradient(155deg, rgba(17, 24, 39, 0.95), rgba(11, 18, 34, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 40px -22px rgba(15, 23, 42, 0.65);
  position: relative;
  overflow: hidden;
}

.auth-panel::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  filter: blur(4px);
  opacity: 0.9;
  pointer-events: none;
}

.auth-card {
  background: linear-gradient(155deg, rgba(17, 28, 52, 0.96), rgba(14, 23, 45, 0.92));
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 34px 30px;
  box-shadow: 0 28px 40px -20px rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
}

.auth-kicker {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.5);
  background: rgba(79, 70, 229, 0.16);
  color: #c7d2fe;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-card .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #38bdf8 100%);
  font-size: 28px;
  color: #fff;
  box-shadow: 0 16px 30px -12px rgba(56, 189, 248, 0.5);
}

.auth-card-header h1 {
  letter-spacing: 0.01em;
}

.auth-card-header p {
  color: #a7b0c2;
}

.auth-panel h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-panel p {
  color: #a7b0c2;
  margin-bottom: 18px;
}

.auth-feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.65);
}

.auth-feature-item i {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 70, 229, 0.2);
  color: #c7d2fe;
}

.auth-feature-item span {
  color: #e2e8f0;
  font-weight: 600;
}

.auth-panel .auth-meta {
  margin-top: 18px;
  font-size: 0.85rem;
  color: #9aa4b2;
}

@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-panel {
    order: 2;
  }
  .auth-card {
    order: 1;
  }
}

.auth-form .form-control {
  background: rgba(17, 28, 52, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
}

.auth-form .form-control:focus {
  background: rgba(17, 28, 52, 0.9);
  border-color: rgba(79, 70, 229, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 23, 42, 0.92);
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-header {
  display: flex;
  justify-content: center;
}

.sidebar .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #38bdf8 100%);
  box-shadow: 0 14px 24px -12px rgba(56, 189, 248, 0.6);
}

.sidebar .brand-text {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8fafc;
  font-size: 0.95rem;
}

.sidebar-user .avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #38bdf8 0%, #4f46e5 100%);
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  font-weight: 500;
}

.sidebar-link:hover {
  background: rgba(79, 70, 229, 0.18);
  color: #f8fafc;
  transform: translateY(-1px);
}

.sidebar-link.active {
  background: rgba(79, 70, 229, 0.32);
  color: #f8fafc;
}

.text-muted {
  color: var(--text-muted) !important;
}

.sidebar-link i {
  font-size: 0.95rem;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  backdrop-filter: blur(6px);
}

.content-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
}

.page-title {
  font-weight: 700;
  color: #f8fafc;
}

.main-content {
  flex: 1;
  padding: 32px;
  background: transparent;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
}

.btn-outline-danger {
  border-color: rgba(248, 113, 113, 0.4);
  color: rgba(254, 202, 202, 0.85);
}

.btn-outline-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #fff;
}

.toast {
  min-width: 240px;
}

@media (max-width: 992px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .sidebar-user {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
  }

  .content-header {
    padding: 20px 24px;
  }

  .main-content {
    padding: 24px 20px;
  }
}
