/* ═══════════════════════════════════════════════════════════════
   TRMT3  —  Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─────────── Reset ─────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
               "Noto Sans KR", system-ui, Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea, button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ─────────── Variables ─────────── */
:root {
  /* Base */
  --page-bg:         #F8F7F4;
  --surface:         #FFFFFF;
  --surface-2:       #F4F3EE;
  --surface-3:       #EBEAE3;

  --text-primary:    #1F1F1D;
  --text-secondary:  #5F5E5A;
  --text-tertiary:   #888780;

  --border-subtle:   #E5E4DD;
  --border:          #D3D1C7;
  --border-strong:   #B4B2A9;

  /* Accents */
  --blue:            #185FA5;
  --blue-hover:      #0F4C85;
  --blue-bg:         #E6F1FB;
  --blue-text:       #0C447C;
  --blue-border:     #85B7EB;
  --blue-dot:        #378ADD;

  --teal:            #0F6E56;
  --teal-bg:         #E1F5EE;
  --teal-text:       #085041;
  --teal-dot:        #1D9E75;

  --purple:          #534AB7;
  --purple-bg:       #EEEDFE;
  --purple-text:     #3C3489;
  --purple-dot:      #7F77DD;

  --coral-dot:       #D85A30;
  --amber-dot:       #EF9F27;
  --gray-dot:        #888780;

  /* Semantic */
  --red:             #A32D2D;
  --red-bg:          #FCEBEB;
  --red-border:      #F09595;
  --red-strong:      #E24B4A;

  --amber:           #854F0B;
  --amber-bg:        #FAEEDA;
  --amber-border:    #FAC775;

  --green:           #3B6D11;
  --green-bg:        #EAF3DE;
  --green-border:    #97C459;

  --nav-bg:          #1E293B;
  --nav-text:        #FFFFFF;
  --nav-text-dim:    rgba(255,255,255,0.65);
}

/* ─────────── Topnav ─────────── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 50;
}
.topnav-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding-right: 16px;
  border-right: 1px solid var(--border-subtle);
  height: 32px;
}
.brand-mark {
  width: 30px; height: 30px;
  background: var(--nav-bg); color: white;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; letter-spacing: 0.5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.brand-sub  { font-size: 10px; color: var(--text-tertiary); }

.main-nav { display: flex; gap: 2px; flex: 1; height: 54px; align-items: center; }
.nav-link {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.1s;
}
.nav-link:hover   { background: var(--surface-2); color: var(--text-primary); }
.nav-link.active  { color: var(--blue); background: var(--blue-bg); }
.nav-link.disabled { color: var(--text-tertiary); pointer-events: none; opacity: 0.55; }

/* ── nav 대분류 드롭다운 (click 방식) ── */
.nav-group { position: relative; display: inline-flex; }
.nav-group > .nav-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 6px;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer; background: none; border: none;
  font-family: inherit; transition: background 0.1s;
}
.nav-group > .nav-trigger:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-group.active > .nav-trigger { color: var(--blue); background: var(--blue-bg); }
.nav-group > .nav-trigger .caret-sm { font-size: 9px; opacity: .65; transition: transform .12s; }
.nav-group.open > .nav-trigger .caret-sm { transform: rotate(180deg); }
.nav-submenu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  min-width: 184px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.16);
  display: none; flex-direction: column; gap: 2px;
}
.nav-group.open > .nav-submenu { display: flex; }
.nav-submenu .nav-link { padding: 8px 12px; border-radius: 6px; }

/* ── 모바일 햄버거 + 시트 메뉴 (≤768px 에서만 노출) ── */
.nav-burger {
  display: none; margin-left: auto; flex: 0 0 auto;
  width: 38px; height: 34px; padding: 8px 8px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; flex-direction: column; justify-content: space-between;
}
.nav-burger span { display: block; height: 2px; width: 100%; background: var(--text-secondary); border-radius: 2px; transition: transform .15s, opacity .15s; }
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; z-index: 900; }
.mobile-menu[hidden] { display: none; }
.mm-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.42); }
.mm-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(82vw, 320px); background: var(--surface);
  box-shadow: -8px 0 28px rgba(0,0,0,.22);
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
}
.mm-panel .nav-link {
  display: block; padding: 11px 14px; border-radius: 8px; font-size: 14.5px;
  color: var(--text-primary);
}
.mm-panel .nav-link.active { color: var(--blue); background: var(--blue-bg); }
.mm-section {
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  color: var(--text-tertiary); text-transform: uppercase;
  margin: 12px 6px 3px; padding-top: 10px; border-top: 1px solid var(--border-subtle);
}
.mm-section:empty { padding: 0; margin: 6px 6px; }
body.mm-lock { overflow: hidden; }

.user-menu { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-name { font-size: 13px; color: var(--text-secondary); }
.logout-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.1s;
}
.logout-btn:hover { background: var(--red-bg); color: var(--red); }

/* ─────────── Main content ─────────── */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* ─────────── Page header ─────────── */
.page-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.page-actions { display: flex; gap: 8px; }

/* ─────────── Buttons ─────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
  height: 32px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn-sm    { height: 30px; font-size: 12px; padding: 0 10px; }
.btn-block { width: 100%; justify-content: center; height: 38px; font-size: 14px; }
.btn-primary  { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-outline  { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger   { background: var(--surface); color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: var(--red-bg); }

/* ─────────── Tab bar ─────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: color 0.1s;
  user-select: none;
}
.tab:hover  { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--blue); font-weight: 600; }
.tab-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.dot-blue   { background: var(--blue-dot); }
.dot-teal   { background: var(--teal-dot); }
.dot-purple { background: var(--purple-dot); }
.dot-coral  { background: var(--coral-dot); }
.dot-amber  { background: var(--amber-dot); }
.dot-gray   { background: var(--gray-dot); }
.tab-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-weight: 500;
}
.tab.active .tab-count { background: var(--blue-bg); color: var(--blue-text); }

/* ─────────── Tab context ─────────── */
.tab-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  min-height: 18px;
}
.tab-context strong { color: var(--text-primary); font-weight: 600; }

/* ─────────── Toolbar (filters) ─────────── */
.toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.input, .select {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border 0.1s, box-shadow 0.1s;
}
.input:focus, .select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.15);
}
.select {
  padding-right: 26px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1.5L5 5L9 1.5' stroke='%23888' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px 6px;
}
.search-input { flex: 1; min-width: 160px; }
.count-label { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }

/* ─────────── Table (desktop) ─────────── */
.grid-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  /* overflow: hidden 제거 — sticky thead가 이 컨테이너 기준이 되어 top:54px 가
     페이지가 아닌 내부 기준으로 잘못 동작하는 문제를 막기 위함 */
}
.ex-table {
  width: 100%;
  border-collapse: separate;   /* sticky thead 렌더 안정성 위해 separate 사용 */
  border-spacing: 0;
  font-size: 12px;
  table-layout: fixed;
}
col.c-no     { width: 40px; }
col.c-vessel { width: 92px; }
col.c-topic  { width: 16.5%; }
col.c-desc   { width: 30%; }
col.c-action { width: 28%; }
col.c-pri    { width: 102px; }
col.c-stat   { width: 62px; }
col.c-edit   { width: 156px; }

.ex-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  padding: 9px 10px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: sticky;
  top: 54px;                        /* 상단 네비(54px) 바로 아래 고정 */
  z-index: 30;                      /* 그룹바/행보다 명확히 위 */
  /* sticky 동안 아래 내용이 살짝 비쳐 보이는 것 방지: 불투명 배경 + 경계선 + 그림자 */
  border-top:    1px solid var(--border-subtle);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.08);
}
.ex-table thead th:first-child { border-left: 1px solid var(--border-subtle); }
.ex-table thead th:last-child  { border-right: 1px solid var(--border-subtle); }

.ex-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: var(--surface);
}
.ex-table td:first-child { border-left: 1px solid var(--border-subtle); }
.ex-table td:last-child  { border-right: 1px solid var(--border-subtle); }
/* separate 모드에서 그룹바 행은 배경이 있으므로 좌우 경계 제거 (가장자리까지 꽉 차게) */
.ex-table tr.month-bar td:first-child,
.ex-table tr.group-bar td:first-child { border-left: none; }
.ex-table tr.month-bar td:last-child,
.ex-table tr.group-bar td:last-child  { border-right: none; }
.ex-table tr.data-row { cursor: pointer; transition: background 0.08s; }
.ex-table tr.data-row:hover td { background: #FAFAF7; }

/* Date group bar (dark navy) */
.ex-table tr.group-bar td {
  background: var(--nav-bg);
  color: white;
  padding: 7px 14px;
  border: none;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 1;
}
.ex-table tr.group-bar td:hover { background: #27364B; }

/* Month group bar (even darker, bolder) */
.ex-table tr.month-bar td {
  background: #0F172A;         /* 더 진한 네이비 */
  color: white;
  padding: 10px 14px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 1;
}
.ex-table tr.month-bar td:hover { background: #1E293B; }
.ex-table tr.group-bar.nested td {
  background: #1E293B;
  padding-left: 32px;          /* 월 바 안에 들여쓰기 */
  font-size: 11.5px;
}
.ex-table tr.group-bar.nested td:hover { background: #27364B; }

.group-bar-inner { display: flex; align-items: center; gap: 10px; }
.gb-caret { font-size: 10px; opacity: 0.85; width: 10px; display: inline-block; }
.gb-date  { font-weight: 600; letter-spacing: 0.5px; }
.gb-count { font-size: 11px; opacity: 0.65; font-weight: 400; }
.gb-stats { margin-left: auto; font-size: 10.5px; opacity: 0.75; display: flex; gap: 10px; }
.gb-stats .gb-stat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }

/* Cell styling */
.no-cell      { color: var(--text-tertiary); font-size: 11px; }
.vessel-cell  {
  font-weight: 600;
  font-size: 11px;
  white-space: normal;          /* 풀네임 지원 — 공백 위치에서 줄바꿈 */
  word-break: keep-all;         /* 한글 단어 유지 */
  overflow-wrap: break-word;
  line-height: 1.35;
}
.topic-cell   { font-weight: 600; font-size: 12px; line-height: 1.5; color: var(--text-primary); }
.desc-cell    { font-size: 11px; color: var(--text-secondary); line-height: 1.6; white-space: pre-line; }
.action-cell  {
  font-size: 11px; line-height: 1.6; color: var(--text-primary);
  padding: 6px 10px;
}

/* Action entries — 한 행에 여러 팔로우업 entry 표시 */
.act-entries { display: flex; flex-direction: column; gap: 3px; }
.act-entry   { display: flex; gap: 6px; align-items: flex-start; line-height: 1.55; }
.act-entry .act-date {
  font-family: ui-monospace, "IBM Plex Mono", Menlo, monospace;
  font-size: 10.5px;
  color: var(--red);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 72px;
  padding-top: 1px;
}
.act-entry .act-progress {
  font-size: 11px;
  color: var(--text-primary);
}
.act-entry.important .act-progress {
  color: var(--red);
  font-weight: 600;
}
.act-entry .act-arrow {
  color: var(--text-tertiary);
  font-size: 9px;
  margin-right: 2px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  transition: color 0.1s;
}
.act-entry .act-arrow:hover { color: var(--text-primary); }
.act-entries.collapsed .act-entry:not(:last-child) { display: none; }

/* Action cell — 없을 때 dash */
.act-empty { color: var(--text-tertiary); font-size: 11px; }

/* Supervisor chip (used in '전체' 탭 on mobile cards) */
.sup-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
}
.sup-chip .tab-dot { width: 7px; height: 7px; }
.sup-chip.c-blue   { color: var(--blue-text); }
.sup-chip.c-teal   { color: var(--teal-text); }
.sup-chip.c-purple { color: var(--purple-text); }

/* Pri + Due stacked */
.pri-stack {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}

/* Badges */
.bd {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  line-height: 1.5;
}
.pri-cocflag { background: var(--red-bg);   color: var(--red); }
.pri-cocflag::before { content: "⚑"; font-size: 10px; color: var(--red-strong); }
.pri-urgent   { background: var(--amber-bg); color: var(--amber); }
.pri-urgent::before   { content: "◆"; font-size: 10px; color: var(--amber-dot); }
.pri-nextdd   { background: var(--blue-bg);  color: var(--blue-text); }
.pri-nextdd::before   { content: "⚓"; font-size: 10px; color: var(--blue); }
.pri-normal   { background: var(--surface-3); color: var(--text-secondary); }
.pri-normal::before   { content: "○"; font-size: 9px; color: var(--text-tertiary); }

.status-open { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.status-prog { background: var(--blue-bg);  color: var(--blue-text); border: 1px solid var(--blue-border); }
.status-done { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }

/* D-day badge */
.dday {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.dday-overdue { background: var(--red); color: white; }
.dday-today   { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.dday-soon    { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.dday-later   { background: var(--surface-3); color: var(--text-secondary); }

/* Action buttons (Edit + Delete) */
.row-actions {
  display: flex; gap: 4px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
}
.icon-btn {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all 0.1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.icon-btn svg { width: 13px; height: 13px; }
.att-indicator {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--text-tertiary); margin-top: 4px;
}
.att-indicator svg { width: 10px; height: 10px; }

/* ─────────── Card list (mobile) ─────────── */
.card-list { display: none; }
.issue-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.issue-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.issue-card-body { margin-bottom: 10px; }
.issue-card-title {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  line-height: 1.4;
}
.issue-card-desc {
  font-size: 12px; color: var(--text-secondary);
  line-height: 1.55; white-space: pre-line;
  margin-bottom: 8px;
}
.issue-card-action {
  font-size: 12px; background: var(--blue-bg);
  color: var(--blue-text);
  padding: 8px 10px; border-radius: 6px;
  line-height: 1.5;
}
.issue-card-action .hl { color: var(--red); font-weight: 600; }
.issue-card-foot {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}
.card-date-bar {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  margin: 14px 0 8px;
  padding: 4px 10px;
  background: var(--nav-bg); color: white;
  border-radius: 4px; display: inline-flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}

/* ─────────── Summary row ─────────── */
.summary-row {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.summary-row strong { color: var(--text-primary); font-weight: 600; }

/* ─────────── Empty state ─────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.empty-state p  { font-size: 14px; margin-bottom: 4px; }
.empty-state .empty-sub { font-size: 12px; }

/* ─────────── Modal ─────────── */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}
.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  width: min(640px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--text-secondary);
  font-size: 22px;
  border-radius: 6px;
  line-height: 1;
}
.modal-close:hover { background: var(--surface-2); color: var(--text-primary); }

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 10px;
}
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.form-label em { color: var(--red); font-style: normal; margin-left: 2px; }

.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border 0.1s, box-shadow 0.1s;
}
.form-field select { appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1.5L5 5L9 1.5' stroke='%23888' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 9px 6px;
}
.form-field textarea { resize: vertical; min-height: 72px; line-height: 1.6; }

/* Action editor in modal */
.form-label em.hint {
  font-style: normal;
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 10.5px;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.action-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.btn-add-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: 5px;
  cursor: pointer;
}
.btn-add-action:hover { background: white; }

.action-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}
.action-editor:empty::before {
  content: "조치 엔트리가 없습니다. 우측의 '엔트리 추가' 버튼을 누르세요.";
  display: block;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11.5px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.act-edit-row {
  display: grid;
  grid-template-columns: 130px 1fr auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.act-edit-row input[type="date"],
.act-edit-row input[type="text"] {
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.act-edit-row input[type="text"]:focus,
.act-edit-row input[type="date"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(24,95,165,0.15);
}
.act-edit-row .imp-toggle {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.act-edit-row .imp-toggle.on {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red);
}
.act-edit-row .act-remove {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 18px;
  width: 26px; height: 26px;
  border-radius: 4px;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.act-edit-row .act-remove:hover { color: var(--red); background: var(--red-bg); }

/* Toggle all button icon rotation */
#btn-toggle-all #toggle-all-icon {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.1s;
}

.modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.footer-right { display: flex; gap: 8px; margin-left: auto; }

/* Attachments */
.att-section {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  background: var(--surface-2);
}
.att-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.att-add {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--blue);
  padding: 5px 10px;
  border: 1px solid var(--blue-border);
  border-radius: 5px;
  cursor: pointer;
  background: var(--blue-bg);
}
.att-add:hover { background: white; }
.att-list { display: flex; flex-direction: column; gap: 4px; }
.att-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  font-size: 12px;
}
.att-item .att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item .att-size { color: var(--text-tertiary); font-size: 11px; }
.att-item .att-del {
  border: none; background: transparent; color: var(--text-tertiary);
  padding: 2px 4px; border-radius: 3px;
}
.att-item .att-del:hover { color: var(--red); background: var(--red-bg); }

/* ─────────── Login page ─────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, #F8F7F4 0%, #E8E6DE 100%);
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  border: 1px solid var(--border-subtle);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-mark {
  width: 48px; height: 48px;
  background: var(--nav-bg); color: white;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.login-sub   { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.login-sub2  { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.login-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--red-border);
}
.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ─────────── Responsive ─────────── */
@media (max-width: 768px) {
  .main-content { padding: 14px; }
  .page-title { font-size: 18px; }
  .brand-sub { display: none; }
  /* 모바일: 데스크탑 가로 nav 숨기고 햄버거 시트로 대체 (드롭다운 클리핑·가로스크롤 해소) */
  .main-nav { display: none; }
  .nav-burger { display: flex; }
  .user-name { display: none; }
  .topnav-inner { gap: 10px; padding: 0 14px; }

  /* Table hidden, card list shown */
  .grid-wrap { display: none; }
  .card-list { display: block; }

  /* 월/날짜 바: inline-flex라 2열로 들쭉날쭉 → 한 줄 전체폭으로 깔끔히 쌓기, 카운트 우측정렬 */
  .card-date-bar {
    display: flex;
    width: auto;
    box-sizing: border-box;
    margin: 12px 0 6px;
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 6px;
  }
  .card-date-bar > span:last-child { margin-left: auto; opacity: 0.75; }

  /* Toolbar: stack cleaner */
  .toolbar { gap: 6px; }
  .search-input { min-width: 100%; order: -1; }
  .select { flex: 1; min-width: 0; }
  .count-label { width: 100%; text-align: right; }

  /* Form grid single column */
  .form-grid { grid-template-columns: 1fr; }

  .modal-box { width: 96vw; max-height: 96vh; border-radius: 10px; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
}
@media (min-width: 769px) {
  .card-list { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   Inline edit / Attachment modal / Inline add (rev.3)
   ═══════════════════════════════════════════════════════════════ */

/* 편집 가능한 셀 — hover 시 미세한 배경 변화로 cue */
.ex-table td.cell-edit {
  cursor: text;
  transition: background 0.08s;
  position: relative;
}
.ex-table td.cell-edit:hover {
  background: #F3F6FB;
  box-shadow: inset 0 0 0 1px var(--blue-border);
}
.ex-table td.cell-edit:hover::after {
  content: "";
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.35;
}
/* Priority/Status 셀은 select 호출용 - 텍스트 커서 말고 pointer */
.ex-table td.cell-edit:has(.bd) { cursor: pointer; }

/* 인라인 입력 요소 */
.inline-input, .inline-select, .inline-textarea {
  width: 100%;
  padding: 4px 7px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: white;
  color: var(--text-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.15);
}
.inline-textarea {
  resize: vertical;
  line-height: 1.5;
  min-height: 60px;
}
.inline-select {
  padding: 3px 7px;
  height: 26px;
  cursor: pointer;
  appearance: auto;           /* 기본 화살표 유지 */
  background-image: none;
  padding-right: 7px;
}

/* 편집 중인 Action entry row */
.act-entry.editing {
  display: flex;
  gap: 4px;
  align-items: center;
  background: #EFF6FE;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid var(--blue-border);
}
.act-entry.editing input[type="date"] {
  width: 120px;
  padding: 3px 5px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: ui-monospace, "IBM Plex Mono", Menlo, monospace;
  color: var(--red);
  font-weight: 600;
}
.act-entry.editing input[type="text"] {
  flex: 1;
  padding: 3px 6px;
  font-size: 11.5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: inherit;
  outline: none;
  min-width: 80px;
}
.act-entry.editing input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.18);
}
.act-entry.editing .mini-btn {
  padding: 0;
  width: 22px; height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: white;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.act-entry.editing .mini-btn:hover { background: var(--surface-2); }
.act-entry.editing .mini-btn.ok    { color: var(--green); border-color: var(--green-border); background: var(--green-bg); }
.act-entry.editing .mini-btn.ok:hover { background: #D8E8BC; }
.act-entry.editing .mini-btn.rm    { color: var(--red); }
.act-entry.editing .mini-btn.rm:hover { background: var(--red-bg); border-color: var(--red-border); }
.act-entry.editing .mini-btn.imp.on { color: var(--red); background: var(--red-bg); border-color: var(--red-border); font-weight: 700; }

/* 인라인 "+ 엔트리 추가" 버튼 (action cell 하단) */
.act-add-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  margin-top: 4px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.1s;
}
.act-add-inline:hover {
  color: var(--blue);
  border-color: var(--blue);
  border-style: solid;
  background: var(--blue-bg);
}

/* Row actions — 3개 버튼 */
.row-actions {
  display: flex;
  gap: 3px;
}
.icon-btn.attach { position: relative; }
.icon-btn.has-attach {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-text);
}
.icon-btn.has-attach .att-count-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* ───── Inline Add row (신규 이슈) ───── */
.ex-table tr.inline-add-row td {
  background: #F0F7FF;
  padding: 8px 10px;
  border-bottom: 2px solid var(--blue-border);
  vertical-align: middle;
}
.inline-add-row .inline-input,
.inline-add-row .inline-select {
  border-color: var(--blue-border);
  background: white;
  font-size: 12px;
  height: 28px;
}
.inline-add-row .inline-textarea { min-height: 52px; font-size: 12px; }
.inline-add-row .ins-num {
  color: var(--blue);
  font-weight: 700;
  text-align: center;
  font-size: 14px;
}
.inline-add-row .ins-placeholder {
  color: var(--text-tertiary);
  font-style: italic;
  font-size: 11px;
}
.inline-add-row .icon-btn.ok {
  color: white; background: var(--blue); border-color: var(--blue);
}
.inline-add-row .icon-btn.ok:hover { background: var(--blue-hover); }

/* "+ 이 날짜로 추가" 트리거 (그룹 바 내) */
.inline-add-trigger {
  margin-left: auto;
  padding: 2px 10px;
  font-size: 10.5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.1s;
  font-weight: 500;
}
.inline-add-trigger:hover {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* ───── Attach Modal ───── */
.attach-modal-box {
  width: min(760px, 94vw);
  max-height: 90vh;
}
.attach-modal-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 8px;
}

.attach-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.attach-dropzone:hover,
.attach-dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue-text);
}
.attach-dropzone svg { color: var(--text-tertiary); margin-bottom: 8px; }
.attach-dropzone:hover svg,
.attach-dropzone.dragover svg { color: var(--blue); }
.attach-dropzone-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.attach-dropzone-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

.attach-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.attach-empty {
  text-align: center;
  padding: 28px;
  color: var(--text-tertiary);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.attach-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 9px 14px;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.attach-item:hover {
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.attach-thumb {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 52px;
  height: 52px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.attach-fileicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}
.attach-fileicon > span:first-child  { font-size: 22px !important; line-height: 1 !important; }
.attach-fileicon > span:nth-child(2) { font-size: 8.5px !important; margin-top: 2px !important; }

.attach-name {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.attach-meta {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  padding: 0;
  color: var(--text-tertiary);
}
.attach-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}
.attach-actions .icon-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 30px;
  font-size: 12px;
  text-decoration: none;
}
.attach-actions a.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .attach-modal-subtitle { display: none; }
  .attach-item { padding: 8px 10px; column-gap: 10px; }
  .attach-thumb { width: 44px; height: 44px; }
  .attach-name { font-size: 12px; }
  .attach-meta { font-size: 10.5px; }
  .attach-actions .icon-btn { width: 28px; height: 28px; }
}

/* ═══════════════════════════════════════════════════════════════
   Admin — 감독/선박/사용자 관리 모달 (rev.5)
   ═══════════════════════════════════════════════════════════════ */

.admin-trigger {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.1s;
}
.admin-trigger:hover { background: var(--surface-3); color: var(--text-primary); }

/* admin modal: 탭형 */
.admin-modal-box { width: min(820px, 94vw); }
.admin-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}
.admin-tab {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  user-select: none;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
}
.admin-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 12.5px;
}
.admin-list-item.inactive {
  background: var(--surface-2);
  opacity: 0.55;
  text-decoration: line-through;
}
.admin-list-item .item-main {
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-list-item .item-main strong { font-size: 13px; font-weight: 600; }
.admin-list-item .item-main .item-sub {
  font-size: 11px; color: var(--text-tertiary); margin-top: 2px;
}
.admin-list-item .item-tags {
  display: flex; flex-wrap: wrap; gap: 3px;
  font-size: 10.5px;
}
.admin-list-item .item-tag {
  padding: 1px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
}
.admin-list-item .item-tag.type { background: var(--blue-bg); color: var(--blue-text); border-color: var(--blue-border); font-weight: 600; }
.admin-list-item .item-actions { display: flex; gap: 3px; }

.admin-add-form {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px;
}
.admin-add-form h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.admin-form-grid .form-field.full { grid-column: 1 / -1; }

.admin-chip-group {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 38px;
}
.admin-chip {
  padding: 3px 10px;
  font-size: 11.5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.1s;
}
.admin-chip:hover { background: var(--surface-3); }
.admin-chip.selected {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 600;
}

.admin-btn-row {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px;
}

.color-swatches { display: flex; gap: 6px; }
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.1s, transform 0.1s;
}
.color-swatch.selected { border-color: var(--text-primary); transform: scale(1.15); }
.color-swatch[data-color="blue"]   { background: var(--blue-dot); }
.color-swatch[data-color="teal"]   { background: var(--teal-dot); }
.color-swatch[data-color="purple"] { background: var(--purple-dot); }
.color-swatch[data-color="coral"]  { background: var(--coral-dot); }
.color-swatch[data-color="amber"]  { background: var(--amber-dot); }
.color-swatch[data-color="gray"]   { background: var(--gray-dot); }

.role-pill {
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.role-admin { background: var(--red-bg);  color: var(--red);    border: 1px solid var(--red-border); }
.role-user  { background: var(--blue-bg); color: var(--blue-text); border: 1px solid var(--blue-border); }

/* 사용자 메뉴 (네비 우측) */
.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.user-menu-trigger:hover { background: var(--surface-2); color: var(--text-primary); }
.user-menu-trigger .caret { font-size: 9px; color: var(--text-tertiary); }

.user-dropdown {
  position: absolute;
  top: 48px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  padding: 4px;
  z-index: 200;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown .dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  border-radius: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.user-dropdown .dropdown-item:hover { background: var(--surface-2); }
.user-dropdown .dropdown-item.danger { color: var(--red); }
.user-dropdown .dropdown-item.danger:hover { background: var(--red-bg); }
.user-dropdown .dropdown-sep {
  height: 1px; background: var(--border-subtle); margin: 4px 0;
}

@media (max-width: 768px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-tabs { padding: 0 14px; }
  .admin-tab { padding: 9px 10px; font-size: 12px; }
  .admin-trigger span.trig-label { display: none; }
}

/* ───── Inline textarea 편집 — 저장/취소 버튼 (rev.6) ───── */
.inline-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inline-edit-btns {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.inline-edit-btns button {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.inline-edit-btns .inline-save-btn {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 600;
}
.inline-edit-btns .inline-save-btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.inline-edit-btns .inline-cancel-btn:hover { background: var(--surface-2); color: var(--text-primary); }

/* ───── 담당 선박 버튼 (tab-context 내 pill) ───── */
.myves-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue-text);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.myves-trigger:hover {
  background: white;
  border-color: var(--blue);
  color: var(--blue);
}
.myves-trigger .ves-icon { font-size: 11px; line-height: 1; }
.myves-trigger .caret   { font-size: 9px; opacity: 0.75; }

/* ───── 2차 모달 (관리 모달 위에 뜨는 편집 모달) ───── */
#vessel-edit-modal,
#supervisor-edit-modal,
#user-edit-modal {
  z-index: 1000;
}

/* ───── 서브 탭 (진행중 / 완료) ───── */
.subtab-bar {
  display: flex;
  gap: 4px;
  padding: 0 0 10px 0;
  margin-top: -4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.subtab-bar:empty { display: none; }
.subtab {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s, color 0.1s;
  margin-bottom: -1px;   /* 아래 border와 겹쳐서 active 시 깔끔하게 */
}
.subtab:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.subtab.active {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  border-bottom-color: var(--surface);
  font-weight: 600;
}
.subtab-count {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 500;
  min-width: 18px;
  text-align: center;
}
.subtab.active .subtab-count {
  background: var(--blue-bg);
  color: var(--blue-text);
}
.subtab[data-sub="open"] .subtab-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
}
.subtab[data-sub="closed"] .subtab-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
}

/* ═══════════════════════════════════════════════════════════════
   Condition Survey
   ═══════════════════════════════════════════════════════════════ */

.cs-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.cs-year-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cs-year-label {
  font-size: 14px;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
}
.cs-context {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.cs-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
}

.cs-vessel-list {
  display: flex; flex-direction: column;
  gap: 16px;
}

.cs-vessel-block {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.cs-vessel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.cs-vessel-icon { font-size: 14px; }
.cs-vessel-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cs-vessel-type {
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px;
  background: var(--blue-bg); color: var(--blue-text);
  border: 1px solid var(--blue-border);
  border-radius: 999px;
}

.cs-quarter-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
}
.cs-quarter-table thead th {
  background: var(--surface-2);
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}
.cs-quarter-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.cs-quarter-row.empty td { color: var(--text-tertiary); }
.cs-quarter-row.has-data { background: var(--surface); }
.cs-quarter-row:hover:not(.cs-detail-row) { background: var(--surface-2); }

.cs-q-label {
  font-weight: 700;
  color: var(--text-primary);
  user-select: none;
}
.cs-q-label.disabled { color: var(--text-tertiary); }
.cs-caret {
  font-size: 9px;
  color: var(--text-tertiary);
  margin-right: 4px;
  display: inline-block;
  width: 10px;
}

.cs-cell-display {
  min-height: 18px;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: text;
}
.cs-cell-display.placeholder { color: var(--text-tertiary); }
.cs-edit-cell:hover .cs-cell-display { background: var(--surface-3); }

.cs-inline-input {
  width: 100%;
  height: 28px;
  padding: 4px 8px;
  font-size: 12.5px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: white;
  font-family: inherit;
  outline: none;
}

.cs-cnt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
}
.cs-cnt-total {
  background: var(--surface-2);
  font-weight: 700;
}
.cs-cnt-close {
  color: var(--green);
}

.cs-actions {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
  /* display: flex 절대 금지! td는 table-cell이어야 보더가 그려짐 */
}
.cs-actions > * {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.cs-actions > *:first-child { margin-left: 0; }

/* 분기 표의 actions 헤더 — 폭 고정 */
.cs-quarter-table .cs-th-actions { width: 90px; }
.cs-quarter-table .cs-actions { padding-right: 10px; }

.icon-btn.has-memo {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-text);
}

/* Open 카운트 셀 — 빨간색 (Closed가 아닌 미해결) */
.cs-cnt-open {
  color: var(--red);
  font-weight: 600;
}

/* 수동 입력된 카운트는 살짝 강조 (글씨 진하게 + 미세한 하단 점선) */
.cs-cnt.is-manual .cs-cell-display {
  font-weight: 700;
  text-decoration: underline dotted var(--blue);
  text-underline-offset: 3px;
}
.cs-cnt.cs-edit-cell { cursor: pointer; }
.cs-cnt.cs-edit-cell:hover .cs-cell-display {
  background: var(--surface-3);
}

/* 펼침 — 세부 행 */
.cs-detail-row td.cs-detail-cell {
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}

.cs-finding-section {
  margin-bottom: 16px;
}
.cs-finding-empty { padding: 12px 0; }

.cs-finding-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.cs-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.cs-cat-defect      .cs-cat-dot { background: var(--red); }
.cs-cat-observation .cs-cat-dot { background: var(--amber-dot); }
.cs-cat-defect      strong       { color: var(--red); }
.cs-cat-observation strong       { color: var(--amber); }
.cs-cat-count {
  font-size: 11px;
  color: var(--text-tertiary);
}

.cs-findings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  table-layout: fixed;
}
.cs-findings-table thead th {
  background: var(--surface-3);
  padding: 6px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}
.cs-findings-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;          /* 윗줄에 맞춰서 정렬 (멀티라인일 때 일관) */
  word-break: break-word;       /* 긴 단어 줄바꿈 */
  line-height: 1.5;
}
.cs-findings-table tbody tr:last-child td { border-bottom: none; }
.cs-findings-table tbody tr:hover { background: var(--surface-2); }

/* Item 20% : Description 50% : Remark 30% 비율 */
.cs-findings-table .cs-th-item {
  width: calc((100% - 50px - 64px - 90px - 80px) * 0.18);
}
.cs-findings-table .cs-th-desc {
  width: calc((100% - 50px - 64px - 90px - 80px) * 0.40);
}
.cs-findings-table .cs-th-trans {
  width: calc((100% - 50px - 64px - 90px - 80px) * 0.24);
}
.cs-findings-table .cs-th-urem {
  width: calc((100% - 50px - 64px - 90px - 80px) * 0.18);
}
.cs-findings-table .vt-prio-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #dc2626; }
.cs-findings-table .cs-prio { color: var(--text-tertiary); }

/* finding 행의 셀별 디스플레이도 멀티라인 깔끔히 */
.cs-findings-table .cs-cell-display {
  white-space: pre-wrap;
  min-height: 18px;
}
/* 상태 뱃지가 항상 첫 줄 기준 정렬되도록 */
.cs-findings-table .cs-status .bd { display: inline-flex; }
.cs-findings-table .cs-actions {
  padding-top: 6px;
  /* 셀이 vertical-align: top 이라 액션도 윗줄 기준 — Status와 동일선상 */
}
.cs-no {
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.cs-add-btn { margin-top: 8px; }
.cs-add-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cs-inline-add-row td { background: var(--blue-bg); }

.cs-overall-remark {
  margin-top: 14px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
}
.cs-overall-remark-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--blue-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.cs-overall-remark-body {
  font-size: 12.5px;
  margin-top: 4px;
  white-space: pre-wrap;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .cs-quarter-table { font-size: 11.5px; }
  .cs-quarter-table thead th,
  .cs-quarter-table td { padding: 6px; }
}

/* ───── 선박 헤더 (클릭 토글) ───── */
.cs-vessel-head {
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.cs-vessel-head:hover { background: var(--surface-3); }
.cs-vessel-head.expanded { border-bottom: 1px solid var(--border-subtle); }
.cs-vessel-caret {
  font-size: 10px;
  color: var(--text-tertiary);
  display: inline-block;
  width: 12px;
  text-align: center;
}
.cs-vessel-summary {
  margin-left: auto;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}
.cs-vessel-summary > span { font-variant-numeric: tabular-nums; }
.cs-vessel-summary-empty { color: var(--text-tertiary); font-style: italic; }
.cs-summary-open  { color: var(--red);   font-weight: 600; }
.cs-summary-close { color: var(--green); font-weight: 600; }

/* cs-vessel-head를 flex로 (요약 우측 정렬) */
.cs-vessel-head { display: flex; }

/* ───── Overall Remark — Defect/Observation 섹션과 동일 헤더 스타일 ───── */
.cs-cat-overall .cs-cat-dot { background: var(--blue); }
.cs-cat-overall strong       { color: var(--blue-text); }
.cs-overall-body {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* 옛 Overall Remark 박스 스타일은 미사용 (필요 시 그대로 둠) */

/* ───── 첨부 뱃지 ───── */
.icon-btn.has-attach {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-text);
  position: relative;
}
.attach-badge {
  position: absolute;
  top: -5px; right: -5px;
  background: var(--blue);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* 첨부 모달 리스트 */
.attach-add { display: flex; gap: 8px; align-items: center; }
.attach-list .attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-subtle);
}
.attach-list .attach-item:last-child { border-bottom: none; }
.attach-thumb {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-3);
}
.attach-thumb-doc {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.attach-meta { flex: 1; min-width: 0; }
.attach-name {
  display: block;
  font-size: 12.5px;
  color: var(--blue-text);
  text-decoration: none;
  word-break: break-word;
}
.attach-name:hover { text-decoration: underline; }
.attach-size {
  font-size: 11px;
  color: var(--text-tertiary);
}
.attach-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 12.5px;
}

/* ───── Condition Survey 검색 입력 ───── */
.cs-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 280px;
}
.cs-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.cs-search-input {
  width: 100%;
  padding: 6px 30px 6px 32px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  outline: none;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.cs-search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-bg);
}
.cs-search-input::placeholder { color: var(--text-tertiary); }
.cs-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  padding: 0;
  border: none;
  background: var(--surface-3);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cs-search-clear:hover {
  background: var(--text-tertiary);
  color: white;
}

/* ───── 선박 헤더의 분기별 Open 카운트 격자 ───── */
.cs-vessel-summary {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.cs-q-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  justify-content: center;
}
.cs-q-summary.has-data {
  background: var(--blue-bg);
  color: var(--blue-text);
}
.cs-q-summary .cs-q-label {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.3px;
}
.cs-q-summary .cs-q-num { font-weight: 600; }
.cs-q-summary .cs-q-num strong.cs-q-open-on {
  color: var(--red);
  font-weight: 800;
}
.cs-q-summary .cs-q-num strong.cs-q-all-closed {
  color: var(--green);
}
.cs-q-summary .cs-q-num .cs-q-empty-data,
.cs-q-summary .cs-q-num .cs-q-blank {
  color: var(--text-tertiary);
}

/* ───── 선종(Vessel Type) 그룹 ───── */
.cs-type-group {
  margin-bottom: 28px;
}
.cs-type-group:last-child { margin-bottom: 0; }

.cs-type-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
}
.cs-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  border-radius: 6px;
  background: var(--text-primary);
  color: white;
}
/* 선종별 색상 강조 */
.cs-type-vlcc    .cs-type-badge { background: #1e3a8a; }   /* deep blue */
.cs-type-aframax .cs-type-badge { background: #155e75; }   /* teal */
.cs-type-mr      .cs-type-badge { background: #166534; }   /* green */
.cs-type-lr      .cs-type-badge { background: #854d0e; }   /* amber-dark */
.cs-type-cntr    .cs-type-badge { background: #7c2d12; }   /* maroon */
.cs-type-기타    .cs-type-badge { background: #475569; }

.cs-type-count {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.cs-type-header::after {
  /* 우측에 채우는 빈 공간을 위한 가짜 요소 (header 폭 다 사용) */
  content: '';
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Vetting Status — 전용 스타일
   ═══════════════════════════════════════════════════════════════ */

/* Vetting 표 */
.vt-vetting-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
  margin-top: 8px;
}
.vt-vetting-table thead th {
  background: var(--surface-3);
  padding: 7px 10px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}
.vt-vetting-table thead th.vt-th-cnt { text-align: center; }
.vt-vetting-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

/* 컬럼 폭 (대략적인 비율 — table-layout: fixed) */
.vt-th-rep    { width: 14%; }
.vt-th-date   { width: 110px; }
.vt-th-comp   { width: 14%; }
.vt-th-insp   { width: 14%; }
.vt-th-port   { width: 12%; }
.vt-th-op     { width: 110px; }
.vt-th-cnt    { width: 60px; }
.vt-th-actions{ width: 90px; }

/* 행 토글 caret */
.vt-row-toggle {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 10px;
  margin-right: 4px;
  user-select: none;
}
.vt-row-toggle:hover { color: var(--blue); }

/* 셀 디스플레이 */
.vt-cell-display { display: inline-block; min-height: 1em; }
.vt-cell-display.placeholder { color: var(--text-tertiary); }
.vt-edit-cell { cursor: pointer; word-break: break-word; }
.vt-edit-cell:hover { background: var(--surface-2); }

/* 빈 행 안내 */
.vt-empty-row {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 14px;
}

/* + 새 Vetting 추가 버튼 영역 */
.vt-add-bar {
  padding: 8px 0 14px 0;
  text-align: left;
}

/* 선박 헤더 요약 - Vetting */
.vt-summary-last {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.vt-summary-open {
  background: var(--red-bg);
  color: var(--red);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
}
.vt-summary-allclosed {
  background: var(--green-bg, #ecfdf5);
  color: var(--green);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
}

/* 새로 추가된 Vetting 행 플래시 효과 */
.vt-vetting-row.vt-row-flash td {
  animation: vt-flash 1.5s ease-out;
}
@keyframes vt-flash {
  0%   { background-color: var(--blue-bg); }
  100% { background-color: transparent; }
}

/* ───── Vetting Overall Remark 모달 ───── */
.vt-remark-textarea {
  width: 100%;
  min-height: 130px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  resize: none;          /* 자동 높이 조정 사용, 수동 리사이즈 비활성 */
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.vt-remark-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-bg);
}
.vt-remark-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* modal-foot 영역이 없으면 하단 버튼 정렬 */
.modal-box .modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ───── Vetting caret 셀 (Report# 편집과 분리) ───── */
.vt-th-caret { width: 36px; }
.vt-caret-cell {
  width: 36px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  padding: 8px 0 !important;
  color: var(--text-tertiary);
  transition: background 0.1s, color 0.1s;
}
.vt-caret-cell:hover {
  background: var(--surface-3);
  color: var(--blue);
}
.vt-caret-icon {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
}

/* 첨부 삭제 버튼 — 오른쪽 끝, 세로 가운데 (grid의 행 전체 span)
   CS 와 VT 모두 적용 */
.attach-item .attach-rm,
.attach-item .attach-rm-right,
.attach-item .icon-btn.attach-rm,
.attach-item .icon-btn.attach-rm-right {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  margin-left: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Calendar (일정)
   ═══════════════════════════════════════════════════════════════ */

.cal-toolbar { gap: 10px; }

.cal-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* 캘린더 그리드 */
.cal-grid-wrap {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border-subtle);
}
.cal-dow {
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 1px;
}
.cal-dow.sun { color: #d6586a; }
.cal-dow.sat { color: #4f8ed4; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));   /* 콘텐츠가 길어도 셀 너비 1/7 균등 유지 */
  grid-auto-rows: minmax(108px, auto);
}
.cal-cell {
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 6px 4px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
  min-width: 0;             /* 자식의 콘텐츠 너비가 셀을 밀어내지 못하게 */
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:nth-last-child(-n+7) { border-bottom: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other-month { background: var(--surface-2); color: var(--text-tertiary); }
.cal-cell.other-month .cal-cell-day { color: var(--text-tertiary); }
.cal-cell.is-today .cal-cell-day {
  background: var(--blue);
  color: white;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.cal-cell.is-selected {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: var(--blue-bg);
}
.cal-cell.is-sun .cal-cell-day { color: #d6586a; }
.cal-cell.is-sat .cal-cell-day { color: #4f8ed4; }
.cal-cell.is-today.is-sun .cal-cell-day,
.cal-cell.is-today.is-sat .cal-cell-day { color: white; }

.cal-cell-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.cal-evt {
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  cursor: pointer;
  max-width: 100%;     /* 셀 너비를 넘어가지 않음 */
  min-width: 0;
  display: block;
  line-height: 1.4;
}
.cal-evt.more {
  background: transparent;
  color: var(--text-tertiary);
  font-size: 10px;
  padding: 1px 4px;
  font-weight: 500;
}

/* 색상 클래스 — 이벤트 뱃지에서 .dot-{color} 가 그대로 배경색 */
.cal-evt.dot-blue   { background: #3b82f6; }
.cal-evt.dot-purple { background: #8b5cf6; }
.cal-evt.dot-amber  { background: #f59e0b; }
.cal-evt.dot-red    { background: #ef4444; }
.cal-evt.dot-green  { background: #10b981; }
.cal-evt.dot-pink   { background: #ec4899; }
.cal-evt.dot-yellow { background: #eab308; color: #1f2937; }
.cal-evt.dot-gray   { background: #6b7280; }

/* 사이드 패널 */
.cal-side {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 720px;
}
.cal-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.cal-side-head strong {
  font-size: 13.5px;
  flex: 1;
  color: var(--text-primary);
}
.cal-side-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.cal-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12.5px;
  line-height: 1.6;
}
.cal-side-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.cal-side-item:hover { background: var(--surface-2); }
.cal-side-color {
  width: 4px;
  border-radius: 3px;
  flex-shrink: 0;
  align-self: stretch;
}
.cal-side-color.dot-blue   { background: #3b82f6; }
.cal-side-color.dot-purple { background: #8b5cf6; }
.cal-side-color.dot-amber  { background: #f59e0b; }
.cal-side-color.dot-red    { background: #ef4444; }
.cal-side-color.dot-green  { background: #10b981; }
.cal-side-color.dot-pink   { background: #ec4899; }
.cal-side-color.dot-yellow { background: #eab308; }
.cal-side-color.dot-gray   { background: #6b7280; }
.cal-side-body {
  flex: 1;
  min-width: 0;
}
.cal-side-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-break: break-word;
}
.cal-side-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}
.cal-side-time { font-weight: 600; color: var(--text-primary); }
.cal-side-cat {
  background: var(--surface-3);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
}
.cal-side-notes {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* 일정 모달 form */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.form-row label .req { color: #ef4444; }
.form-row label .hint {
  color: var(--text-tertiary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
}
.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-bg);
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cb-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500 !important;
  text-transform: none !important;
  color: var(--text-primary) !important;
  letter-spacing: 0 !important;
  cursor: pointer;
}
.cb-row input[type="checkbox"] { width: auto; }

/* Color picker */
.color-picker {
  display: flex;
  gap: 6px;
  padding: 6px 0 2px;
  flex-wrap: wrap;
}
.color-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
  transition: transform 0.1s, box-shadow 0.1s;
}
.color-dot:hover { transform: scale(1.1); }
.color-dot.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--surface);
}
.color-dot.dot-blue   { background: #3b82f6; }
.color-dot.dot-purple { background: #8b5cf6; }
.color-dot.dot-amber  { background: #f59e0b; }
.color-dot.dot-red    { background: #ef4444; }
.color-dot.dot-green  { background: #10b981; }
.color-dot.dot-pink   { background: #ec4899; }
.color-dot.dot-yellow { background: #eab308; }
.color-dot.dot-gray   { background: #6b7280; }

/* Calendar 사이드 — 출처 뱃지 */
.cal-side-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.cal-side-title-row .cal-side-title { margin-bottom: 0; }
.cal-side-source {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.cal-side-source.src-issue   { background: #dbeafe; color: #1e40af; }
.cal-side-source.src-cs      { background: #ede9fe; color: #6d28d9; }
.cal-side-source.src-vetting { background: #fef3c7; color: #92400e; }

/* ───── 한국 공휴일 표시 ───── */
.cal-cell-head {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 18px;
}
.cal-cell.is-holiday .cal-cell-day {
  color: #d6586a;
}
.cal-cell.is-holiday.is-today .cal-cell-day {
  color: white;  /* 오늘+공휴일이면 today 동그라미 흰글자 유지 */
}
.cal-holiday-label {
  font-size: 9.5px;
  color: #d6586a;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}
.cal-cell.other-month .cal-holiday-label {
  color: #c8a4ad;  /* 다른 달이면 흐리게 */
}
.cal-side-holiday {
  display: inline-block;
  margin-left: 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: -0.1px;
}

/* ───── Last Update 라벨 (CS / VT 공용) ───── */
.cs-last-update {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-left: 8px;
  padding: 2px 7px;
  background: var(--surface-3);
  border-radius: 999px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.cs-last-update.empty { display: none; }

/* ───── CS 분기 격자: vendor 색상 + 라벨 ───── */
.cs-q-summary.cs-q-vendor-blue {
  background: #dbeafe;
  border-color: #93c5fd;
}
.cs-q-summary.cs-q-vendor-amber {
  background: #fef3c7;
  border-color: #fcd34d;
}
.cs-q-summary.cs-q-vendor-gray {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.cs-q-vendor-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  margin-left: 4px;
  text-transform: uppercase;
}
.cs-q-vendor-blue  .cs-q-vendor-label { color: #1e40af; }
.cs-q-vendor-amber .cs-q-vendor-label { color: #92400e; }
.cs-q-vendor-gray  .cs-q-vendor-label { color: #4b5563; }

/* ════════════════════════════════════════════════════════════
   Dry Dock Report — Step 1 (목록 + 메타 모달)
   ════════════════════════════════════════════════════════════ */

/* 카드 그리드 */
.dd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.dd-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dd-card:hover {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.dd-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.dd-card-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  color: var(--text-primary, #111827);
  word-break: break-all;
  flex: 1;
}

.dd-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dd-badge-draft { background: #fef3c7; color: #92400e; }
.dd-badge-done  { background: #d1fae5; color: #065f46; }
.dd-badge-clickable { cursor: pointer; transition: filter 0.12s, box-shadow 0.12s; user-select: none; }
.dd-badge-clickable:hover { filter: brightness(0.95); box-shadow: 0 0 0 2px rgba(0,0,0,0.06); }

.dd-card-vessel {
  font-size: 12.5px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.2px;
}

.dd-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  align-items: center;
}
.dd-meta-chip {
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
}
.dd-meta-text {
  white-space: nowrap;
}

.dd-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted, #9ca3af);
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e5e7eb);
}

/* 모달 - large variant: .modal-box와 함께 사용 */
.modal-box.modal-lg {
  width: min(720px, 95vw);
}

/* 폼 그리드 */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-row-4col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
.form-row-2col > label,
.form-row-3col > label,
.form-row-4col > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-row-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
}
.form-label-sm {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
}
.req { color: #ef4444; font-style: normal; }

.form-fieldset {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px 14px 14px;
  margin: 0;
}
.form-fieldset > legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #4b5563);
  padding: 0 6px;
}

.flex-spacer { flex: 1; }

@media (max-width: 640px) {
  .form-row-2col,
  .form-row-3col,
  .form-row-4col {
    grid-template-columns: 1fr;
  }
  .dd-grid {
    grid-template-columns: 1fr;
  }
}


/* ════════════════════════════════════════════════════════════
   Dry Dock Report — Step 2 (v2): Editor
   ════════════════════════════════════════════════════════════ */

/* 카드 우측 메타편집 버튼 */
.dd-card-head-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.dd-card-edit {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 16px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted, #9ca3af);
}
.dd-card-edit:hover {
  background: var(--surface-2, #f3f4f6);
  border-color: var(--border, #e5e7eb);
  color: var(--text-primary, #111827);
}

/* ──── 편집 페이지 레이아웃 ──── */
.dde-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  margin: -16px -16px 0;
  background: var(--surface, #fff);
}
.dde-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  flex-shrink: 0;
}
.dde-title-block { display: flex; flex-direction: column; min-width: 0; }
.dde-title {
  font-size: 15px; font-weight: 700; margin: 0;
  color: var(--text-primary, #111827);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dde-subtitle {
  font-size: 11.5px; color: var(--text-secondary, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dde-save-status {
  font-size: 12px; color: var(--text-muted, #9ca3af);
  font-style: italic; min-width: 90px;
}
.dde-save-ok   { color: #10b981; font-style: normal; }
.dde-save-busy { color: #2563eb; font-style: italic; }
.dde-save-err  { color: #ef4444; font-weight: 600; font-style: normal; }

.dde-body { flex: 1; display: flex; min-height: 0; }

/* ──── 좌측 사이드바 ──── */
.dde-sidebar {
  width: 280px; flex-shrink: 0;
  border-right: 1px solid var(--border, #e5e7eb);
  background: #fafbfc;
  display: flex; flex-direction: column;
}
.dde-side-head, .dde-side-foot {
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-secondary, #4b5563);
}
.dde-side-foot {
  border-top: 1px solid var(--border, #e5e7eb);
  background: #f3f4f6;
}
.dde-toc { flex: 1; overflow-y: auto; padding: 6px 8px; }
.dde-toc-empty {
  padding: 20px 16px; font-size: 12px;
  color: var(--text-muted, #9ca3af); text-align: center; line-height: 1.5;
}
.dde-toc-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px;
  color: var(--text-primary, #111827);
  margin-bottom: 2px; position: relative;
}
.dde-toc-item:hover { background: var(--surface-2, #eef2ff); }
.dde-toc-item.active {
  background: #dbeafe; color: #1e40af; font-weight: 600;
}
.dde-toc-no {
  font-weight: 700; color: #2563eb; flex-shrink: 0;
  font-size: 12px; min-width: 28px;
}
.dde-toc-item.active .dde-toc-no { color: #1e40af; }
.dde-toc-title {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dde-toc-actions { display: none; gap: 2px; }
.dde-toc-item:hover .dde-toc-actions { display: flex; }
.dde-toc-btn {
  background: transparent;
  border: 1px solid var(--border, #d1d5db);
  width: 20px; height: 20px; border-radius: 4px;
  font-size: 11px; cursor: pointer; padding: 0;
  color: var(--text-secondary, #4b5563);
}
.dde-toc-btn:hover { background: #fff; border-color: #2563eb; color: #2563eb; }
.dde-toc-children {
  padding-left: 14px;
  border-left: 2px solid #e5e7eb;
  margin-left: 12px; margin-bottom: 4px;
}
.dde-toc-item.depth-1 { font-size: 12.5px; }
.dde-toc-item.depth-2 { font-size: 12px; opacity: 0.95; }

/* ──── 우측 메인 ──── */
.dde-main {
  flex: 1; overflow-y: auto;
  padding: 18px 56px 80px 24px;   /* 우측 패딩 56px = 블록 외부 컨트롤(24+6)용 공간 */
  min-width: 0;
}
.dde-main-empty {
  padding: 60px 20px; text-align: center;
  color: var(--text-muted, #9ca3af); font-size: 13.5px;
}
.dde-section-edit { max-width: 920px; }
.dde-section-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid #2563eb;
  margin-bottom: 14px;
}
.dde-section-no {
  font-size: 18px; font-weight: 800; color: #2563eb; flex-shrink: 0;
}
.dde-section-title-input {
  flex: 1; font-size: 17px; font-weight: 700;
  border: none; border-bottom: 1px solid transparent;
  padding: 6px 4px; background: transparent;
  outline: none; color: var(--text-primary, #111827);
}
.dde-section-title-input:hover { border-bottom-color: var(--border, #d1d5db); }
.dde-section-title-input:focus { border-bottom-color: #2563eb; background: #f9fafb; }

/* ──── 블록 컨테이너 ──── */
.dde-blocks { display: flex; flex-direction: column; }

.dde-blocks-hint {
  padding: 30px 20px; text-align: center;
  color: var(--text-muted, #9ca3af); font-size: 13px;
}

/* 빈 섹션 — 4종 블록 큰 버튼 */
.dde-empty-add {
  padding: 30px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.dde-empty-add-hint {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
}
.dde-empty-add-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 720px;
}
.dde-empty-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  background: #fff;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.dde-empty-add-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.dde-empty-add-icon {
  font-size: 24px;
  color: var(--text-secondary, #4b5563);
  height: 32px;
  display: flex;
  align-items: center;
}
.dde-empty-add-btn:hover .dde-empty-add-icon { color: #2563eb; }
.dde-empty-add-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #111827);
}
.dde-empty-add-desc {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
}
@media (max-width: 600px) {
  .dde-empty-add-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 블록 사이의 + Inserter — 평소엔 살짝 보이고, 호버 시 진해짐 */
.dde-inserter {
  display: flex; justify-content: center; align-items: center;
  height: 18px;
  position: relative;
  transition: height 0.15s;
}
.dde-inserter-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--border, #d1d5db);
  background: #fff;
  color: var(--text-muted, #9ca3af);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.15s, background 0.15s, border-color 0.15s;
}
.dde-inserter:hover .dde-inserter-btn {
  opacity: 1;
}
.dde-inserter-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  border-style: solid;
  color: #fff;
  transform: scale(1.1);
}

/* 마지막에 항상 보이는 추가 영역 */
.dde-tail-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px dashed var(--border, #d1d5db);
  border-radius: 8px;
}
.dde-tail-add-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #6b7280);
  margin-right: 4px;
}
.dde-tail-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #111827);
  transition: all 0.15s;
}
.dde-tail-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}
.dde-tail-icon {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}
.dde-tail-btn:hover .dde-tail-icon { color: #2563eb; }

/* + 메뉴 (블록 종류 선택) */
.dde-insert-menu {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 180px;
  display: flex; flex-direction: column;
}
.dde-insert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: none; background: transparent;
  cursor: pointer; font-size: 13px;
  border-radius: 5px;
  color: var(--text-primary, #111827);
  text-align: left;
}
.dde-insert-item:hover {
  background: #eff6ff; color: #1e40af;
}
.dde-insert-icon {
  font-size: 15px;
  width: 22px; text-align: center;
  color: var(--text-secondary, #6b7280);
}
.dde-insert-item:hover .dde-insert-icon { color: #2563eb; }

/* ──── 블록 (헤더 없음, 호버 시 우측 상단 컨트롤) ──── */
.dde-block {
  position: relative;
  padding: 8px 4px;
  border-radius: 6px;
  transition: background 0.1s;
}
.dde-block:hover {
  background: #fafbfc;
}
.dde-block-body {}

/* 블록 컨트롤 — 블록 우측 바깥쪽에 세로 배치 (항상 표시) */
.dde-block-controls {
  position: absolute;
  top: 4px;
  left: 100%;          /* 블록 우측 바깥 */
  margin-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 5;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.dde-block:hover .dde-block-controls { opacity: 1; }
.dde-block-controls:hover { opacity: 1; }
.dde-block-btn {
  background: transparent; border: none;
  width: 24px; height: 24px; border-radius: 4px;
  cursor: pointer; font-size: 12px;
  color: var(--text-secondary, #4b5563); padding: 0;
}
.dde-block-btn:hover:not(:disabled) {
  background: #eff6ff; color: #2563eb;
}
.dde-block-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.dde-block-del:hover { background: #fee2e2 !important; color: #b91c1c !important; }

/* 좁은 화면(사이드바 접힘) 환경에선 다시 안쪽 우측 상단으로 — 단, 표 콘텐츠 위가 아니라
   블록 우측 상단 외곽 (top -8 right -2) — 더 작게 표시 */
@media (max-width: 1100px) {
  .dde-block-controls {
    left: auto;
    right: 4px;
    top: -10px;
    margin-left: 0;
    flex-direction: row;
    padding: 2px;
  }
  .dde-block-btn {
    width: 22px; height: 22px;
  }
}

/* ──── paragraph ──── */
.dde-p-input {
  width: 100%; min-height: 60px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit; font-size: 13.5px;
  line-height: 1.7;
  resize: none; outline: none;
  background: transparent;
}
.dde-p-input:hover { background: #fff; border-color: var(--border, #e5e7eb); }
.dde-p-input:focus { background: #fff; border-color: #2563eb; }

/* ──── bullet_list ──── */
.dde-bullet-opts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.dde-bullet-opts-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin-right: 2px;
}
.dde-marker-btn {
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border, #d1d5db);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
  line-height: 1;
}
.dde-marker-btn:hover { border-color: #2563eb; color: #2563eb; }
.dde-marker-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.dde-bullet-list { display: flex; flex-direction: column; gap: 2px; }
.dde-bullet-row { display: flex; align-items: flex-start; gap: 6px; }
/* 들여쓰기 레벨별 padding */
.dde-bullet-row.indent-0 { padding-left: 0; }
.dde-bullet-row.indent-1 { padding-left: 28px; }
.dde-bullet-row.indent-2 { padding-left: 56px; }
.dde-bullet-row.indent-3 { padding-left: 84px; }

.dde-bullet-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  font-style: italic;
}
.dde-bullet-marker {
  color: var(--text-secondary, #6b7280);
  font-size: 14px;
  text-align: center;
  flex-shrink: 0;
  min-width: 16px;
  /* textarea의 첫 줄 텍스트 baseline과 맞춤 */
  padding-top: 4px;
  line-height: 1.6;
}
/* 마커 종류별 너비 조정 (숫자·알파벳은 점·대시보다 자리 더 필요) */
.dde-bullet-row.dde-bullet-bullet .dde-bullet-marker,
.dde-bullet-row.dde-bullet-dash   .dde-bullet-marker {
  font-size: 16px;
  min-width: 14px;
}
.dde-bullet-row.dde-bullet-number .dde-bullet-marker,
.dde-bullet-row.dde-bullet-alpha  .dde-bullet-marker {
  font-size: 13px;
  min-width: 22px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  text-align: right;
  padding-right: 2px;
}
.dde-bullet-input {
  flex: 1; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 4px;
  font-family: inherit;
  font-size: 13px; background: transparent; outline: none;
  /* textarea 사용 — 자동 줄바꿈 + 자동 높이 확장 */
  resize: none;
  line-height: 1.6;
  overflow: hidden;
  min-height: 26px;
  /* textarea도 한 줄 input과 비슷한 정렬 */
  display: block;
  width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.dde-bullet-input:hover { background: #fff; border-color: var(--border, #e5e7eb); }
.dde-bullet-input:focus { background: #fff; border-color: #2563eb; }
.dde-bullet-x {
  background: transparent; border: none; cursor: pointer;
  font-size: 11px; color: var(--text-muted, #9ca3af);
  width: 22px; height: 22px; border-radius: 4px; visibility: hidden;
  flex-shrink: 0;
  margin-top: 2px;
}
.dde-bullet-row:hover .dde-bullet-x { visibility: visible; }
.dde-bullet-x:hover { background: #fee2e2; color: #b91c1c; }
.dde-bullet-add-link {
  align-self: flex-start;
  margin-top: 6px;
  margin-left: 22px;
  background: transparent;
  border: none;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
}
.dde-bullet-add-link:hover { color: #2563eb; }

/* ──── table ──── */
.dde-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
}
.dde-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed;
}
.dde-table th, .dde-table td {
  border: 1px solid var(--border, #e5e7eb);
  padding: 0;
  vertical-align: middle;
  position: relative;
}
.dde-table th {
  background: #f3f4f6; font-weight: 700;
}
.dde-table th .dde-cell-input,
.dde-table th .dde-cell-textarea,
.dde-table td .dde-cell-textarea {
  width: 100%;
  border: none;
  padding: 6px 8px;
  margin: 0;
  font-family: inherit; font-size: 12.5px;
  background: transparent;
  outline: none;
  resize: none;
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  /* 브라우저 기본 textarea 외곽 스타일 제거 (Safari/Firefox 등) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* 박스 그림자/내부 그림자 제거 */
  box-shadow: none;
  /* 줄바꿈 처리 */
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 헤더 셀의 입력 — input이든 textarea든 동일하게 굵게/중앙 정렬 */
.dde-table th .dde-cell-input,
.dde-table th .dde-cell-textarea {
  font-weight: 700;
  text-align: center;
  /* 헤더 배경(회색)을 그대로 보이게 — 자체 배경 강제 transparent */
  background-color: transparent !important;
}
.dde-table th .dde-cell-input:focus,
.dde-table th .dde-cell-textarea:focus,
.dde-table td .dde-cell-textarea:focus {
  background-color: #eff6ff !important;
}
.dde-table td .dde-cell-textarea { min-height: 28px; line-height: 1.4; }
.dde-table th .dde-cell-textarea { min-height: 28px; line-height: 1.4; }

.dde-col-del, .dde-row-del {
  background: transparent; border: none;
  color: var(--text-muted, #9ca3af); cursor: pointer;
  font-size: 10px;
  width: 18px; height: 18px;
  border-radius: 3px; padding: 0;
  visibility: hidden;
}
.dde-col-del { position: absolute; top: 2px; right: 2px; }
.dde-table th:hover .dde-col-del { visibility: visible; }
.dde-row-del {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 4px auto; visibility: visible;
}
.dde-col-del:hover, .dde-row-del:hover { background: #fee2e2; color: #b91c1c; }

.dde-tbl-ctrl-col, .dde-tbl-ctrl-col-c {
  width: 30px;
  background: #f9fafb;
  text-align: center;
}

/* 컬럼 리사이즈 핸들 — 셀 우측 경계에 걸쳐 표시 */
.dde-col-resize {
  position: absolute;
  right: -5px;
  top: 0;
  width: 10px;
  height: 100%;
  cursor: col-resize !important;
  z-index: 100;
  user-select: none;
  background: transparent;
  /* 항상 옅게 보이도록 우측 경계선 표시 */
  border-right: 2px solid #cbd5e1;
}
/* 핸들 위에 마우스 → 진한 파랑 */
.dde-col-resize:hover {
  background: #2563eb22;
  border-right-color: #2563eb !important;
  border-right-width: 3px;
}
/* 드래그 중 표시 */
body.dde-col-resizing { cursor: col-resize !important; user-select: none; }
body.dde-col-resizing * { cursor: col-resize !important; user-select: none !important; }

.dde-table-ctrls {
  display: flex; gap: 8px; margin-top: 8px;
  align-items: center;
}
.dde-table-hint {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  margin-left: 6px;
}

/* ──── image gallery ──── */
.dde-image-block { display: flex; flex-direction: column; gap: 10px; position: relative; }

.dde-img-opts {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0;
}
.dde-img-opts-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin-right: 4px;
}
.dde-col-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--border, #d1d5db);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary, #4b5563);
}
.dde-col-btn:hover { border-color: #2563eb; color: #2563eb; }
.dde-col-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.dde-img-grid {
  display: grid;
  gap: 12px;
}
.dde-img-cell {
  display: flex; flex-direction: column; gap: 4px;
}
.dde-img-cell-inner {
  position: relative;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.dde-img-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.dde-img-ctrl {
  position: absolute;
  top: 6px; right: 6px;
  display: none;
  gap: 4px;
  background: rgba(0,0,0,0.6);
  padding: 4px;
  border-radius: 4px;
}
.dde-img-cell-inner:hover .dde-img-ctrl { display: flex; }
.dde-img-mv, .dde-img-x {
  background: transparent; border: none;
  color: #fff; cursor: pointer;
  width: 22px; height: 22px;
  font-size: 11px;
  border-radius: 3px; padding: 0;
}
.dde-img-mv:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.dde-img-mv:disabled { opacity: 0.3; cursor: not-allowed; }
.dde-img-x:hover { background: #ef4444; }

.dde-img-caption-inp {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11.5px;
  text-align: center;
  font-style: italic;
  background: transparent;
  outline: none;
  color: var(--text-secondary, #4b5563);
}
.dde-img-caption-inp:hover { background: #fafbfc; border-color: var(--border, #e5e7eb); }
.dde-img-caption-inp:focus { background: #fff; border-color: #2563eb; }

.dde-image-drop {
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.dde-image-drop:hover { border-color: #2563eb; background: #eff6ff; }
.dde-image-drop-icon { font-size: 32px; }
.dde-image-drop-text {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary, #111827); margin-top: 6px;
}
.dde-image-drop-hint {
  font-size: 11.5px; color: var(--text-muted, #9ca3af); margin-top: 4px;
}

/* 사진 갤러리 — 드래그앤드롭 업로드 */
.dde-image-block.dde-dnd-over {
  outline: 2px dashed #2563eb;
  outline-offset: 4px;
  border-radius: 8px;
}
.dde-image-block.dde-dnd-over::after {
  content: '여기에 놓으면 사진이 추가됩니다';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  pointer-events: none;
  z-index: 6;
}
.dde-image-block.dde-dnd-over .dde-image-drop {
  border-color: #2563eb;
  background: #eff6ff;
}

@media (max-width: 800px) {
  .dde-body { flex-direction: column; }
  .dde-sidebar {
    width: 100%; max-height: 240px;
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
  }
  .dde-main { padding: 14px 16px 60px; }
}

/* ──── 일괄 추가 모달 ──── */
.dde-side-actions {
  display: flex;
  gap: 6px;
}

.dde-bulk-help {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary, #4b5563);
  margin: 0 0 12px 0;
}
.dde-bulk-help code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11.5px;
  font-family: monospace;
  color: #2563eb;
}

.dde-bulk-example {
  background: #f9fafb;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
}
.dde-bulk-example strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dde-bulk-example pre {
  margin: 0;
  font-family: 'Malgun Gothic', sans-serif;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary, #111827);
  white-space: pre;
}

#dde-bulk-text {
  width: 100%;
  font-family: 'Consolas', 'Malgun Gothic', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  min-height: 200px;
  tab-size: 4;
  -moz-tab-size: 4;
}
#dde-bulk-text:focus {
  border-color: #2563eb;
}

.dde-bulk-preview {
  margin-top: 12px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e40af;
}

/* ──── Dry Dock Report — 읽기 전용 모드 ──── */
.dde-readonly-banner {
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
  color: #92400e;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 18px;
  text-align: center;
}
.dde-readonly-banner::before {
  content: '🔒 ';
}

/* 읽기 전용일 때 모든 input/textarea 보더 + 호버 효과 제거 */
body.dde-readonly .dde-section-title-input,
body.dde-readonly .dde-p-input,
body.dde-readonly .dde-bullet-input,
body.dde-readonly .dde-cell-input,
body.dde-readonly .dde-cell-textarea,
body.dde-readonly .dde-img-caption-inp {
  pointer-events: none;
  background: transparent !important;
  border-color: transparent !important;
  cursor: default;
  color: var(--text-primary, #111827);
}
body.dde-readonly .dde-section-title-input:hover,
body.dde-readonly .dde-p-input:hover,
body.dde-readonly .dde-bullet-input:hover,
body.dde-readonly .dde-cell-textarea:hover {
  background: transparent !important;
  border-color: transparent !important;
}
body.dde-readonly .dde-block:hover {
  background: transparent;
}
/* 읽기 전용 모드에서는 마커 옵션 / 표 컨트롤 / 이미지 컨트롤 모두 숨김 */
body.dde-readonly .dde-bullet-opts,
body.dde-readonly .dde-bullet-add-link,
body.dde-readonly .dde-table-ctrls,
body.dde-readonly .dde-table-hint,
body.dde-readonly .dde-col-resize,
body.dde-readonly .dde-col-del,
body.dde-readonly .dde-row-del,
body.dde-readonly .dde-tbl-ctrl-col,
body.dde-readonly .dde-tbl-ctrl-col-c,
body.dde-readonly .dde-bullet-x,
body.dde-readonly .dde-img-opts,
body.dde-readonly .dde-img-ctrl {
  display: none !important;
}

.dde-blocks-empty-ro {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
  font-size: 13px;
  font-style: italic;
}

/* 목록 카드에 readonly 표시 */
.dd-card.dd-card-readonly .dd-card-edit {
  display: none;
}
.dd-card-readonly::after {
  content: '읽기 전용';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.dd-card { position: relative; }

/* ════════════════════════════════════════════════════════════
 *  Boarding Report — 신규 블록 (info_table, defect_table)
 * ════════════════════════════════════════════════════════════ */

/* ── info_table (Label-Value 쌍 표) ── */
.bre-info-table-wrap {
  overflow-x: auto;
  margin: 4px 0;
}
.bre-info-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--border, #d1d5db);
}
.bre-info-table td {
  border: 1px solid var(--border, #d1d5db);
  padding: 6px 10px;
  vertical-align: top;
}
.bre-info-table td.bre-info-label {
  width: 28%;
  background: #f3f4f6;
  font-weight: 600;
}
.bre-info-table td.bre-info-value {
  background: #fff;
}
.bre-info-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  font: inherit;
  color: inherit;
  outline: none;
  resize: none;
}
.bre-info-input:hover { border-color: #e5e7eb; }
.bre-info-input:focus { border-color: #2563eb; background: #fff; }
.bre-info-textarea { min-height: 28px; line-height: 1.45; }

/* ── defect_table (결함 표) ── */
.bre-defect-wrap {
  overflow-x: auto;
  margin: 4px 0;
}
.bre-defect-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--border, #d1d5db);
  font-size: 13px;
}
.bre-defect-table thead th {
  background: #1f4e79;
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  text-align: center;
  padding: 8px 6px;
  border: 1px solid #1f4e79;
}
.bre-defect-th-no    { width: 42px; }
.bre-defect-th-photo { width: 22%; }
.bre-defect-th-desc  { width: 30%; }
.bre-defect-th-fix   { width: 27%; }
.bre-defect-th-risk  { width: 110px; }

.bre-defect-table td {
  border: 1px solid var(--border, #d1d5db);
  padding: 6px;
  vertical-align: top;
}
.bre-defect-row.bre-defect-risk-L { background: #f0fdf4; }
.bre-defect-row.bre-defect-risk-M { background: #fffbeb; }
.bre-defect-row.bre-defect-risk-H { background: #fef2f2; }

.bre-defect-no {
  text-align: center;
  font-weight: 700;
  color: #4b5563;
  vertical-align: middle !important;
}

/* 사진 셀 */
.bre-defect-photo-cell {
  text-align: center;
  position: relative;
}
.bre-defect-photo-add {
  background: transparent;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  padding: 18px 8px;
  width: 100%;
  cursor: pointer;
  color: #6b7280;
  font-size: 11.5px;
  line-height: 1.6;
}
.bre-defect-photo-add:hover { border-color: #2563eb; background: #f0f9ff; color: #2563eb; }

/* 결함 사진 셀 — 드래그앤드롭 업로드 */
.bre-defect-photo-cell.bre-defect-dnd-over {
  outline: 2px dashed #2563eb;
  outline-offset: -3px;
  background: rgba(37, 99, 235, 0.10);
}
.bre-defect-photo-cell.bre-defect-dnd-over::after {
  content: '여기에 놓기';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  z-index: 4;
}
.bre-defect-photo-cell.bre-defect-dnd-over .bre-defect-photo-add {
  border-color: #2563eb;
  background: #eff6ff;
}
.bre-defect-photo-main {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  display: block;
}
.bre-defect-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.bre-defect-photo-thumb {
  width: 38px; height: 38px;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #d1d5db;
}
.bre-defect-photo-thumb:hover { border-color: #2563eb; }
.bre-defect-photo-actions {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 5px;
}
.bre-defect-photo-add-btn,
.bre-defect-photo-del-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  width: 22px; height: 22px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #4b5563;
}
.bre-defect-photo-add-btn:hover { background: #dbeafe; color: #1d4ed8; border-color: #2563eb; }
.bre-defect-photo-del-btn:hover { background: #fee2e2; color: #b91c1c; border-color: #dc2626; }

/* Description / Rectification / Item */
.bre-defect-desc-cell, .bre-defect-fix-cell { background: transparent; }
.bre-defect-item-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 4px;
  outline: none;
}
.bre-defect-item-input:hover { border-color: #e5e7eb; }
.bre-defect-item-input:focus { border-color: #2563eb; background: #fff; }
.bre-defect-desc-input, .bre-defect-fix-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  resize: none;
  line-height: 1.5;
}
.bre-defect-desc-input:hover, .bre-defect-fix-input:hover { border-color: #e5e7eb; }
.bre-defect-desc-input:focus, .bre-defect-fix-input:focus { border-color: #2563eb; background: #fff; }

/* Risk 셀 */
.bre-defect-risk-cell { text-align: center; vertical-align: middle !important; }
.bre-defect-risk-select {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  font-size: 12px;
  text-align-last: center;
  cursor: pointer;
}
.bre-defect-row.bre-defect-risk-L .bre-defect-risk-select { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.bre-defect-row.bre-defect-risk-M .bre-defect-risk-select { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.bre-defect-row.bre-defect-risk-H .bre-defect-risk-select { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Risk 범례 */
.bre-defect-legend {
  margin-top: 10px;
  font-size: 12px;
  color: #4b5563;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid var(--border, #e5e7eb);
}
.bre-defect-legend-L { color: #065f46; font-weight: 600; }
.bre-defect-legend-M { color: #92400e; font-weight: 600; }
.bre-defect-legend-H { color: #991b1b; font-weight: 600; }

/* 빈 섹션 - 신규 블록 2종 포함 6칸 그리드 */
.bre-add-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}
@media (max-width: 900px) {
  .bre-add-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* 읽기 전용 시 신규 블록도 비활성화 */
body.dde-readonly .bre-info-input,
body.dde-readonly .bre-defect-item-input,
body.dde-readonly .bre-defect-desc-input,
body.dde-readonly .bre-defect-fix-input {
  pointer-events: none;
  background: transparent !important;
  border-color: transparent !important;
}
body.dde-readonly .bre-defect-risk-select { pointer-events: none; }
body.dde-readonly .bre-defect-photo-add,
body.dde-readonly .bre-defect-photo-actions,
body.dde-readonly .bre-defect-photo-main,
body.dde-readonly .bre-defect-photo-thumb {
  pointer-events: none;
}

/* ──── 표 셀 선택 표시 (Ctrl/Shift+클릭) ──── */
.dde-cell-selected {
  background-color: #dbeafe !important;
  box-shadow: inset 0 0 0 2px #2563eb;
}

/* ──── 표 셀 우클릭 컨텍스트 메뉴 ──── */
.dde-table-ctx-menu {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px;
  z-index: 9999;
  min-width: 220px;
  font-size: 13px;
}
.dde-ctx-item {
  display: block;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  border-radius: 4px;
  color: var(--text-primary, #111827);
}
.dde-ctx-item:hover:not(.disabled):not(:disabled) {
  background: #eff6ff;
  color: #1d4ed8;
}
.dde-ctx-item.disabled, .dde-ctx-item:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}
.dde-ctx-sep {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* ──── 섹션 이동 모달 ──── */
.dde-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.dde-modal {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  width: 90%; max-width: 480px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.dde-modal-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary, #111827);
  margin-bottom: 8px;
}
.dde-modal-hint {
  font-size: 12px; color: var(--text-secondary, #6b7280);
  margin-bottom: 12px;
}
.dde-modal-list {
  flex: 1; overflow-y: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #fafafa;
  padding: 4px;
  margin-bottom: 16px;
  max-height: 360px;
}
.dde-modal-option {
  padding: 8px 12px;
  cursor: pointer;
  font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  border-radius: 4px;
  white-space: pre;
  color: var(--text-primary, #111827);
}
.dde-modal-option:hover { background: #eff6ff; }
.dde-modal-option.selected {
  background: #2563eb; color: #fff;
}
.dde-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}

/* 목차 ↗ 버튼 (이동) */
.dde-toc-btn[title="다른 섹션으로 이동…"] {
  /* 기본 토글 버튼과 동일 스타일이지만 강조 */
  color: var(--text-secondary, #6b7280);
}
.dde-toc-btn[title="다른 섹션으로 이동…"]:hover {
  background: #eff6ff;
  color: #2563eb;
}


/* ═══════════════════════════════════════════════════════════
   출장 경비 (Business Trip Expense)
   ═══════════════════════════════════════════════════════════ */
.expd-total-chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #eef2ff; color: #3730a3; font-weight: 500; font-size: 12px;
  margin-left: 4px;
}

/* 상세 페이지 */
.expd-wrap { max-width: 1200px; margin: 0 auto; }
.expd-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.expd-title-block { min-width: 0; }
.expd-title { font-size: 20px; font-weight: 600; margin: 0; }
.expd-subtitle { font-size: 12.5px; color: #6b7280; margin-top: 2px; }

.expd-totals { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.expd-total-label { font-size: 12px; color: #6b7280; font-weight: 600; }

.expd-add-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.expd-add-bar .form-hint { font-size: 12px; color: #9ca3af; }

/* 영수증 표 */
.expd-table-wrap { overflow-x: auto; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 24px; }
.expd-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 920px; }
.expd-table thead th {
  background: #f3f4f6; color: #374151; font-weight: 600; text-align: left;
  padding: 9px 8px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; font-size: 12px;
}
.expd-table thead th.num { text-align: right; }
.expd-table tbody td { padding: 5px 6px; border-bottom: 1px solid #f1f1f1; vertical-align: middle; }
.expd-table tbody tr:nth-child(odd) { background: #fcfcfd; }
.expd-table td.seq { font-variant-numeric: tabular-nums; color: #6b7280; text-align: center; width: 52px; }
.expd-table td.num { text-align: right; }
.expd-table td.ph  { width: 56px; text-align: center; }
.expd-table td.del { width: 34px; text-align: center; }

.expd-cell-input {
  width: 100%; box-sizing: border-box; padding: 5px 6px;
  border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px; background: #fff;
}
.expd-cell-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.expd-cell-input.sel  { min-width: 96px; }
.expd-cell-input.card { min-width: 90px; }
.expd-cell-input.cur  { width: 72px; text-transform: uppercase; }
.expd-cell-input.num  { text-align: right; }
.expd-cell-input:disabled { background: #f3f4f6; color: #9ca3af; }
.expd-cell-input.expd-req-missing { border-color: #f0997b; background: #fef6f2; }

.expd-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid #e5e7eb; cursor: pointer; }
.expd-nophoto { color: #d1d5db; }
.expd-del-btn {
  width: 26px; height: 26px; border: none; background: transparent; color: #b91c1c;
  font-size: 18px; line-height: 1; cursor: pointer; border-radius: 5px;
}
.expd-del-btn:hover { background: #fee2e2; }

/* 증빙 갤러리 (화면) */
.expd-section-title { font-size: 15px; font-weight: 600; margin: 8px 0 12px; }
.expd-receipt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.expd-receipt-cell { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; background: #fff; }
.expd-receipt-imgbox { height: 200px; display: flex; align-items: center; justify-content: center; background: #f8f8f9; border-radius: 6px; overflow: hidden; }
.expd-receipt-img { max-width: 100%; max-height: 200px; object-fit: contain; }
.expd-receipt-cap { margin-top: 6px; font-size: 11.5px; color: #4b5563; text-align: center; line-height: 1.4; }
.expd-receipt-cap-head { font-size: 11px; color: #6b7280; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.expd-receipt-cap-input { width: 100%; box-sizing: border-box; text-align: center; font-size: 12px; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px 6px; background: #fff; }
.expd-receipt-cap-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }
.expd-receipt-cap-input:disabled { background: #f3f4f6; color: #6b7280; }
.expd-gallery-empty { color: #9ca3af; font-size: 13px; padding: 12px 0; }
.expd-print-head { display: none; }

/* 추출 리뷰 모달 */
.expd-review-grid { display: grid; grid-template-columns: 240px 1fr; gap: 18px; }
.expd-review-photo { background: #f8f8f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; max-height: 360px; overflow: hidden; }
.expd-review-photo img { max-width: 100%; max-height: 360px; object-fit: contain; }
.expd-review-warn { background: #fef6f2; border: 1px solid #f0997b; color: #7a2e12; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5; }
.expd-warn-hint { display: inline-block; margin-top: 4px; color: #9a3d1d; font-size: 11.5px; }
@media (max-width: 640px) { .expd-review-grid { grid-template-columns: 1fr; } }

/* ── A4 인쇄: 증빙 영수증만, 한 장당 4~6개 ── */
@media print {
  .topnav, .expd-topbar, .expd-totals, .expd-add-bar, .expd-table-wrap,
  .expd-section-title, .no-print, .modal { display: none !important; }
  .main-content { padding: 0 !important; margin: 0 !important; }
  .expd-wrap { max-width: none; }

  .expd-print-head { display: block !important; margin-bottom: 6mm; }
  .expd-print-title { font-size: 15pt; font-weight: 700; }
  .expd-print-sub { font-size: 10pt; color: #333; margin-top: 1mm; }

  .expd-receipt-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .expd-receipt-cell { break-inside: avoid; page-break-inside: avoid; border: 1px solid #999; border-radius: 0; padding: 3mm; background: #fff; }
  .expd-receipt-imgbox { height: 108mm; background: #fff; }
  .expd-receipt-img { max-width: 100%; max-height: 108mm; object-fit: contain; }
  .expd-receipt-cap { margin-top: 2mm; font-size: 9pt; color: #000; }
  .expd-receipt-cap-head { font-size: 9pt; color: #000; margin-bottom: 1mm; }
  .expd-receipt-cap-input { border: none !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; font-size: 10pt; color: #000; text-align: center; }

  @page { size: A4 portrait; margin: 12mm; }
}

/* ── 영수증 크롭 / 원근보정 모달 ── */
.expd-crop-modal { z-index: 1200; }
.expd-crop-box {
  position: relative; z-index: 1; margin: auto; background: #1f2937; color: #fff;
  border-radius: 12px; width: min(96vw, 720px); max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.expd-crop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.12); }
.expd-crop-head .modal-close { color: #fff; background: transparent; border: none; font-size: 22px; line-height: 1; cursor: pointer; }
.expd-crop-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: #111827; overflow: auto; }
#expd-crop-canvas { display: block; max-width: 100%; max-height: 66vh; touch-action: none; user-select: none; }
.expd-crop-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); touch-action: none; }
#expd-crop-svg { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
#expd-crop-poly { fill: rgba(37,99,235,0.14); stroke: #3b82f6; stroke-width: 2; }
.expd-crop-handle {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; background: rgba(59,130,246,0.35); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5); cursor: grab; touch-action: none;
}
.expd-crop-handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.expd-crop-handle:active { cursor: grabbing; background: rgba(59,130,246,0.6); }
.expd-crop-hint { padding: 8px 16px; font-size: 12.5px; color: #cbd5e1; text-align: center; }
.expd-crop-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.12); }

/* ── CS 보고서 자동 추출 ── */
.csx-bar { margin: 0 0 10px; }
.csx-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.csx-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.csx-row { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 10px; background: #fff; }
.csx-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.csx-chk { width: 17px; height: 17px; flex: 0 0 auto; }
.csx-cat { flex: 0 0 auto; padding: 5px 6px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; font-size: 13px; }
.csx-in { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; font-size: 13px; }
.csx-ta { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; font-size: 13px; resize: vertical; }
.csx-row-rem { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.csx-rem-label { font-size: 11.5px; color: var(--text-tertiary, #9ca3af); flex: 0 0 auto; }
.csx-selall { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary, #4b5563); }

/* ═══════════════════════════════════════════════════════════════
   CLASS STATUS 탭
   ═══════════════════════════════════════════════════════════════ */
.cls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.cls-card-unm { border-color: var(--amber-border, #f0c36d); }

.cls-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cls-unm-head { background: #fff8ec; }
.cls-toggle {
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
  width: 20px; height: 20px; line-height: 1;
}
.cls-toggle.open { color: var(--blue); }

.cls-vessel { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.cls-vessel-name { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.cls-vessel-type {
  font-size: 11px; color: var(--text-tertiary);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px;
}
.cls-badge {
  font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 7px;
  background: var(--blue-bg); color: var(--blue-text);
}
.cls-badge.society { background: #eef2ff; color: #4338ca; letter-spacing: .3px; }
.cls-badge.warn { background: #fef3c7; color: #92400e; }

.cls-meta {
  display: flex; align-items: center; gap: 14px; flex: 1;
  font-size: 12px; color: var(--text-secondary); flex-wrap: wrap;
}
.cls-src {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-tertiary); font-family: ui-monospace, monospace; font-size: 11px;
}
.cls-counts { font-weight: 600; color: var(--text-primary); }
.cls-actions { display: flex; align-items: center; gap: 6px; }
.cls-del { color: var(--red); border-color: var(--red-border); }
.cls-del:hover { background: var(--red-bg); }

.cls-card-body { padding: 4px 14px 14px; }
.cls-noitems { padding: 16px 4px; color: var(--text-tertiary); font-size: 13px; }

.cls-cat { margin-top: 12px; }
.cls-cat-title {
  font-size: 13px; font-weight: 700; margin: 6px 0 6px;
  padding-left: 8px; border-left: 3px solid var(--border);
}
.cls-cat-title.coc  { border-left-color: #dc2626; color: #b91c1c; }
.cls-cat-title.stat { border-left-color: #2563eb; color: #1d4ed8; }

.cls-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cls-table th, .cls-table td {
  border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left;
}
.cls-table thead th {
  background: var(--surface-2); font-weight: 600; color: var(--text-secondary);
  font-size: 11.5px; white-space: nowrap;
}
.cls-table .c-no   { width: 36px; text-align: center; color: var(--text-tertiary); }
.cls-table .c-date { width: 96px; white-space: nowrap; }
.cls-table .c-desc { min-width: 280px; }
.cls-table .c-rmk  { width: 30%; }
.cls-table .c-imp  { width: 78px; text-align: center; }

.cls-edit { cursor: text; outline: none; white-space: pre-wrap; word-break: break-word; }
.cls-edit:focus { box-shadow: inset 0 0 0 2px var(--blue); background: #fff; }
.cls-edit.c-rmk { background: #fcfcf7; }

.cls-urgent-cell { text-align: center; }
.cls-urgent-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #dc2626; }
tr.cls-urgent-row td { background: #fff5f5; }
tr.cls-urgent-row .c-no { color: #dc2626; font-weight: 700; }

/* 미매칭 */
.cls-unm-title {
  font-size: 14px; font-weight: 700; color: #92400e;
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.cls-assign-sel {
  font-size: 12px; padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); max-width: 200px;
}

/* 업로드 결과 */
.cls-up-results { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cls-up-spin { font-size: 13px; color: var(--text-secondary); padding: 8px 0; }
.cls-up-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
}
.cls-up-row.ok   { background: #f0fdf4; border-color: #bbf7d0; }
.cls-up-row.warn { background: #fffbeb; border-color: #fde68a; }
.cls-up-row.err  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cls-up-file { font-weight: 600; font-family: ui-monospace, monospace; }
.cls-up-vessel { color: var(--text-primary); }
.cls-up-cnt { color: var(--text-secondary); margin-left: auto; }

.cls-up-results + .form-hint, .modal-foot .form-hint { font-size: 12px; color: var(--text-tertiary); }
.cs-toolbar .form-hint { font-size: 12px; color: var(--text-tertiary); }
.cls-bulk-toggle { display: inline-flex; gap: 6px; }
.csx-dropzone { padding: 18px 16px; margin-bottom: 10px; cursor: pointer; }

/* ───── Vetting 선박 단위 SIRE 요약 패널 (자동 집계, 읽기전용) ───── */
.vt-digest { margin: 2px 0 12px; overflow-x: auto; }
.vt-digest-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.vt-digest-table th {
  text-align: left; padding: 7px 12px; background: #fff8e1;
  color: var(--text-secondary); font-weight: 600; font-size: 11.5px;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.vt-digest-table td { padding: 9px 12px; vertical-align: top; white-space: nowrap; }
.vt-digest-table th:last-child, .vt-digest-table td:last-child { width: 46%; white-space: normal; }
.vt-dg-status { font-weight: 700; }
.vt-dg-next { color: #1d4ed8; }
.vt-dg-last { color: #b91c1c; }
.vt-dg-total { color: #047857; font-weight: 700; }
.vt-dg-open { color: #dc2626; font-weight: 700; }
.vt-dg-open-zero { color: var(--text-tertiary); font-weight: 700; }
.vt-dg-sep { color: var(--text-tertiary); }
.vt-dg-detail { min-width: 280px; color: var(--text); }
.vt-dg-line { line-height: 1.55; min-height: 1.55em; white-space: normal; }

/* ───── Class Status 선박 단위 요약 패널 (자동 집계, 읽기전용) ───── */
.cls-digest { margin: 0 0 12px; overflow-x: auto; }
.cls-digest-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.cls-digest-table th {
  text-align: left; padding: 7px 12px; background: #ecfdf5; color: #065f46;
  font-weight: 600; font-size: 11.5px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
.cls-digest-table td { padding: 9px 12px; vertical-align: top; white-space: nowrap; }
.cls-digest-table th:nth-child(2), .cls-digest-table td.cls-dg-coc { text-align: center; }
.cls-digest-table th:last-child, .cls-digest-table td:last-child { width: 72%; white-space: normal; }
.cls-dg-society { font-weight: 700; color: #047857; }
.cls-dg-coc { font-weight: 700; color: #b45309; }
.cls-dg-detail { min-width: 280px; color: var(--text); }
.cls-dg-line { line-height: 1.55; min-height: 1.55em; white-space: normal; }

/* ─────────── 모바일 테이블 가로스크롤 래퍼 ─────────── */
/* 데스크탑: 투명 래퍼(레이아웃 영향 0). 모바일에서만 가로스크롤로 표 컬럼 짓눌림 방지 */
.tbl-scroll { width: 100%; }
@media (max-width: 768px) {
  .tbl-scroll, .cls-digest, .vt-digest {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* 모바일: fixed 레이아웃 해제 → 셀 내용을 한 줄로(nowrap) 유지해 자연폭 확보 → 래퍼가 가로스크롤 */
  .tbl-scroll > table,
  .cls-digest > table,
  .vt-digest > table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 100%;
  }
  .tbl-scroll > table th, .tbl-scroll > table td,
  .cls-digest > table th, .cls-digest > table td,
  .vt-digest > table th, .vt-digest > table td {
    white-space: nowrap !important;
    width: auto !important;
  }
}
