@media (max-width: 1200px) {
  .main {
    padding: 20px 20px 30px;
  }

  .grid.top-grid {
    grid-template-columns: 1fr;
  }

  .campaign-filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .filter-container {
    flex-wrap: wrap;
    gap: 9px;
    align-content: flex-end;
  }

  .filter-group {
    height: auto;
    min-height: 50px;
    min-width: 130px;
  }

  .filter-section {
    height: auto;
    min-height: 34px;
    gap: 6px;
    padding: 7px 10px;
    justify-content: space-around;
  }

  .filter-item {
    flex: 1;
    min-width: 65px;
  }

  .filter-section input[type="number"],
  .filter-section input[type="text"] {
    width: auto;
    min-width: 55px;
    max-width: 90px;
    height: auto;
    min-height: 24px;
    flex: 1;
  }

  .filter-section.range-section {
    justify-content: space-between;
  }

  .filter-actions {
    margin-left: 0;
    width: auto;
    justify-content: flex-end;
    height: auto;
    min-height: 50px;
  }

  .filter-actions .btn {
    height: auto;
    min-height: 34px;
    min-width: 80px;
  }

  .dashboard-grid.small {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .report-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
  }

  .brand {
    margin-bottom: 10px;
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .brand-title {
    font-size: 16px;
    line-height: 1.2;
  }

  .brand-sub {
    display: none;
  }

  .nav-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .nav-btn {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
  }

  .current-user-box {
    margin-top: 12px;
    padding: 10px 12px;
  }

  .dashboard-grid,
  .dashboard-grid.small {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .main {
    padding: 16px 16px 24px;
  }

  .sidebar {
    padding: 8px 10px;
  }

  .brand {
    margin-bottom: 8px;
  }

  .brand-title {
    font-size: 15px;
  }

  .nav-btn {
    padding: 9px 11px;
    font-size: 13px;
  }

  .current-user-box {
    display: none;
  }

  .two-col,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .table-toolbar,
  .bulk-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .bulk-actions .actions-wrap {
    width: 100%;
    justify-content: flex-start;
  }

  .bulk-search-input {
    width: 100%;
    min-width: 0;
  }

  .actions-row {
    width: 100%;
  }

  .video-edit-row {
    grid-template-columns: 1fr;
  }

  .filter-container {
    flex-wrap: wrap;
    gap: 6px;
    align-content: flex-end;
  }

  .filter-group {
    height: auto;
    min-height: auto;
    flex: none;
    min-width: auto;
  }

  .filter-section {
    height: auto;
    min-height: auto;
    gap: 4px;
    padding: 5px 8px;
    justify-content: space-around;
  }

  .filter-item {
    flex: 1;
    min-width: 50px;
    font-size: 11px;
  }

  .filter-section input[type="number"],
  .filter-section input[type="text"] {
    width: auto;
    min-width: 50px;
    max-width: 80px;
    height: auto;
    min-height: auto;
    padding: 4px 6px;
    flex: 1;
  }

  .filter-section.range-section {
    justify-content: space-between;
  }

  .filter-actions {
    height: auto;
    min-height: auto;
    margin-left: 0;
  }

  .filter-actions .btn {
    height: auto;
    min-height: auto;
    min-width: auto;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Reduce table cell widths on mobile */
  .name-cell {
    min-width: 100px;
  }

  .link-cell {
    min-width: 70px;
  }

  .contact-cell {
    min-width: 100px;
  }

  .number-cell {
    min-width: 60px;
  }

  .currency-cell {
    min-width: 70px;
  }

  .text-cell {
    min-width: 60px;
  }

  .note-cell {
    min-width: 70px;
  }

  .note-truncate {
    max-width: 80px;
  }
}

@media (max-width: 640px) {
  .detail-page {
    padding: 16px;
  }

  .dashboard-grid,
  .dashboard-grid.small,
  .grid.top-grid,
  .grid.two-col {
    grid-template-columns: 1fr;
  }

  .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .segment-control {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .segment-btn {
    text-align: center;
  }

  .modal-header,
  .modal-form,
  .modal-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .filter-section input[type="number"],
  .filter-section input[type="text"] {
    width: 100px;
  }
}