/* =============================================================
   RRM Responsive / Mobile Layout
   Mobile-first breakpoints:
     480px  — small phones
     768px  — tablets / large phones (landscape)
     1024px — tablets landscape / small laptops
     1280px — 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(--ink);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease);
}

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

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,35,24,.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--duration-base);
}

.sidebar-backdrop.visible {
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(26,35,24,.15);
  border-radius: 2px;
  margin: 14px auto 0;
  flex-shrink: 0;
}

.bottom-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 32px;
  -webkit-overflow-scrolling: touch;
}

.mobile-fab-fixed {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: var(--sage);
  color: var(--white);
  border: none;
  border-radius: var(--radius-xl);
  padding: 13px 20px;
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(107,148,120,.4);
  transition: background var(--duration-base);
}

.mobile-fab-fixed:hover { background: var(--sage-mid); }

.mobile-summary-sticky {
  position: sticky;
  top: var(--topbar-height);
  z-index: 40;
  background: var(--ink);
  padding: 8px 16px;
  display: none;
  overflow-x: auto;
  gap: 8px;
  scrollbar-width: none;
}

.mobile-summary-sticky::-webkit-scrollbar { display: none; }

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 0px;
    --content-pad: 20px;
  }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
    z-index: 101;
    transition: transform var(--duration-slow) var(--ease);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-backdrop {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
    margin-right: 8px;
  }

  .topbar {
    padding: 0 var(--content-pad);
  }

  .kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .grid-3-2,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .myDay-layout {
    grid-template-columns: 1fr;
  }

  .mobile-feed {
    height: auto;
    position: static;
    max-height: none;
  }

  .process-detail-pane {
    display: none;
  }

  .mobile-fab {
    display: none;
  }

  .mobile-fab-fixed {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  :root {
    --content-pad: 16px;
    --topbar-height: 76px;
  }

  html { font-size: 14px; }

  .page-title { font-size: 1.6rem; }
  .page-sub { font-size: .75rem; }

  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    padding: 10px 16px;
    gap: 10px;
  }

  .topbar-date { display: none; }

  .topbar-view-switcher .view-tab {
    padding: 4px 10px;
    font-size: .7rem;
  }

  .content {
    padding: 20px 16px;
  }

  .week-nav {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .week-nav::-webkit-scrollbar { display: none; }

  .week-day {
    min-width: 58px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .employee-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .timeline-strip {
    height: 36px;
  }

  .timeline-labels {
    display: none;
  }

  .panel-header,
  .panel-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .subtask-item,
  .comment-thread,
  .comment-input-row {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .kpi-strip,
  .employee-grid {
    grid-template-columns: 1fr;
  }

  .timeline-strip,
  .timeline-legend {
    display: none;
  }

  .topbar-view-switcher {
    max-width: 150px;
  }

  .topbar-actions .btn-ghost {
    padding: 5px 10px;
    font-size: .72rem;
  }
}
