: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;
}

.auth-main {
  width: min(420px, 100%);
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 32px 28px;
  box-shadow: 0 24px 32px -18px rgba(15, 23, 42, 0.55);
}

.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%, #38bdf8 100%);
  font-size: 28px;
  color: #fff;
}

.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;
  }
}
