/* ============================================================
   Shared responsive layer for all Lesame Health Station pages.
   Loaded after each page's own stylesheet so it can adapt the
   existing design for small/medium screens without having to
   rewrite every page's CSS individually.
   ============================================================ */

/* ---- Global safety net ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ---- Responsive tables: scroll only inside the table, never the page ---- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
}

.table-responsive table {
  width: 100%;
  margin-top: 0;
}

@media (max-width: 768px) {
  .table-responsive th,
  .table-responsive td {
    white-space: nowrap;
  }
}

/* ---- Modals: keep dialogs fully on-screen on small phones ---- */
@media (max-width: 480px) {
  .modal-content {
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============================================================
   Sidebar navigation: collapsible hamburger menu on tablets and
   phones, unchanged docked sidebar on laptops/desktops.
   ============================================================ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: #2E7D32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }

  .staff-layout {
    padding: 15px;
    padding-top: 72px;
  }

  .staff-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(280px, 80vw);
    flex-direction: column;
    flex-wrap: nowrap;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1050;
    overflow-y: auto;
  }

  .staff-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .staff-main {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .staff-layout {
    padding: 10px;
    padding-top: 68px;
  }
}

/* ---- Shared clinic filter bar (super_admin pages that list data
   across multiple clinics) ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.filter-bar label {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.filter-bar select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  min-width: 180px;
}

/* ---- Tighten the shared .container padding on very small phones ----
   (equal specificity to each page's own ".container" rule; wins because
   this stylesheet is loaded last on every page) */
@media (max-width: 480px) {
  .container {
    padding: 20px 16px;
  }
}

