:root {
  --app-bg-top: #eef2ff;
  --app-bg-bottom: #f8fafc;
  --sidebar-bg: #0f172a;
  --sidebar-ink: #f8fafc;
  --sidebar-muted: #94a3b8;
  --sidebar-active: rgba(255, 255, 255, 0.08);
  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.12);
  --card-border: rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 380px at 10% -20%, #dbeafe 0%, transparent 60%),
    radial-gradient(1000px 420px at 90% 10%, #fee2e2 0%, transparent 60%),
    linear-gradient(180deg, var(--app-bg-top), var(--app-bg-bottom));
  min-height: 100vh;
  color: #111827;
}

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

.page-enter {
  animation: riseIn 0.45s ease-out;
}

.admin-layout {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.admin-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  --bs-offcanvas-width: 260px;
}

.admin-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: grid;
  place-items: center;
}

.sidebar-section-title {
  color: var(--sidebar-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.admin-sidebar .nav-link {
  color: var(--sidebar-muted);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: var(--sidebar-active);
}

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

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-card {
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.filter-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.filter-card .input-group-text,
.filter-card .form-control,
.filter-card .form-select {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
}

.filter-card .form-control:focus,
.filter-card .form-select:focus {
  border-color: rgba(29, 78, 216, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.15);
}

.table-hover tbody tr:hover {
  background-color: var(--accent-soft);
}

.badge-soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-soft-danger {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-truncate-1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-preview {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 1rem;
  white-space: pre-wrap;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

@media (max-width: 991.98px) {
  .admin-layout {
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .admin-content .page-enter {
    padding: 1.25rem !important;
  }

  .admin-card .card-body {
    padding: 1rem;
  }

  .admin-topbar .container-fluid {
    gap: 0.5rem;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.7rem;
  }
}
