/**
 * JungFoodKorea ERP — MRP Drilldown Dashboard Responsive Stylesheet
 * File: mrp/dashboard.responsive.css
 *
 * Responsive layout rules, breakpoints (1100px, 768px, 480px) and
 * 390px mobile horizontal overflow defense specifications for the MRP dashboard.
 * Loaded after mrp/dashboard.css to apply media query overrides and container constraints.
 */

/* ───────────────────────────────────────────────────────────────────────────
 * [반응형 레이아웃 및 390px 가로 오버플로우 방어 규격]
 * ─────────────────────────────────────────────────────────────────────────── */
.erp-main-layout {
  align-items: stretch !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.content-main,
#screen-mrp,
#mrpDrilldownSection,
.jfk-mrp-drilldown {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#jfkMrpBreadcrumb,
#jfkMrpKpiSection,
#jfkMrpChartSection,
#jfkMrpSummarySection,
#jfkMrpMonthlySection,
#jfkMrpDailySection {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* 1. KPI 섹션 반응형 */
.jfk-kpi-grid,
.jfk-mrp-kpi-grid,
#jfkMrpKpiSection {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 1100px) {
  .jfk-kpi-grid,
  .jfk-mrp-kpi-grid,
  #jfkMrpKpiSection {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .jfk-kpi-grid,
  .jfk-mrp-kpi-grid,
  #jfkMrpKpiSection {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .jfk-kpi-grid,
  .jfk-mrp-kpi-grid,
  #jfkMrpKpiSection {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* 2. 차트 패널 반응형 */
.jfk-chart-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.jfk-chart-svg-wrap {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  touch-action: pan-y;
  box-sizing: border-box !important;
}

/* 3. 자재 요약 테이블 섹션 반응형 */
.jfk-mrp-summary-wrapper,
.jfk-table-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.jfk-mrp-toolbar,
.jfk-table-header-bar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.jfk-mrp-table-scroll-wrap,
.jfk-table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

.jfk-mrp-table {
  min-width: 980px;
  box-sizing: border-box;
}

/* 4. 월별 비교 대시보드 섹션 반응형 */
.jfk-mrp-monthly-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.jfk-mrp-monthly-toolbar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .jfk-mrp-monthly-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .jfk-mrp-monthly-tools-left,
  .jfk-mrp-monthly-tools-right {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
  }
}

.jfk-mrp-kpi-ribbon {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
}

@media (max-width: 480px) {
  .jfk-mrp-kpi-ribbon {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.jfk-mrp-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

.jfk-mrp-table {
  min-width: 820px;
}

/* 5. 일별 작업지시 섹션 반응형 */
.jfk-daily-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.jfk-daily-header {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .jfk-daily-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .jfk-daily-controls {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }
  .jfk-daily-input,
  .jfk-daily-select {
    flex: 1 1 120px !important;
  }
}

.jfk-daily-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
}

.jfk-daily-table {
  min-width: 760px;
}
