/* ===== ASGG ASGG · 공정표 디자인 통일 스킨 (메인과 한 세트) =====
   추가일: 2026-07-16 · 메인(현장리스트) 톤(Pretendard / #F7F6F3 / #0075de)에 맞춤.
   아래 블록은 기존 규칙 위에 얹히며(!important), 원본 규칙은 그대로 보존됨.
   되돌리려면 이 블록(다음 주석 전까지)만 삭제하거나 styles.zip 백업으로 복원. */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');

:root{
  --asgg-bg:#F7F6F3;
  --asgg-ink:rgba(0,0,0,.95);
  --asgg-line:rgba(0,0,0,.10);
  --asgg-accent:#0075de;
  --asgg-muted:#64748b;
}
html, body,
.excel-app, .sheet-toolbar, .sheet-frame, .sheet-cell,
.sheet-toolbar button, .sheet-toolbar select, .sheet-toolbar input,
.project-info-label{
  font-family:'Pretendard','Apple SD Gothic Neo',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
}
body, .excel-app{ background:var(--asgg-bg) !important; }
.sheet-toolbar{
  background:#fff !important;
  border-bottom:1px solid var(--asgg-line) !important;
  box-shadow:none !important;
}
.sheet-toolbar button:not(.marker-color),
.sheet-toolbar select,
.sheet-toolbar input{
  border-radius:8px !important;
  border:1px solid var(--asgg-line) !important;
  background:#fff !important;
  color:var(--asgg-ink) !important;
}
.sheet-toolbar button:not(.marker-color):hover{ background:#f4f4f2 !important; }
.sheet-toolbar .is-active:not(.marker-color){
  background:var(--asgg-accent) !important;
  color:#fff !important;
  border-color:var(--asgg-accent) !important;
}
.sheet-toolbar .marker-color{ border-radius:50% !important; }
.sheet-toolbar .marker-color.is-active{
  box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--asgg-accent) !important;
  border-color:var(--asgg-accent) !important;
}
.sheet-toolbar .danger-action, .toolbar-actions button.danger-action{ color:#dc2626 !important; }
.edit-status{ background:#fff !important; color:var(--asgg-muted) !important; }
.sheet-frame{
  background:#fff !important;
  border:1px solid var(--asgg-line) !important;
  border-radius:14px !important;
  margin:16px !important;
  box-shadow:0 1px 2px rgba(0,0,0,.04) !important;
  overflow:auto !important;
}
.sheet-cell.project-info-label{ color:var(--asgg-muted) !important; }

/* 주말 강조 셀: 튀는 주황(#FCD5B4)을 차분한 웜톤으로 낮춤 */
.sheet-cell[style*="252, 213, 180"]{ background-color:#F1E7D9 !important; }

/* 브랜드 로고: 메인(Pretendard 700, near-black)과 톤 통일 */
.schedule-brand-text strong{
  font-weight:700 !important;
  letter-spacing:0 !important;
  color:var(--asgg-ink) !important;
}
.schedule-brand-text small{ color:var(--asgg-muted) !important; }
.schedule-brand-mark{
  border-color:var(--asgg-line) !important;
  color:var(--asgg-ink) !important;
  font-weight:800 !important;
}

/* PROJECT SCHEDULE 헤더: 카드 톤 + 액센트 바 */
.schedule-project-heading{
  border:1px solid var(--asgg-line) !important;
  border-left:4px solid var(--asgg-accent) !important;
  border-radius:10px !important;
}
.schedule-project-heading h1{
  font-weight:800 !important;
  letter-spacing:-0.02em !important;
  color:var(--asgg-ink) !important;
}
.schedule-project-kicker{ color:var(--asgg-muted) !important; }
/* ===== 통일 스킨 끝 · 이하 원본 styles.css 원본 규칙 ===== */

:root {
  --page: #e8edf2;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #687385;
  --line: #cfd6df;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.excel-app {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.sheet-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  min-height: 72px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.schedule-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #111827;
  text-decoration: none;
}

.schedule-brand-link:hover .schedule-brand-mark {
  border-color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.schedule-brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.06em;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.schedule-brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.05;
}

.schedule-brand-text strong {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.schedule-brand-text small {
  display: block;
  color: #6b7280;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.toolbar-actions > * {
  flex: 0 0 auto;
}

.toolbar-actions label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar-actions input,
.toolbar-actions select {
  height: 32px;
  border: 1px solid #cbd3dc;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-size: 11.5px;
}

.toolbar-actions select {
  min-width: 260px;
  max-width: 360px;
  font-weight: 700;
}

.project-picker-control {
  min-width: 260px;
}

.project-picker-control select {
  width: 360px;
}

.toolbar-actions input[type="date"] {
  width: 128px;
}

.toolbar-actions .print-scale-control input {
  width: 58px;
  text-align: right;
}

.toolbar-actions button {
  height: 32px;
  border: 1px solid #cbd3dc;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  padding: 0 8px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar-actions button:hover {
  border-color: #667085;
}

.toolbar-actions button.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.toolbar-actions button.danger-action {
  border-color: #fecaca;
  color: #b91c1c;
}

.toolbar-actions button.danger-action:hover {
  border-color: #ef4444;
  background: #fff1f2;
}

@media (max-width: 1180px) {
  .sheet-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .sheet-toolbar {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .schedule-brand-link {
    gap: 12px;
  }

  .schedule-brand-mark {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 8px;
    font-size: 10px;
  }

  .schedule-brand-text strong {
    font-size: 15px;
  }

  .schedule-brand-text small {
    font-size: 8px;
  }

  .toolbar-actions {
    grid-column: auto;
  }
}

.marker-colors,
.text-align-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.text-align-tools {
  padding-left: 4px;
}

.toolbar-actions .text-align-tools button {
  min-width: 42px;
  padding: 0 7px;
}

.toolbar-actions .text-align-tools button.is-active {
  border-color: #111827;
  background: #111827;
  color: #fff;
}

.toolbar-actions .marker-color {
  width: 20px;
  height: 20px;
  border: 1px solid #9aa4b2;
  border-radius: 50%;
  background: var(--marker-color);
  padding: 0;
}

.toolbar-actions .marker-color.is-active {
  border-color: #111827;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px #111827;
}

.edit-status {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #f7f9fb;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.sheet-frame {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.schedule-project-heading {
  position: sticky;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-width: 720px;
  margin: 0 0 10px;
  padding: 12px 16px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid #111827;
  background: #ffffff;
}

.schedule-project-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.schedule-project-heading h1 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.schedule-project-source {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.sheet-frame.is-panning {
  cursor: grabbing;
  user-select: none;
}

.sheet-grid {
  display: grid;
  width: max-content;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  zoom: var(--screen-scale, 1);
  transform-origin: top left;
}

.sheet-load-message {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 420px;
  padding: 20px 24px;
  border: 1px solid #dbe3ef;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
}

.sheet-load-message strong {
  font-size: 15px;
}

.sheet-load-message span {
  color: var(--muted);
}

.sheet-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
  padding: 1px 3px;
  line-height: 1.15;
  text-overflow: clip;
}

.sheet-cell.project-info-band-cell {
  background: #ffffff !important;
  color: #111827 !important;
  padding: 2px 6px;
}

.sheet-cell.project-info-row-end {
  border-bottom: 1px solid #94a3b8 !important;
}

.sheet-cell.project-info-label {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
}

.sheet-cell.project-info-value {
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.sheet-cell.project-info-title {
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: -0.025em;
}

.sheet-cell.project-info-status {
  color: #0f766e !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

.sheet-cell.has-text {
  z-index: 2;
  overflow: visible;
}

.sheet-cell.month-boundary {
  border-left: 1.25px solid #000000 !important;
}

.sheet-cell.range-selected-cell {
  z-index: 11;
  box-shadow: inset 0 0 0 1px #10b981 !important;
}

.sheet-cell.selected-cell {
  z-index: 12;
  box-shadow: inset 0 0 0 2px #2563eb !important;
}

.sheet-grid.is-range-selecting .sheet-cell {
  user-select: none;
}

.sheet-cell.month-header-cell {
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
  text-align: center !important;
}

.sheet-cell.header-label-cell,
.sheet-cell.trade-label-cell {
  justify-content: center !important;
  align-items: center !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  text-align: center !important;
  overflow: hidden !important;
}

.sheet-grid.is-editing .sheet-cell.trade-label-cell {
  cursor: text !important;
}

.sheet-grid.is-editing .sheet-cell.trade-label-cell:hover {
  box-shadow: inset 0 0 0 1px #64748b;
}

.sheet-cell.remark-header-cell {
  display: grid !important;
  place-items: center !important;
  justify-content: stretch !important;
  align-content: stretch !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.sheet-cell.memo-body-cell {
  padding: 4px 6px !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
}

.sheet-cell.bottom-memo-header-cell {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 0 10px !important;
  border: 1px solid #111827 !important;
  border-bottom: 0 !important;
  background: #f8fafc !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  text-align: left !important;
  letter-spacing: 0 !important;
}

.sheet-cell.bottom-memo-header-cell::before {
  content: "";
  display: block;
  width: 4px;
  height: 14px;
  flex: 0 0 4px;
  border-radius: 0;
  background: #111827;
}

.sheet-cell.bottom-memo-line-cell {
  justify-content: flex-start !important;
  align-items: flex-start !important;
  padding: 5px 10px 4px 48px !important;
  border-left: 1px solid #111827 !important;
  border-right: 1px solid #111827 !important;
  border-top: 0 !important;
  border-bottom: 0.5px solid #9ca3af !important;
  background: #ffffff !important;
  line-height: 1.3 !important;
  white-space: normal !important;
}

.sheet-cell.bottom-memo-line-cell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38px;
  border-left: 1px solid #cbd5e1;
}

.sheet-cell.bottom-memo-line-cell:last-child {
  border-bottom: 1px solid #111827 !important;
}

.sheet-cell.bottom-remark-label-cell {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  text-align: center !important;
  overflow: hidden !important;
}

.sheet-cell.schedule-note-cell {
  z-index: 6;
  overflow: visible !important;
  padding-left: 6px !important;
  padding-right: 6px !important;
  color: #111827 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-shadow:
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    1px 1px 0 #fff;
}

.sheet-grid.is-editing .sheet-cell.work-marker-cell {
  cursor: pointer !important;
}

.sheet-grid.is-editing .sheet-cell.work-text-cell {
  cursor: text;
}

.sheet-grid.is-editing .sheet-cell.draggable-note-cell {
  cursor: grab !important;
}

.sheet-cell.is-dragging-note {
  opacity: 0.55;
}

.sheet-cell.is-note-drop-target {
  background: #eef6ff !important;
  box-shadow: inset 0 0 0 2px #2563eb !important;
}

.sheet-cell.schedule-note-start-edge {
  justify-content: flex-start !important;
  padding-left: 9px !important;
  text-align: left !important;
}

.sheet-cell.schedule-note-end-edge {
  justify-content: flex-end !important;
  padding-right: 9px !important;
  text-align: right !important;
}

.sheet-cell.schedule-note-cell:hover {
  background: #fffdf0 !important;
  box-shadow: inset 0 0 0 1px #111827;
}

.sheet-grid.is-editing .sheet-cell.marker-toggle-cell {
  cursor: pointer !important;
}

.sheet-grid.is-editing .sheet-cell.marker-toggle-cell:hover {
  background: #f8fafc !important;
  box-shadow: inset 0 0 0 1px #64748b;
}

.sheet-grid.is-editing .sheet-cell.editable-cell {
  cursor: text;
}

.sheet-cell.editable-cell[contenteditable="true"]:hover {
  box-shadow: inset 0 0 0 1px #2563eb;
}

.sheet-cell.editable-cell[contenteditable="true"]:focus {
  z-index: 10;
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #fffbe6 !important;
  overflow: visible;
}

.sheet-cell.marker-cell {
  justify-content: center !important;
  align-items: center !important;
  padding: 0 !important;
  line-height: 1;
  overflow: hidden;
  text-align: center !important;
}

.sheet-cell[data-address="A1"],
.sheet-cell[data-address="A2"] {
  padding-left: 5px;
}

.sheet-cell[data-address="C1"],
.sheet-cell[data-address="C2"] {
  padding-left: 5px;
}

.sheet-cell[data-row="1"],
.sheet-cell[data-row="2"],
.sheet-cell[data-row="3"] {
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.sheet-cell[data-address="A1"],
.sheet-cell[data-address="A2"],
.sheet-cell[data-address="R1"],
.sheet-cell[data-address="R2"],
.sheet-cell[data-address="R3"] {
  font-weight: 700 !important;
}

.has-diagonal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      to top right,
      transparent calc(50% - 0.5px),
      #000000 calc(50% - 0.5px),
      #000000 calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
}

.has-diagonal.diagonal-up::after {
  background:
    linear-gradient(
      to bottom right,
      transparent calc(50% - 0.5px),
      #000000 calc(50% - 0.5px),
      #000000 calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
}

.text-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.28);
}

.text-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid #8ea0b8;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
}

.text-dialog strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
}

.text-dialog p {
  margin: 0 0 12px;
  color: #475569;
  font-size: 13px;
}

.text-dialog input {
  width: 100%;
  height: 34px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  font: inherit;
}

.text-dialog input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.text-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.text-dialog-actions button {
  min-width: 64px;
}

@page {
  size: A3 landscape;
  margin: 8mm;
}

@media print {
  html,
  body {
    background: #fff;
    height: auto;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .excel-app {
    display: block;
    height: auto;
  }

  .sheet-toolbar {
    display: none;
  }

  .edit-status {
    display: none;
  }

  .sheet-frame {
    overflow: visible;
    padding: 0;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .schedule-project-heading {
    position: static;
    width: 100%;
    min-width: 0;
    margin: 0 0 4mm;
    padding: 0 0 3mm;
    border: 0;
    border-bottom: 0.4mm solid #111827;
  }

  .schedule-project-kicker {
    font-size: 7pt;
  }

  .schedule-project-heading h1 {
    font-size: 16pt;
  }

  .schedule-project-source {
    font-size: 8pt;
  }

  .sheet-grid {
    box-shadow: none;
    zoom: var(--print-scale, 0.68) !important;
    transform: none;
    transform-origin: top left;
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 auto !important;   /* 페이지 가로 가운데 정렬 */
    border: 1px solid #111827 !important;  /* 깔끔한 외곽선 */
  }

  /* 인쇄 시 하단 메모장 제거 (analysis.js가 그리드 높이도 콘텐츠까지로 잘라줌) */
  .bottom-memo-header-cell,
  .bottom-memo-line-cell {
    display: none !important;
  }

  /* 분석 패널/버튼 등 화면 전용 요소 숨김 */
  #asgg-analysis-btn,
  .asgg-an-backdrop {
    display: none !important;
  }

  /* 공정표를 보기 좋게: 제목 여백·간격 정리 */
  .schedule-project-heading {
    margin-bottom: 5mm;
  }
}
