:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --ink: #10202b;
  --muted: #5c6b78;
  --faint: #8592a0;
  --line: rgba(16,32,43,0.12);
  --line-strong: rgba(16,32,43,0.2);
  --accent: #0b5e78;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11,94,120,0.09);
  --brass: #a8701f;
  --brass-soft: rgba(168,112,31,0.12);
  --good: #1f8a5c;
  --good-soft: rgba(31,138,92,0.11);
  --warn: #b1791f;
  --warn-soft: rgba(177,121,31,0.12);
  --critical: #b23a2e;
  --critical-soft: rgba(178,58,46,0.11);
  --shadow: 0 1px 2px rgba(16,32,43,0.04), 0 12px 28px rgba(16,32,43,0.08);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Batang, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", Pretendard, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Nanum Gothic Coding", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a131a;
    --surface: #101c26;
    --surface-2: #15232f;
    --ink: #e8eef3;
    --muted: #8ea0ac;
    --faint: #64707b;
    --line: rgba(232,238,243,0.12);
    --line-strong: rgba(232,238,243,0.22);
    --accent: #5cb9d6;
    --accent-ink: #06202a;
    --accent-soft: rgba(92,185,214,0.14);
    --brass: #d9a24f;
    --brass-soft: rgba(217,162,79,0.14);
    --good: #4bbd8a;
    --good-soft: rgba(75,189,138,0.14);
    --warn: #d9a24f;
    --warn-soft: rgba(217,162,79,0.14);
    --critical: #e2685a;
    --critical-soft: rgba(226,104,90,0.16);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 34px rgba(0,0,0,0.38);
  }
}
:root[data-theme="dark"] {
  --bg: #0a131a; --surface: #101c26; --surface-2: #15232f; --ink: #e8eef3; --muted: #8ea0ac; --faint: #64707b;
  --line: rgba(232,238,243,0.12); --line-strong: rgba(232,238,243,0.22);
  --accent: #5cb9d6; --accent-ink: #06202a; --accent-soft: rgba(92,185,214,0.14);
  --brass: #d9a24f; --brass-soft: rgba(217,162,79,0.14);
  --good: #4bbd8a; --good-soft: rgba(75,189,138,0.14);
  --warn: #d9a24f; --warn-soft: rgba(217,162,79,0.14);
  --critical: #e2685a; --critical-soft: rgba(226,104,90,0.16);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 16px 34px rgba(0,0,0,0.38);
}
:root[data-theme="light"] {
  --bg: #eef1f4; --surface: #ffffff; --surface-2: #f5f7fa; --ink: #10202b; --muted: #5c6b78; --faint: #8592a0;
  --line: rgba(16,32,43,0.12); --line-strong: rgba(16,32,43,0.2);
  --accent: #0b5e78; --accent-ink: #ffffff; --accent-soft: rgba(11,94,120,0.09);
  --brass: #a8701f; --brass-soft: rgba(168,112,31,0.12);
  --good: #1f8a5c; --good-soft: rgba(31,138,92,0.11);
  --warn: #b1791f; --warn-soft: rgba(177,121,31,0.12);
  --critical: #b23a2e; --critical-soft: rgba(178,58,46,0.11);
  --shadow: 0 1px 2px rgba(16,32,43,0.04), 0 12px 28px rgba(16,32,43,0.08);
}

* { box-sizing: border-box; }
html, body { height: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; text-wrap: balance; margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

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

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}
.brand svg { flex-shrink: 0; color: var(--accent); }
.brand-name { font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }

.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel {
  font-size: 0.68rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 6px 10px 4px;
}
.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.navlink svg { width: 17px; height: 17px; flex-shrink: 0; }
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}
.navlink .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---------- Main ---------- */
main { padding: 22px 28px 60px; min-width: 0; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  margin-bottom: 12px;
}
.backlink:hover { color: var(--accent); }
.backlink svg { width: 15px; height: 15px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.topbar .eyebrow {
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.topbar h1 { font-size: 1.5rem; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; }
.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 0.83rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn svg { width: 14px; height: 14px; }

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.notice svg { width: 15px; height: 15px; flex-shrink: 0; }

/* KPI strip */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--stripe, var(--accent));
}
.kpi .label { font-size: 0.78rem; color: var(--muted); }
.kpi .value { font-size: 1.7rem; margin-top: 4px; font-weight: 600; }
.kpi .sub { font-size: 0.74rem; color: var(--faint); margin-top: 3px; }

.kpis:not(.compact) .kpi { padding: 9px 14px; }
.kpis:not(.compact) .kpi .value { font-size: 1.3rem; margin-top: 2px; }
.kpis:not(.compact) .kpi .sub { margin-top: 1px; }

section.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
  scroll-margin-top: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
.panel-head h2 { font-size: 1.05rem; }
.panel-head .link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.panel-note { font-size: 0.78rem; color: var(--muted); margin: -8px 0 14px; }

.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
.map-placeholder {
  min-height: 460px;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.map-placeholder .leaflet-container { width: 100%; height: 100%; font-family: var(--sans); }
.vessel-label {
  /* 지도 타일은 라이트/다크 테마와 무관하게 항상 밝은 배경이라, 글자색을 --ink(다크모드에선 거의
     흰색)로 두면 라벨 배경(흰색)과 겹쳐 거의 안 보인다. 항상 어두운 고정색을 쓴다. */
  background: rgba(255, 255, 255, 0.92);
  border: none;
  box-shadow: none;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #10202b;
  border-radius: 4px;
}
.vessel-label::before { display: none; }

.map-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 6px 4px 0; font-size: 0.72rem; color: var(--faint);
}
.map-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.map-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* table */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th {
  font-size: 0.68rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { font-family: var(--mono); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.critical { background: var(--critical-soft); color: var(--critical); }

.stripe-row { border-left: 3px solid transparent; }
tr.stripe-critical td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
tr.stripe-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.stripe-good td:first-child { box-shadow: inset 3px 0 0 var(--good); }

/* schedule form + list */
.schedule-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.schedule-form input[type="date"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
  font-family: var(--sans);
}
.schedule-form input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
  font-family: var(--sans);
}
.sched-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sched-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}
.sched-item:last-child { border-bottom: none; }
.sched-text { flex: 1; }
.sched-actions { display: flex; gap: 4px; flex-shrink: 0; }
.sched-empty { color: var(--faint); font-size: 0.84rem; }
.daychip {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 6px;
  min-width: 58px;
  text-align: center;
  flex-shrink: 0;
}
.daychip.today { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 700; }

.memo {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 11px 12px;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* vetting cover timeline */
.cover-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cover-row:last-child { border-bottom: none; }
.cover-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.cover-head strong { font-family: var(--serif); font-size: 1rem; }
.cover-head span { font-size: 0.78rem; color: var(--muted); }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tcard {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 3px solid var(--stripe, var(--line));
}
.tcard strong { display: block; color: var(--ink); font-size: 0.86rem; margin-bottom: 5px; }
.tcard div + div { margin-top: 2px; }

footer.foot {
  text-align: center;
  color: var(--faint);
  font-size: 0.74rem;
  padding: 18px 0 6px;
}

/* ---------- VETTING detail view ---------- */
.util-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.ai-btn { border-color: transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ai-btn:hover { filter: brightness(1.08); }

details.intdrop { position: relative; }
details.intdrop summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 0.83rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
details.intdrop summary::-webkit-details-marker { display: none; }
details.intdrop summary:hover { background: var(--surface-2); }
details.intdrop summary svg { width: 14px; height: 14px; }
details.intdrop .menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 190px;
  z-index: 8;
  display: flex;
  flex-direction: column;
}
details.intdrop .menu button, details.intdrop .menu a {
  text-align: left;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 0.82rem;
  border: none;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  text-decoration: none;
}
details.intdrop .menu button:hover, details.intdrop .menu a:hover { background: var(--surface-2); }
details.intdrop .menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 2px; }

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
}
.fgroup { display: flex; flex-direction: column; gap: 5px; }
.fgroup .flabel {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  font-weight: 600;
}
select.fselect {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.83rem;
  font-family: var(--sans);
  min-width: 132px;
}
input.fsearch {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.83rem;
  font-family: var(--sans);
  min-width: 190px;
}
.fgroup.checkline { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 7px; }
.fgroup.checkline label.flabel { padding: 0; text-transform: none; letter-spacing: 0; font-size: 0.83rem; color: var(--muted); font-weight: 500; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: none;
  background: transparent;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
}
.seg button.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.vetting-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

tr.hidden-row, .hidden-row { display: none; }

/* ---------- Editor form (PROFILE add/edit) ---------- */
.editor {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.editor-header strong { color: var(--ink); font-family: var(--serif); font-size: 0.98rem; }
.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.editor-grid input,
.editor-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-family: var(--sans);
}
.editor-grid textarea { min-height: 64px; resize: vertical; }
.editor-actions { display: flex; gap: 8px; }
.editor-actions button.btn.primary { font-weight: 600; }
.row-action {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--sans);
  margin-right: 4px;
}
.row-action:hover { background: var(--surface-2); }
.row-action.danger { color: var(--critical); border-color: var(--critical-soft); }

.kpis.compact { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .kpis.compact { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .kpis.compact { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 담당 선단 동정 (VESSEL INFO / VOYAGE / SIRE INSPECTION / CLASS) ---------- */
.fleetmove-wrap { overflow-x: auto; }
.fleetmove-table { width: 100%; min-width: 1220px; border-collapse: collapse; font-size: 0.8rem; }
.fleetmove-table th, .fleetmove-table td {
  padding: 7px 9px;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  line-height: 1.45;
}
.fleetmove-table thead tr.group-row th {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-color: rgba(255,255,255,0.16);
}
.fleetmove-table thead tr.group-row th.grp-vessel { background: #17222c; }
.fleetmove-table thead tr.group-row th.grp-voyage { background: #1f4fa0; }
.fleetmove-table thead tr.group-row th.grp-sire { background: #9c451c; }
.fleetmove-table thead tr.group-row th.grp-class { background: #157a52; }
.fleetmove-table thead tr.group-row th.grp-manage { background: #3a3f47; }

.fleetmove-table thead tr.col-row th {
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  text-transform: none;
  letter-spacing: 0;
}
.fleetmove-table thead tr.col-row th:first-child { text-align: left; }
.fleetmove-table thead tr.col-row th.sub-sire { background: #fbf1cf; color: #7a5312; }
.fleetmove-table thead tr.col-row th.sub-class { background: #ddf1e3; color: #14603f; }

.obscell { text-align: center; }

/* CONDITION SURVEY — VESSEL INFO는 좁게, SURVEY 상세(특히 TSI Remark)는 넓게 */
.condition-table { min-width: 1600px; }
.condition-table thead tr.col-row th:nth-child(1) { width: 170px; }  /* 선명 (전체 이름이 잘리지 않도록 충분히 넓게) */
.condition-table thead tr.col-row th:nth-child(2) { width: 56px; }  /* SIZE */
.condition-table thead tr.col-row th:nth-child(3) { width: 76px; }  /* Management */
.condition-table thead tr.col-row th:nth-child(4) { width: 66px; }  /* P.I.C */
.condition-table thead tr.col-row th:nth-child(5) { width: 78px; }  /* Quarter */
.condition-table thead tr.col-row th:nth-child(6) { width: 78px; }  /* Survey */
.condition-table thead tr.col-row th:nth-child(7) { width: 88px; }  /* Port */
.condition-table thead tr.col-row th:nth-child(8) { width: 108px; } /* Inspection date */
.condition-table thead tr.col-row th:nth-child(9) { width: 54px; }  /* Defect */
.condition-table thead tr.col-row th:nth-child(10) { width: 54px; } /* Open */
.condition-table thead tr.col-row th:nth-child(11) { width: 54px; } /* Closed */
.condition-table thead tr.col-row th:nth-child(12) { width: 100px; } /* High Priority */
.condition-table thead tr.col-row th:nth-child(13) { width: 420px; } /* TSI Remark */
.condition-table thead tr.col-row th:nth-child(14) { width: 84px; }  /* 관리 */
.condition-table .cell-textarea { min-height: 70px; }

/* VETTING(SIRE STATUS) — 지적 상세 / COC·수리 상세는 3~5줄 정도 적어야 해서 칸을 넉넉하게 */
.vetting-table { min-width: 2400px; }
.vetting-table thead tr.col-row th:nth-child(1) { width: 200px; } /* 선명 — 긴 이름도 안 잘리게 */
.vetting-table thead tr.col-row th:nth-child(2) { width: 56px; } /* L/B select — L/B 안 잘리게 */
.vetting-table thead tr.col-row th:nth-child(3) { width: 140px; } /* VOYAGE STATUS */
.vetting-table thead tr.col-row th:nth-child(4) { width: 150px; } /* VOYAGE 항구 */
.vetting-table thead tr.col-row th:nth-child(5) { width: 70px; } /* KIND select — ETA/ETD 안 잘리게 */
.vetting-table thead tr.col-row th:nth-child(7) { width: 140px; } /* SIRE 상태 */
.vetting-table thead tr.col-row th:nth-child(8) { width: 140px; } /* SIRE 항구 */
.vetting-table thead tr.col-row th:nth-child(10) { width: 130px; } /* OIL MAJOR */
.vetting-table thead tr.col-row th:nth-child(12) { width: 340px; } /* 지적 상세 */
.vetting-table thead tr.col-row th:nth-child(13) { width: 100px; } /* SIRE REPORT — 파일 첨부 버튼 */
.vetting-table thead tr.col-row th:nth-child(14) { width: 130px; } /* 선급 — 입력칸이 너무 좁아 글씨가 잘 안 보이던 것을 넓힘 */
.vetting-table thead tr.col-row th:nth-child(15) { width: 110px; } /* COC — 위와 동일한 이유로 넓힘 */
.vetting-table thead tr.col-row th:nth-child(16) { width: 340px; } /* COC / 수리 상세 */
.vetting-table .cell-textarea { min-height: 78px; }
/* 숫자 입력칸(COC 등)의 브라우저 기본 스핀 버튼이 좁은 칸에서 글자보다 자리를 더 많이 차지해
   위처럼 넓혀도 표시가 잘 안 보이는 문제가 있었다 — 스핀 버튼을 없애 숫자 표시 공간을 최대로 준다. */
.cell-input[type="number"] { -moz-appearance: textfield; }
.cell-input[type="number"]::-webkit-outer-spin-button,
.cell-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 인라인 편집 셀 — 표/카드 어디서든 바로 수기 입력 (Excel 스타일) */
.cell-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  font-family: var(--sans);
  padding: 5px 6px;
  border-radius: 5px;
}
.cell-input:hover { background: var(--surface-2); }
.cell-input:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.cell-textarea { min-height: 44px; resize: vertical; }

/* select 형태의 cell-input(L/B, KIND 등)은 브라우저 기본 드롭다운 화살표가 별도 여백 없이
   바로 글자 옆에 그려져 짧은 텍스트(B, ETA 등)를 가린다 — 기본 화살표를 없애고 여백을 확보한
   작은 화살표를 직접 그려서 겹치지 않게 한다. */
select.cell-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 20px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--faint) 50%),
    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 10px) center, calc(100% - 6px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.fleetmove-table .obscell-wrap { display: flex; align-items: center; justify-content: center; gap: 4px; }
.fleetmove-table .cell-obs { width: 42px; flex: none; text-align: center; padding: 5px 2px; }
.cell-input.cell-saved { background: var(--good-soft) !important; }
.empty-state { text-align: center; color: var(--faint); padding: 22px 10px; font-size: 0.85rem; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.82em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* 선박별 1~3차 SIRE 펼치기/접기 */
.vessel-name-cell { display: flex; align-items: center; gap: 2px; }
.row-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--muted);
  width: 18px;
  flex: none;
}
.row-toggle:hover { color: var(--accent); }
tr.vessel-row.is-open { background: var(--surface-2); }
.latest-summary { font-size: 0.78rem; color: var(--muted); vertical-align: middle; }
.latest-summary .pill { margin-right: 6px; }
.round-meta { font-size: 0.66rem; color: var(--faint); margin-bottom: 4px; white-space: nowrap; }
tr.round-row { background: var(--surface-2); }
tr.round-row .round-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-right: 14px;
  vertical-align: middle;
}
tr.round-row .round-na { text-align: center; color: var(--faint); vertical-align: middle; }

/* DAILY STATUS — 카드형 레이아웃 (긴 텍스트 작성/수정에 특화, 표 대신 사용) */
.daily-board { display: flex; flex-direction: column; gap: 12px; }
.daily-vessel-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.daily-vessel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-2);
}
.daily-vessel-head .cell-input {
  border: 1px solid transparent;
  background: transparent;
}
.daily-vessel-head .cell-input:hover,
.daily-vessel-head .cell-input:focus {
  background: var(--surface);
  border-color: var(--line-strong);
  outline: none;
}
.daily-vessel-head .daily-vessel-name { width: auto; min-width: 130px; flex: none; font-weight: 700; font-size: 0.92rem; padding: 5px 7px; }
.daily-vessel-head .daily-vessel-size {
  flex: none;
  font-size: 0.76rem;
  color: var(--muted);
  padding: 5px 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.size-readonly { color: var(--faint); font-size: 0.8rem; }
.daily-vessel-summary { flex: 1 1 auto; font-size: 0.78rem; color: var(--muted); }
.daily-vessel-head .row-action { flex: none; }

.daily-task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.daily-task-card {
  --stripe: var(--line-strong);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stripe);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}
.daily-task-card[data-priority="상"] { --stripe: var(--critical); }
.daily-task-card[data-priority="중"] { --stripe: var(--warn); }
.daily-task-card[data-priority="하"] { --stripe: var(--good); }

/* 1. 제목 + 발생일자 + 중요도(+상태) — 카드 상단, 가장 눈에 띄게 */
.daily-task-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.daily-priority-select { width: 64px; flex: none; text-align: center; font-weight: 700; font-size: 0.86rem; }
.daily-task-title { flex: 1 1 260px; font-weight: 700; font-size: 1.05rem; padding: 7px 9px; }
.daily-occurred-input { width: 142px; flex: none; font-weight: 600; }
.daily-status-select { width: 76px; flex: none; font-weight: 700; }

/* 담당자/마감일 — 보조 정보로 작게 한 줄 아래에 */
.daily-task-subrow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-left: 2px;
}
.daily-task-subrow .subrow-label { font-size: 0.72rem; color: var(--faint); }
.daily-assignee-input { width: 96px; flex: none; font-size: 0.8rem; }
.daily-task-subrow input[type="date"] { width: 132px; flex: none; font-size: 0.8rem; }
.daily-date-arrow { color: var(--faint); font-size: 0.78rem; }
.daily-task-subrow .row-action { margin-left: auto; }

.daily-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 12px 0 5px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* 2. 상세내용 — 3~5줄 작성 공간 */
.daily-task-detail { width: 100%; min-height: 104px; line-height: 1.5; }

/* 3. 진행사항(조치이력) — 날짜별 기록이 쌓이는 로그, 5~7건 정도 보이고 그 이상은 스크롤 */
.daily-log-section { margin-top: 4px; }
.daily-log-list {
  max-height: 234px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.daily-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.daily-log-entry:last-child { border-bottom: none; }
.daily-log-entry .daily-log-date {
  flex: none;
  width: 98px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 3px;
}
.daily-log-entry .daily-log-note { flex: 1 1 auto; font-size: 0.86rem; line-height: 1.5; white-space: pre-wrap; }
.daily-log-entry .gantt-icon-btn { flex: none; }
.daily-log-empty { padding: 14px 10px; text-align: center; color: var(--faint); font-size: 0.82rem; }
.daily-log-add-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.daily-log-add-form input[type="date"] { flex: none; width: 132px; font-size: 0.82rem; }
.daily-log-add-form input[type="text"] {
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: var(--sans);
}

/* 4. 첨부파일 — 현안 한 건에 1개~수십개까지 붙일 수 있다(진행사항과 같은 스크롤 리스트 형태) */
.daily-file-section { margin-top: 4px; }
.daily-file-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  transition: background 0.1s, border-color 0.1s;
}
.daily-file-list.dragover { background: var(--accent-soft); border-color: var(--accent); }
.daily-file-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.daily-file-entry:last-child { border-bottom: none; }
.daily-file-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.85rem; color: var(--accent); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.daily-file-name:hover { text-decoration: underline; }
.daily-file-size { flex: none; font-size: 0.76rem; color: var(--faint); font-family: var(--mono); }
.daily-file-entry .gantt-icon-btn { flex: none; }
.daily-file-add-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 12px;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  font-size: 0.82rem; color: var(--accent); cursor: pointer;
}
.daily-file-add-btn:hover { background: var(--accent-soft); }

@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; }
  .navgroup { flex-direction: row; }
  .navlabel { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  main { padding: 16px; }
}

/* 인쇄 — 인쇄 버튼을 누르면 #print-area에 DAILY/VETTING/CONDITION COVER만 복제해 넣고
   window.print()을 호출한다. 인쇄 시에는 그 외 화면(사이드바, 지도, KPI 등)은 전부 숨긴다. */
#print-area { display: none; }
#print-area h1 { font-size: 1.2rem; margin-bottom: 16px; }
#print-area .panel { border: none; box-shadow: none; padding: 0; margin-bottom: 28px; break-inside: avoid; }
#print-area .panel-head .link { display: none; }
/* 인쇄 전 실제 가로폭을 재기 위해 화면 밖(왼쪽 -99999px)에 잠깐 렌더링한다 — 사용자에게는 보이지 않는다. */
#print-area.print-measuring { display: block; position: fixed; top: 0; left: -99999px; }
@media print {
  @page { size: landscape; margin: 10mm; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; padding: 24px; }
  /* 간트차트/표는 화면에서 가로 스크롤로 잘려 보이던 것을 인쇄 시에는 스크롤 없이 전체 폭을 그대로 드러낸다.
     실제로 페이지 폭을 넘는 부분은 script.js가 인쇄 직전에 zoom으로 축소해 잘리지 않게 맞춘다. */
  #print-area .gantt-scroll,
  #print-area .tablewrap,
  #print-area .reqindex-block,
  #print-area .filterbar { overflow: visible !important; width: auto !important; }
}

/* DRY DOCK · MAIN SCHEDULE — Gantt 차트 (조선소=파랑 / 외주업체=주황으로 구분) */
.gantt-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.83rem; color: var(--muted); margin-right: 16px; }
.gantt-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.gantt-swatch.shipyard { background: #1d5a94; }
.gantt-swatch.subcontractor { background: #b1791f; }

/* 열거티브: 라벨열 폭/일자 셀 폭/행 높이 — 30일 안팎의 입거수리 일정이 격자 달력처럼 또렷이 보이도록
   충분히 크게 잡고, JS의 grid-template-columns 인라인 스타일과 반드시 같은 값을 써야 격자선이 셀 경계와 맞는다. */
:root {
  --gantt-label-w: 320px;
  --gantt-col-w: 44px;
  --gantt-row-h: 58px;
}

.gantt-block { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 28px; overflow: hidden; }
.gantt-block-head { padding: 16px 20px; background: var(--surface-2); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.gantt-block-head strong { font-size: 1.2rem; }
.gantt-block-head span { font-size: 0.92rem; color: var(--muted); }

/* 표시 기간(간트차트 달력 폭) 직접 입력 — 등록된 작업이 없어도 원하는 기간(기본 30일)만큼
   미리 칸을 확보해두고, 자유롭게 시작일/기간을 조정할 수 있다 */
.gantt-range-editor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.gantt-range-label { font-size: 0.74rem; color: var(--faint) !important; }
.gantt-range-start, .gantt-range-days {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-family: var(--sans);
  padding: 4px 6px;
}
.gantt-range-start { width: 138px; }
.gantt-range-days { width: 56px; text-align: center; }

.gantt-scroll { overflow-x: auto; padding: 16px 20px 26px; }
.gantt-grid {
  display: grid;
  position: relative;
  width: max-content;
  grid-auto-rows: var(--gantt-row-h);
  border: 1px solid var(--line-strong);
  /* 격자칸: 세로선은 일자 셀 폭마다, 가로선은 행 높이마다 — 라벨열/헤더행을 지나서부터 시작 */
  background-image:
    repeating-linear-gradient(to right, var(--line-strong) 0 1px, transparent 1px var(--gantt-col-w)),
    repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px var(--gantt-row-h));
  background-position: var(--gantt-label-w) 0, 0 var(--gantt-row-h);
}
.gantt-cell {
  display: flex; align-items: center; justify-content: center;
  height: 100%; box-sizing: border-box;
  font-size: 0.86rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.gantt-day-head.weekend { background: var(--surface-2); color: var(--critical); }
/* 일정 미정인 작업 행의 날짜 칸 — 마우스로 드래그하거나 클릭해서 그 범위를 시작일~종료일로
   바로 지정할 수 있다. 옅은 테두리로 날짜별 경계를 또렷하게 보여준다. */
.gantt-cell.gantt-day-slot { background: transparent; cursor: pointer; user-select: none; }
.gantt-cell.gantt-day-slot:hover { background: var(--accent-soft); }
.gantt-cell.gantt-day-slot.is-selecting { background: var(--accent-soft); border-color: var(--accent); }
/* 이미 일정이 있는 작업 행(막대 뒤 빈 공간)이나 구분 행, 하단 "+ 작업 추가" 행도 날짜 칸 테두리가
   하루도 빠짐없이 보이도록 까는 배경용 칸 — 클릭/드래그 대상은 아니다. */
.gantt-cell.gantt-day-filler { cursor: default; }
.gantt-cell.gantt-category-fill { background: var(--accent-soft); }
.gantt-cell.gantt-add-row-fill { background: var(--surface-2); }
.gantt-corner {
  position: relative;
  font-size: 0.86rem; font-weight: 700; color: var(--ink); justify-content: flex-start; padding-left: 10px;
  border-right: 1px solid var(--line-strong);
}
/* "구분 / 작업" 라벨 칸 너비 드래그 조절 핸들 — 작업명이 잘려 보이던 것을 사용자가 직접 늘릴 수 있게 한다. */
.gantt-corner .col-resize-handle {
  position: absolute; top: 0; right: -3px; bottom: 0; width: 6px; cursor: col-resize; z-index: 5;
  touch-action: none;
}
.gantt-corner .col-resize-handle:hover,
.gantt-corner .col-resize-handle.is-resizing { background: var(--accent); opacity: 0.6; }
.gantt-category-row {
  height: 100%; box-sizing: border-box;
  font-size: 0.98rem; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  padding: 8px 12px; display: flex; align-items: center; border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}
.gantt-label {
  height: 100%; box-sizing: border-box;
  font-size: 1rem; color: var(--ink); padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; white-space: nowrap; overflow: hidden;
}
.gantt-label-text { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.gantt-label-actions { display: flex; gap: 2px; flex: none; }
.gantt-add-row { justify-content: flex-start; background: var(--surface-2); }
.gantt-add-task-btn {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  font-family: var(--sans);
}
.gantt-add-task-btn:hover { background: var(--accent-soft); }
.gantt-icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 6px;
}
.gantt-icon-btn:hover { background: var(--surface-2); color: var(--accent); }
.gantt-icon-btn.danger:hover { color: var(--critical); background: var(--critical-soft); }
.gantt-bar {
  position: relative;
  margin: 10px 3px;
  border-radius: 6px;
  height: 38px;
  overflow: hidden;
  display: flex;
  align-items: center;
  cursor: pointer;
  z-index: 1;
}
.gantt-bar.shipyard { background: rgba(29,90,148,0.22); border: 1.5px solid #1d5a94; }
.gantt-bar.subcontractor { background: rgba(177,121,31,0.22); border: 1.5px solid #b1791f; }
.gantt-bar-fill { position: absolute; top: 0; left: 0; bottom: 0; }
.gantt-bar.shipyard .gantt-bar-fill { background: #1d5a94; }
.gantt-bar.subcontractor .gantt-bar-fill { background: #b1791f; }
.gantt-bar-pct { position: relative; z-index: 1; font-size: 0.84rem; font-weight: 700; color: #fff; margin-left: 9px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,0.35); }

.btn.danger { border-color: var(--critical-soft); color: var(--critical); }
.btn.danger:hover { background: var(--critical-soft); }

/* ---------- 공용 모달 (DRY DOCK · DAILY REPORT 상세 작성 팝업) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,32,43,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-panel {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 880px; max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header strong { font-family: var(--serif); font-size: 1.1rem; }
.modal-header .btn { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); color: var(--accent-ink); }
.modal-header .btn:hover { background: rgba(255,255,255,0.2); }
.modal-header .btn.danger { border-color: rgba(255,255,255,0.4); color: #ffd9d4; }
.modal-header .btn.danger:hover { background: rgba(255,255,255,0.2); }
.modal-header .btn.primary { background: var(--accent-ink); color: var(--accent); border-color: transparent; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.dockreport-form { display: flex; flex-direction: column; gap: 14px; }
.dockreport-toprow { display: flex; gap: 14px; flex-wrap: wrap; }
.dockreport-toprow label { display: flex; flex-direction: column; gap: 5px; font-size: 0.76rem; color: var(--faint); flex: 1 1 200px; }
.dockreport-toprow input {
  padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 0.9rem; font-family: var(--sans);
}
.dockreport-section {
  display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--muted);
}
.dockreport-section textarea {
  min-height: 118px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 0.88rem; font-family: var(--sans);
  line-height: 1.55; resize: vertical; font-weight: 400;
}

.dockreport-files { border-top: 1px solid var(--line); padding-top: 14px; }
.dockreport-files-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  font-size: 0.82rem; color: var(--muted);
}
.dockreport-dropzone {
  border: 1px dashed var(--line-strong); border-radius: 10px; padding: 4px; transition: background 0.12s, border-color 0.12s;
}
.dockreport-dropzone.dragover { background: var(--accent-soft); border-color: var(--accent); }
.dockreport-file-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dockreport-file-table th, .dockreport-file-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.dockreport-file-table a { color: var(--accent); text-decoration: none; }
.dockreport-file-table a:hover { text-decoration: underline; }

/* ---------- DRY DOCK · CLASS ITEM > DEFECT ITEM ("LIST CCS SURVEY OBSERVATION AND REPAIR") ---------- */
.progress-summary-table { width: 100%; max-width: 460px; border-collapse: collapse; font-size: 0.86rem; }
.progress-summary-table th {
  background: var(--surface-2); padding: 8px 10px; border: 1px solid var(--line-strong);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.progress-summary-table td { padding: 8px 10px; border: 1px solid var(--line); }
.progress-summary-table tr td:first-child { color: var(--muted); }
.progress-summary-table tr td:last-child { font-weight: 700; text-align: right; width: 100px; }
.progress-summary-input {
  width: 70px; text-align: right; border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-family: var(--mono); font-size: 0.86rem; padding: 4px 6px;
}

.classdefect-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.classdefect-table th, .classdefect-table td { padding: 8px 9px; border: 1px solid var(--line); vertical-align: top; text-align: left; }
.classdefect-table thead th { background: var(--surface-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.classdefect-table textarea { width: 100%; min-height: 64px; resize: vertical; }
.classdefect-photo-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.classdefect-photo-dropzone {
  width: 100%; border-radius: 8px; transition: background 0.12s, border-color 0.12s;
}
.classdefect-photo-dropzone img {
  display: block; width: 100%; max-width: 270px; height: 190px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer; background: var(--surface-2);
}
.classdefect-photo-placeholder {
  width: 100%; max-width: 270px; height: 190px; display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 8px; color: var(--faint); font-size: 0.8rem; line-height: 1.5;
  background: var(--surface-2); cursor: pointer;
}
.classdefect-photo-dropzone.dragover .classdefect-photo-placeholder,
.classdefect-photo-dropzone.dragover img { border-color: var(--accent); background: var(--accent-soft); opacity: 0.85; }
.classdefect-photo-placeholder:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- DRY DOCK · SPARE PARTS ("SINOKOR DOCKING REQUISITION INDEX" 양식) ---------- */
.reqindex-block { border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.reqindex-title {
  background: #1f3864; color: #fff; font-weight: 700; font-size: 1.02rem;
  padding: 10px 16px; letter-spacing: 0.01em; text-align: center;
}
.reqindex-header-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.reqindex-header-table td { border: 1px solid var(--line-strong); padding: 0; }
.reqindex-header-table td.reqindex-label {
  background: #305496; color: #fff; font-weight: 700; padding: 8px 12px; width: 160px; white-space: nowrap;
}
.reqindex-header-table input {
  width: 100%; border: none; background: var(--surface); color: var(--ink);
  padding: 8px 12px; font-size: 0.86rem; font-family: var(--sans);
}
.reqindex-header-table input:disabled { background: var(--surface-2); color: var(--muted); }
.reqindex-header-table input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* table-layout: fixed으로 해야 th에 지정한(또는 드래그로 바꾼) width가 실제 칸 너비로 그대로
   반영된다 — auto layout에서는 내용에 따라 브라우저가 너비를 다시 늘려버려 드래그 조정이 무의미해진다. */
.reqindex-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; table-layout: fixed; }
.reqindex-table th, .reqindex-table td { padding: 7px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow: hidden; }
.reqindex-table thead th { background: #305496; color: #fff; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; position: relative; }
/* 마우스로 드래그해서 칸 가로 너비를 조정하는 핸들 — th 오른쪽 끝의 얇은 세로줄, 드래그 중에는
   강조색으로 보여준다. 너비는 localStorage에 저장해 새로고침해도 유지된다. */
.reqindex-table .col-resize-handle {
  position: absolute; top: 0; right: -3px; bottom: 0; width: 6px; cursor: col-resize; z-index: 2;
  touch-action: none;
}
.reqindex-table .col-resize-handle:hover,
.reqindex-table .col-resize-handle.is-resizing { background: var(--accent); opacity: 0.6; }
.reqindex-prepared-select { font-weight: 700; }
.reqindex-prepared-select[data-prepared="OWNER"] { background: var(--good-soft); color: var(--good); }
.reqindex-prepared-select[data-prepared="MANAGER"] { background: var(--warn-soft); color: var(--warn); }
.classdefect-status-select { font-weight: 700; }
.classdefect-status-select[data-status="CLOSED"] { color: var(--good); }
.classdefect-status-select[data-status="OPEN"] { color: var(--ink); }

/* ---------- DRY DOCK · SURVEY PLAN — 담당선박 전체 1년치 검사 캘린더(초안) ---------- */
.surveyplan-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; table-layout: fixed; }
.surveyplan-table th, .surveyplan-table td {
  padding: 6px; border: 1px solid var(--line); vertical-align: top; text-align: left;
}
.surveyplan-table thead th { background: var(--surface-2); font-size: 0.8rem; text-align: center; color: var(--muted); }
.surveyplan-vessel-col { width: 220px; }
.surveyplan-table td.surveyplan-vessel-cell {
  font-weight: 700; font-size: 0.86rem; background: var(--surface-2); vertical-align: middle;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.surveyplan-vessel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.surveyplan-status-wrap { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.surveyplan-status-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; font-size: 0.82rem; cursor: pointer;
  border: 1px dashed var(--line-strong); color: var(--faint); text-decoration: none;
}
.surveyplan-status-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.surveyplan-status-btn.has-file { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.surveyplan-status-remove {
  border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 0.68rem; padding: 2px;
}
.surveyplan-status-remove:hover { color: var(--critical); }
/* SIRE STATUS의 SIRE REPORT 첨부 버튼 — surveyplan-status-* 와 같은 모양(미첨부=점선, 첨부됨=실선+강조색) */
.filecell-wrap { display: inline-flex; align-items: center; gap: 2px; }
.filecell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 5px; font-size: 0.9rem; cursor: pointer;
  border: 1px dashed var(--line-strong); color: var(--faint); text-decoration: none;
}
.filecell-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filecell-btn.has-file { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filecell-remove {
  border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 0.72rem; padding: 2px;
}
.filecell-remove:hover { color: var(--critical); }
.surveyplan-month-cell { min-height: 40px; cursor: pointer; transition: background 0.1s; }
.surveyplan-month-cell:hover { background: var(--accent-soft); }
.surveyplan-badge {
  display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 3px 6px; margin-bottom: 3px;
  border-radius: 5px; color: #fff; font-size: 0.7rem; font-weight: 700; cursor: pointer;
  white-space: normal; line-height: 1.25; word-break: keep-all;
}
.surveyplan-badge:last-child { margin-bottom: 0; }
.surveyplan-badge.done { opacity: 0.45; text-decoration: line-through; }
.surveyplan-badge[data-type="ANNUAL"] { background: #2f6fb0; }
.surveyplan-badge[data-type="INTERMEDIATE"] { background: #1f8a5c; }
.surveyplan-badge[data-type="SPECIAL"] { background: #b23a2e; }
.surveyplan-badge[data-type="DOCKING"] { background: #7c5cbf; }
.surveyplan-badge .surveyplan-badge-day { font-family: var(--mono); }

/* ---------- OPERATIONS · 송금요청 ---------- */
.remit-table td { vertical-align: middle; }
.remit-table input[type="date"] {
  padding: 5px 7px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 0.8rem; font-family: var(--sans);
}
.remit-table select.fselect { padding: 5px 7px; font-size: 0.8rem; }
.remit-table .btn.remit-del { padding: 3px 8px; font-size: 0.78rem; }
.remit-table tr.remit-done td { color: var(--good); background: var(--good-soft); }
.remit-table tr.remit-dup td { color: var(--faint); }
.remit-preview-summary { margin-left: auto; font-size: 0.86rem; color: var(--muted); text-align: right; line-height: 1.6; }
.remit-preview-summary b { color: var(--ink); }
.remit-table td.num, .remit-table th { white-space: nowrap; }

/* 송금요청 · Cost Kind 필터 (SVMS 비용조회와 같은 6종 + 코드표에 없는 값) */
.costkind-checks { display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 520px; }
.costkind-checks label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; white-space: nowrap; cursor: pointer; }
