/* ============================================================
   BRAAI & BEYOND — PORTAL RESPONSIVE CSS
   ============================================================ */

/* ── Hamburger button ── */
.portal-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 2000;
  width: 40px;
  height: 40px;
  background: #4B3619;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.portal-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.portal-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.portal-toggle.active span:nth-child(2) { opacity: 0; }
.portal-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Overlay ── */
.portal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1500;
}
.portal-overlay.active { display: block; }

/* ============================================================
   TABLET (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {

  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dashboard two column → one column */
  .portal-content > div[style*="grid-template-columns:1fr 340px"],
  .portal-content > div[style*="grid-template-columns:1fr 300px"],
  .portal-content > div[style*="grid-template-columns:1fr 320px"],
  .portal-content > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .portal-auth-card {
    max-width: 640px;
  }
}

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

  /* Show hamburger */
  .portal-toggle { display: flex; }

  /* Sidebar slides off screen */
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    z-index: 1600;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
  }

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

  /* Main takes full width */
  .portal-main {
    margin-left: 0;
    width: 100%;
  }

  /* Topbar */
  .portal-topbar {
    padding: 14px 16px 14px 68px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .portal-topbar-left h1 { font-size: 16px; }
  .portal-topbar-left p  { font-size: 12px; }

  .portal-date-badge { display: none; }

  /* Content padding */
  .portal-content { padding: 16px; }

  /* Stats grid */
  .portal-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .portal-stat-card { padding: 14px; }

  .portal-stat-card .stat-value { font-size: 20px; }

  /* All multi-column grids → single column */
  .portal-content > div[style*="grid-template-columns"],
  div[style*="grid-template-columns:1fr 340px"],
  div[style*="grid-template-columns:1fr 300px"],
  div[style*="grid-template-columns:1fr 320px"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Cards */
  .portal-card { padding: 16px; }

  /* Tables scrollable */
  .portal-card { overflow-x: auto; }

  .portal-table {
    min-width: 580px;
  }

  /* Month grid — smaller pills */
  .month-grid { gap: 5px; }

  .month-pill {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  /* Upload page */
  .upload-dropzone { padding: 20px 12px; }

  /* Auth pages */
  .portal-auth-card {
    flex-direction: column;
    max-width: 100%;
    border-radius: 12px;
  }

  .portal-auth-left {
    padding: 28px 24px;
  }

  .portal-auth-left .portal-auth-features {
    display: none;
  }

  .portal-auth-right {
    padding: 24px;
    max-height: none;
  }

  /* Sub type selector */
  .sub-type-selector { flex-direction: column; }

  /* Form rows → stack */
  .portal-form-row {
    flex-direction: column;
    gap: 0;
  }

  /* Group header card grid */
  .group-header-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px;
  }

  /* What happens next panel */
  .what-next-steps { gap: 10px; }

  /* Banner */
  .portal-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Modal */
  .portal-modal-box {
    padding: 24px 16px;
    margin: 0 12px;
    max-width: calc(100% - 24px);
  }

	.portal-toggle {
    transition: left 0.3s ease;
}

.portal-toggle.active {
    left: 200px;   /* Sidebar width (240px) + a little spacing */
}
}

/* ============================================================
   SMALL MOBILE (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {

  .portal-stats-grid {
    grid-template-columns: 1fr;
  }

  .portal-topbar-left h1 { font-size: 15px; }

  .portal-auth-left { padding: 20px 16px; }
  .portal-auth-right { padding: 20px 16px; }

  .group-header-card div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

	.portal-toggle {
    transition: left 0.3s ease;
}

.portal-toggle.active {
    left: 200px;   /* Sidebar width (240px) + a little spacing */
}
}