/* ── 기본 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  font-size: 14px;
  background: #f5f6fa;
  color: #2d2d2d;
}

/* ── 컨테이너 ── */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px 60px;
}

/* ── 제목 ── */
h1 {
  font-size: 22px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #2c3e50;
}

h2 {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin: 36px 0 12px;
  padding: 10px 14px;
  background: #eaf0fb;
  border-left: 5px solid #2980b9;
  border-radius: 3px;
}

h2.section2-title {
  margin-top: 52px;
}

/* ── 조회 폼 ── */
.search-form {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 8px;
}

.search-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #555;
}

.search-form select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  background: #fafafa;
  cursor: pointer;
}

.search-form select:focus { outline: none; border-color: #2980b9; }

.search-form button {
  padding: 7px 22px;
  background: #2980b9;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}

.search-form button:hover { background: #1f6391; }

/* ── 에러 박스 ── */
.error-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fdecea;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  color: #c0392b;
  font-weight: 600;
}

/* ── 데이터 없음 ── */
.no-data {
  text-align: center;
  padding: 30px 0;
  color: #888;
  font-size: 15px;
}

/* ── 테이블 래퍼 ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

/* ── 테이블 ── */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

/* ── 헤더 ── */
thead th {
  position: sticky;
  top: 0;
  background: #2c3e50;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 11px 12px;
  border-right: 1px solid #3d5166;
  white-space: nowrap;
  z-index: 10;
}

thead th:last-child { border-right: none; }

/* ── 기본 셀 ── */
td {
  padding: 8px 12px;
  border-bottom: 1px solid #e9ecef;
  border-right: 1px solid #e9ecef;
  white-space: nowrap;
}

td:last-child { border-right: none; }

/* ── 홀짝 줄 ── */
tr.row-odd  td { background: #fff; }
tr.row-even td { background: #f8f9fc; }

/* ── 정렬 ── */
td.center { text-align: center; }
td.right  { text-align: right;  font-variant-numeric: tabular-nums; }
td.phone-list { color: #555; font-size: 12px; }

/* ── 일자 구분선 ── */
tr.date-divider td {
  padding: 0;
  height: 4px;
  background: #d0d7de;
  border: none;
}

/* ── 일자 소계 행 ── */
tr.subtotal-row td {
  background: #f0f0f0 !important;
  font-weight: 700;
  color: #333;
  border-top: 1px solid #c8c8c8;
  border-bottom: 1px solid #c8c8c8;
}

/* ── 월 총계 / 전체 합계 행 ── */
tr.grand-total-row td {
  background: #2c3e50 !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  border-color: #3d5166;
}

tr.grand-total-row td.right {
  text-align: right;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
  h1 { font-size: 18px; }
  .search-form { flex-wrap: wrap; }
  td, th { padding: 7px 8px; font-size: 12px; }
}

/* ── 인쇄 ── */
@media print {
  body { background: #fff; font-size: 11px; }
  .search-form, button { display: none; }
  .container { margin: 0; padding: 0; max-width: 100%; }
  .table-wrap { box-shadow: none; overflow: visible; }
  thead th { background: #444 !important; -webkit-print-color-adjust: exact; }
  tr.subtotal-row td { background: #e0e0e0 !important; -webkit-print-color-adjust: exact; }
  tr.grand-total-row td { background: #2c3e50 !important; color: #fff !important; -webkit-print-color-adjust: exact; }
  h2 { page-break-before: auto; }
}

/* 고유 dst 건수 50 이상 강조 */
.dst-warning {
  color: #e74c3c;
  font-weight: 700;
}

/* 섹션 2 고유 dst 건수 경고 색상 */
.dst-orange {
  color: #e67e22;
  font-weight: 700;
}

.dst-red {
  color: #e74c3c;
  font-weight: 700;
}