/* responsive.css — Consolidated Viewport Breakpoints & Adaptive Layouts */

/* ==========================================================================
   1. Large Desktop & Dual-Monitor Scaling (Widescreen Breakpoints)
   ========================================================================== */

/* Large Desktop Displays (>= 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1620px;
    padding: 0 24px 24px 24px;
  }
}

/* Full HD, Dual-Monitor Workstations & 1080p Screens (>= 1920px) */
@media (min-width: 1920px) {
  .container {
    max-width: 1860px;
    padding: 0 32px 32px 32px;
  }

  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }

  .chart-row {
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 16px;
  }

  .chart-canvas-wrap {
    height: 350px;
  }

  .chart-canvas-wrap.tall {
    height: 420px;
  }

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

  .data-table thead th {
    font-size: 11.5px;
  }
}

/* 2K / QHD & Ultrawide Displays (>= 2400px) */
@media (min-width: 2400px) {
  .container {
    max-width: 2240px;
    padding: 0 40px 40px 40px;
  }

  .kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .chart-row {
    grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
  }

  .chart-canvas-wrap {
    height: 380px;
  }

  .chart-canvas-wrap.tall {
    height: 460px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 16px;
    font-size: 13.5px;
  }
}

/* ==========================================================================
   2. Laptop Vertical Adaptability (Short Screen Height Optimization)
   ========================================================================== */

/* Laptops with short viewports (1366x768, 1440x900, 1600x900) */
@media (max-height: 800px) {
  .dash-header {
    padding: 8px 16px;
    margin-bottom: 8px;
  }

  .sticky-lookup-card,
  #card-czhistory-header {
    padding: 10px 16px;
    top: 50px;
    margin-bottom: 10px;
  }

  .kpi-card {
    padding: 12px 16px;
  }

  .kpi-value {
    font-size: 21px;
    margin-bottom: 2px;
  }

  .kpi-label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .chart-container {
    padding: 12px 16px;
    margin-bottom: 10px;
  }

  .chart-canvas-wrap {
    height: 250px;
  }

  .chart-canvas-wrap.tall {
    height: 280px;
  }

  .table-scroll-wrap {
    min-height: 250px;
    max-height: calc(100vh - 210px);
  }

  .card {
    padding: 12px 16px;
    margin-bottom: 10px;
  }
}

/* Extra Compact Laptops / Small Windows (<= 700px height) */
@media (max-height: 700px) {
  .dash-header {
    padding: 6px 12px;
  }

  .sticky-lookup-card,
  #card-czhistory-header {
    padding: 8px 12px;
    top: 45px;
  }

  .table-scroll-wrap {
    min-height: 200px;
    max-height: calc(100vh - 180px);
  }

  .chart-canvas-wrap {
    height: 210px;
  }

  .chart-canvas-wrap.tall {
    height: 240px;
  }
}

/* ==========================================================================
   3. Tablet & Mobile Responsive Layouts
   ========================================================================== */

/* Tablet & Smaller Desktops (<= 960px) */
@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
  }
  .header-left {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* Tablets & Mobile Landscape (<= 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 8px 8px 8px;
  }

  .dash-header {
    border-radius: 0;
    margin-bottom: 12px;
    padding: 8px 12px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

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

  .chart-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .lookup-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .lookup-search-box {
    width: 100%;
  }

  .cust-nav-controls {
    justify-content: space-between;
    width: 100%;
  }

  .lookup-actions-right {
    width: 100%;
    justify-content: space-between;
  }

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

  .geo-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
  }
}

/* Mobile Portrait (<= 480px) */
@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
    gap: 2px;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
    font-size: 12px;
    padding: 6px 8px;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}
