
/* ============================================================
   Subida Founder Hub — Responsive CSS
   Breakpoints: 768px (tablet), 480px (phone)
   ============================================================ */

/* ── Hamburger Button (hidden on desktop) ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary, #0B1F4B);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar overlay on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 149;
}

/* ============================================================
   TABLET — 768px
   ============================================================ */
@media (max-width: 768px) {

  /* Show hamburger */
  .hamburger { display: flex; }

  /* Sidebar: off-canvas */
  .sidebar,
  [class*="sidebar"],
  nav.sidebar,
  #sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 150;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  .sidebar.open,
  #sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  /* Main content — full width */
  .main-content,
  [class*="main-content"],
  main,
  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Kanban: stack columns */
  .kanban,
  [class*="kanban"],
  .board,
  [class*="board-columns"] {
    flex-direction: column !important;
    gap: 16px !important;
  }
  .kanban-column,
  [class*="kanban-col"],
  [class*="board-col"] {
    min-width: unset !important;
    width: 100% !important;
  }

  /* Workstream cards → full width list */
  .workstream-grid,
  [class*="workstream-grid"],
  .cards-grid,
  [class*="cards-grid"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
  .workstream-card,
  [class*="workstream-card"],
  .card {
    width: 100% !important;
    max-width: unset !important;
  }

  /* Tables: horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Page padding */
  .page, [class*="page-content"], main {
    padding: 16px !important;
  }

  /* Page header flex wrap */
  .page-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Gantt → Liste */
  .gantt,
  [class*="gantt"],
  [class*="timeline-chart"] {
    display: none !important;
  }
  .gantt-mobile-fallback {
    display: block !important;
  }

  /* Topbar */
  .topbar [class*="topbar-actions"] .btn-text {
    display: none;
  }
  .topbar [class*="create-task"],
  .topbar [class*="new-task"] {
    display: none;
  }
}

/* ============================================================
   PHONE — 480px
   ============================================================ */
@media (max-width: 480px) {

  body { font-size: 14px; }

  /* Task modal → fullscreen */
  .modal,
  [class*="modal-content"],
  [class*="task-modal"] {
    position: fixed !important;
    inset: 0 !important;
    max-width: unset !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow-y: auto;
  }
  .modal-overlay,
  [class*="modal-overlay"] {
    align-items: flex-start !important;
    padding: 0 !important;
  }

  /* Touch-friendly tap targets */
  a, button, [role="button"],
  .btn, input[type="checkbox"],
  input[type="radio"],
  select {
    min-height: 44px;
    min-width: 44px;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
  }

  /* Files sidebar: hide by default, toggleable */
  .files-sidebar,
  [class*="files-sidebar"],
  [class*="doc-sidebar"] {
    display: none;
  }
  .files-sidebar.show,
  [class*="files-sidebar"].show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 160;
    overflow-y: auto;
  }

  /* Calendar grid: day min-height shrink */
  .cal-day { min-height: 60px; }
  .cal-weekdays div { font-size: 10px; padding: 6px 2px; }

  /* Form rows → stack */
  .form-row { grid-template-columns: 1fr !important; }

  /* Topbar: minimal */
  .topbar { padding: 0 12px !important; }
  .topbar h1, .topbar [class*="logo-text"] { font-size: 16px !important; }

  /* Card padding */
  .card, [class*="-card"] { padding: 14px !important; }
}

/* ============================================================
   Gantt mobile fallback (shown instead of gantt on mobile)
   ============================================================ */
.gantt-mobile-fallback {
  display: none;
}
.gantt-mobile-fallback .gm-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #E5E9F0);
  font-size: 14px;
}
.gm-item-title { font-weight: 500; }
.gm-item-date { color: var(--muted, #6B7280); font-size: 12px; }

/* ============================================================
   PWA Standalone padding (notch-safe)
   ============================================================ */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
  body    { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
