:root {
  --bg: #eef2f8;
  --sidebar: #1f2b58;
  --sidebar-soft: #2d3b6c;
  --surface: #ffffff;
  --line: #d9e1ef;
  --line-strong: #c7d3e8;
  --ink: #151d2f;
  --muted: #576887;
  --accent: #2d57de;
  --accent-soft: #e7efff;
  --teal: #0a8a74;
  --teal-soft: #dbf4ef;
  --orange: #b76826;
  --orange-soft: #f9e9db;
  --danger: #b02f43;
  /* 4K 모니터 대응: 최대 너비를 화면의 96%로 넓혀서 꽉 차게 만듭니다 */
  --content-max: 96%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans KR", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .dashboard {
  display: none;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(155deg, #e6ecf7 0%, #d9e2f0 100%);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 26px 24px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: #244cb6;
}

.auth-card h2 {
  margin: 12px 0 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.auth-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.auth-form label {
  font-size: 12px;
  color: #5e6d8a;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #f9fbff;
  color: var(--ink);
  font-size: 16px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px;
  outline: none;
}

.auth-form input:focus {
  border-color: #6f8ceb;
  box-shadow: 0 0 0 3px rgba(71, 108, 223, 0.14);
}

.auth-submit {
  border: 1px solid #325cd8;
  background: linear-gradient(165deg, #3a67e8 0%, #264abb 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.auth-error {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
  color: var(--danger);
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #243364 0%, #1f2b58 100%);
  color: #d8e2ff;
  padding: 18px 14px;
  border-right: 1px solid #34477d;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #4a63a7;
}

.brand-title {
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: #98aadf;
  margin-top: 3px;
}

.menu-label {
  margin: 14px 8px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9db0e4;
  font-weight: 700;
}

.menu {
  display: grid;
  gap: 4px;
}

.menu a {
  padding: 9px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e1e8ff;
  font-size: 13px;
  font-weight: 600;
}

.menu a i {
  width: 14px;
  text-align: center;
  color: #93a8ff;
  font-size: 12px;
}

.menu a:hover,
.menu a.active {
  background: var(--sidebar-soft);
}

.sidebar-note {
  margin-top: 16px;
  border: 1px solid #3f538c;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  background: #293a6e;
  color: #d5e0ff;
}

.sidebar-note b {
  display: block;
  margin-bottom: 4px;
  color: #ffffff;
}

/* 콘텐츠 영역 전체 패딩을 넉넉하게 */
.content {
  padding: 24px 32px 40px;
  display: grid;
  grid-auto-rows: min-content;
  gap: 10px;
}

.content > .hero,
.content > .section {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

/* 박스들 내부 패딩을 큼직하게 */
.hero {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 32px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: #244cb6;
}

.hero-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* 폰트 큼직하게 (h1, p) */
.hero h1 {
  font-size: 40px;
  letter-spacing: -0.02em;
}

.hero p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-date {
  text-align: right;
  font-size: 13px;
  color: #5f6e8c;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.section {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 32px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

/* 폰트 큼직하게 (h2) */
.section-head h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-head p {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.section-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #f3f7ff;
  color: #2a52cb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.kpi-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi {
  border: 1px solid var(--line);
  background: #fbfdff;
  padding: 24px;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.kpi-top span {
  font-size: 15px;
  color: #5f6f8d;
  font-weight: 700;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: #2853d7;
  font-size: 12px;
}

.kpi-value {
  margin-top: 14px;
  font-family: "Manrope", sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-value .unit {
  font-size: 22px;
  font-weight: 700;
  margin-left: 4px;
}

.kpi-meta {
  margin-top: 10px;
  font-size: 14px;
  color: #546683;
  line-height: 1.45;
}

.kpi-meta b {
  color: var(--teal);
}

.split-2 {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.split-2-ratio {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
}

.panel {
  border: 1px solid var(--line);
  background: #fcfdff;
  padding: 24px;
}

.panel h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin-top: 10px;
  font-size: 15px;
  color: #5c6f90;
  line-height: 1.45;
}

/* 차트 높이 확대 */
.chart-wrap {
  margin-top: 20px;
  height: 380px;
}

.metric-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.metric-item {
  border: 1px solid var(--line);
  background: #f8fbff;
  padding: 9px;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #42557a;
  margin-bottom: 7px;
}

.metric-head b {
  font-size: 15px;
  color: #1f3152;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #dce4f2;
  overflow: hidden;
}

.meter > span {
  height: 100%;
  display: block;
  border-radius: inherit;
}

.flow-shorts {
  width: 43.1%;
  background: linear-gradient(90deg, #2d57de 0%, #6286f0 100%);
}

.flow-search {
  width: 41.1%;
  background: linear-gradient(90deg, #0b8b74 0%, #4ecab1 100%);
}

.flow-browse {
  width: 9.1%;
  background: linear-gradient(90deg, #b76826 0%, #e0a170 100%);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

/* 표 간격 및 폰트 크기 확대 */
th,
td {
  border-bottom: 1px solid #dbe4f2;
  padding: 16px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 15px;
  line-height: 1.4;
}

th {
  color: #657493;
  font-size: 14px;
}

.num {
  text-align: right;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.title-cell {
  color: #2552d7;
  font-weight: 700;
}

.growth {
  color: var(--teal);
  font-weight: 700;
}

.bullet {
  margin: 10px 0 0;
  padding-left: 20px;
}

.bullet li {
  margin-bottom: 7px;
  font-size: 14px;
  line-height: 1.45;
}

/* 파란색 성과 분석 및 향후 실행 전략 박스 */
article.panel.strategy {
  background: linear-gradient(165deg, #2f5fe4 0%, #244abf 100%);
  color: #eff3ff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 380px; /* 왼쪽 차트와 높이 동기화 */
  padding: 32px;
}

article.panel.strategy h3 {
  color: #ffffff;
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 16px;
}

article.panel.strategy ul {
  margin: 0;
  padding-left: 20px;
}

article.panel.strategy li {
  color: #ffffff;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 14px; /* 내용이 늘어나서 삐져나가지 않도록 간격 최적화 */
}

article.panel.strategy li:last-child {
  margin-bottom: 0;
}

.notice {
  border: 1px solid #e6c8b4;
  background: #fff8f3;
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #7f451e;
}

.contract-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.contract-kpi {
  border: 1px solid var(--line);
  background: #fbfdff;
  padding: 24px;
}

.contract-kpi span {
  display: block;
  font-size: 15px;
  color: #60708f;
  font-weight: 700;
}

.contract-kpi b {
  margin-top: 14px;
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 46px;
  line-height: 1.1;
}

.contract-detail {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #fcfdff;
  padding: 24px;
}

.progress-row {
  margin-top: 10px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #3f5276;
  margin-bottom: 7px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #dbe4f3;
  overflow: hidden;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-long {
  width: 96.4%;
  background: linear-gradient(90deg, #2d57de 0%, #6286f0 100%);
}

.bar-short {
  width: 100%;
  background: linear-gradient(90deg, #0b8b74 0%, #4ecab1 100%);
}

.bar-reedit {
  width: 100%;
  background: linear-gradient(90deg, #b76826 0%, #e0a170 100%);
}

/* --- 새로 추가된 반원형 차트 스타일 --- */
.doughnut-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
  padding: 0 20px;
}

.chart-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chart-box canvas {
  width: 100% !important;
  max-width: 280px;
  height: 180px !important;
}

.chart-box h4 {
  margin-top: -20px; /* 반원 차트 하단의 빈 공간을 메워줍니다 */
  font-size: 19px;
  color: #1f3152;
}

.chart-box p {
  margin-top: 8px;
  font-size: 15px;
  color: #5c6f90;
  line-height: 1.5;
}

.chart-box p b {
  color: #151d2f;
  font-size: 17px;
}
/* ------------------------------------- */

/* --- 성과 해석(Interpretation) 페이지 전용 4K 최적화 --- */
.qa-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px; /* 박스 사이 간격을 시원하게 */
}

.qa h4 {
  margin: 0;
  font-size: 22px; /* 제목 확대 */
  color: #1f3152;
}

.qa p {
  margin-top: 14px;
  font-size: 16px; /* 본문 확대 */
  color: #4f607f;
  line-height: 1.6;
}

.final-note {
  margin-top: 20px;
  border: 1px solid #c9d9f5;
  background: #edf3ff;
  padding: 32px; /* 4K 해상도에 맞춰 큼직하게 확대 */
  border-radius: 8px;
}

.final-note h4 {
  margin: 0;
  font-size: 24px; /* 결론 제목 돋보이게 */
  color: #1a3673;
}

.final-note .bullet {
  margin-top: 16px;
}

.final-note .bullet li {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: #2b3f66;
}
/* ---------------------------------------------------- */

.schedule-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 10px;
}

.date-option {
  border: 1px solid var(--line);
  background: #fbfdff;
  padding: 24px;
}

.date-option + .date-option {
  margin-top: 9px;
}

.date-option h4 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.date-option p {
  margin-top: 7px;
  color: #4d5f81;
  font-size: 15px;
  line-height: 1.5;
}

.calendar-box {
  border: 1px solid var(--line);
  background: #fcfdff;
  padding: 24px;
}

.calendar-box h4 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.calendar {
  margin-top: 10px;
}

.calendar th,
.calendar td {
  text-align: center;
  font-size: 20px;
  padding: 9px 8px;
}

.calendar-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.opt-a {
  background: var(--teal-soft);
  color: #0f806d;
}

.opt-b {
  background: var(--orange-soft);
  color: var(--orange);
}

.schedule-end {
  margin-top: 10px;
  border: 1px solid #c8d8f5;
  background: #edf3ff;
  padding: 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #34517d;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 23, 45, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(660px, 100%);
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal-head h3 {
  font-size: 19px;
}

.modal-close {
  border: 1px solid var(--line-strong);
  background: #f4f7fe;
  color: #3552a9;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.modal p {
  margin-top: 10px;
  color: #4f607f;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 1400px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #34477d;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-2,
  .split-2-ratio,
  .contract-grid,
  .qa-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  /* 하단에 휑하게 빈 흰색 공간이 남는 문제를 없애기 위해 높이 강제 설정을 auto로 변경 */
  body.page-overview .content > .section,
  body.page-contract .content > .section,
  body.page-interpretation .content > .section,
  body.page-schedule .content > .section {
    min-height: auto; 
  }
}

@media (max-width: 760px) {
  .content {
    padding: 10px;
  }

  .hero,
  .section {
    padding: 12px;
  }

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

  .hero h1 {
    font-size: 27px;
  }

  .hero p {
    font-size: 15px;
  }

  .hero-date {
    text-align: left;
  }

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

  .calendar th,
  .calendar td {
    font-size: 15px;
    padding: 8px 5px;
  }

  .calendar-dot {
    width: 30px;
    height: 30px;
  }

  .date-option h4,
  .calendar-box h4 {
    font-size: 22px;
  }
  
  /* 반원형 차트 모바일 대응 추가 */
  .doughnut-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media print {
  .dashboard {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 0;
  }

  .hero,
  .section,
  .panel,
  .date-option,
  .calendar-box,
  .contract-detail {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
