﻿@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px 16px;
    position: static;
    min-height: auto;
    max-height: none;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
  }

  .nav-section {
    min-width: 180px;
  }

  .workspace,
  .toolbar,
  .dashboard-grid,
  .metric-grid,
  .report-controls {
    grid-template-columns: 1fr;
  }

  .editor {
    position: static;
  }

  .work-view-modal {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    min-height: 0;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .editor.editor-modal {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    min-height: 0;
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .editor.editor-modal .editor-head {
    top: -16px;
    margin: -16px -16px 0;
    padding: 16px 16px 12px;
  }

  .editor.editor-modal .form-actions {
    bottom: -16px;
    margin: 8px -16px -16px;
    padding: 12px 16px 16px;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-user {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .topbar-user {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .topbar-profile {
    flex: 1 1 180px;
  }

  .primary-action,
  .secondary-action,
  .warning-action,
  .success-action,
  .danger-action {
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .task-item,
  .task-browser,
  .task-evidence-form,
  .task-actions,
  .file-upload-form,
  .budget-item-form,
  .cost-item-form,
  .budget-item-card,
  .file-browser {
    grid-template-columns: 1fr;
  }
}

