/* ====================== */
/* HAMBURGER BUTTON       */
/* ====================== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  background: #161b22;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  line-height: 0;
}

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

/* ====================== */
/* MOBILE BREAKPOINT      */
/* ====================== */
@media (max-width: 768px) {

  /* --- Sidebar Toggle --- */
  .sidebar-toggle {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 50;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }

  /* --- Main Content --- */
  .main-content {
    margin-left: 0 !important;
    padding: 16px !important;
    padding-top: 56px !important;
  }

  /* --- Modals --- */
  .modal {
    min-width: unset !important;
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 10px;
    padding: 16px !important;
  }

  /* --- Tables --- */
  table {
    font-size: 13px;
  }
  th, td {
    padding: 8px 6px;
  }

  /* --- Page Headers (title + button rows) --- */
  .main-content > div:first-child {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* --- Page Titles --- */
  h2 {
    font-size: 1.25rem !important;
  }

  /* --- Toast Notifications --- */
  .toast {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    width: auto !important;
  }

  /* --- Card Padding --- */
  .card {
    padding: 14px;
  }

  /* --- Calendar: horizontal scroll --- */
  #calendarGrid {
    grid-template-columns: repeat(7, minmax(200px, 1fr)) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  #calendarGrid > .day-card {
    scroll-snap-align: start;
    min-height: 180px;
  }
  #overviewView .card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #overviewTable {
    min-width: 600px;
  }

  /* --- Generate Page: form layout --- */
  .option-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .option-label {
    min-width: unset !important;
  }
  .checkbox-grid {
    grid-template-columns: 1fr !important;
  }
  .hook-grid {
    grid-template-columns: 1fr !important;
  }
  .options-grid {
    display: flex !important;
    flex-direction: column;
  }
  .radio-group {
    gap: 6px;
  }
  .radio-item {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* --- Analytics Page: grids --- */
  .overview-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .charts-grid {
    grid-template-columns: 1fr !important;
  }
  .snapshot-form-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .multi-select-wrapper {
    min-width: unset !important;
  }

  /* --- Accounts Page --- */
  .filter-bar {
    flex-direction: column;
    align-items: stretch !important;
  }
  .filter-bar select {
    min-width: unset !important;
    width: 100%;
  }

  /* --- Fixed-width selects --- */
  select[style*="width: 220px"],
  select[style*="width:220px"],
  select[style*="width: 160px"],
  select[style*="width:160px"] {
    width: 100% !important;
  }
}
