:root {
  --sidebar-bg: #0b1320;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: rgba(255, 255, 255, 0.85);
  --sidebar-muted: rgba(255, 255, 255, 0.55);

  --parallel-blue-900: #0b2d4a;
  --parallel-blue-800: #0c3d66;
  --parallel-blue-700: #0e5a92;
  --parallel-blue-600: #0f6db3;
  --parallel-blue-500: #1683d6;
}

body {
  background: #f7f8fb;
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar .brand-logo {
  display: block;
  width: 156px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.98;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-subtitle {
  color: var(--sidebar-muted);
  font-size: 0.9rem;
}

.sidebar-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-label {
  color: var(--sidebar-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  padding: 0.75rem 0.75rem;
  display: grid;
  gap: 0.25rem;
  flex: 1;
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link.active {
  background: rgba(13, 110, 253, 0.22);
  border: 1px solid rgba(13, 110, 253, 0.35);
}

.sidebar-footer {
  padding: 1rem 1.25rem 1.25rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content {
  padding: 1.25rem;
}

.kpi {
  background: #fff;
}

.chart-skeleton {
  height: 240px;
  background: linear-gradient(90deg, #f2f4f7 0%, #e9edf3 50%, #f2f4f7 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

@media (max-width: 991px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────────────────
   Auth (login) theme — friendly blue UI
   ────────────────────────────────────────────────────────────────────── */

body.theme-auth {
  background: radial-gradient(900px 500px at 20% 10%, rgba(22, 131, 214, 0.28), transparent 55%),
              radial-gradient(700px 460px at 85% 15%, rgba(15, 109, 179, 0.22), transparent 55%),
              linear-gradient(180deg, #f6fbff 0%, #f7f8fb 100%);
}

.theme-auth .auth-card {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(2, 25, 45, 0.14);
}

.theme-auth .auth-card .card-body {
  padding: 1.75rem;
}

.theme-auth .auth-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.theme-auth .auth-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(22,131,214,0.18), rgba(15,109,179,0.06));
  border: 1px solid rgba(15, 109, 179, 0.18);
  display: grid;
  place-items: center;
}

.theme-auth .auth-title {
  margin: 0;
  line-height: 1;
}

.theme-auth .auth-logo-img {
  display: block;
  width: min(220px, 64vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(2, 25, 45, 0.12));
}

.theme-auth .auth-subtitle {
  margin: 0;
  color: rgba(15, 23, 42, 0.62);
}

.theme-auth .btn-primary {
  background: linear-gradient(135deg, var(--parallel-blue-500), var(--parallel-blue-600));
  border: 0;
}

.theme-auth .btn-primary:hover {
  filter: brightness(0.98);
}

/* ──────────────────────────────────────────────────────────────────────
   Admin theme — blue sidebar + softer cards
   ────────────────────────────────────────────────────────────────────── */

body.theme-admin {
  --sidebar-bg: linear-gradient(180deg, #0b5fa0 0%, #0b3d66 100%);
  --sidebar-border: rgba(255, 255, 255, 0.16);
  --sidebar-text: rgba(255, 255, 255, 0.92);
  --sidebar-muted: rgba(255, 255, 255, 0.70);
  background: #f3f7fb;
}

/* ──────────────────────────────────────────────────────────────────────
   Main app theme — blue, friendly (for owners/occupants too)
   ────────────────────────────────────────────────────────────────────── */

body.theme-blue {
  --sidebar-bg: linear-gradient(180deg, #0b5fa0 0%, #0b3d66 100%);
  --sidebar-border: rgba(255, 255, 255, 0.16);
  --sidebar-text: rgba(255, 255, 255, 0.92);
  --sidebar-muted: rgba(255, 255, 255, 0.70);
  background: #f3f7fb;
}

.theme-blue .topbar {
  background: linear-gradient(90deg, rgba(11, 95, 160, 0.10), rgba(22, 131, 214, 0.06));
  border-bottom: 1px solid rgba(11, 95, 160, 0.14);
}

.theme-blue .card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(2, 25, 45, 0.06);
}

.theme-blue .sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-blue .sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
}

.theme-blue .btn-primary {
  background: linear-gradient(135deg, var(--parallel-blue-500), var(--parallel-blue-600));
  border: 0;
}

.theme-blue .btn-outline-primary {
  border-color: rgba(11, 95, 160, 0.30);
  color: rgba(11, 61, 102, 0.92);
}

.theme-blue .btn-outline-primary:hover {
  background: rgba(11, 95, 160, 0.08);
  border-color: rgba(11, 95, 160, 0.40);
  color: rgba(11, 61, 102, 1);
}

.theme-blue .badge.text-bg-secondary {
  background-color: rgba(11, 95, 160, 0.12) !important;
  color: #0b3d66 !important;
}

.theme-blue .comfort-metric {
  display: grid;
  gap: 0.35rem;
}

.theme-blue .comfort-metric .label {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.85rem;
}

.theme-blue .comfort-metric .value {
  font-weight: 800;
  font-size: 1.65rem;
  line-height: 1.05;
  color: rgba(11, 61, 102, 0.98);
}

.theme-blue .comfort-metric .sub {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.85rem;
}

.theme-blue .comfort-chart {
  margin-top: 0.4rem;
  border-radius: 14px;
  padding: 6px 8px;
  border: 1px solid rgba(11, 95, 160, 0.14);
  background: linear-gradient(180deg, rgba(11, 95, 160, 0.06), rgba(22, 131, 214, 0.03));
  overflow: hidden;
}

.theme-blue .comfort-chart-sm {
  padding: 5px 7px;
}

.theme-blue .mini-chart-svg {
  display: block;
  width: 100%;
  height: 64px;
}

.theme-blue .comfort-chart-sm .mini-chart-svg {
  height: 52px;
}

.theme-blue .comfort-zone-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.theme-blue .ppd-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.65), rgba(245, 158, 11, 0.60), rgba(239, 68, 68, 0.60));
  position: relative;
  overflow: hidden;
}

.theme-blue .ppd-bar .marker {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 20px;
  background: rgba(11, 61, 102, 0.9);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85);
  border-radius: 2px;
}

.theme-admin .topbar {
  background: linear-gradient(90deg, rgba(11, 95, 160, 0.10), rgba(22, 131, 214, 0.06));
  border-bottom: 1px solid rgba(11, 95, 160, 0.14);
}

.theme-admin .card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(2, 25, 45, 0.06);
}

.theme-admin .badge.text-bg-secondary {
  background-color: rgba(11, 95, 160, 0.12) !important;
  color: #0b3d66 !important;
}

.theme-admin .sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-admin .sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
}

.theme-admin .admin-shell {
  max-width: 1220px;
}

.theme-admin .admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.theme-admin .admin-title {
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.25rem;
}

.theme-admin .admin-subtitle {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.95rem;
}

.theme-admin .admin-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.theme-admin .admin-search {
  width: min(420px, 80vw);
}

.theme-admin .admin-divider {
  border-top: 1px solid rgba(11, 95, 160, 0.12);
  opacity: 1;
}

.theme-admin .admin-stat {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(246,251,255,1) 100%);
  position: relative;
  overflow: hidden;
}

.theme-admin .admin-stat:before {
  content: '';
  position: absolute;
  inset: -40% -30%;
  background: radial-gradient(circle at 30% 30%, rgba(22, 131, 214, 0.22), transparent 55%),
              radial-gradient(circle at 80% 20%, rgba(11, 95, 160, 0.18), transparent 50%);
  transform: rotate(-6deg);
  pointer-events: none;
}

.theme-admin .admin-stat .card-body {
  position: relative;
  z-index: 1;
}

.theme-admin .admin-stat-label {
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.85rem;
}

.theme-admin .admin-stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--parallel-blue-800);
  line-height: 1.05;
  margin-top: 0.25rem;
}

.theme-admin .admin-stat-foot {
  color: rgba(15, 23, 42, 0.58);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.theme-admin .admin-stat-accent .admin-stat-value {
  color: var(--parallel-blue-600);
}

.theme-admin .admin-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(11, 61, 102, 0.65);
  border-bottom: 1px solid rgba(11, 95, 160, 0.14);
}

.theme-admin .admin-table tbody td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.theme-admin .admin-pill {
  background: rgba(11, 95, 160, 0.10);
  color: rgba(11, 61, 102, 0.92);
  border: 1px solid rgba(11, 95, 160, 0.18);
  border-radius: 999px;
  font-weight: 600;
}

.theme-admin .btn-primary {
  background: linear-gradient(135deg, var(--parallel-blue-500), var(--parallel-blue-600));
  border: 0;
}

.theme-admin .btn-outline-primary {
  border-color: rgba(11, 95, 160, 0.30);
  color: rgba(11, 61, 102, 0.92);
}

.theme-admin .btn-outline-primary:hover {
  background: rgba(11, 95, 160, 0.08);
  border-color: rgba(11, 95, 160, 0.40);
  color: rgba(11, 61, 102, 1);
}


