/* ============================================
   Responsive Design - Architectural Luxury Theme
   ============================================ */

/* Tablet landscape (1180px) */
@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 280px 1fr;
  }

  .metric-grid,
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-hero,
  .insight-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-main {
    padding: 16px;
  }

  .metric-card {
    min-height: 100px;
    padding: 14px;
  }
}

/* Tablet portrait (980px) */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .project-list {
    max-height: none;
    overflow: visible;
  }

  .workspace {
    height: auto;
    overflow: visible;
    padding: 20px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .role-switch {
    width: 100%;
    overflow-x: auto;
  }

  .role-button {
    flex: 1 0 100px;
  }

  .summary-strip,
  .metric-grid,
  .source-matrix,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-button {
    flex: 0 0 130px;
    font-size: 12px;
  }

  .data-table {
    min-width: 600px;
  }

  .summary-card {
    min-height: 90px;
    padding: 14px;
  }

  .summary-card strong {
    font-size: 24px;
  }

  .hero-main h2 {
    font-size: 22px;
  }
}

/* Mobile (560px) */
@media (max-width: 560px) {
  .sidebar,
  .workspace {
    padding: 12px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .hero-title-row,
  .section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .hero-main h2,
  .topbar h2 {
    font-size: 20px;
  }

  .summary-card strong,
  .metric-card strong {
    font-size: 22px;
  }

  .summary-strip {
    gap: 8px;
  }

  .summary-card {
    min-height: 80px;
    padding: 12px;
  }

  .metric-card {
    min-height: 90px;
    padding: 12px;
  }

  .brand-block {
    padding: 12px;
  }

  .brand-block h1 {
    font-size: 14px;
  }

  .side-section {
    padding: 12px;
  }

  .content-grid {
    gap: 12px;
  }

  .form-card,
  .table-card,
  .note-card {
    padding: 14px;
  }

  .tab-content {
    padding: 14px;
  }

  .action-row {
    flex-wrap: wrap;
  }

  .outline-button,
  .primary-button {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }

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

  .photo-tile {
    height: 60px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline-item time {
    font-size: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 11px;
  }

  .field-grid {
    gap: 10px;
  }

  .field input,
  .field textarea {
    min-height: 34px;
    font-size: 12px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

/* ============================================
   Dashboard Responsive
   ============================================ */

/* Tablet landscape (1180px) */
@media (max-width: 1180px) {
  .dashboard-kpi {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

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

/* Tablet portrait (980px) */
@media (max-width: 980px) {
  .page-nav {
    width: 100%;
  }

  .nav-button {
    flex: 1;
    text-align: center;
  }

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

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .bar-item {
    grid-template-columns: 60px 1fr 50px;
  }

  .donut-chart {
    width: 160px;
    height: 160px;
  }
}

/* Mobile (560px) */
@media (max-width: 560px) {
  .dashboard-kpi {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 22px;
  }

  .chart-card {
    padding: 14px;
  }

  .chart-header {
    flex-direction: column;
    gap: 10px;
  }

  .trend-legend {
    flex-wrap: wrap;
    gap: 8px;
  }

  .donut-chart {
    width: 140px;
    height: 140px;
  }

  .donut-labels {
    gap: 8px;
  }

  .ranking-tabs {
    width: 100%;
  }

  .ranking-tab {
    flex: 1;
    text-align: center;
  }

  .risk-alert-item {
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    padding: 10px;
  }

  .risk-alert-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .risk-alert-count {
    font-size: 18px;
  }

  .ranking-item {
    padding: 8px 10px;
  }

  .ranking-value {
    font-size: 14px;
  }

  .project-grid-card {
    padding: 14px;
  }

  .project-stat strong {
    font-size: 16px;
  }
}
