:root {
  --bg: #e8ecf4;
  --surface: #ffffff;
  --surface2: #f1f4fa;
  --border: #cdd6e6;
  --text: #162032;
  --muted: #5c677d;
  --brand: #2b57a7;
  --brand-bright: #3a67c4;
  --accent: #2456b8;
  --danger: #c62828;
  --radius: 12px;
  --sidebar-w-expanded: 268px;
  --sidebar-w-collapsed: 64px;
  --font: system-ui, "Segoe UI", sans-serif;

  /* 사이드바 접기 버튼 아이콘 — 커스텀 PNG/SVG 사용 시 url(...) 로 교체 (none 이면 아래 기본 SVG 사용) */
  --sidebar-toggle-icon-open: none;
  --sidebar-toggle-icon-closed: none;

  --sidebar-bg: #212529;
  --sidebar-edge: rgba(255, 255, 255, 0.08);
  --sidebar-link: #89928e;
  --sidebar-active-bg: rgba(255, 255, 255, 0.10);
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
  --sidebar-brand-text: #ffffff;

  --shadow-panel: 0 12px 40px rgba(22, 32, 52, 0.08);
  --shadow-modal: 0 28px 56px rgba(22, 32, 52, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.view {
  min-height: 100vh;
}

.view--login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(ellipse 100% 80% at 50% -25%, rgba(43, 87, 167, 0.14) 0%, transparent 52%),
    var(--bg);
}

.login-layout {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.login-brand {
  text-align: center;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.login-brand__logo {
  display: block;
  margin: 0 auto;
  max-width: min(220px, 85vw);
  height: auto;
}

.login-brand__subtitle {
  margin: 12px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.login-brand__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.1;
}

.login-brand__badge {
  display: inline-block;
  padding: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.login-brand__footer {
  margin: 22px auto 0;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  width: 100%;
}

.login-brand__footer-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

.login-brand__footer-link:hover {
  opacity: 0.85;
}

.login-brand__footer-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 4px;
}

.login-brand__footer-logo {
  display: inline-block;
  max-width: 110px;
  height: auto;
  opacity: 0.95;
  vertical-align: middle;
}

/* 로그인 패널 — 폼 자식 가운데 정렬 + 일관 간격 */
.panel--login {
  padding: 32px 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.panel--login .field {
  margin-bottom: 14px;
}

.panel--login .field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.panel--login .btn--block {
  margin-top: 6px;
}

.panel--login .btn--link {
  text-align: center;
  margin-top: 2px;
}

/* 입력 그룹 — 아이콘은 인풋 박스 밖에 단독, 배경/테두리 없음 */
.input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.input-group > input,
.field .input-group > input,
.panel--login .field .input-group > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
  color: var(--text);
  font-size: 1rem;
}

.input-group > input:focus,
.field .input-group > input:focus,
.panel--login .field .input-group > input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.input-group .input-group-addon,
.input-group .btn.input-group-addon,
.input-group .btn.btn-primary.input-group-addon {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  box-sizing: content-box;
  text-decoration: none;
  user-select: none;
  cursor: default;
  outline: none;
  box-shadow: none;
}

/* ID/비밀번호 아이콘 — 배경/테두리/포커스 효과 모두 제거 */
.input-group .input-group-addon.input-group-addon--brand,
.input-group .btn.btn-primary.input-group-addon--brand {
  background: transparent;
  border: 0;
  color: var(--muted);
}

.input-group .input-group-addon:hover,
.input-group .input-group-addon--brand:hover,
.input-group .btn.btn-primary.input-group-addon--brand:hover {
  filter: none;
  background: transparent;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 100%;
  box-shadow: var(--shadow-panel);
}

.panel__title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
}

.panel__meta {
  margin: 0 0 22px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input,
.field select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1rem;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.field--inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.field--inline label {
  white-space: nowrap;
  color: #212529;
  font-weight: 600;
}

/* 날짜 범위 필터 — '시작일 ~ 종료일' */
.field--date-range {
  gap: 8px;
}

.hist-date-input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 0;
}

.hist-date-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.field--date-range .field__sep {
  color: var(--muted);
  font-weight: 600;
  user-select: none;
}

/* 작업 이력 필터 컨트롤 높이 축소 (UGV/기간/결과 박스, Excel 버튼) */
.page-history .page-filters .field--inline select,
.page-history .page-filters .hist-date-input,
.page-history .page-filters .btn--excel {
  height: 33px;
  min-height: 33px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  box-sizing: border-box;
}

/* 작업 이력 — 조회 건수 라벨 (Excel 버튼 좌측, 자기 자신만 오른쪽 정렬) */
.page-history .page-filters .hist-count {
  margin-left: auto;
  align-self: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #212529;
  white-space: nowrap;
}

.btn {
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}

.btn--primary {
  background: linear-gradient(180deg, var(--brand-bright), var(--brand));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover {
  border-color: var(--brand);
}

/* 페이지 툴바 — 아이콘 + 텍스트 액션 버튼 */
.btn--action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  border: 1px solid transparent;
  padding: 9px 16px;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(22, 32, 52, 0.10);
}

.btn--action > i {
  font-size: 0.95rem;
  line-height: 1;
}

.btn--action-add {
  background: #2f70ff;
  border-color: #2f70ff;
}

.btn--action-add:hover {
  filter: brightness(1.06);
}

.btn--action-delete {
  background: #d33242;
  border-color: #d33242;
}

.btn--action-delete:hover {
  filter: brightness(1.06);
}

.btn--brand-outline {
  background: transparent;
  color: var(--accent);
  border-color: rgba(79, 139, 235, 0.45);
}

.btn--brand-outline:hover {
  background: rgba(43, 87, 167, 0.1);
}

.btn--muted {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn--muted:hover {
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface2);
  border-color: var(--brand);
}

.btn--danger {
  background: rgba(198, 40, 40, 0.08);
  color: var(--danger);
  border-color: rgba(198, 40, 40, 0.35);
}

.btn--danger:hover {
  background: rgba(198, 40, 40, 0.14);
}

.btn--link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px 0;
  font-weight: 500;
  text-decoration: underline;
  width: 100%;
}

.btn--block {
  width: 100%;
  margin-bottom: 8px;
}

.btn--icon {
  padding: 4px 10px;
  font-size: 1.4rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--muted);
}

.btn--icon:hover {
  color: var(--text);
}

.btn--small {
  padding: 6px 12px;
  font-weight: 700;
}

.btn--sidebar-logout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--sidebar-link);
  border-color: var(--sidebar-edge);
}

.sidebar__logout-icon {
  font-size: 1rem;
  line-height: 1;
}

.btn--sidebar-logout:hover {
  color: #ffffff;
  background: var(--sidebar-hover-bg);
  border-color: rgba(255, 255, 255, 0.22);
}

.msg {
  font-size: 0.88rem;
  margin: 0 0 12px;
}

.msg--error {
  color: var(--danger);
}

.view--app {
  display: flex;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* 모바일 주소창 등 — 가능하면 동적 뷰포트 높이 사용 */
@supports (height: 100dvh) {
  .view--app {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
  }
}

.sidebar {
  width: var(--sidebar-w-expanded);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-edge);
  min-height: 0;
  align-self: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.22s ease;
}

.sidebar__head {
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--sidebar-edge);
}

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

.sidebar__toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--sidebar-edge);
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-link);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sidebar__toggle:hover {
  background: var(--sidebar-hover-bg);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sidebar__toggle:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

.sidebar__toggle-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.sidebar__brand {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--sidebar-brand-text);
  line-height: 1.3;
}

.sidebar__link-short {
  display: none;
}

.sidebar__logout-short {
  display: none;
}

@media (min-width: 769px) {
  .view--app.view--sidebar-collapsed .sidebar {
    width: var(--sidebar-w-collapsed);
  }

  .view--app.view--sidebar-collapsed .sidebar__brand {
    display: none;
  }

  .view--app.view--sidebar-collapsed .sidebar__head-top {
    justify-content: center;
  }

  /* 접힘 — 네비 버튼: 아이콘만 가운데 정렬로 표시, 텍스트 숨김 */
  .view--app.view--sidebar-collapsed .sidebar__nav {
    padding: 16px 8px;
  }

  .view--app.view--sidebar-collapsed .sidebar__link {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }

  .view--app.view--sidebar-collapsed .sidebar__link-text,
  .view--app.view--sidebar-collapsed .sidebar__link-short {
    display: none;
  }

  .view--app.view--sidebar-collapsed .sidebar__link-icon {
    width: auto;
    font-size: 1.1rem;
  }

  /* 접힘 — 로그아웃 버튼: 아이콘만 표시 */
  .view--app.view--sidebar-collapsed .sidebar__foot {
    padding: 16px 8px 24px;
  }

  .view--app.view--sidebar-collapsed .btn--sidebar-logout {
    padding: 10px 0;
    gap: 0;
  }

  .view--app.view--sidebar-collapsed .sidebar__logout-text,
  .view--app.view--sidebar-collapsed .sidebar__logout-short {
    display: none;
  }

  .view--app.view--sidebar-collapsed .sidebar__logout-icon {
    font-size: 1.05rem;
  }
}

.sidebar__nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar__link {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-link);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar__link-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: inherit;
}

.sidebar__link:hover {
  background: var(--sidebar-hover-bg);
  color: #ffffff;
}

.sidebar__link--active {
  background: var(--sidebar-active-bg);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--sidebar-active-text);
}

.sidebar__foot {
  padding: 16px 12px 24px;
  border-top: 1px solid var(--sidebar-edge);
}

.app-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 32px 6px;
}

.app-brand-logo {
  display: block;
  width: 80px;
  height: auto;
  max-height: 20px;
  object-fit: contain;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 28px 32px 40px;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.85) 0%, transparent 48%),
    linear-gradient(160deg, rgba(43, 87, 167, 0.06) 0%, transparent 42%),
    var(--bg);
}

.workspace {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.main-list-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-right: 2px;
}

.main-list-view > .page {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#page-ugv {
  overflow-y: auto;
}

.page-history {
  overflow: hidden;
  min-height: 0;
}

.page-history .page-head,
.page-history .page-filters {
  flex-shrink: 0;
}

.main-list-view[hidden] {
  display: none !important;
}

.main-inline-panel {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

/* HTML hidden 속성보다 위에서 준 display:flex가 이기는 문제 방지 */
.main-inline-panel[hidden] {
  display: none !important;
  flex: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.main-inline-panel:not([hidden]) {
  display: flex;
}

.workspace-detail__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface2);
}

.workspace-detail__close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

.workspace-detail__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #212529;
}

.workspace-detail__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.workspace-detail__body .embedded-modal {
  position: static !important;
  left: auto !important;
  top: auto !important;
  translate: none !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.workspace-detail__body .embedded-modal .modal__header {
  display: none;
}

.workspace-detail__body .embedded-modal .modal__body {
  flex: 1;
  min-height: 0;
}

.workspace-detail__body .embedded-modal .modal__footer {
  flex-shrink: 0;
  border-radius: 0;
}

.workspace-detail__body .embedded-modal.modal--large,
.workspace-detail__body .embedded-modal.modal--xlarge {
  width: 100% !important;
}

.page {
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: min-content;
}

.page--hidden {
  display: none !important;
}

.page-head__title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #212529;
}

/* 타이틀과 액션 버튼을 같은 행에 두는 페이지 헤더 */
.page-head--with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head--with-actions .page-toolbar {
  margin: 0;
}

.page-head__icon {
  font-size: 1.35rem;
  color: #212529;
  line-height: 1;
}

.page-head__desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 720px;
}

.page-toolbar,
.page-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.page-toolbar {
  justify-content: flex-end;
}

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.page-card--grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.table-wrap--page {
  max-height: none;
}

.table-wrap--tall {
  flex: 1;
  max-height: min(560px, calc(100vh - 320px));
}

.hist-empty {
  margin: 12px 4px 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.history-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-layout__table {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-layout__table.page-card {
  min-height: 0;
}

.history-layout__table .table-wrap--history {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.history-layout__detail.page-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: 10px;
  box-sizing: border-box;
  overflow: visible;
}

.history-layout__detail[hidden] {
  display: none !important;
}

.history-detail-panel__title {
  flex-shrink: 0;
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.history-detail-panel__icon {
  font-size: 1.1rem;
  color: #212529;
  line-height: 1;
}

/* '소독 완료 영역' 패널 푸터 — 표 컬럼 시작 위치에 맞춰 좌측 정렬 */
.history-detail-panel__foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 6px;
  /* 맵(260) + 컬럼간격(18) + 줌(44) + 컬럼간격(18) = 340px → 정보 컬럼 시작 위치 */
  padding-left: 340px;
}

/* 푸터가 JS에 의해 정보 컬럼 안으로 이동된 경우 — 표 바로 아래 정렬 */
.detail-popup__col--info > .history-detail-panel__foot {
  padding-left: 0;
  margin-top: 6px;
  width: 100%;
}

@media (max-width: 1199px) {
  .history-detail-panel__foot {
    padding-left: 0;
    justify-content: flex-end;
  }
}

/* '이력 삭제' 버튼 */
.btn--history-delete {
  height: 33px;
  min-height: 33px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #d33242;
  color: #ffffff;
  border: 1px solid #d33242;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(22, 32, 52, 0.10);
}

.btn--history-delete > i {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1;
}

.btn--history-delete:hover {
  filter: brightness(1.06);
  color: #ffffff;
}

.btn--history-delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.history-detail-mount {
  flex: 0 0 auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.history-detail-mount .detail-popup-body--history-fixed {
  flex: 0 0 auto;
  min-height: 0;
  align-items: flex-start;
  margin: 0;
  padding: 5px 0;
  box-sizing: border-box;
  --detail-map-size: 260px;
  width: 100%;
  max-width: 100%;
}

.history-detail-mount .modal__body.detail-popup-body--history-fixed {
  padding: 0;
  overflow: visible;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--info {
  flex: 1 1 0%;
  min-width: 0;
  align-self: flex-start;
  height: auto;
  min-height: 0;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table-wrap {
  flex: 0 0 auto;
  height: auto;
  max-height: 200px;
  overflow: auto;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  padding-bottom: 10px;
  box-sizing: border-box;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table thead th,
.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table tbody td {
  vertical-align: top;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table th,
.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.history-detail-mount .detail-popup-body--history-fixed .detail-popup-table thead th {
  white-space: normal;
}

.detail-popup-body--history-fixed.detail-popup-body--history-empty {
  align-items: flex-start;
}

.detail-popup__col--history-spacer {
  flex-shrink: 0;
  width: 44px;
  height: var(--detail-map-size);
  min-height: var(--detail-map-size);
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;
}

.detail-map.detail-map--empty {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.detail-map.detail-map--empty .detail-map__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-popup-table__placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px 12px;
  vertical-align: middle;
}

.data-table--interactive tbody tr.history-row--selected {
  background: rgba(43, 87, 167, 0.11);
  box-shadow: inset 3px 0 0 var(--brand);
}

.data-table--interactive tbody tr.history-row--selected:hover {
  background: rgba(43, 87, 167, 0.14);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.modal-layer:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 32, 52, 0.38);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  pointer-events: auto;
  z-index: 1;
}

.modal--large {
  width: min(920px, calc(100vw - 32px));
}

.modal--xlarge {
  width: min(1000px, calc(100vw - 24px));
}

.modal--small {
  width: min(400px, calc(100vw - 32px));
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal__toolbar {
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.modal__body {
  padding: 16px 20px 20px;
  overflow: auto;
}

.modal__footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal__footer--single-wide {
  justify-content: center;
}

.modal__footer--single-wide .btn--footer-wide {
  min-width: min(100%, 22rem);
  padding-left: 3rem;
  padding-right: 3rem;
}

.workspace-detail__body .modal__footer--single-wide .btn--footer-wide {
  max-width: min(100%, 28rem);
}

/* 좁은 액션 버튼(취소/추가, 취소/삭제) — 우측 정렬, 동일 폭 */
.modal__footer--narrow-actions {
  justify-content: flex-end;
  gap: 12px;
}

.btn--narrow-action {
  width: 8.4rem;
  min-width: 8.4rem;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.btn--narrow-cancel {
  background: #909294;
  color: #ffffff;
  border-color: #909294;
}

.btn--narrow-cancel:hover {
  filter: brightness(1.06);
}

.btn--narrow-confirm {
  background: linear-gradient(180deg, var(--brand-bright), var(--brand));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--narrow-confirm:hover {
  filter: brightness(1.06);
}

.btn--narrow-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn--narrow-danger:hover {
  filter: brightness(1.06);
}

/* Excel 내보내기 버튼 */
.btn--excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #217346;
  color: #ffffff;
  border: 1px solid #217346;
  box-shadow: 0 2px 6px rgba(22, 32, 52, 0.10);
}

.btn--excel > i {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1;
}

.btn--excel:hover {
  filter: brightness(1.06);
  color: #ffffff;
}

.modal__footer--split {
  justify-content: stretch;
}

.modal__footer--split .btn {
  flex: 1;
}

.modal.modal--large,
.modal.modal--xlarge {
  max-height: calc(100vh - 40px);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table thead th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr:hover {
  background: rgba(43, 87, 167, 0.06);
}

.data-table--interactive tbody tr {
  cursor: pointer;
}

.col-check {
  width: 44px;
  text-align: center;
}

.check-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

/* 소독 완료 영역 — 팝업: 맵(1:1) | 세로 줌 | 표 */
.detail-popup-body {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px 18px;
  --detail-map-size: 320px;
  /* + / − 버튼이 차지하는 세로 합(여유 포함) — 트랙 = 맵 높이 − 이 값 */
  --detail-zoom-stack: 70px;
}

.detail-popup__col--map {
  flex: 0 0 auto;
}

.detail-popup__col--zoom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 44px;
  flex-shrink: 0;
  align-self: flex-start;
  box-sizing: border-box;
  height: var(--detail-map-size);
  min-height: var(--detail-map-size);
  max-height: var(--detail-map-size);
}

.detail-popup__zoom-btn {
  width: 32px;
  min-width: 32px;
  padding: 4px 0;
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1;
}

/* + / − 사이: 고정 높이로 트랙 길이 보장 (회전 후 세로 막대 길이 ≈ 이 높이) */
.detail-popup__zoom-slider-wrap {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: calc(var(--detail-map-size) - var(--detail-zoom-stack));
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.detail-popup__zoom-slider {
  --zoom-fill-pct: 0%;
  box-sizing: border-box;
  height: 36px;
  max-height: 36px;
  margin: 0;
  padding: 0;
  transform: rotate(-90deg);
  transform-origin: center center;
  width: calc(var(--detail-map-size) - var(--detail-zoom-stack));
  min-width: 160px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

/* Chromium/Safari: 왼쪽(미회전 기준) = 확대 진행 — 회전 후 시각적으로 채워진 트랙 */
.detail-popup__zoom-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(
    to right,
    var(--brand) 0%,
    var(--brand) var(--zoom-fill-pct),
    var(--border) var(--zoom-fill-pct),
    var(--border) 100%
  );
}

.detail-popup__zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.detail-popup__zoom-slider::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: var(--border);
}

.detail-popup__zoom-slider::-moz-range-progress {
  height: 10px;
  border-radius: 5px;
  background: var(--brand);
}

.detail-popup__zoom-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.detail-popup__col--info {
  flex: 1 1 220px;
  min-width: min(100%, 420px);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.detail-popup-table-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.detail-popup-table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.45;
}

.detail-popup-table th,
.detail-popup-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.detail-popup-table thead th {
  background: rgba(43, 87, 167, 0.16);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.detail-popup-table tbody td {
  background: var(--surface);
}

.detail-popup-table tbody tr:last-child td {
  border-bottom: none;
}

.modal__footer--detail-popup {
  justify-content: flex-end;
}

/* 작업 이력 — 소독 완료 영역: 좁은 폭에서 맵 아래로 표 배치 (반쪽 창 등) */
@media (max-width: 1200px) {
  .history-detail-mount .detail-popup-body--history-fixed {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    --detail-map-size: min(260px, calc(100vw - 80px));
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--map {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-map-wrap {
    width: min(var(--detail-map-size), 100%);
    max-width: 100%;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--history-spacer {
    display: none;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--zoom {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 12px;
    align-self: stretch;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--zoom [data-action="zoom-out"] {
    order: 1;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--zoom .detail-popup__zoom-slider-wrap {
    order: 2;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--zoom [data-action="zoom-in"] {
    order: 3;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__zoom-slider-wrap {
    flex: 1;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: none;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__zoom-slider {
    width: 100% !important;
    max-width: min(320px, 100%);
    height: 36px;
    max-height: none;
    transform: none;
    min-width: 0;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__zoom-slider::-webkit-slider-thumb {
    margin-top: 0;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup__col--info {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup-table-wrap {
    max-height: none;
  }

  .history-detail-mount .detail-popup-body--history-fixed .detail-popup-table thead th {
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .view--app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
    gap: 12px;
  }

  .sidebar__head {
    padding: 0;
    border: none;
    flex: 0 0 auto;
  }

  .sidebar__brand {
    font-size: 0.86rem;
    font-weight: 700;
    max-width: min(220px, 42vw);
  }

  .sidebar__nav {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0;
    gap: 8px;
  }

  .sidebar__link {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    text-align: center;
  }

  .sidebar__foot {
    width: 100%;
    padding: 8px 0 0;
    border-top: 1px solid var(--sidebar-edge);
  }

  .app-topbar {
    padding: 10px 16px 4px;
  }

  .app-brand-logo {
    width: 80px;
    max-height: 20px;
  }

  .app-main {
    padding: 20px 16px 32px;
  }

  .detail-popup-body {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-popup-body--history-fixed .detail-popup__col--history-spacer {
    display: none;
  }

  .history-detail-mount .detail-popup-body--history-fixed {
    --detail-map-size: min(260px, 78vw);
  }

  .detail-popup__col--zoom {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 12px;
  }

  .detail-popup__col--zoom [data-action="zoom-out"] {
    order: 1;
  }

  .detail-popup__col--zoom .detail-popup__zoom-slider-wrap {
    order: 2;
  }

  .detail-popup__col--zoom [data-action="zoom-in"] {
    order: 3;
  }

  .detail-popup__zoom-slider-wrap {
    container-type: normal;
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: auto;
    max-height: none;
    height: auto;
  }

  .detail-popup__zoom-slider {
    width: 100% !important;
    max-width: min(320px, 100%);
    height: 36px;
    max-height: none;
    transform: none;
    min-width: 0;
  }

  .detail-popup__zoom-slider::-webkit-slider-thumb {
    margin-top: 0;
  }

  .detail-popup__col--info {
    max-width: none;
    min-width: 0;
  }
}

.detail-map-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.detail-popup-body .detail-map-wrap {
  width: var(--detail-map-size);
  max-width: 100%;
  flex-shrink: 0;
}

/* 정사각 뷰; 줌 슬라이더와 무관하게 한 변은 --detail-map-size 고정 */
.detail-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #3a4048;
}

.detail-map__viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  contain: strict;
}

.detail-map__viewport.detail-map__viewport--pannable {
  cursor: grab;
  touch-action: none;
}

.detail-map__viewport.detail-map__viewport--pannable.detail-map__viewport--dragging {
  cursor: grabbing;
}

.detail-map__pan {
  width: 100%;
  height: 100%;
  position: relative;
  transform-origin: center center;
  will-change: transform;
}

.detail-map__scalable {
  width: 100%;
  height: 100%;
  position: relative;
  transform-origin: center center;
  will-change: transform;
}

.detail-map__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
}

.confirm-msg {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}
