/* BSC WorkFlow — 참고형 PC(사이드바) / 모바일(보라 헤더) */
:root {
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1a1d21;
  --muted: #6c757d;
  --primary: #3a62a9;
  --primary-dark: #2f5391;
  --sidebar-bg: #2f5391;
  --sidebar-hover: #3a62a9;
  --sidebar-active: #456fba;
  --border: #e5e7ec;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { overflow-x: hidden; font-size: 14px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; font-size: 1rem; background: var(--bg); color: var(--text); line-height: 1.5; }
input, select, textarea, button { font-size: 1rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— 앱 셸 (로그인 후) —— */
.wf-shell {
  display: flex;
  min-height: 100vh;
}
.wf-sidebar {
  width: 228px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 260;
}
.wf-sidebar-brand {
  padding: 1rem 0.85rem;
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #1a2e5c 0%, #1f3568 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}
.wf-sidebar-brand a {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  word-break: keep-all;
}
.wf-sidebar-brand a:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.92;
}
.wf-sidebar-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.wf-snav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.56rem 0.95rem;
  color: #e8f0ff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  min-height: 44px;
}
.wf-snav:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
  color: #ffffff;
}
.wf-snav.is-active {
  background: var(--sidebar-active);
  border-left-color: #c6d8ff;
  color: #ffffff;
  font-weight: 600;
}
.wf-snav-ico {
  width: 1.35rem;
  text-align: center;
  opacity: 0.95;
  flex-shrink: 0;
}
.wf-sidebar-divider {
  height: 1px;
  background: rgba(228, 238, 255, 0.35);
  margin: 0.5rem 0.75rem;
}
.wf-sidebar-foot {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(228, 238, 255, 0.35);
  font-size: 0.88rem;
}
.wf-sidebar-user {
  display: block;
  color: #dbe8ff;
  margin-bottom: 0.35rem;
}
.wf-sidebar-logout {
  font-size: 0.88rem;
  color: #f4f8ff;
}
.wf-sidebar-logout:hover {
  color: #ffffff;
}

.wf-sidebar-backdrop {
  display: none;
}
.wf-sidebar-backdrop.is-open {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 24, 0.4);
  z-index: 250;
}

.wf-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.wf-top-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.56rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.wf-search {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  max-width: 36rem;
}
.wf-search input[type="search"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  max-width: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  background: #f7f8fb;
}
.wf-search-submit {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.wf-search-submit:hover {
  filter: brightness(1.05);
}
.wf-top-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.wf-link-logout {
  color: var(--muted);
  font-size: 0.88rem;
}

.wf-top-mobile {
  display: none;
}

.wf-top-guest {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: 0;
  padding: 0.85rem 1.25rem;
}
.wf-guest-brand a {
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.wf-guest-brand a:hover {
  color: #fff;
  opacity: 0.92;
  text-decoration: none;
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
  width: 100%;
}
.wf-authed .main {
  max-width: none;
  margin: 0;
}
.main--guest {
  max-width: 1180px;
}

@media (max-width: 900px) {
  .wf-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 88vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  }
  .wf-sidebar.is-open {
    transform: translateX(0);
  }
  .wf-top-desktop {
    display: none;
  }
  .wf-top-mobile {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 200;
    min-height: 52px;
  }
  .wf-menu-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 0.4rem 0.55rem;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
  }
  .wf-menu-btn:hover,
  .wf-menu-btn:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
  }
  .wf-mobile-titles {
    flex: 1;
    min-width: 0;
    text-align: center;
  }
  .wf-mobile-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wf-mobile-sub {
    display: block;
    font-size: 0.78rem;
    opacity: 0.92;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wf-mobile-search {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    text-decoration: none;
    border-radius: 8px;
  }
  .wf-mobile-search:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
    color: #fff;
  }
.wf-mobile-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.4rem 0.62rem;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
.wf-mobile-home-btn:hover,
.wf-mobile-home-btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
  text-decoration: none;
  color: #fff;
}
.wf-mobile-create {
  position: relative;
  flex-shrink: 0;
}
.wf-mobile-create > summary {
  list-style: none;
}
.wf-mobile-create > summary::-webkit-details-marker {
  display: none;
}
.wf-mobile-create-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.4rem 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.wf-mobile-create-btn:hover,
.wf-mobile-create-btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}
.wf-mobile-create-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  min-width: 124px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
  z-index: 500;
  overflow: hidden;
}
.wf-mobile-create-menu a {
  display: block;
  min-height: 44px;
  padding: 0.62rem 0.7rem;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.wf-mobile-create-menu a + a {
  border-top: 1px solid #e6ebf2;
}
.wf-mobile-create-menu a:hover {
  background: #f8faff;
  text-decoration: none;
}
  .main {
    padding: 0.85rem;
  }
  .wf-card-list {
    padding: 0.7rem;
  }
  .wf-list-head {
    gap: 0.35rem;
  }
  .wf-list-title {
    font-size: 1.05rem;
  }
  .wf-list-actions {
    width: 100%;
  }
  .wf-list-actions .btn {
    min-height: 40px;
    font-size: 0.85rem;
  }
  .wf-task-filters {
    gap: 0.4rem;
  }
  .wf-filter-search,
  .wf-filter-status,
  .wf-filter-sort,
  .wf-filter-actions {
    min-width: 100%;
    max-width: 100%;
  }
  .wf-filter-status > details,
  .wf-filter-sort > details {
    flex: 1 1 auto;
  }
  .wf-status-filter-picker,
  .wf-sort-picker {
    width: 100%;
  }
  .wf-filter-actions .btn {
    flex: 1;
    text-align: center;
  }
  .wf-status-count-row {
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
  }
  .wf-status-count-row .wf-status-count-card {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0.5rem 0.35rem !important;
    margin-bottom: 0 !important;
    text-align: center;
  }
  .wf-status-count-row .wf-status-count-card .badge-soft {
    width: 100%;
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.16rem 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wf-status-count-row .wf-status-count-num {
    font-size: 1.06rem !important;
    margin-top: 0.25rem !important;
    line-height: 1.15;
  }
}

@media (min-width: 901px) {
  .wf-sidebar-backdrop.is-open {
    display: none !important;
  }
}

/* 업무 목록 도구줄 */
.wf-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.wf-list-title {
  flex: 1;
  margin: 0;
  font-size: 1.22rem;
}
.wf-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.wf-btn-settings {
  font-size: 0.85rem;
}
.wf-btn-create {
  background: #14b8a6;
}
.wf-btn-create:hover {
  filter: brightness(0.96);
}
.wf-card-list {
  padding: 0.9rem;
  border-radius: 8px;
}
.wf-list-plain {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.wf-status-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wf-status-count-card {
  min-width: 120px;
}
.wf-task-filters {
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
}
.row.wf-task-filters > div {
  flex: 0 0 auto;
  min-width: 0;
}
.wf-filter-search,
.wf-filter-status,
.wf-filter-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.wf-filter-search > label,
.wf-filter-status > label,
.wf-filter-sort > label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 2.2rem;
}
.wf-filter-search { width: min(380px, 96vw); }
.wf-filter-search > input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.wf-filter-status { width: auto; min-width: 0; }
.wf-filter-sort { width: auto; min-width: 0; }

/* 공통 콤보 트리거(결제정보 스타일 재사용) */
.wf-combo-trigger {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.38rem !important;
  min-height: 36px !important;
  min-width: 8.2rem;
  padding: 0.35rem 0.75rem !important;
  border: 1px solid #c8d3e3 !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #ffffff 0%, #edf2fb 100%) !important;
  color: #1f2937 !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
button.wf-combo-trigger {
  cursor: pointer;
}
summary.wf-combo-trigger {
  list-style: none;
}
summary.wf-combo-trigger::-webkit-details-marker {
  display: none;
}
.wf-combo-trigger:hover,
.wf-combo-trigger:focus-visible {
  border-color: #aebdd3 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fc 100%) !important;
  outline: none !important;
}
.wf-combo-trigger .task-status-label {
  white-space: nowrap;
}
.wf-combo-trigger .task-status-caret {
  margin-left: 0.08rem;
  color: #64748b;
  font-size: 0.76rem;
}

.wf-status-filter-picker {
  position: relative;
  display: inline-block;
  min-width: 150px;
}
.wf-sort-picker {
  position: relative;
  display: inline-block;
  min-width: 120px;
}
.wf-sort-picker > summary {
  list-style: none;
}
.wf-sort-picker > summary::-webkit-details-marker {
  display: none;
}
.wf-status-filter-picker > summary {
  list-style: none;
}
.wf-status-filter-picker > summary::-webkit-details-marker {
  display: none;
}
.wf-status-filter-menu {
  position: absolute !important;
  left: 0;
  top: calc(100% + 0.25rem);
  min-width: 170px;
  max-width: 220px;
  max-height: 260px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 90;
  padding: 0.35rem 0.4rem;
}
.wf-sort-menu {
  position: absolute !important;
  left: 0;
  top: calc(100% + 0.25rem);
  min-width: 150px;
  z-index: 90;
  padding: 0.35rem 0.4rem;
}
.wf-status-filter-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.16rem;
  min-height: 30px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  padding: 0 20px;
  border-radius: 4px;
  background: #fff;
  border: 0;
}
.wf-status-filter-check:last-child {
  margin-bottom: 0;
}
.wf-status-filter-check:hover {
  background: #f8fbff;
}
.wf-status-filter-check.is-checked {
  background: var(--wf-status-filter-bg, #eef2f7);
}
.wf-status-filter-check input {
  width: auto;
  margin: 0;
}
.wf-status-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wf-status-filter-color, #64748b);
  flex: 0 0 auto;
}
.wf-status-filter-text {
  color: #1f2937;
  font-weight: 600;
}
.wf-sort-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 30px;
  margin: 0 0 0.2rem;
  padding: 0 12px;
  border: 0;
  background: #f8fafd;
  cursor: pointer;
}
.wf-sort-option:last-child {
  margin-bottom: 0;
}
.wf-sort-option input {
  width: auto;
  margin: 0;
}
.wf-filter-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  min-width: 0;
}
.wf-filter-actions .wf-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 88px;
  padding: 0.38rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
}
.wf-filter-btn-apply {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
}
.wf-filter-btn-apply:hover {
  background: var(--primary-dark);
}
.wf-filter-btn-reset {
  background: #fff;
  color: #475569;
  border-color: #cdd6e3;
}
.wf-filter-btn-reset:hover {
  background: #f7f9fc;
  color: #334155;
}

/* 업무상태 색상 선택 */
.wf-status-color-field {
  min-width: 0;
}
.wf-status-color-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wf-status-color-picker {
  width: 44px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #d1d5db;
  background: #fff;
}
.wf-status-color-preview {
  width: 28px;
  height: 28px;
  border: 1px solid #cfd5df;
  border-radius: 4px;
  flex: 0 0 auto;
}
.wf-status-color-palette {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 22px;
  grid-template-rows: 22px;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: max-content;
}
.wf-status-color-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
}
.wf-status-color-swatch:hover {
  transform: translateY(-1px);
}
.wf-status-admin-page .wf-list-title {
  margin-bottom: 0.35rem;
}
.wf-status-admin-section {
  margin-top: 1rem;
}
.wf-status-admin-list {
  display: grid;
  gap: 0.75rem;
}
.wf-status-admin-item {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.75rem;
}
.wf-status-admin-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.wf-status-admin-form {
  margin: 0;
}
.wf-status-admin-toggle-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.wf-status-admin-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.wf-status-admin-actions .btn {
  min-height: 40px;
}
.wf-status-admin-grid {
  display: grid;
  gap: 0.55rem;
}
.wf-status-admin-form--edit .wf-status-edit-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.wf-status-admin-form--edit .wf-status-field-color,
.wf-status-admin-form--edit .wf-status-field-palette,
.wf-status-admin-form--edit .wf-status-field-actions {
  grid-column: 1 / -1;
}
.wf-status-admin-form--edit .wf-status-field-palette {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.wf-status-admin-form--edit .wf-status-field-actions {
  display: flex;
  gap: 0.45rem;
}
.wf-status-admin-form--edit .wf-status-field-actions .btn {
  flex: 1 1 auto;
  min-height: 40px;
  white-space: nowrap;
}
@media (min-width: 900px) {
  .wf-status-admin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wf-status-admin-form--edit .wf-status-edit-line {
    grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) 90px 250px auto;
    align-items: end;
  }
  .wf-status-admin-form--edit .wf-status-field-color {
    grid-column: auto;
  }
  .wf-status-admin-form--edit .wf-status-field-palette {
    display: none;
  }
  .wf-status-admin-form--edit .wf-status-field-actions {
    grid-column: auto;
    display: inline-flex;
    align-items: flex-end;
    margin-bottom: 0.1rem;
  }
  .wf-status-admin-form--edit .wf-status-field-actions .btn {
    flex: 0 0 auto;
  }
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  background: #eef0f4;
}
@supports (background: color-mix(in srgb, white 86%, purple)) {
  .badge-soft {
    background: color-mix(in srgb, var(--st-color, #888) 18%, #fff);
  }
}
.badge-soft-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--st-color, #868e96);
  flex-shrink: 0;
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.main > .card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.card ul:not(.plain) li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .75rem; }

.btn {
  display: inline-block; padding: .45rem .9rem; border-radius: 8px; border: 0;
  background: var(--primary); color: #fff; cursor: pointer; font-size: .95rem; text-decoration: none;
}
.btn:hover { filter: brightness(0.95); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--muted); }
.btn-danger { background: #dc3545; }
.btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--border); }

label { display: block; margin: .65rem 0 .2rem; font-weight: 500; font-size: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local],
input[type=date], input[type=url], textarea, select {
  width: 100%; max-width: 42rem; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
textarea { min-height: 100px; resize: vertical; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.row > div { flex: 1; min-width: 180px; }

table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th, table.data td { border-bottom: 1px solid var(--border); padding: .47rem .48rem; text-align: left; vertical-align: middle; }
table.data th { font-weight: 600; color: #7b8191; background: #f8f9fb; font-size: .78rem; }
table.data tbody tr:hover td { background: #fbfcff; }
.table-wrap .data-sales {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.table-wrap .data-sales th,
.table-wrap .data-sales td {
  white-space: nowrap;
}
.table-wrap .data-employees {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.table-wrap .data-employees th,
.table-wrap .data-employees td {
  white-space: nowrap;
}
.table-wrap .data-companies {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.table-wrap .data-companies th,
.table-wrap .data-companies td {
  white-space: nowrap;
}
.table-wrap .data-rentals {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.table-wrap .data-rentals th,
.table-wrap .data-rentals td {
  white-space: nowrap;
}
.wf-sales-summary-row {
  gap: 0.65rem;
  align-items: stretch;
}
.wf-sales-summary-row > .wf-sales-summary-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wf-sales-summary-row > .wf-sales-summary-main,
.wf-sales-summary-row > .wf-sales-summary-profit,
.wf-sales-summary-row > .wf-sales-summary-receivable {
  justify-content: flex-start;
}
.table-wrap,
.table-wrap table,
table.data,
table.data th,
table.data td {
  border-radius: 0 !important;
}
.table-wrap table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
}

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: #d1e7dd; color: #0f5132; }
.flash.err { background: #f8d7da; color: #842029; }
.wf-flash-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1rem;
  pointer-events: none;
}
.wf-flash-modal {
  pointer-events: auto;
  min-width: min(560px, calc(100vw - 2rem));
  max-width: min(760px, calc(100vw - 2rem));
  margin: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
  border: 1px solid #d5dbe5;
  background: #fff;
  animation: wfFlashIn .18s ease-out;
}
.wf-flash-modal.flash.ok { border-color: #b9ddca; }
.wf-flash-modal.flash.err { border-color: #efc3c8; }
@keyframes wfFlashIn {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.form-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: .9rem; }

#map,
#wf-task-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--border); margin-top: .75rem; overflow: hidden; }
@media (max-width: 600px) {
  #map,
  #wf-task-map { height: 240px; }
}
.wf-task-map-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .5rem; margin-top: .5rem; }
.wf-task-map-wrap .muted { font-size: .82rem; }

.login-wrap { max-width: 400px; margin: 4rem auto; }

/* ── 로그인 페이지 (전체화면 / 브랜드 중앙 배치) ──────────────── */
.wf-page-login {
  background: linear-gradient(160deg, #e8eef9 0%, #f5f6f8 55%, #eef0f5 100%);
}
.wf-page-login .wf-top-guest { display: none; }
.wf-page-login .main,
.wf-page-login .main--guest {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.wf-login-page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1rem);
  box-sizing: border-box;
}

.wf-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10),
              0 2px 6px  rgba(15, 23, 42, 0.04);
}

.wf-login-brand {
  text-align: center;
  margin: 0.25rem 0 1.15rem;
}
.wf-login-brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.7rem;
  box-shadow: 0 6px 14px rgba(58, 98, 169, 0.28);
}
.wf-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.15rem 0 0.2rem;
  color: var(--text);
  letter-spacing: -0.005em;
  word-break: keep-all;
}
.wf-login-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.wf-login-form label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #475569;
  margin: 0.85rem 0 0.3rem;
}
.wf-login-form input[type="text"],
.wf-login-form input[type="password"] {
  width: 100%;
  max-width: none;
  padding: 0.75rem 0.85rem;
  font-size: 1rem;
  border-radius: 10px;
}
.wf-login-form input[type="text"]:focus,
.wf-login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 98, 169, 0.18);
}
.wf-login-hint {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0.4rem 0 0.2rem;
}

/* 설정 페이지 — 관리자/사용자 섹션 분리 */
.wf-settings-section { padding: 1rem 1.1rem 1.15rem; }
.wf-settings-section + .wf-settings-section { margin-top: 0.85rem; }
.wf-settings-section-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0 0 0.35rem;
}
.wf-settings-section-title {
  margin: 0;
  font-size: 1.1rem;
}
.wf-settings-section-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  letter-spacing: 0.02em;
}
.wf-settings-section-badge--admin {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.wf-settings-admin {
  border-left: 4px solid #f59e0b;
}
.wf-settings-user {
  border-left: 4px solid #2563eb;
}
.wf-settings-subhead {
  margin: 1.1rem 0 0.25rem;
  font-size: 0.96rem;
  color: #1f2937;
}
.wf-settings-section > .wf-settings-subhead:first-of-type {
  margin-top: 0.6rem;
}
.wf-settings-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(248,250,252,0) 0%, rgba(248,250,252,1) 35%);
  padding: 0.9rem 0 0.4rem;
  margin-top: 0.4rem;
  z-index: 1;
}
@media (max-width: 600px) {
  .wf-settings-section { padding: 0.85rem 0.85rem 1rem; }
  .wf-settings-section-title { font-size: 1.02rem; }
  .wf-settings-actions {
    background: #fff;
    border-top: 1px solid var(--border, #e2e8f0);
  }
}
.wf-login-remember {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0.1rem;
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}
.wf-login-remember input { width: auto; margin: 0; }

.wf-login-actions { margin-top: 1rem; }
.wf-login-submit {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.02rem;
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 6px 14px rgba(58, 98, 169, 0.22);
}
.wf-login-submit:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(58, 98, 169, 0.28);
}

.wf-login-foot {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

@media (min-width: 640px) {
  .wf-login-card {
    max-width: 400px;
    padding: 1.85rem 1.65rem 1.4rem;
  }
  .wf-login-title { font-size: 1.6rem; }
  .wf-login-brand-mark { width: 72px; height: 72px; font-size: 1.9rem; }
}

/* 업무 상세: 개요 + 업무내용 2단 배치 (모바일 우선) */
.task-view-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}
.task-view-overview,
.task-view-body {
  display: flex;
  flex-direction: column;
}
.task-view-overview h2,
.task-view-body h2 {
  margin-top: 0;
}
.task-view-inline-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.task-view-inline-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.task-view-inline-item strong {
  color: #5b6476;
  font-weight: 600;
}
.task-view-body-content {
  flex: 1 1 auto;
  min-height: 100px;
  line-height: 1.55;
  word-break: break-word;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
@media (min-width: 992px) {
  .task-view-summary-grid {
    grid-template-columns: minmax(340px, 36%) minmax(0, 1fr);
    gap: 1.25rem;
  }
}

/* 주소 검색 (Nominatim) */
.address-search-wrap {
  position: relative;
  max-width: 42rem;
  margin-bottom: .25rem;
}
.address-search-wrap label {
  margin-top: 0;
}
.address-search-wrap input[type="text"] {
  max-width: 100%;
}
.addr-search-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.addr-search-inline > input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
}
.addr-postcode-btn {
  min-height: 44px;
  white-space: nowrap;
}

/* [주소검색] 버튼 + 주소 입력란 한 줄 배치 */
.addr-search-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.4rem;
}
.addr-search-row > .addr-postcode-btn {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
  align-self: stretch;
}
.addr-search-row > input[type="text"] {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}
@media (max-width: 480px) {
  /* 매우 좁은 화면에선 버튼이 위, 입력란이 아래로 줄바꿈 */
  .addr-search-row { flex-wrap: wrap; }
  .addr-search-row > .addr-postcode-btn { width: 100%; }
  .addr-search-row > input[type="text"] { flex-basis: 100%; width: 100%; }
}

/* 카카오 주소찾기 모달 (모바일·PC 공용) */
.wf-kakao-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.wf-kakao-modal-inner {
  background: #fff;
  width: 100%;
  max-width: 540px;
  height: 620px;
  max-height: 90vh;
  max-height: 90dvh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wf-kakao-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}
.wf-kakao-modal-head strong {
  font-size: 0.95rem;
  color: #111827;
}
.wf-kakao-modal-close {
  background: transparent;
  border: 0;
  font-size: 1.15rem;
  color: #4b5563;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  line-height: 1;
}
.wf-kakao-modal-close:hover {
  background: #e5e7eb;
}
.wf-kakao-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.wf-kakao-modal-body > iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}
@media (max-width: 600px) {
  .wf-kakao-modal {
    padding: 0;
    align-items: stretch;
  }
  .wf-kakao-modal-inner {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
}
.addr-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 300;
  max-height: min(50vh, 280px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.addr-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .75rem .85rem;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font: inherit;
  font-size: .92rem;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
}
.addr-search-item:last-child {
  border-bottom: 0;
}
.addr-search-item:hover,
.addr-search-item:focus {
  background: #eef5ff;
  outline: none;
}
.addr-search-hint {
  font-size: .85rem;
  color: var(--muted);
  margin: .35rem 0 0;
}

/* 시작일/마감일 (날짜 + 선택적 시간) */
.date-time-row { align-items: flex-start; }
.date-block {
  flex: 1;
  min-width: 200px;
}
.chk-inline {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0 .35rem;
  font-weight: 500;
  cursor: pointer;
}
.chk-inline input {
  width: auto;
  margin: 0;
}
.time-wrap {
  margin-top: .35rem;
}
.time-wrap.is-hidden {
  display: none !important;
}
.date-time-hint {
  margin-top: -.25rem;
  margin-bottom: .5rem;
  font-size: .88rem;
}

/* 업무 상세 — 진행 메모 */
.task-notes-lead {
  margin: -.25rem 0 .75rem;
  font-size: .88rem;
}
.task-notes-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.task-note {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  background: #fafbfc;
}
.task-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-bottom: .5rem;
  font-size: .88rem;
}
.task-note-author {
  font-weight: 600;
}
.task-note-time {
  font-size: .85rem;
}
.task-note-delete {
  margin-left: auto;
}
.btn-note-del {
  padding: .2rem .5rem;
  font-size: .8rem;
  color: var(--muted);
}
.task-note-body {
  font-size: .95rem;
  line-height: 1.55;
  word-break: break-word;
}
.task-note-reply-form-wrap {
  margin-top: .65rem;
}
.task-note-reply-toggle {
  cursor: pointer;
  color: var(--primary);
  font-size: .86rem;
}
.task-note-reply-form {
  margin-top: .5rem;
}
.task-note-reply-form textarea {
  max-width: 100%;
  min-height: 80px;
}
.task-note-reply {
  margin-top: .65rem;
  margin-left: 1rem;
  background: #fff;
  border-left: 3px solid #d7def0;
}
.task-note-compose textarea {
  max-width: 100%;
}

/* 상태 즉시 변경 (버튼 + 팝오버) */
.task-status-picker {
  position: relative;
  display: inline-block;
  z-index: 1;
}
.task-status-picker.is-open {
  z-index: 60;
}
.task-status-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.34rem;
  min-height: 30px;
  min-width: 5.4rem;
  max-width: 10rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef2f8 100%);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.1;
  color: #1f2937;
  cursor: pointer;
}
.task-status-trigger:hover,
.task-status-trigger:focus-visible {
  border-color: #b7bfcb;
  background: linear-gradient(180deg, #ffffff 0%, #f1f4f9 100%);
  outline: none;
}
/* 상태색을 트리거 전체 배경으로 표시 (브라우저가 color-mix를 지원하면 적용) */
@supports (background: color-mix(in srgb, white 86%, purple)) {
  .task-status-trigger {
    background: color-mix(in srgb, var(--status-color, #6c757d) 22%, #ffffff);
    border-color: color-mix(in srgb, var(--status-color, #6c757d) 55%, #ffffff);
    color: color-mix(in srgb, var(--status-color, #6c757d) 80%, #000000);
  }
  .task-status-trigger:hover,
  .task-status-trigger:focus-visible {
    background: color-mix(in srgb, var(--status-color, #6c757d) 32%, #ffffff);
    border-color: color-mix(in srgb, var(--status-color, #6c757d) 70%, #ffffff);
  }
}
/* 트리거 안의 작은 점은 배경색으로 충분히 구분되므로 숨긴다 (메뉴 옵션의 점은 유지) */
.task-status-trigger > .task-status-dot {
  display: none;
}
.task-status-label {
  white-space: nowrap;
}
.task-status-caret {
  margin-left: 0.08rem;
  color: currentColor;
  opacity: 0.7;
  font-size: 0.7rem;
}
.task-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.task-status-menu {
  position: fixed;
  z-index: 1000;
  min-width: 136px;
  padding: 0.28rem 0;
  border: 1px solid #b6bfcc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}
.task-status-menu-title {
  padding: 0.28rem 0.55rem 0.32rem;
  font-size: 0.75rem;
  color: #475569;
  border-bottom: 1px solid #edf1f5;
  margin-bottom: 0.2rem;
}
.task-status-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.34rem;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 0.28rem 0.55rem;
  min-height: 28px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}
.task-status-option:hover,
.task-status-option:focus-visible {
  background: #f4f7fb;
  outline: none;
}
.task-status-option.is-current {
  background: #eef3fb;
  font-weight: 700;
}
.task-status-option:disabled,
.task-status-trigger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.task-status-edit-link {
  display: block;
  margin-top: 0.2rem;
  border-top: 1px solid #edf1f5;
  padding: 0.35rem 0.55rem 0.25rem;
  font-size: 0.73rem;
  color: #64748b;
  text-decoration: none;
}
.task-status-edit-link:hover {
  color: var(--primary-dark);
  text-decoration: none;
}
.task-status-picker--header .task-status-trigger {
  font-size: 0.82rem;
  min-height: 32px;
}
.task-title-status .badge-soft {
  font-size: 0.82rem;
  padding: 0.24rem 0.62rem;
}
.task-view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}
.task-view-head-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.task-view-head-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.task-view-head-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.task-view-delete-form {
  display: inline-flex;
  margin: 0;
}
table.data td .task-status-trigger {
  max-width: 100%;
}
.data-recent-tasks th,
.data-recent-tasks td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}
.data-recent-tasks tbody tr:hover td {
  background: #edf3ff;
}
.task-date-cell,
.task-remark-cell {
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
}
.task-remark-cell {
  min-width: 8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 업무 목록 — 메인 하위 트리 */
.task-tree-title-cell {
  --task-parent-title-start: calc(1.35rem + 0.35rem);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.task-tree-title-cell a {
  color: #111827;
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-tree-title-cell a:hover {
  color: var(--primary-dark);
}
.task-tree-toggle {
  flex: 0 0 auto;
  margin: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-tree-toggle-placeholder {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-block;
}
.task-tree-toggle:hover,
.task-tree-toggle:focus-visible {
  background: var(--sidebar-hover);
  border-color: var(--primary);
  color: var(--primary-dark);
  outline: none;
}
.task-tree-sub-title {
  padding-left: 1.35rem;
  font-size: 0.86rem;
}
.task-tree-sub-depth-1 {
  padding-left: 0;
}
.task-tree-sub-depth-2 {
  padding-left: 0;
}
.task-tree-sub-title .task-tree-branch {
  position: static;
  transform: none;
  min-width: auto;
  width: auto;
  height: auto;
  margin: 0;
  justify-content: center;
}
.task-tree-sub-title a {
  margin-left: 0;
}

/* 업무/대시보드 테이블 컬럼 폭 규칙
   - 상태/우선순위/진척/시작/마감/등록/수정: 고정
   - 제목/업체/담당: 유동 (제목은 더 넓게) */
.data-task-tree,
.data-recent-tasks {
  table-layout: auto;
}
.data-task-tree th:nth-child(1),
.data-task-tree td:nth-child(1) {
  min-width: 28rem;
}
.data-task-tree th:nth-child(2),
.data-task-tree td:nth-child(2) {
  width: 7.5rem !important;
  min-width: 7.5rem;
  max-width: 7.5rem;
}
.data-task-tree th:nth-child(3),
.data-task-tree td:nth-child(3) {
  width: 6rem !important;
  min-width: 6rem;
  max-width: 6rem;
}
.data-task-tree th:nth-child(6),
.data-task-tree td:nth-child(6) {
  width: 9rem !important;
  min-width: 9rem;
  max-width: 9rem;
}
.data-task-tree th:nth-child(7),
.data-task-tree td:nth-child(7),
.data-task-tree th:nth-child(8),
.data-task-tree td:nth-child(8),
.data-task-tree th:nth-child(9),
.data-task-tree td:nth-child(9),
.data-task-tree th:nth-child(10),
.data-task-tree td:nth-child(10) {
  width: 9.5rem !important;
  min-width: 9.5rem;
  max-width: 9.5rem;
}

.data-recent-tasks th:nth-child(1),
.data-recent-tasks td:nth-child(1) {
  min-width: 24rem;
}
.data-recent-tasks th:nth-child(2),
.data-recent-tasks td:nth-child(2) {
  width: 7.5rem !important;
  min-width: 7.5rem;
  max-width: 7.5rem;
}
.data-recent-tasks th:nth-child(3),
.data-recent-tasks td:nth-child(3) {
  width: 6rem !important;
  min-width: 6rem;
  max-width: 6rem;
}
.data-recent-tasks th:nth-child(5),
.data-recent-tasks td:nth-child(5) {
  width: 9rem !important;
  min-width: 9rem;
  max-width: 9rem;
}
.data-recent-tasks th:nth-child(6),
.data-recent-tasks td:nth-child(6) {
  width: 8.5rem !important;
  min-width: 8.5rem;
  max-width: 8.5rem;
}
.data-recent-tasks th:nth-child(7),
.data-recent-tasks td:nth-child(7),
.data-recent-tasks th:nth-child(8),
.data-recent-tasks td:nth-child(8) {
  width: 9.5rem !important;
  min-width: 9.5rem;
  max-width: 9.5rem;
}
.task-tree-branch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 0.74rem;
  line-height: 1;
}
.task-tree-branch::before {
  content: "↳";
}
.task-tree-branch-depth-2::before {
  content: "↳";
}
table.data.data-task-tree tbody tr td {
  border-bottom: 1px solid var(--border);
}
table.data.data-task-tree tbody tr {
  box-shadow: none;
}
.task-tree-group.task-tree-closed .task-row-sub {
  display: none;
}
table.data.data-task-tree tbody tr.task-row-parent {
  background: var(--card);
}
table.data.data-task-tree tbody tr.task-row-sub {
  background: #fcfcfd;
}
table.data.data-task-tree tbody tr.task-row-sub-depth-2 {
  background: #fafbfc;
}
table.data.data-task-tree tbody + tbody tr.task-row-parent td {
  border-top: 0;
}
.data-task-tree {
  table-layout: fixed;
}
.data-task-tree th,
.data-task-tree td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-task-tree th:nth-child(1),
.data-task-tree td:nth-child(1) {
  width: 22rem;
}
.data-task-tree th:nth-child(2),
.data-task-tree td:nth-child(2) {
  width: 7.5rem;
}
.data-task-tree th:nth-child(3),
.data-task-tree td:nth-child(3) {
  width: 5.5rem;
}
.data-task-tree th:nth-child(4),
.data-task-tree td:nth-child(4) {
  width: 7.5rem;
}
.data-task-tree th:nth-child(5),
.data-task-tree td:nth-child(5) {
  width: 6.5rem;
}
.data-task-tree th:nth-child(6),
.data-task-tree td:nth-child(6) {
  width: 9rem;
}
.data-task-tree th:nth-child(7),
.data-task-tree td:nth-child(7),
.data-task-tree th:nth-child(8),
.data-task-tree td:nth-child(8) {
  width: 7.2rem;
}
.data-task-tree th:nth-child(9),
.data-task-tree td:nth-child(9),
.data-task-tree th:nth-child(10),
.data-task-tree td:nth-child(10) {
  width: 9.2rem;
  white-space: nowrap;
}
.data-recent-tasks th:nth-child(2),
.data-recent-tasks td:nth-child(2) {
  width: 7.5rem;
}
.data-recent-tasks th:nth-child(1),
.data-recent-tasks td:nth-child(1) {
  width: 20rem;
}
.data-recent-tasks th:nth-child(3),
.data-recent-tasks td:nth-child(3) {
  width: 5.5rem;
}
.data-recent-tasks th:nth-child(4),
.data-recent-tasks td:nth-child(4) {
  width: 6.5rem;
}
.data-recent-tasks th:nth-child(5),
.data-recent-tasks td:nth-child(5) {
  width: 9rem;
}
.data-recent-tasks th:nth-child(6),
.data-recent-tasks td:nth-child(6) {
  width: 7.2rem;
}
.data-recent-tasks th:nth-child(7),
.data-recent-tasks td:nth-child(7),
.data-recent-tasks th:nth-child(8),
.data-recent-tasks td:nth-child(8) {
  width: 9.2rem;
  white-space: nowrap;
}
.data-task-tree,
.data-recent-tasks {
  table-layout: auto;
}
.data-task-tree {
  min-width: 1280px;
}
.data-recent-tasks {
  min-width: 1080px;
}
.data-task-tree th,
.data-task-tree td,
.data-recent-tasks th,
.data-recent-tasks td {
  width: auto !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 날짜 컬럼 겹침 방지: 진척도 폭 축소 + 날짜 4열 동일 폭 */
.data-task-tree th:nth-child(6),
.data-task-tree td:nth-child(6) {
  width: 8.2rem !important;
  min-width: 8.2rem;
  max-width: 8.2rem;
}
.data-task-tree th:nth-child(7),
.data-task-tree td:nth-child(7),
.data-task-tree th:nth-child(8),
.data-task-tree td:nth-child(8),
.data-task-tree th:nth-child(9),
.data-task-tree td:nth-child(9),
.data-task-tree th:nth-child(10),
.data-task-tree td:nth-child(10) {
  width: 9.3rem !important;
  min-width: 9.3rem;
  max-width: 9.3rem;
}
.data-recent-tasks th:nth-child(5),
.data-recent-tasks td:nth-child(5) {
  width: 8.2rem !important;
  min-width: 8.2rem;
  max-width: 8.2rem;
}
.data-recent-tasks th:nth-child(6),
.data-recent-tasks td:nth-child(6),
.data-recent-tasks th:nth-child(7),
.data-recent-tasks td:nth-child(7),
.data-recent-tasks th:nth-child(8),
.data-recent-tasks td:nth-child(8) {
  width: 9.3rem !important;
  min-width: 9.3rem;
  max-width: 9.3rem;
}
.task-tree-sub-label {
  display: inline-block;
  padding: 0.06rem 0.35rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  color: #64748b;
  background: #e9eef6;
  line-height: 1.25;
}

/* 진척도 선택 (버튼 + 팝오버), 읽기 전용은 바 */
.task-progress-picker {
  position: relative;
  display: inline-block;
  z-index: 1;
}
.task-progress-picker.is-open {
  z-index: 60;
}
.task-progress-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 30px;
  min-width: 124px;
  padding: 0.22rem 0.45rem;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef2f8 100%);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}
.task-progress-trigger:hover,
.task-progress-trigger:focus-visible {
  border-color: #b7bfcb;
  background: linear-gradient(180deg, #ffffff 0%, #f1f4f9 100%);
  outline: none;
}
.task-progress-trigger .task-progress-track {
  width: 66px;
}
.task-progress-caret {
  color: #6b7280;
  font-size: 0.7rem;
}
.task-progress-menu {
  position: fixed;
  z-index: 1000;
  min-width: 120px;
  max-height: min(300px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 0.28rem 0;
  border: 1px solid #b6bfcc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}
.task-progress-menu-title {
  padding: 0.28rem 0.55rem 0.32rem;
  font-size: 0.75rem;
  color: #475569;
  border-bottom: 1px solid #edf1f5;
  margin-bottom: 0.2rem;
}
.task-progress-option {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 0.28rem 0.55rem;
  min-height: 28px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}
.task-progress-option:hover,
.task-progress-option:focus-visible {
  background: #f4f7fb;
  outline: none;
}
.task-progress-option.is-current {
  background: #eef3fb;
  font-weight: 700;
}
.task-progress-option:disabled,
.task-progress-trigger:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.task-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 10rem;
  max-width: 17rem;
}
.task-progress--readonly {
  gap: 0.5rem;
}
.task-progress-track {
  flex: 1;
  min-width: 3rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.task-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #374151;
  transition: width 0.18s ease;
}
.task-progress-pct {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  min-width: 2.4rem;
  text-align: right;
  color: var(--muted);
}

table.data td .task-progress {
  max-width: 100%;
}

/* 우선순위 선택 (버튼 + 팝오버) */
.task-priority-picker {
  position: relative;
  display: inline-block;
  z-index: 1;
}
.task-priority-picker.is-open {
  z-index: 60;
}
.task-priority-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 30px;
  min-width: 74px;
  padding: 0.2rem 0.45rem;
  border: 1px solid #cfd5df;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef2f8 100%);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}
.task-priority-trigger:hover,
.task-priority-trigger:focus-visible {
  border-color: #b7bfcb;
  background: linear-gradient(180deg, #ffffff 0%, #f1f4f9 100%);
  outline: none;
}
.task-priority-menu {
  position: fixed;
  z-index: 1000;
  min-width: 104px;
  max-height: min(300px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 0.28rem 0;
  border: 1px solid #b6bfcc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}
.task-priority-menu-title {
  padding: 0.28rem 0.55rem 0.32rem;
  font-size: 0.75rem;
  color: #475569;
  border-bottom: 1px solid #edf1f5;
  margin-bottom: 0.2rem;
}
.task-priority-option {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 0.28rem 0.55rem;
  min-height: 28px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}
.task-priority-option:hover,
.task-priority-option:focus-visible {
  background: #f4f7fb;
  outline: none;
}
.task-priority-option.is-current {
  background: #eef3fb;
  font-weight: 700;
}
.task-priority-picker.is-readonly .task-priority-trigger {
  color: #7b8798;
  border-color: #d8dee8;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  opacity: 0.68;
  cursor: not-allowed;
}
.task-priority-picker.is-readonly .task-priority-caret {
  color: #9aa5b5;
}
.task-priority-readonly {
  display: inline-block;
  min-width: 2.8rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid #d6dce6;
  background: #f7f9fc;
  color: #334155;
  font-size: 0.74rem;
}

/* 업무 등록 모달 */
body.wf-dialog-open {
  overflow: hidden;
}
.wf-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}
.wf-dialog-frame {
  width: min(1120px, 100%);
  height: min(92vh, 860px);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
  position: relative;
}
.wf-dialog-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  cursor: pointer;
  z-index: 2;
}
.wf-dialog-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.wf-modal-page {
  margin: 0;
  background: var(--bg);
}
.wf-modal-main {
  padding: 0.75rem;
}
.wf-modal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* 업무 등록/수정 폼 레이아웃 */
.wf-task-form-card {
  max-width: 1180px;
  margin: 0 auto;
}
.wf-task-form-card > h1,
.wf-task-form-card .wf-modal-card-head {
  margin-bottom: 0.5rem;
}
.wf-task-form-card form {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}
.wf-task-form-card label {
  margin: 0 0 0.24rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.wf-task-form-card input[type=text],
.wf-task-form-card input[type=password],
.wf-task-form-card input[type=number],
.wf-task-form-card input[type=date],
.wf-task-form-card input[type=file],
.wf-task-form-card textarea,
.wf-task-form-card select {
  max-width: none;
  min-height: 40px;
}
.wf-task-form-card textarea {
  min-height: 108px;
}
.wf-task-form-card .row {
  gap: 0.75rem;
  align-items: flex-start;
}
.wf-task-form-card .row > div {
  min-width: 220px;
}
/* 제목 + 상태/담당자/우선순위 한줄 레이아웃 */
.wf-task-form-card .wf-task-title-row {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wf-task-form-card .wf-task-title-field {
  flex: 1 1 260px;
  min-width: 0;
}
.wf-task-form-card .wf-task-meta-field {
  flex: 0 0 auto;
  width: 140px;
  min-width: 120px;
}
.wf-task-form-card .wf-task-meta-assignee {
  width: 170px;
  min-width: 130px;
}
.wf-task-form-card .wf-task-meta-field .wf-form-picker,
.wf-task-form-card .wf-task-meta-field .wf-assignee-picker {
  width: 100%;
}
.wf-task-form-card .wf-task-meta-field .wf-combo-trigger {
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
/* 업체명 + 요청담당자 한줄 행 */
.wf-task-form-card .wf-task-company-row {
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wf-task-form-card .wf-task-company-field {
  flex: 2 1 160px;
  min-width: 0;
}
.wf-task-form-card .wf-task-progress-field {
  flex: 0 0 90px;
  width: 90px;
  min-width: 0;
}
.wf-task-form-card .wf-task-contact-field {
  flex: 0 0 160px;
  width: 160px;
  min-width: 0;
}
.wf-task-form-card .wf-task-contact-field .wf-combo-trigger {
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
.wf-task-form-card .wf-task-reqname-field {
  flex: 1 1 120px;
  min-width: 0;
}
.wf-task-form-card .wf-task-reqphone-field {
  flex: 1 1 120px;
  min-width: 0;
}
.wf-task-form-card .task-date-row > div {
  flex: 1 1 0;
  min-width: 260px;
}
.wf-task-form-card .task-assignee-list {
  max-height: 172px;
}
.wf-task-form-card .form-actions {
  margin-top: 0.25rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e7ebf2;
}
.wf-task-company-rental-note {
  border: 1px solid #cfe0fb;
  background: #f4f8ff;
  color: #1e3a68;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.wf-task-company-rental-note strong {
  display: inline-block;
  margin-bottom: 0.22rem;
  font-size: 0.86rem;
}
#taskCompanyRentalNoteBody {
  white-space: pre-line;
  line-height: 1.45;
  font-size: 0.84rem;
}

/* 업무 폼 - 거래처 직원 */
.company-contacts-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0.65rem 0 1rem;
  background: #fafbff;
}
.company-contacts-block.is-disabled {
  opacity: 0.65;
}
.company-contacts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.company-contacts-hint {
  margin: 0.4rem 0 0.6rem;
}
.company-contact-existing-list {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.company-contact-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  background: #fff;
}
.company-contact-check input {
  width: auto;
  margin-top: 0.1rem;
}
.company-contact-check span {
  display: block;
}
.company-contact-check small {
  display: block;
  color: var(--muted);
  margin-top: 0.15rem;
}
.company-contact-new-rows {
  display: grid;
  gap: 0.5rem;
}
.company-contact-new-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}
.wf-company-form-card form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.wf-company-form-row {
  gap: 0.75rem;
  align-items: flex-start;
}
.wf-company-form-row > div {
  min-width: 0;
}
.wf-company-col-2 {
  flex: 1 1 calc(50% - 0.4rem);
  max-width: none;
}
.wf-company-col-3 {
  flex: 1 1 calc(33.333% - 0.5rem);
  max-width: none;
}
.wf-company-col-4 {
  flex: 1 1 calc(25% - 0.57rem);
  max-width: none;
}
.wf-company-col-5 {
  flex: 1 1 calc(20% - 0.6rem);
  max-width: none;
}
.wf-company-form-card input[type="text"],
.wf-company-form-card input[type="email"],
.wf-company-form-card textarea {
  max-width: none;
}
.task-assignee-list {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.35rem 0.45rem;
  max-height: 160px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.task-assignee-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  margin: 0;
}
.task-assignee-check input {
  width: auto;
  margin: 0;
}

/* ── 업무 폼 담당자 콤보 피커 ─────────────────────────── */
.wf-assignee-picker {
  position: relative;
  display: block;
  width: 100%;
}
.wf-assignee-picker > summary {
  list-style: none;
  width: 100%;
}
.wf-assignee-picker > summary::-webkit-details-marker { display: none; }
.wf-assignee-picker > summary.wf-combo-trigger {
  display: flex !important;
  width: 100%;
  min-height: 2.25rem;
  justify-content: space-between;
  box-sizing: border-box;
}
.wf-assignee-label {
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2937;
}
.wf-assignee-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  min-width: 100%;
  max-width: 320px;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 200;
  background: #fff;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  padding: 0.35rem 0.4rem;
}
.wf-assignee-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.16rem;
  min-height: 32px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  padding: 0 0.5rem;
  border-radius: 5px;
  background: #fff;
  border: 0;
}
.wf-assignee-check:last-child { margin-bottom: 0; }
.wf-assignee-check:hover { background: #f0f5ff; }
.wf-assignee-check.is-checked { background: #eff6ff; }
.wf-assignee-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #2563eb;
  width: 15px;
  height: 15px;
}
.wf-assignee-check-name {
  font-weight: 500;
  color: #1f2937;
  flex: 1 1 0;
}

/* ── 단일 선택 폼 피커 공통 (상태·우선순위·상위업무·요청담당자) ── */
.wf-form-picker {
  position: relative;
  display: block;
  width: 100%;
}
.wf-form-picker > summary {
  list-style: none;
  width: 100%;
}
.wf-form-picker > summary::-webkit-details-marker { display: none; }
.wf-form-picker > summary.wf-combo-trigger {
  display: flex !important;
  width: 100%;
  min-height: 2.25rem;
  justify-content: space-between;
  box-sizing: border-box;
}
.wf-picker-label {
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2937;
}
.wf-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  min-width: 100%;
  max-width: 340px;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 200;
  background: #fff;
  border: 1px solid #d1d9e6;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  padding: 0.35rem 0.4rem;
}
.wf-picker-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.16rem;
  min-height: 32px;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0 0.5rem;
  border-radius: 5px;
  background: #fff;
}
.wf-picker-option:last-child { margin-bottom: 0; }
.wf-picker-option:hover { background: #f0f5ff; }
.wf-picker-option.is-selected { background: #eff6ff; }
.wf-picker-option input[type="radio"] { display: none; }
.wf-picker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, #64748b);
  flex: 0 0 auto;
}
.wf-picker-option-name {
  font-weight: 500;
  color: #1f2937;
  flex: 1 1 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 상위업무 피커는 긴 제목을 줄바꿈 허용 */
#wfParentTaskPicker .wf-picker-option-name {
  white-space: normal;
  word-break: break-word;
}
#wfParentTaskPicker .wf-picker-menu {
  max-width: 420px;
}

.task-cost-row {
  align-items: flex-start;
}
.task-cost-row .task-cost-field {
  flex: 1 1 0;
  min-width: 0;
}
.task-vat-group-row {
  align-items: flex-start;
}
.task-vat-group-row .task-cost-field {
  flex: 1 1 0;
  min-width: 0;
}
/* 매출/매입 구분 + 출장비/점검비/매입가/판매가를 한 줄에 묶는 컨테이너 */
.task-cost-all-row {
  align-items: flex-start;
}
.task-cost-all-row .task-cost-field,
.wf-task-form-card .task-cost-all-row .task-cost-field {
  flex: 1 1 0;
  min-width: 0;
}
.task-cost-row .task-cost-field .wf-vat-inline,
.task-cost-all-row .task-cost-field .wf-vat-inline,
.wf-vat-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 120px);
  gap: .35rem;
  margin-top: .35rem;
}
.task-cost-all-row .task-cost-field-vat .wf-vat-inline {
  grid-template-columns: minmax(0, 1fr);
}
.task-cost-row .task-cost-field .wf-vat-inline select,
.task-cost-row .task-cost-field .wf-vat-inline input,
.task-cost-all-row .task-cost-field .wf-vat-inline select,
.task-cost-all-row .task-cost-field .wf-vat-inline input,
.wf-vat-inline select,
.wf-vat-inline input {
  width: 100%;
  min-width: 0;
}
.task-body-remark-row .task-body-remark-field {
  flex: 1 1 0;
  min-width: 0;
}
.task-body-remark-row .task-body-remark-textarea {
  min-height: 110px;
}
.task-upload-help {
  margin: 0.35rem 0 0;
}
.task-upload-existing {
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  background: #fafbff;
}
.task-upload-existing ul,
.task-file-list {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
.task-file-list {
  margin: 0;
}
.task-file-list li {
  margin: 0.25rem 0;
}

/* 업무 폼 - 시간 선택 모달 */
.wf-time-selected {
  margin-left: 0.45rem;
  color: #334155;
  font-weight: 600;
}
.wf-time-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}
.wf-time-modal[hidden] {
  display: none !important;
}
.wf-time-modal-dialog {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.9rem;
}
.wf-time-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.wf-time-picker-grid label {
  margin: 0;
}

/* 테이블 헤더/값 겹침 방지: 업무/대시보드 최종 컬럼 폭 */
.data-task-tree {
  table-layout: fixed !important;
  width: max-content !important;
  min-width: 100% !important;
}
.data-recent-tasks {
  table-layout: fixed !important;
  width: max-content !important;
  min-width: 100% !important;
}
.data-task-tree th,
.data-task-tree td,
.data-recent-tasks th,
.data-recent-tasks td {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* 업무 목록 (11열): 제목/상태/우선/거래처/담당자/진척도/시작일/마감일/등록일/수정일/비고 */
.data-task-tree th:nth-child(1), .data-task-tree td:nth-child(1) { width: 11.5rem !important; }
.data-task-tree th:nth-child(2), .data-task-tree td:nth-child(2) { width: 7rem !important; }
.data-task-tree th:nth-child(3), .data-task-tree td:nth-child(3) { width: 7rem !important; }
.data-task-tree th:nth-child(4), .data-task-tree td:nth-child(4) { width: 10rem !important; }
.data-task-tree th:nth-child(5), .data-task-tree td:nth-child(5) { width: 7rem !important; }
.data-task-tree th:nth-child(6), .data-task-tree td:nth-child(6) { width: 9.5rem !important; }
.data-task-tree th:nth-child(7), .data-task-tree td:nth-child(7),
.data-task-tree th:nth-child(8), .data-task-tree td:nth-child(8),
.data-task-tree th:nth-child(9), .data-task-tree td:nth-child(9),
.data-task-tree th:nth-child(10), .data-task-tree td:nth-child(10) { width: 9.5rem !important; }
.data-task-tree th:nth-child(11), .data-task-tree td:nth-child(11) { width: 10rem !important; }

/* 최근 업무 (9열): 제목/상태/우선/담당자/진척도/마감일/등록일/수정일/비고 */
.data-recent-tasks th:nth-child(1), .data-recent-tasks td:nth-child(1) { width: 12.5rem !important; }
.data-recent-tasks th:nth-child(2), .data-recent-tasks td:nth-child(2) { width: 7rem !important; }
.data-recent-tasks th:nth-child(3), .data-recent-tasks td:nth-child(3) { width: 7rem !important; }
.data-recent-tasks th:nth-child(4), .data-recent-tasks td:nth-child(4) { width: 7rem !important; }
.data-recent-tasks th:nth-child(5), .data-recent-tasks td:nth-child(5) { width: 9.5rem !important; }
.data-recent-tasks th:nth-child(6), .data-recent-tasks td:nth-child(6),
.data-recent-tasks th:nth-child(7), .data-recent-tasks td:nth-child(7),
.data-recent-tasks th:nth-child(8), .data-recent-tasks td:nth-child(8) { width: 9.5rem !important; }
.data-recent-tasks th:nth-child(9), .data-recent-tasks td:nth-child(9) { width: 10rem !important; }

/* 제목(1열) 제외 모든 컬럼 가운데 정렬 */
.data-task-tree th:not(:first-child),
.data-task-tree td:not(:first-child),
.data-recent-tasks th:not(:first-child),
.data-recent-tasks td:not(:first-child) {
  text-align: center !important;
}

/* 행 하단 라인 고정 (열 경계 끊김 방지) */
table.data.data-task-tree tbody tr td,
table.data.data-recent-tasks tbody tr td {
  border-bottom: 0 !important;
}
table.data.data-task-tree tbody tr,
table.data.data-recent-tasks tbody tr {
  position: relative;
}
table.data.data-task-tree tbody tr::after,
table.data.data-recent-tasks tbody tr::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}

/* 업무 리스트 hover 강조 (행 전체 배경으로 흰 띠 방지) */
table.data.data-task-tree tbody tr:hover,
table.data.data-recent-tasks tbody tr:hover {
  background: #dfe9ff !important;
}
table.data.data-task-tree tbody tr:hover td,
table.data.data-recent-tasks tbody tr:hover td {
  background: transparent !important;
}
table.data.data-task-tree tbody tr.task-row-done td {
  color: #8b95a3;
}
table.data.data-task-tree tbody tr.task-row-done .task-tree-title-cell > a {
  color: #7f8a98 !important;
  text-decoration-line: line-through;
  text-decoration-thickness: 1px;
}
table.data.data-task-tree tbody tr.task-row-done .task-tree-title-cell > a:hover {
  text-decoration-line: line-through;
}
table.data.data-task-tree tbody tr.task-row-mine td {
  font-weight: 700;
}

/* 진척도 잘림 방지: 셀 폭 내 유동 크기 */
.data-task-tree td .task-progress-picker,
.data-recent-tasks td .task-progress-picker {
  display: block;
  width: 100%;
}
.data-task-tree td .task-progress-trigger,
.data-recent-tasks td .task-progress-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.data-task-tree td .task-progress-trigger .task-progress-track,
.data-recent-tasks td .task-progress-trigger .task-progress-track {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
}

/* 최종 안정화: 우선순위 점/우측 빈공간/헤더 끊김/제목 세로정렬 */
.data-task-tree {
  width: 100% !important;
  min-width: 1320px !important;
  table-layout: fixed !important;
}
.data-recent-tasks {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

table.data.data-task-tree td:first-child,
table.data.data-recent-tasks td:first-child {
  vertical-align: middle !important;
  padding-top: .47rem !important;
  padding-bottom: .47rem !important;
}
.task-tree-title-cell {
  min-height: 0;
  height: auto;
  align-items: center !important;
}
.data-task-tree td:first-child .task-tree-title-cell,
.data-recent-tasks td:first-child .task-tree-title-cell {
  display: flex;
  align-items: center !important;
  line-height: 1.5;
}

.data-task-tree td .task-priority-picker,
.data-recent-tasks td .task-priority-picker {
  display: block;
  width: 100%;
}
.data-task-tree td .task-priority-trigger,
.data-recent-tasks td .task-priority-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: center;
}
.task-priority-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-priority-caret {
  flex: 0 0 auto;
}

/* 테이블 표시 보정:
   - 우선순위 문구 잘림 방지
   - 마지막 비고 컬럼이 남는 폭을 채우도록 설정 */
.data-task-tree,
.data-recent-tasks {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
}

.data-task-tree th,
.data-task-tree td,
.data-recent-tasks th,
.data-recent-tasks td {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

/* 업무 목록: 마지막 비고(11열)를 유동 폭으로 사용 */
.data-task-tree th:nth-child(11),
.data-task-tree td:nth-child(11) {
  width: auto !important;
  min-width: 16rem !important;
  max-width: none !important;
}

/* 최근 업무: 마지막 비고(9열)를 유동 폭으로 사용 */
.data-recent-tasks th:nth-child(9),
.data-recent-tasks td:nth-child(9) {
  width: auto !important;
  min-width: 14rem !important;
  max-width: none !important;
}

/* 우선순위 컬럼 최소 폭 확대 (우선... 잘림 방지) */
.data-task-tree th:nth-child(3),
.data-task-tree td:nth-child(3),
.data-recent-tasks th:nth-child(3),
.data-recent-tasks td:nth-child(3) {
  min-width: 8.6rem !important;
}

.task-priority-label,
.task-priority-readonly {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.task-remark-cell {
  min-width: 14rem !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* 제목 셀 최종 정렬: 메인/하위 제목 시작점 통일 */
.task-tree-title-cell {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  min-width: 0;
  white-space: nowrap;
  line-height: 1.5;
}
.task-tree-title-cell .task-tree-toggle,
.task-tree-title-cell .task-tree-toggle-placeholder {
  margin-right: 0 !important;
}
.task-tree-sub-title {
  padding-left: 0 !important;
}
.task-tree-sub-title::before {
  content: "";
  flex: 0 0 40px;
  width: 40px;
}

/* 업무 리스트 헤더 구분선 표시 강화 */
table.data.data-task-tree thead th {
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
}
table.data.data-task-tree thead th + th {
  border-left: 1px solid var(--border) !important;
}
.task-tree-sub-title .task-tree-branch {
  display: none !important;
}
.data-task-tree td:first-child .task-tree-title-cell,
.data-recent-tasks td:first-child .task-tree-title-cell {
  min-height: 0 !important;
  height: auto !important;
  align-items: center !important;
}
.task-tree-title-cell a {
  display: inline-flex !important;
  align-items: center;
  min-height: 0 !important;
  line-height: 1.5 !important;
  padding: 0;
  position: static !important;
  top: auto !important;
}

/* 사용자 설정 컬럼 숨김 적용 시 nth-child 고정폭 규칙 무시 */
.data-task-tree.wf-task-cols-custom {
  table-layout: auto !important;
  width: 100% !important;
  min-width: 100% !important;
}
.data-task-tree.wf-task-cols-custom th,
.data-task-tree.wf-task-cols-custom td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  text-align: left !important;
}
.data-task-tree.wf-task-cols-custom th:first-child,
.data-task-tree.wf-task-cols-custom td:first-child {
  min-width: 20rem !important;
}
.data-task-tree.wf-task-cols-custom th:last-child,
.data-task-tree.wf-task-cols-custom td:last-child {
  width: 100% !important;
  min-width: 16rem !important;
}
.data-task-tree.wf-task-cols-custom td:last-child {
  white-space: normal !important;
}

@media (max-width: 768px) {
  .wf-task-form-card {
    max-width: 100%;
  }
  .wf-task-form-card form {
    gap: 0.6rem;
  }
  .wf-task-form-card .row {
    gap: 0.55rem;
  }
  .wf-task-form-card .row > div,
  .wf-task-form-card .task-date-row > div {
    flex: 0 0 100%;
    min-width: 0;
  }
  /* 모바일: 제목행·업체행 모두 세로 스택 */
  .wf-task-form-card .wf-task-title-field,
  .wf-task-form-card .wf-task-meta-field,
  .wf-task-form-card .wf-task-meta-assignee,
  .wf-task-form-card .wf-task-company-field,
  .wf-task-form-card .wf-task-progress-field,
  .wf-task-form-card .wf-task-contact-field,
  .wf-task-form-card .wf-task-reqname-field,
  .wf-task-form-card .wf-task-reqphone-field {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
  }
  .wf-task-form-card .task-cost-row .task-cost-field {
    flex: 0 0 calc(50% - 0.28rem);
    min-width: 0;
  }
  .wf-task-form-card .task-assignee-list {
    max-height: 140px;
  }
  .wf-task-form-card .form-actions {
    padding-top: 0.5rem;
    margin-top: 0.1rem;
  }
  .task-view-head {
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
  }
  .task-view-head-title {
    width: 100%;
    font-size: 1.22rem;
    line-height: 1.35;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .task-view-head-actions {
    width: 100%;
    gap: .4rem;
  }
  .task-view-head-actions .btn,
  .task-view-head-actions .task-view-delete-form .btn {
    min-height: 32px;
    padding: 0.24rem 0.62rem;
    font-size: .82rem;
    line-height: 1.1;
  }
  .task-requester-row > div {
    min-width: 0;
  }
  .task-requester-row > div:nth-child(1) {
    flex: 0 0 100%;
  }
  .task-requester-row > div:nth-child(2),
  .task-requester-row > div:nth-child(3) {
    flex: 1 1 calc(50% - 0.5rem);
  }
  .company-contact-new-row {
    grid-template-columns: 1fr;
  }
  .wf-company-col-2,
  .wf-company-col-3 {
    flex: 0 0 calc(50% - 0.28rem);
    max-width: calc(50% - 0.28rem);
  }
  .wf-company-col-4,
  .wf-company-col-5 {
    flex: 0 0 calc(50% - 0.28rem);
    max-width: calc(50% - 0.28rem);
  }
  .wf-company-col-email {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .task-cost-row .task-cost-field {
    flex: 0 0 calc(50% - 0.5rem);
    min-width: 0;
  }
  .task-vat-group-row .task-cost-field,
  .wf-task-form-card .task-vat-group-row .task-cost-field {
    flex: 0 0 calc(50% - 0.28rem);
    min-width: 0;
  }
  /* 모바일: 매출구분/매입구분/출장비/점검비/매입가/판매가 모두 2개씩 한 줄 */
  .task-cost-all-row .task-cost-field,
  .wf-task-form-card .task-cost-all-row .task-cost-field {
    flex: 0 0 calc(50% - 0.28rem);
    min-width: 0;
  }
  .task-cost-row .task-cost-field .wf-vat-inline,
  .wf-vat-inline {
    grid-template-columns: minmax(0, 1fr) 90px;
  }
  .task-cost-all-row .task-cost-field-vat .wf-vat-inline {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-body-remark-row .task-body-remark-field {
    flex: 0 0 100% !important;
  }
  .task-body-remark-row .task-body-remark-textarea {
    min-height: 140px;
  }
  .wf-dialog-frame {
    height: 95vh;
  }
  .wf-time-picker-grid {
    grid-template-columns: 1fr;
  }
  .wf-sales-summary-row {
    gap: 0.5rem;
  }
  .wf-sales-summary-row > .wf-sales-summary-main,
  .wf-sales-summary-row > .wf-sales-summary-profit,
  .wf-sales-summary-row > .wf-sales-summary-receivable {
    flex: 0 0 100% !important;
    width: 100%;
    min-width: 0 !important;
  }
  .wf-sales-summary-row > .wf-sales-summary-stat {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto;
    padding: 0.62rem 0.38rem !important;
    text-align: center;
  }
  .wf-sales-summary-row > .wf-sales-summary-stat strong {
    display: block;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .wf-sales-summary-row > .wf-sales-summary-stat div {
    font-size: 1.06rem !important;
  }
  .task-cost-row .task-cost-field .wf-vat-inline,
  .wf-vat-inline {
    grid-template-columns: 1fr;
  }
  .wf-rentals-summary-row > .card {
    flex: 0 0 100% !important;
    min-width: 0 !important;
    width: 100%;
  }
}

/* 업무리스트(FHD) 가로 스크롤 제거용 최종 규칙 */
@media (min-width: 901px) {
  .data-task-tree:not(.wf-task-cols-custom) {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  /* 기존 min/max 폭 규칙 무력화 */
  .data-task-tree:not(.wf-task-cols-custom) th,
  .data-task-tree:not(.wf-task-cols-custom) td {
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 제목 폭 50px 축소(기존 대비) */
  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(1),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(1) { width: 170px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(2),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(2) { width: 88px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(3),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(3) { width: 90px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(4),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(4) { width: 110px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(5),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(5) { width: 92px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(6),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(6) { width: 110px !important; }

  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(7),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(7),
  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(8),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(8),
  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(9),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(9),
  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(10),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(10) { width: 76px !important; }

  /* 비고는 남는 폭 사용 */
  .data-task-tree:not(.wf-task-cols-custom) th:nth-child(11),
  .data-task-tree:not(.wf-task-cols-custom) td:nth-child(11) {
    width: auto !important;
    min-width: 0 !important;
  }

  /* 제목 세로 중앙 미세 보정 (업무리스트) */
  .data-task-tree td:first-child .task-tree-title-cell,
  .data-recent-tasks td:first-child .task-tree-title-cell {
    position: relative;
    top: 1px;
  }
}

/* 업체관리 폼: 모바일 2열 고정(이메일만 1열) */
@media (max-width: 900px) {
  .wf-company-form-card .wf-company-form-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    align-items: start !important;
  }
  .wf-company-form-card .wf-company-form-row > .wf-company-col-2,
  .wf-company-form-card .wf-company-form-row > .wf-company-col-3,
  .wf-company-form-card .wf-company-form-row > .wf-company-col-4,
  .wf-company-form-card .wf-company-form-row > .wf-company-col-5 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .wf-company-form-card .wf-company-form-row > .wf-company-col-email {
    grid-column: 1 / -1 !important;
  }
}

/* 캘린더 주말/공휴일 색상 */
#calendar .fc .fc-daygrid-day-frame {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}
#calendar .fc .fc-daygrid-day-top,
#calendar .fc .fc-scrollgrid-sync-inner {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}
#calendar .fc .fc-daygrid-day-top {
  min-height: 1.4rem;
  flex-direction: row !important;
  justify-content: flex-start !important;
}
#calendar .fc .fc-daygrid-day-number {
  align-self: flex-start !important;
  display: block !important;
  order: 0 !important;
  margin: 0 !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  padding: 0.2rem 0.35rem 0 0.35rem !important;
  text-align: left !important;
}
#calendar .fc .fc-daygrid-day-events {
  margin-top: 0.2rem !important;
  margin-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  align-content: flex-start !important;
}
#calendar .fc .fc-daygrid-event-harness {
  margin-top: 0 !important;
  margin-bottom: 0.14rem !important;
}
#calendar .fc .fc-daygrid-day {
  background-color: #fff;
}
#calendar .fc .fc-daygrid-day:not(.wf-cal-sat):not(.wf-cal-sun):not(.wf-cal-holiday) {
  background-color: #fff !important;
}
#calendar .fc .fc-daygrid-day.fc-day-today:not(.wf-cal-sat):not(.wf-cal-sun):not(.wf-cal-holiday) {
  background-color: #fff !important;
}
#calendar .fc .wf-cal-sat {
  background-color: #e8f1ff !important;
}
#calendar .fc .wf-cal-sun {
  background-color: #ffecec !important;
}
#calendar .fc .wf-cal-sat .fc-daygrid-day-frame {
  background-color: #e8f1ff !important;
}
#calendar .fc .wf-cal-sun .fc-daygrid-day-frame {
  background-color: #ffecec !important;
}
#calendar .fc .fc-day-sat {
  background-color: #e8f1ff !important;
}
#calendar .fc .fc-day-sun {
  background-color: #ffecec !important;
}
#calendar .fc .fc-day-sat .fc-daygrid-day-frame,
#calendar .fc .fc-day-sat .fc-daygrid-day-bg {
  background-color: #e8f1ff !important;
}
#calendar .fc .fc-day-sun .fc-daygrid-day-frame,
#calendar .fc .fc-day-sun .fc-daygrid-day-bg {
  background-color: #ffecec !important;
}
#calendar .fc .fc-col-header-cell,
#calendar .fc .fc-col-header-cell .fc-scrollgrid-sync-inner {
  background-color: #ffffff !important;
}
#calendar .fc .fc-col-header-cell.fc-day-sat,
#calendar .fc .fc-col-header-cell.fc-day-sat .fc-scrollgrid-sync-inner {
  background-color: #e8f1ff !important;
}
#calendar .fc .fc-col-header-cell.fc-day-sun,
#calendar .fc .fc-col-header-cell.fc-day-sun .fc-scrollgrid-sync-inner {
  background-color: #ffecec !important;
}
#calendar .fc .fc-timegrid-col.fc-day-sat,
#calendar .fc .fc-timegrid-col.fc-day-sat .fc-timegrid-col-bg {
  background-color: #e8f1ff !important;
}
#calendar .fc .fc-timegrid-col.fc-day-sun,
#calendar .fc .fc-timegrid-col.fc-day-sun .fc-timegrid-col-bg {
  background-color: #ffecec !important;
}
#calendar .fc .wf-cal-red .fc-daygrid-day-number,
#calendar .fc .wf-cal-red .fc-col-header-cell-cushion {
  color: #d63b3b;
  font-weight: 600;
}
#calendar .fc .wf-cal-sat .fc-daygrid-day-number,
#calendar .fc .wf-cal-sat .fc-col-header-cell-cushion {
  color: #2b6fd6;
  font-weight: 600;
}

/* 업무 목록 실시간 갱신 토스트 */
#wf-tasks-live-toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  background: #1e40af;
  color: #fff;
  border-radius: 2rem;
  padding: .45rem 1.2rem;
  font-size: .85rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  pointer-events: none;
  animation: wfBannerIn .25s ease;
}
@keyframes wfBannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-.4rem); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* 업무 목록 갱신 시 부드러운 진입 */
@keyframes wfListFadeIn {
  from { opacity: .4; }
  to   { opacity: 1; }
}

/* ── 자동기록 댓글 스타일 ───────────────────────────────── */
.task-note-auto {
  background: #f8faff;
  border-left: 3px solid #93c5fd;
  opacity: .92;
}
.task-note-auto-badge {
  font-size: .75rem;
  font-weight: 600;
  color: #2563eb;
  background: #dbeafe;
  border-radius: .3rem;
  padding: .1rem .45rem;
}
.task-note-auto .task-note-body {
  font-size: .82rem;
  color: #374151;
  white-space: pre-wrap;
}

/* ── 첨부 이미지 갤러리 ────────────────────────────────── */
.task-img-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .5rem;
}
.task-img-thumb-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  text-decoration: none;
  color: inherit;
  max-width: 120px;
}
.task-img-thumb {
  width: 110px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dde3ec;
  background: #f3f4f6;
  cursor: zoom-in;
  transition: opacity .15s, box-shadow .15s;
}
.task-img-thumb:hover {
  opacity: .85;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.task-img-name {
  font-size: .72rem;
  color: #555;
  word-break: break-all;
  text-align: center;
  max-width: 110px;
}
.task-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  position: relative;
}
.wf-file-del-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  font-size: .75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wf-file-del-btn:hover { background: #b91c1c; }
.task-img-wrap .wf-file-del-btn {
  position: absolute;
  top: .2rem;
  right: .2rem;
  opacity: 0;
  transition: opacity .15s;
}
.task-img-wrap:hover .wf-file-del-btn,
.task-img-wrap:focus-within .wf-file-del-btn {
  opacity: 1;
}
.task-file-list .wf-file-del-btn {
  margin-left: .4rem;
  vertical-align: middle;
}
.task-upload-existing .wf-file-del-btn {
  margin-left: .4rem;
  vertical-align: middle;
}

/* ── 이미지 라이트박스 ──────────────────────────────────── */
#wf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0,0,0,.82);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#wf-lightbox-close {
  position: absolute;
  top: .8rem;
  right: 1rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: .2rem .5rem;
  z-index: 1;
}
#wf-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  max-width: 96vw;
  max-height: 96vh;
}
#wf-lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
#wf-lightbox-caption {
  color: #ddd;
  font-size: .85rem;
  margin: 0;
  text-align: center;
}
#wf-lightbox-dl {
  color: #93c5fd;
  font-size: .85rem;
  text-decoration: none;
}
#wf-lightbox-dl:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   전사 채팅
   ══════════════════════════════════════════════════════ */
.wf-chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  height: calc(100dvh - 120px); /* 모바일 dynamic viewport 보정 */
  min-height: 400px;
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
}
.wf-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}
.wf-chat-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.wf-chat-status { font-size: .78rem; }
.wf-chat-status--ok  { color: #16a34a; }
.wf-chat-status--err { color: #dc2626; }

/* 알림 권한 안내 배너 (floating - 항상 보이도록) */
.wf-chat-notice[hidden] { display: none !important; }
.wf-chat-notice {
  position: fixed;
  top: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.4rem);
  max-width: 480px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .85rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  color: #78350f;
  font-size: .85rem;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}
@media (min-width: 769px) {
  .wf-chat-notice {
    top: 1rem;
    right: 1.2rem;
    left: auto;
    transform: none;
    width: auto;
    max-width: 380px;
  }
}
.wf-chat-notify-btn {
  margin-left: .35rem;
  padding: .28rem .65rem;
  background: #f59e0b;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}
.wf-chat-notify-btn:hover { background: #d97706; }
.wf-chat-notify-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #78350f;
  font-size: 1rem;
  cursor: pointer;
  padding: .15rem .35rem;
  line-height: 1;
}
.wf-chat-notify-close:hover { color: #b45309; }

/* 메시지 영역 */
.wf-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  scroll-behavior: smooth;
}
.wf-chat-loading { text-align: center; margin: auto; }

/* 날짜 구분선 */
.wf-chat-date-divider {
  text-align: center;
  font-size: .72rem;
  color: #9ca3af;
  margin: .6rem 0;
  position: relative;
}
.wf-chat-date-divider::before,
.wf-chat-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: #e5e7eb;
}
.wf-chat-date-divider::before { left: 0; }
.wf-chat-date-divider::after  { right: 0; }

/* 메시지 버블 */
.wf-chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
}
.wf-chat-msg--mine {
  align-self: flex-end;
  align-items: flex-end;
}
.wf-chat-msg-name {
  font-size: .72rem;
  color: #6b7280;
  margin-bottom: .15rem;
  padding-left: .3rem;
}
.wf-chat-msg-bubble {
  background: #f3f4f6;
  border-radius: 1rem 1rem 1rem .25rem;
  padding: .5rem .8rem;
  font-size: .9rem;
  line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
}
.wf-chat-msg--mine .wf-chat-msg-bubble {
  background: #2563eb;
  color: #fff;
  border-radius: 1rem 1rem .25rem 1rem;
}
.wf-chat-msg-time {
  font-size: .68rem;
  color: #9ca3af;
  margin-top: .12rem;
  padding: 0 .3rem;
}

/* 파일 첨부 미리보기 */
.wf-chat-file-preview[hidden] { display: none !important; }
.wf-chat-file-preview {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .75rem;
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  flex-shrink: 0;
}
.wf-chat-preview-img {
  max-height: 80px;
  max-width: 160px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #93c5fd;
}
.wf-chat-preview-file {
  font-size: .85rem;
  color: #1d4ed8;
}
.wf-chat-file-cancel {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.wf-chat-file-cancel:hover { background: #b91c1c; }

/* 입력 영역 */
.wf-chat-compose {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .6rem .75rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}
.wf-chat-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: .6rem;
  padding: .5rem .75rem;
  font-size: .9rem;
  resize: none;
  line-height: 1.4;
  min-height: 2.4rem;
  max-height: 7.5rem;
  font-family: inherit;
  background: #fff;
}
.wf-chat-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.wf-chat-send-btn {
  padding: .5rem 1.1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: .6rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: 2.4rem;
  flex-shrink: 0;
}
.wf-chat-send-btn:hover  { background: #1d4ed8; }
.wf-chat-send-btn:active { background: #1e40af; }

/* 파일첨부 버튼 */
.wf-chat-attach-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: .2rem .4rem;
  flex-shrink: 0;
  line-height: 1;
  opacity: .7;
}
.wf-chat-attach-btn:hover { opacity: 1; }
.wf-chat-file-input { display: none; }

/* 버블 내 파일/이미지 공통 */
.wf-chat-file-bubble {
  margin-bottom: .2rem;
  display: inline-block;
  max-width: 100%;
}

/* 이미지 버블 – 상대방 */
.wf-chat-file-bubble--img {
  background: #f3f4f6;
  border-radius: 1rem 1rem 1rem .25rem;
  padding: .35rem;
  overflow: hidden;
}
/* 이미지 버블 – 내 메시지 */
.wf-chat-msg--mine .wf-chat-file-bubble--img {
  background: #1d4ed8;
  border-radius: 1rem 1rem .25rem 1rem;
}

/* 문서 버블 – 상대방 */
.wf-chat-file-bubble--doc {
  background: #f3f4f6;
  border-radius: 1rem 1rem 1rem .25rem;
  padding: .4rem .65rem;
}
/* 문서 버블 – 내 메시지 */
.wf-chat-msg--mine .wf-chat-file-bubble--doc {
  background: #2563eb;
  border-radius: 1rem 1rem .25rem 1rem;
}

.wf-chat-bubble-img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 6px;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.wf-chat-img-link { display: inline-block; }
.wf-chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  text-decoration: none;
  color: #374151;
  word-break: break-all;
}
.wf-chat-msg--mine .wf-chat-file-link {
  color: #fff;
}

/* 메뉴 안읽 배지 */
.wf-chat-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9999px;
  padding: .05rem .38rem;
  margin-left: .3rem;
  vertical-align: middle;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .wf-chat-wrap {
    height: calc(100vh - 90px);
    height: calc(100dvh - 90px);
    border-radius: 0;
    box-shadow: none;
  }
  .wf-chat-msg { max-width: 90%; }
}
