/* /stat/daily — PC 일간 브리핑 (08:00 스냅샷) */

/* 본문 mount: dashboard-content 안에 .mstat-root 있을 때만 표시 */
#daily-stat-mount.mstat-mount {
  display: none;
  padding: 0 20px 28px;
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
}

body:has(#dashboard-content .mstat-root) #daily-stat-mount.mstat-mount {
  display: block !important;
}

.mstat-page {
  padding: 12px 20px 28px;
  max-width: 1600px;
  margin: 0 auto;
}

.mstat-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.mstat-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.mstat-range {
  font-size: 13px;
  color: #475569;
}

.mstat-range strong {
  color: #0f172a;
  font-weight: 700;
}

.mstat-range-arr {
  margin: 0 6px;
  color: #94a3b8;
}

.mstat-range-kst {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 4px;
}

.mstat-viewed {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.mstat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 11px;
  color: #64748b;
}

.mstat-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mstat-legend-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
}

.mstat-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.mstat-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13px;
}

.mstat-th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 10px 8px;
  text-align: center;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

/* 피벗: 첫 열=지표(고정), 가로=구역 */
.mstat-th--metric {
  left: 0;
  z-index: 3;
  text-align: left;
  min-width: 88px;
  padding-left: 14px;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

.mstat-th--region {
  min-width: 108px;
}

.mstat-th--total-col {
  background: #eef2ff;
  color: #1e3a8a;
}

.mstat-metric-label {
  display: inline-block;
  font-weight: 700;
  color: #0f172a;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--mstat-accent, #64748b);
}

.mstat-tr--metric:nth-child(even) {
  background: #fafbfc;
}

.mstat-td {
  border-bottom: 1px solid #f1f5f9;
  padding: 6px 6px;
  vertical-align: middle;
  text-align: center;
}

.mstat-td--metric {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  text-align: left;
  padding-left: 14px;
  white-space: nowrap;
  box-shadow: 2px 0 4px rgba(15, 23, 42, 0.04);
}

.mstat-tr--metric:nth-child(even) .mstat-td--metric {
  background: #fafbfc;
}

.mstat-td--total-col {
  background: #f8fafc;
}

.mstat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 118px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: default;
  font: inherit;
}

.mstat-cell--click {
  cursor: pointer;
}

.mstat-cell--click:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mstat-cell:disabled {
  opacity: 1;
}

.mstat-nums {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.2;
}

.mstat-num--prev {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.mstat-num-arr {
  font-size: 10px;
  color: #cbd5e1;
}

.mstat-num--curr {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.mstat-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.mstat-delta {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.mstat-delta--up {
  background: #fee2e2;
  color: #991b1b;
}

.mstat-delta--down {
  background: #dcfce7;
  color: #166534;
}

.mstat-delta--zero {
  background: #f3f4f6;
  color: #6b7280;
}

.mstat-drill-hint {
  font-size: 10px;
  color: #64748b;
}

.mstat-empty {
  text-align: center;
  padding: 48px 24px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.mstat-empty-ico {
  margin-bottom: 12px;
}

.mstat-empty-msg {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 8px;
}

.mstat-empty-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

.mstat-notes {
  margin-top: 16px;
}

.mstat-md-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.mstat-md-sub {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.mstat-md-sec {
  margin-bottom: 20px;
}

.mstat-md-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.mstat-md-sec-note {
  font-size: 11px;
  color: #64748b;
  margin: -4px 0 8px;
  line-height: 1.45;
}

.mstat-md-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.mstat-md-table th {
  background: #f8fafc;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.mstat-md-table td {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.mstat-md-recv {
  white-space: nowrap;
  color: #64748b;
}

.mstat-md-site {
  font-weight: 600;
  min-width: 120px;
  max-width: 200px;
}

.mstat-md-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  max-width: 100%;
}

.mstat-md-open-btn:hover .mstat-md-site-link {
  color: #1d4ed8;
  text-decoration: underline;
}

.mstat-md-site-link {
  font-weight: 600;
  color: #334155;
}

.mstat-md-more {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.mstat-md-tr--click:hover {
  background: #f8fafc;
}

/* PC: 기본 .modal(2000)보다 위 — 일간 증감 모달 위에 장애 상세 */
@media screen and (min-width: 801px) {
  #detail-modal.modal[style*="flex"] {
    z-index: 2030 !important;
  }
}

/* 모바일: .modal 전역 10180 — 상세보기는 증감 모달보다 한 단계 위 */
@media screen and (max-width: 800px) {
  #daily-stat-detail-modal.modal[style*="flex"] {
    z-index: 10180 !important;
  }
  #detail-modal.modal[style*="flex"] {
    z-index: 10220 !important;
  }
}

.mstat-md-desc,
.mstat-md-result {
  max-width: 240px;
  color: #475569;
  line-height: 1.45;
  word-break: break-word;
}

.mstat-md-st,
.mstat-md-assign {
  white-space: nowrap;
}

/* 전역 layout_root 모달 — 화면 중앙 (dashboard-content 밖) */
.mstat-detail-modal-content.modal-content {
  max-width: 1140px;
  width: 96%;
}

@media (min-width: 1200px) {
  .mstat-page {
    padding: 16px 28px 32px;
  }
  .mstat-num--curr {
    font-size: 20px;
  }
}
