/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sidebar-width: 16vw;
  --sidebar-min-width: 220px;
  --sidebar-max-width: 280px;
  --topbar-height: 56px;
  /* Teal / blue-gray palette — no red anywhere */
  --teal-600: #0e8a7a;
  --teal-500: #2cb5a0;
  --teal-400: #4fd1bc;
  --teal-100: #d4f5ef;
  --charcoal-900: #1e2328;
  --charcoal-800: #272d33;
  --charcoal-700: #333b44;
  --gray-100: #f4f6f8;
  --gray-200: #e4e8ec;
  --gray-300: #cdd4da;
  --gray-500: #7a8a97;
  --gray-900: #1a2633;
  --white: #ffffff;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html, body {
  height: 100vh;
  font-family: var(--font-stack);
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.5;
}

/* ===== Layout Shell ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  min-width: var(--sidebar-min-width);
  max-width: var(--sidebar-max-width);
  height: 100vh;
  background: var(--charcoal-900);
  color: var(--gray-200);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.main-wrapper {
  margin-left: clamp(var(--sidebar-min-width), var(--sidebar-width), var(--sidebar-max-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Sidebar ===== */
.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--charcoal-700);
}

.sidebar-logo { display: flex; align-items: center; gap: 0.6rem; }

.sidebar-title { font-size: 1.1rem; font-weight: 700; color: var(--white); letter-spacing: 0.02em; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.nav-item:hover { background: var(--charcoal-800); color: var(--white); }

.nav-item.active {
  background: var(--charcoal-700);
  color: var(--teal-400);
  border-left-color: var(--teal-500);
}

.nav-item svg { flex-shrink: 0; width: 20px; height: 20px; }

/* ===== Top Bar ===== */
.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 50;
}

.page-title { font-size: 1.15rem; font-weight: 600; color: var(--gray-900); }

.facility-selector { display: flex; align-items: center; gap: 0.5rem; }

.facility-label { font-size: 0.82rem; font-weight: 500; color: var(--gray-500); white-space: nowrap; }

.facility-dropdown {
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-family: var(--font-stack);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  min-width: 200px;
  outline: none;
  transition: border-color 0.15s;
}

.facility-dropdown:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 2px var(--teal-100);
}

/* ===== Main Content ===== */
.content { flex: 1; padding: 2rem; }

/* ===== Page Shell Cards ===== */
.page-shell { max-width: 720px; }

.page-shell h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.page-shell .page-description {
  font-size: 1rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.page-shell .page-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 2rem;
}

.page-shell .page-card p { color: var(--gray-500); font-size: 0.95rem; }

.page-shell .status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--teal-100);
  color: var(--teal-600);
  margin-bottom: 1rem;
}

/* ===== Sidebar Footer ===== */
.sidebar-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--charcoal-700); }

.logout-btn {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-stack);
  color: var(--gray-300);
  background: transparent;
  border: 1px solid var(--charcoal-700);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.logout-btn:hover { background: var(--charcoal-700); color: var(--white); }

.hidden { display: none !important; }
