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

.app-shell {
  overflow-x: hidden;
  max-width: 100%;
}

.main-content {
  overflow-x: hidden;
  max-width: 100%;
  min-width: 0;
}

.screen {
  overflow-x: hidden;
  max-width: 100%;
}

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

  :root { --sidebar-w: 60px; }

  .main-content { padding: 32px 24px; }

  .sidebar-header { padding: 20px 0; display: flex; justify-content: center; align-items: center; }
  .logo-text      { display: none; }
  .studio-name    { display: none; }

  .nav-item       { padding: 14px 0; justify-content: center; }
  .nav-label      { display: none; }
  .nav-icon       { width: 20px; }
  .nav-icon svg   { width: 18px; height: 18px; }

  .sidebar-footer { padding: 16px 0; justify-content: center; }
  .user-info      { display: none; }

  .stat-cards      { grid-template-columns: repeat(2, 1fr); }
  .milestone-cards { grid-template-columns: repeat(2, 1fr); }
  .board           { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   RESPONSIVE — MOBILE (max 640px)
============================================================ */
@media (max-width: 640px) {

  :root { --sidebar-w: 52px; }

  .main-content {
    padding: 20px 14px;
    width: calc(100% - 52px);
    min-width: 0;
    overflow-x: hidden;
  }

  .screen {
    width: 100%;
    min-width: 0;
  }

  .milestone-card {
    min-width: 0;
    width: 100%;
  }

  .milestone-cards {
    width: 100%;
    min-width: 0;
  }

  /* ---- SIDEBAR ---- */
  .nav-icon svg { width: 16px; height: 16px; }

  /* ---- TYPOGRAPHY ---- */
  .page-title    { font-size: 20px; }
  .project-title { font-size: 28px; }
  .stat-value    { font-size: 32px; }

  /* ---- OVERVIEW ---- */
  .stat-cards { grid-template-columns: 1fr; }
  .two-col    { grid-template-columns: 1fr; }
  .team-list  { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* ---- TASK BOARD ---- */
  .filter-bar   { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-group { flex-wrap: wrap; }
  .board        { grid-template-columns: 1fr; overflow-x: visible; }
  .board-column { width: 100%; }

  /* ---- MILESTONE TRACKER ---- */
  .timeline-section { overflow: visible; padding: 16px 0; }

  .timeline-track-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
    width: 100%;
  }

  .timeline-track {
    min-width: 520px;
    width: max-content;
    padding: 0 16px;
  }

  .milestone-cards {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .milestone-card {
    width: 100%;
  }

  /* ---- BUG LOG ---- */
  .bug-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .bug-search      { min-width: 100%; order: 1; }
  .bug-filters     { display: flex; flex-wrap: wrap; gap: 6px; order: 2; flex: 1; }
  .filter-dropdown { flex: 1; min-width: 100px; }
  .btn--primary    { order: 3; white-space: nowrap; }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .bug-table {
    min-width: 560px;
    width: max-content;
    table-layout: auto;
  }

  .bug-table td { padding: 0 10px; }
  .bug-table th { padding: 12px 10px; }

  .severity-badge,
  .status-badge   { font-size: 10px; padding: 2px 5px; }

  .col-title { max-width: 150px; }
  .bug-title-link {
    display: block;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* ---- TEAM ---- */
  .team-grid { grid-template-columns: 1fr; }

  /* ---- SETTINGS ---- */
  .settings-content { max-width: 100%; }
}