:root {
  --rail-bg: #1e2554;
  --rail-active: #5b4dff;
  --rail-text: #c8d0f0;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e4e8ef;
  --text: #1a1d26;
  --muted: #6b7280;
  --link: #06a06d;
  --link-hover: #05945f;
  --accent-green: #15803d;
  --crm-green: #166534;
  --accent-purple: #6c5ce7;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body.auth-screen-login {
  background: linear-gradient(160deg, #1e2554 0%, #2d3a7c 45%, #1a1f45 100%);
  min-height: 100vh;
}

.screen-login {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1e2554 0%, #2d3a7c 45%, #1a1f45 100%);
}

/* display:flex가 [hidden]보다 우선하는 브라우저 대비 — 로그인 성공 후에도 화면을 가리는 문제 방지 */
.screen-login[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.screen-login__inner {
  width: 100%;
  max-width: 440px;
}

.screen-login__brand {
  text-align: center;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

.screen-login__card {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.07),
    0 24px 48px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.screen-login__head {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.screen-login__banner {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  line-height: 1.45;
}

.screen-login__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.screen-login__sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.screen-login__form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.screen-login__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 8px;
}

.screen-login__label:first-of-type {
  margin-top: 0;
}

.screen-login__hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}

.screen-login__input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid #c5cad6;
  border-radius: 10px;
  background: #fafbfc;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.screen-login__input::placeholder {
  color: #9ca3af;
}

.screen-login__input:hover {
  border-color: #a8b0c0;
}

.screen-login__input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.screen-login__err {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 13px;
  font-weight: 600;
  color: #b91c1c;
  line-height: 1.45;
}

.screen-login__submit {
  width: 100%;
  margin-top: 22px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
}

.screen-login__note {
  margin: 16px 0 0;
  text-align: center;
  line-height: 1.45;
}

.screen-login__alt {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.screen-login__alt-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
}

.screen-login__alt-btn:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

body {
  margin: 0;
  font-family:
    'Pretendard',
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    'Segoe UI',
    Roboto,
    Arial,
    'Apple SD Gothic Neo',
    'Noto Sans KR',
    sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.app {
  display: flex;
  min-height: 100vh;
}

.nav-rail {
  width: 72px;
  background: var(--rail-bg);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 0;
  flex-shrink: 0;
}

.nav-rail__brand {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.nav-rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  margin: 2px 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 10px;
}
/* author display:flex 가 [hidden] 기본 숨김을 이기는 브라우저 대비 — 비관리자에게 Settings가 보이지 않게 */
.nav-rail__item[hidden] {
  display: none !important;
}

.nav-rail__item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-rail__item.is-active {
  background: var(--rail-active);
  color: #fff;
}

.nav-rail__icon {
  font-size: 18px;
  line-height: 1;
}

.nav-rail__label {
  opacity: 0.9;
}

.sub-rail {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  flex-shrink: 0;
}

.sub-rail__title {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.sub-rail__link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.sub-rail__link.is-active {
  background: #eef0fb;
  color: var(--accent-purple);
  font-weight: 600;
}

.sub-rail__muted {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted);
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-top__left {
  flex-shrink: 0;
}

.app-top__search {
  flex: 1;
  max-width: 420px;
}

.app-top__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb {
  font-weight: 700;
  font-size: 18px;
  min-height: 1.2em;
}

.breadcrumb:empty {
  display: none;
}

.search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
}

.user-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.select-inline {
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  min-width: 120px;
}

.view {
  flex: 1;
  padding: 16px 20px 32px;
  overflow: auto;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.link {
  color: var(--link);
  cursor: pointer;
  text-decoration: none;
  border: 0;
  background: none;
  font: inherit;
  padding: 0;
}

.link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.banner {
  background: #e8f4ff;
  border: 1px solid #c5ddf5;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner__text {
  font-size: 13px;
  color: #1a5a8a;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar__tabs {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  background: var(--surface);
}

.toolbar__tab {
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.toolbar__tab.is-active {
  background: #eef0fb;
  color: var(--accent-purple);
  font-weight: 600;
}

.toolbar__tab--icon {
  padding: 6px 10px;
  min-width: 36px;
  font-size: 15px;
  line-height: 1;
}

.toolbar__tab:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.deals-toolbar .deals-count {
  margin-left: auto;
}

.deals-toolbar .btn--primary {
  flex-shrink: 0;
  margin-left: 2px;
}

.input-inline,
.deals-list-table select.deal-stage-sel {
  max-width: 160px;
  width: 100%;
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--accent-green);
  background: #e8faf2;
  color: #047857;
  font-weight: 600;
}

.btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow);
}

.btn:hover {
  border-color: #c5cbd6;
}

.btn--primary {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

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

.btn--ghost {
  box-shadow: none;
  background: transparent;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.data-table th {
  background: #fafbfc;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.cell-done {
  width: 40px;
  text-align: center;
}

.bulk-select-col {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.bulk-select-col .checkbox-round {
  vertical-align: middle;
}

.lead-list-preview {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.lead-list-preview-td {
  max-width: 260px;
}

.lead-note-preview-edit {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.lead-note-preview-edit:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  border-radius: 6px;
}

.lead-note-preview-edit .lead-list-preview {
  text-decoration: none;
}

.lead-note-preview-edit:hover .lead-list-preview {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.leads-view-toolbar--split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 4;
}

.leads-table-wrap {
  position: relative;
  z-index: 1;
}

/* Planner: 담당 멀티셀렉트 드롭다운이 .table-wrap overflow에 잘리지 않도록 */
.table-wrap.leads-table-wrap.planner-table-wrap {
  overflow: visible;
}

.planner-data-table .user-multi {
  position: relative;
}

.lead-filter-dropdown,
.lead-toolbar-dropdown {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.lead-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-filter-pictogram {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  opacity: 0.9;
}

.lead-filter-count {
  font-variant-numeric: tabular-nums;
}

.lead-filter-dropdown.deals-prefs-dropdown {
  min-width: 260px;
  max-height: none;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
}

.lead-filter-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.lead-filter-dropdown__head .link {
  white-space: nowrap;
}
.lead-filter-dropdown__head .link + .link {
  margin-left: 8px;
}

.lead-filter-dropdown__title {
  font-weight: 600;
  font-size: 14px;
}

.lead-filter-dropdown__body--menu {
  padding: 0;
  overflow: visible;
  max-height: none;
}

.lead-filter-menu-row {
  position: relative;
  border-bottom: 1px solid var(--border);
}

.lead-filter-menu-row:last-child {
  border-bottom: none;
}

.lead-filter-main-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: default;
  user-select: none;
}

.lead-filter-main-row__lead {
  font-size: 14px;
  line-height: 1;
  opacity: 0.88;
}

.lead-filter-main-row__text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.lead-filter-main-row__chev {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.lead-filter-menu-row:hover .lead-filter-main-row {
  background: #f3f4f6;
}

/* 우측 고정 패널 기준: 하위 메뉴는 왼쪽으로 펼침(뷰포트 밖으로 밀리지 않음) */
.lead-filter-flyout {
  display: none;
  position: absolute;
  right: 100%;
  left: auto;
  top: 0;
  margin-right: -6px;
  padding-right: 10px;
  z-index: 80;
}

.lead-filter-menu-row:hover .lead-filter-flyout,
.lead-filter-menu-row:focus-within .lead-filter-flyout {
  display: block;
}

.lead-filter-flyout__inner {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  padding: 6px 4px;
  min-width: 220px;
  max-width: min(92vw, 320px);
  max-height: min(52vh, 320px);
  overflow-y: auto;
}

.lead-filter-flyout__bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 4px 8px 8px;
  margin: 0 2px 4px;
  border-bottom: 1px solid var(--border);
}

.lead-filter-bulk-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.lead-filter-bulk-row input[type='radio'] {
  margin: 0;
  flex-shrink: 0;
}

.lead-filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.lead-filter-check:hover {
  background: #f3f4f6;
}

.lead-filter-check input[type='checkbox'] {
  margin: 0;
  flex-shrink: 0;
}

.leads-data-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.leads-data-table th,
.leads-data-table td {
  border-right: 1px solid var(--border);
}

.leads-data-table thead th:last-child,
.leads-data-table tbody td:last-child {
  border-right: none;
}

.lead-th-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 8px);
}

.lead-th-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-th-sort-wrap .deals-th-sort-wrap__label.lead-th-label {
  flex: 1;
  min-width: 0;
}

.lead-col-order-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.lead-col-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: grab;
  user-select: none;
}

.lead-col-order-row:active {
  cursor: grabbing;
}

.lead-col-order-row.is-dragging {
  opacity: 0.85;
  box-shadow: var(--shadow);
}

.lead-col-order-grip {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -2px;
}

.lead-col-prefs-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.lead-col-visibility-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.leads-table-wrap tbody td {
  vertical-align: middle;
}

.leads-data-table thead th.lead-th-draggable {
  cursor: grab;
  user-select: none;
}

.leads-data-table thead th.lead-th-draggable:active {
  cursor: grabbing;
}

thead th.lead-th-drop-over {
  outline: 2px solid rgba(99, 102, 241, 0.45);
  outline-offset: -2px;
}

.leads-data-table.lead-table-col-resizing th,
.leads-data-table.lead-table-col-resizing td {
  transition: none;
}

.lead-th-resizable {
  position: relative;
  padding-right: 8px;
}

.lead-th-inner {
  display: inline-block;
  max-width: calc(100% - 6px);
}

.lead-col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 2;
  user-select: none;
}

.lead-col-resize-handle:hover {
  background: rgba(99, 102, 241, 0.22);
}

/* Lead 목록: 열 너비 드래그 시 미리보기 세로선 (전체 표 높이) */
.lead-col-resize-guide {
  position: fixed;
  width: 2px;
  margin-left: -1px;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10050;
  background: #2563eb;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

#leadListColsAnchor {
  position: relative;
  display: inline-block;
}

#leadListColsAnchor #leadDropListCols {
  left: 0;
}

.lead-label-td {
  position: relative;
  z-index: 1;
}

.lead-label-td:has(.lead-temp-dropdown:not([hidden])) {
  z-index: 60;
}

.lead-label-td .btn--ghost {
  padding: 4px 8px;
  min-height: 0;
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.lead-temp-dropdown {
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
}

.lead-temp-dropdown__search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.lead-temp-dropdown__body {
  padding: 6px 4px;
  max-height: 220px;
  overflow-y: auto;
}

.lead-temp-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border: none;
  background: transparent;
  padding: 8px 10px;
  margin: 0;
  cursor: pointer;
  border-radius: var(--radius);
  text-align: left;
  font: inherit;
  color: inherit;
}

.lead-temp-opt:hover {
  background: #f3f4f6;
}

.lead-temp-opt.is-selected {
  background: #eef2ff;
}

.lead-temp-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.lead-temp-pill--lg {
  padding: 6px 14px;
  font-size: 13px;
}

.lead-temp-placeholder {
  font-size: 12px;
  color: var(--muted);
}

.lead-temp-check {
  font-size: 14px;
  color: var(--accent-purple);
  flex-shrink: 0;
}

.lead-temp-check--sp {
  width: 1em;
  visibility: hidden;
}

.lead-temp-clear {
  display: block;
  margin: 4px 10px 8px;
}

.checkbox-round {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

body.deal-drag-active {
  cursor: grabbing;
}

body.deal-drag-active .view--deals {
  padding-bottom: 96px;
}

.deal-drag-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 12px 16px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.deal-drag-dock.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.deal-drag-dock__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2.2fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 -4px 28px rgba(15, 23, 42, 0.12);
  padding: 12px;
}

@media (max-width: 900px) {
  .deal-drag-dock__inner {
    grid-template-columns: 1fr 1fr;
  }
}

.deal-drag-zone {
  min-height: 64px;
  border: 2px dashed #c5cbd6;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.deal-drag-zone__label,
.deal-drag-zone__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.deal-drag-zone--wide {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px;
}

.deal-drag-zone__title {
  text-align: center;
}

.deal-drag-zone--won {
  border-color: rgba(33, 191, 115, 0.45);
}

.deal-drag-zone--lost {
  border-color: rgba(220, 38, 38, 0.35);
}

.deal-drag-zone.is-over {
  border-color: var(--accent-purple);
  background: #eef0fb;
  box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.25);
}

.deal-drag-zone--won.is-over {
  border-color: var(--accent-green);
  background: #e8faf2;
}

.deal-drag-zone--lost.is-over {
  border-color: #dc2626;
  background: #fef2f2;
}

.deal-drag-zone[data-action='delete'].is-over {
  border-color: #dc2626;
  background: #fef2f2;
}

.deal-drag-zone__stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.deal-stage-chip {
  display: inline-block;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: default;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.deal-stage-chip.is-over {
  border-color: var(--accent-purple);
  background: #eef0fb;
}

.board {
  display: grid;
  grid-template-columns: repeat(var(--board-cols, 1), minmax(0, 1fr));
  gap: 16px;
  overflow-x: hidden;
  padding-bottom: 8px;
  align-items: stretch;
}

.deals-inline-prefs {
  margin: 6px 0 10px;
  border: 1px solid var(--border);
  background: #fafbfc;
  border-radius: var(--radius);
  padding: 8px 10px;
}

.deals-inline-prefs__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.deals-th-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.deals-th-sort-wrap__label {
  flex: 0 1 auto;
}

.deals-th-sort-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.deals-th-sort-btn .table-sort-icon {
  flex-shrink: 0;
}

.deals-th-sort-btn:hover {
  border-color: var(--accent-purple);
  color: var(--text);
  background: #eef0fb;
}

.deals-prefs-anchor {
  position: relative;
  display: inline-block;
}

.deals-prefs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: min(70vh, 360px);
  overflow-y: auto;
  z-index: 80;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.deals-prefs-dropdown__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}

.deals-prefs-dropdown__body .row-check {
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
}

.deals-prefs-dropdown__body .row-check:hover {
  background: #f3f4f6;
}

.deals-prefs-caret {
  font-size: 10px;
  opacity: 0.75;
  margin-left: 2px;
}

.pipeline-col {
  background: #edeff3;
  border-radius: var(--radius);
  padding: 8px 6px 14px;
  min-height: 200px;
}

.pipeline-col__head {
  margin-bottom: 10px;
}

.pipeline-col__name {
  font-weight: 700;
  font-size: 14px;
}

.pipeline-col__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.pipeline-col__add-zone {
  display: flex;
  justify-content: center;
  padding: 6px 0 0;
  margin-top: 2px;
}

.pipeline-col__add-btn {
  width: 100%;
  border: 1px dashed transparent;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.pipeline-col:hover .pipeline-col__add-btn,
.pipeline-col__add-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
  border-color: #d8dde6;
  background: #e4e8ef;
  color: var(--text);
}

.pipeline-col__add-btn:hover {
  border-color: var(--accent-green);
  background: #e8faf2;
  color: var(--accent-green);
}

.deal-product-dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.deal-product-dd select {
  flex: 1;
  min-width: 120px;
}

.input-krw-comma {
  width: 100%;
  max-width: 100%;
}

.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  margin: 0 0 8px;
  width: 100%;
  box-sizing: border-box;
  cursor: grab;
  box-shadow: var(--shadow);
  position: relative;
}

.deal-card:active {
  cursor: grabbing;
}

.deal-card__title {
  font-weight: 700;
  margin-bottom: 6px;
  padding-right: 20px;
}

.deal-card__org {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.deal-card__line {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 4px;
}

.deal-card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 4px;
}

.deal-label-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.deal-label-pill--rem {
  padding-right: 4px;
}

.deal-label-pill__x {
  border: 0;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  font-size: 14px;
}

.deal-labels-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  background: #fafbfc;
}

.deal-label-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}

.deal-label-search {
  width: 100%;
  margin-bottom: 8px;
}

.deal-label-checklist {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  background: var(--surface);
}

.deal-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  cursor: pointer;
  font-size: 13px;
}

.deal-label-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.deal-label-editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.deal-planner-item__main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.deal-planner-item__main .deal-collapsible-item__hit {
  flex: 1;
  text-align: left;
}

.deal-planner-edit {
  flex-shrink: 0;
  margin-top: 2px;
}

.row-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deals-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.deals-toolbar.deals-toolbar--reordered {
  display: flex;
  align-items: center;
  gap: 8px;
}
.deals-toolbar.deals-toolbar--reordered .deal-filter-anchor {
  margin-left: auto;
}

.deal-card__value {
  margin-top: 8px;
  font-weight: 700;
  color: var(--text);
}

.deal-card__dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
}

.empty-state {
  max-width: 520px;
  margin: 48px auto;
  text-align: center;
  padding: 40px 24px;
}

.empty-state__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.empty-state__desc {
  color: var(--muted);
  margin-bottom: 20px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dashboard-title {
  font-size: 20px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.widget__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.widget__sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.widget__big {
  font-size: 32px;
  font-weight: 800;
}

.funnel-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.funnel-row__label {
  width: 140px;
  font-size: 12px;
  flex-shrink: 0;
}

.funnel-row__barwrap {
  flex: 1;
  height: 22px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
}

.funnel-row__bar {
  height: 100%;
  background: #ffd640;
  border-radius: 4px;
  min-width: 4px;
}

.funnel-row__cnt {
  font-size: 12px;
  color: var(--muted);
  width: 48px;
  text-align: right;
}

.stacked-bar {
  display: flex;
  height: 160px;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.stacked-bar__col {
  width: 48px;
  background: linear-gradient(to top, #80d8c1 0%, #80d8c1 33%, #c5e063 33%, #c5e063 66%, #7dc9ed 66%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.rep-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.rep-bar-row__name {
  width: 80px;
  font-size: 13px;
}

.rep-bar-row__track {
  flex: 1;
  height: 20px;
  background: #eef2f7;
  border-radius: 4px;
  overflow: hidden;
}

.rep-bar-row__fill {
  height: 100%;
  background: #7dc9ed;
  border-radius: 4px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}

.modal.isOpen {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal__panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  margin: 48px auto;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal__panel--wide {
  width: min(920px, calc(100vw - 24px));
  margin: 24px auto;
}

.modal__panel--deal {
  width: min(1380px, calc(100vw - 10px));
  margin: max(12px, 2vh) auto;
}

.modal__panel--deal .modal__title {
  font-size: 18px;
}

.modal__panel--deal .modal__body {
  max-height: min(94vh, 1200px);
  padding: 20px 22px 24px;
}

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

.modal__title {
  font-weight: 800;
  font-size: 16px;
}

.modal__body {
  padding: 18px;
  max-height: 70vh;
  overflow: auto;
}

.modal__panel--wide .modal__body {
  max-height: min(78vh, 880px);
}

.modal__panel--products {
  width: min(1120px, calc(100vw - 16px));
  margin: 16px auto;
}

.modal__panel--products .modal__body {
  max-height: min(88vh, 960px);
}

.view--deal-detail {
  padding: 0 20px 32px;
  overflow: auto;
  max-height: calc(100vh - 56px);
}

.deal-detail-page__bar {
  margin-bottom: 12px;
}

.deal-detail__amount-dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.deal-detail__amount-dd .input-krw-comma {
  flex: 1;
  min-width: 120px;
}

.deal-products-summary {
  text-align: right;
  font-size: 14px;
  line-height: 1.5;
}

.deal-products-table th,
.deal-products-table td {
  vertical-align: top;
  padding: 8px 6px;
}

.deals-list-table tbody tr.deal-row--click {
  cursor: pointer;
}

.deals-list-table tbody tr.deal-row--click:hover {
  background: #f3f4f6;
}

.deal-detail__progress {
  display: flex;
  gap: 2px;
  margin: 8px 0 14px;
  flex-wrap: wrap;
}

.deal-detail__progress-seg {
  flex: 1;
  min-width: 56px;
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  border: 0;
  background: #eef0f4;
  color: var(--muted);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}

.deal-detail__progress-seg:first-child {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
}

.deal-detail__progress-seg:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
}

.deal-detail__progress-seg.is-current {
  background: var(--accent-green);
  color: #fff;
}

.deal-detail__progress-seg:hover:not(:disabled) {
  filter: brightness(0.98);
}

.deal-detail__progress-seg:disabled {
  cursor: default;
}

.date-input-wrap {
  display: block;
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}

.date-input-wrap:hover {
  background: #f3f5f9;
}

.date-input-wrap input[type='date'] {
  cursor: pointer;
}

textarea.auto-grow-note {
  resize: none;
  overflow: hidden;
}

.deal-title-edit {
  margin-bottom: 10px;
}

.deal-note-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-start;
  align-items: center;
}

.deal-note-card__actions {
  margin-top: 6px;
}

.deal-note-comment-wrap {
  margin-top: 8px;
}

.deal-note-comment-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.deal-note-comment-input--styled {
  width: 100%;
  box-sizing: border-box;
  background: #f3f4f6 !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 4px 4px 0 0;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  min-height: 72px;
}

.deal-note-comment-input--styled:focus {
  outline: none;
  border-bottom-color: #2563eb !important;
  background: #eef2f6 !important;
}

.deal-note-comment-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.deal-note-comment-send {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f3f4f6;
  color: #64748b;
  cursor: pointer;
}

.deal-note-comment-send:disabled {
  opacity: 0.55;
  cursor: default;
}

.deal-note-comment-send:not(:disabled) {
  color: #1e293b;
  background: #e5e7eb;
}

.deal-note-comment-send:not(:disabled):hover {
  background: #d1d5db;
}

.deal-note-card__preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}

.deal-note-card__preview-meta {
  display: block;
}

.deal-note-card__preview-snippet {
  font-size: 13px;
  color: #0f172a;
}

.deal-note-card__text--solo {
  margin: 0;
}

.deal-thread-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}

.deal-thread-comment:last-child {
  border-bottom: 0;
}

.deal-thread-comment__avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.deal-thread-comment__main {
  flex: 1;
  min-width: 0;
}

.deal-thread-comment__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.deal-thread-comment__name {
  font-size: 14px;
}

.deal-thread-comment__time {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.deal-thread-comment__body {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: #1e293b;
  white-space: pre-wrap;
}

.mention-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 4px;
}

.mention-pop__item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.mention-pop__item:hover {
  background: #f3f4f6;
}

.note-tool {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.note-link {
  color: #2563eb;
  text-decoration: underline;
}

.deal-detail__layout {
  display: grid;
  grid-template-columns: clamp(360px, 42vw, 520px) 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 720px) {
  .deal-detail__layout {
    grid-template-columns: 1fr;
  }

  .deal-detail__kv--grid {
    grid-template-columns: 1fr;
  }

  .deal-detail__kv-cell--full {
    grid-column: auto;
  }
}

.deal-detail__aside {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #fafbfc;
}

.deal-detail__aside h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deal-detail__kv {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.deal-detail__kv--grid {
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  align-items: start;
}

.deal-detail__kv-cell {
  min-width: 0;
}

.deal-detail__kv-cell--full {
  grid-column: 1 / -1;
}

.deal-detail__kv dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.deal-detail__kv dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.deal-detail__kv-cell dd input[type='text']:not(.input-krw-comma),
.deal-detail__kv-cell dd input.input-krw-comma {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.deal-detail__kv-cell .date-input-wrap {
  display: block;
  width: 100%;
  max-width: 280px;
}

.deal-detail__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.deal-detail__composer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.deal-detail__composer h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.deal-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.deal-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}

.deal-section__body {
  padding: 10px 14px 14px;
  max-height: none;
  overflow: visible;
}

.deal-planner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.deal-planner-item:last-child {
  border-bottom: 0;
}

.deal-note-card {
  position: relative;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 13px;
}

.deal-note-card--editable {
  padding-left: 40px;
}

.deal-note-edit-btn {
  position: absolute;
  left: 8px;
  top: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--crm-green, #28a745);
}

.deal-note-edit-btn:hover {
  background: rgba(40, 167, 69, 0.12);
}

.deal-note-del-btn {
  position: absolute;
  right: 8px;
  top: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #b91c1c;
}

.deal-note-del-btn:hover {
  background: rgba(185, 28, 28, 0.12);
}

.deal-note-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.deal-note-card__text {
  white-space: pre-wrap;
  line-height: 1.45;
}

.deal-timeline-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.deal-timeline-item:last-child {
  border-bottom: 0;
}

.deal-detail__tabbar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.deal-detail__tab {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.deal-detail__tab:hover {
  color: var(--text);
  background: #f3f4f6;
}

.deal-detail__tab.is-active {
  color: var(--accent-purple);
  background: #eef0fb;
}

.deal-detail__kv input[type='number'],
.deal-detail__kv input[type='date'] {
  width: 100%;
  margin-top: 4px;
  font-weight: 600;
}

.deal-summary-save {
  margin-top: 12px;
  width: 100%;
}

.deal-collapsible-item__hit {
  cursor: pointer;
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 0;
}

.deal-collapsible-item__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.deal-collapsible-item.is-expanded .deal-collapsible-item__preview {
  white-space: normal;
}

.deal-collapsible-item__body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  line-height: 1.45;
}

.deal-attach-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.deal-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deal-attach-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 13px;
}

.deal-attach-list a {
 color: var(--link);
 font-weight: 600;
 text-decoration: none;
}

.deal-attach-list a:hover {
  text-decoration: underline;
}

.iconBtn {
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: minmax(260px, 2.4fr) minmax(140px, 1fr) minmax(120px, 0.9fr);
  gap: 12px;
}

/* Deal·Lead Todo: 할당(멀티) + 기한 겹침 방지 */
.planner-todo-row {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(120px, 0.95fr);
  align-items: start;
}

.planner-todo-row .user-multi {
  min-width: 0;
  max-width: 100%;
}

.planner-todo-row .field .date-input-wrap {
  min-width: 0;
  width: 100%;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

input,
textarea,
select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.error {
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

.ok {
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 600;
}

.leads-table .link {
  font-weight: 600;
}

/* Admin panel */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.admin-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.admin-tab-btn.is-active {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}
.admin-panel-section {
  overflow: auto;
  max-height: 56vh;
  padding-right: 6px;
}

/* Deal product picker (autocomplete list) */
.deal-product-picker {
  position: relative;
  width: min(520px, 100%);
}
.deal-product-picker__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 240px;
  overflow: auto;
}
.deal-product-picker__item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.deal-product-picker__item:last-child {
  border-bottom: none;
}
.deal-product-picker__item:hover {
  background: #f6f7ff;
}

.btn--accent-green {
  background: var(--crm-green);
  border-color: var(--crm-green);
  color: #fff;
  font-weight: 700;
}
.btn--accent-green:hover {
  filter: brightness(0.95);
}

/* Settings / Admin full-page view */
.view--settings {
  background: var(--bg);
  padding: 20px 24px 40px;
  overflow: auto;
}
.settings-page {
  max-width: 1200px;
  margin: 0 auto;
}
.settings-page__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.settings-page__sub {
  margin: 0 0 20px;
  max-width: 720px;
  line-height: 1.5;
}
.settings-page__tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.settings-page__tab {
  border: 0;
  background: transparent;
  padding: 10px 16px;
  margin-bottom: -2px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.settings-page__tab.is-active {
  color: var(--text);
  border-bottom-color: var(--crm-green);
}
.settings-page__body {
  min-height: 200px;
}
.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}
.settings-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.settings-toolbar__actions .settings-search {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 320px;
}
.settings-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.settings-seg__btn {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.settings-seg__btn.is-active {
  background: #e8f5e9;
  color: #1b5e20;
}
.settings-search {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.settings-table-wrap {
  max-height: min(56vh, 520px);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.settings-users-table thead th {
  font-size: 12px;
}
.settings-users-groupbar th {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.settings-th-group {
  text-align: center;
}
.settings-users-subhead th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.settings-user-cell {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.settings-user-cell__meta {
  min-width: 0;
  flex: 1;
}
.settings-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.badge-admin {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--crm-green);
  color: #fff;
}
.badge-admin--outline {
  background: transparent;
  color: var(--crm-green, #21bf73);
  border: 1px solid var(--crm-green, #21bf73);
  padding: 1px 7px;
}
.perm-dash {
  color: var(--muted);
}
.btn-icon-key {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 8px;
}
.btn-icon-key:hover {
  background: #e8f5e9;
}
.settings-account-cell {
  white-space: nowrap;
  vertical-align: middle;
}
.settings-master-key {
  display: inline-flex;
  vertical-align: middle;
  color: var(--crm-green, #21bf73);
  margin-right: 2px;
}
.settings-master-key__icon {
  display: block;
}
.settings-master-mark {
  color: var(--crm-green, #21bf73);
  font-weight: 700;
}
.settings-master-hint {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #c8e6c9;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 13px;
  line-height: 1.45;
}
.settings-temp-pw {
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  word-break: break-all;
}
.settings-form-card {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.settings-form-card__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
}
.settings-product-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.settings-letter {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.settings-letter.is-active {
  color: var(--crm-green);
  box-shadow: inset 0 -2px 0 var(--crm-green);
}
.settings-products-table td,
.settings-products-table th {
  border-bottom: 1px solid #eef1f5;
}

/* Deal card + Product */
.deal-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.deal-card__add-product {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--crm-green);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.deal-card__add-product:hover {
  color: #1e7e34;
}

/* Contact / free-text combo suggestions */
.combo-suggest {
  position: relative;
  width: 100%;
}
.combo-suggest__list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  margin: 4px 0 0;
  padding: 4px 0;
  max-height: 220px;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.combo-suggest__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.combo-suggest__item:hover {
  background: rgba(15, 23, 42, 0.06);
}

.nav-rail__icon--package {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-rail__icon--package svg {
  width: 22px;
  height: 22px;
  display: block;
  color: inherit;
}

/* Products catalog (main Products view) */
.products-catalog {
  padding: 0 0 24px;
}
.products-catalog__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.products-catalog__primary-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.products-catalog__excel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.products-catalog__primary-actions .btn--primary {
  border-radius: 8px;
}
.products-catalog__chev {
  min-width: 36px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}
.products-catalog__hint {
  flex: 1;
  min-width: 200px;
  margin: 0;
}
.products-catalog__letters {
  margin-bottom: 12px;
}
.products-catalog__table-wrap {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: auto;
  background: var(--surface);
}
.products-catalog-table .products-catalog__cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.products-catalog-row {
  position: relative;
}
.products-catalog-row:hover {
  background: rgba(15, 23, 42, 0.03);
}
.products-catalog__pencil {
  opacity: 0;
  transition: opacity 0.12s ease;
  padding: 4px 8px;
  min-height: 0;
  font-size: 15px;
  line-height: 1;
}
.products-catalog-row:hover .products-catalog__pencil {
  opacity: 1;
}
.products-catalog__th-cb,
.products-catalog__cb {
  width: 40px;
  text-align: center;
}
.products-catalog__th-act,
.products-catalog__act {
  width: 120px;
  text-align: right;
  vertical-align: middle;
}
.products-catalog__edit-actions {
  white-space: nowrap;
}
.products-catalog__input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.products-catalog__foot {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}
.products-catalog__quick-plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--crm-green, #2e7d32);
}
.products-catalog__quick-plus:hover {
  background: rgba(46, 125, 50, 0.08);
}
.products-catalog__settings-link {
  display: block;
  margin: 8px auto 0;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 10px;
  min-height: 0;
}

/* ---------- Planner (활동) 테이블 — 참고 UI 스타일 ---------- */
.planner-table--modern .planner-ref-title {
  font-size: 13px;
  color: var(--text);
  max-width: 220px;
}
.planner-task-name {
  font-weight: 600;
  font-size: 13px;
}
.planner-task-name--done {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
}
/* 완료 행: opacity는 자식(담당 드롭다운)까지 흐려 격자가 비쳐 보이므로 배경만 조정 */
.planner-data-row--done > td[data-planner-col] {
  background-color: #f8fafc;
}
.planner-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}
.planner-pill--default {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
.planner-pill--phone {
  background: #fce7f3;
  color: #9d174d;
  border-color: #fbcfe8;
}
.planner-pill--meet {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.planner-pill--task {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.planner-pill--mail {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}
.planner-assign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.planner-assign__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.planner-assign__name {
  font-size: 12px;
}
.planner-due--overdue {
  background: transparent !important;
  color: #dc2626 !important;
  font-weight: 700;
  border-radius: 0;
}

.deal-detail__kv .user-multi {
  width: 100%;
}
.planner-prog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.planner-prog__icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  background: var(--accent-green, #21bf73);
  flex-shrink: 0;
}
.planner-prog--done .planner-prog__icon {
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  color: #fff;
}
.planner-prog__icon--half {
  background: conic-gradient(var(--accent-green, #21bf73) 50%, #e2e8f0 0);
}
.planner-prog__icon--empty {
  background: transparent;
  border: 2px solid #cbd5e1;
}
.planner-prog--todo {
  color: var(--muted);
}
.planner-quick {
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: 0.85;
}
.planner-add-row {
  background: #fafbfc;
}
.planner-add-row td {
  vertical-align: middle;
  padding-top: 10px;
  padding-bottom: 10px;
}
.planner-inline-input,
.planner-inline-select,
.planner-inline-date {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-sizing: border-box;
}
.planner-inline-add-btn {
  white-space: nowrap;
}

/* ---------- 전역 버튼·칩·탭 호버 (은은한 음영) ---------- */
.btn {
  transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease, color 0.15s ease;
}
.btn--ghost:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
  border-color: #c5cbd6;
}
.btn--ghost:active:not(:disabled) {
  background: rgba(15, 23, 42, 0.09);
}
.btn--primary:hover:not(:disabled) {
  filter: brightness(0.92);
}
.btn--primary:active:not(:disabled) {
  filter: brightness(0.88);
}
.btn--accent-green:hover:not(:disabled) {
  filter: brightness(0.93);
}
.btn--accent-green:active:not(:disabled) {
  filter: brightness(0.88);
}
.chip {
  transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.chip:hover:not(.is-active):not(:disabled) {
  background: #eef1f5;
  border-color: #c5cbd6;
}
.chip.is-active:hover:not(:disabled) {
  filter: brightness(0.97);
}
.toolbar__tab {
  transition: background-color 0.15s ease, color 0.15s ease;
}
.toolbar__tab:hover:not(.is-active):not(:disabled) {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
}
.toolbar__tab.is-active:hover:not(:disabled) {
  filter: brightness(0.98);
}
.iconBtn {
  transition: background-color 0.15s ease, color 0.15s ease;
  border-radius: 8px;
}
.iconBtn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.nav-rail__item {
  transition: background-color 0.15s ease;
}
.settings-page__tab {
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.settings-page__tab:hover:not(.is-active) {
  background: rgba(15, 23, 42, 0.04);
}
.settings-seg__btn {
  transition: background-color 0.15s ease, color 0.15s ease;
}
.settings-seg__btn:hover:not(.is-active) {
  background: rgba(15, 23, 42, 0.04);
}
.planner-data-row {
  transition: background-color 0.12s ease;
}
.planner-data-row:hover {
  background: #f8fafc;
}
.planner-inline-add-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.06);
}

.planner-data-table td[data-planner-col],
.planner-data-table th[data-planner-col] {
  transition: box-shadow 0.12s ease, background-color 0.12s ease;
  border-right: 1px solid var(--border);
}
.planner-data-table td[data-planner-col]:hover,
.planner-data-table th[data-planner-col]:hover {
  box-shadow: inset 0 0 0 1px #d8dee8;
}
.planner-cell--selected {
  box-shadow: inset 0 0 0 2px #6d5efc !important;
}
.planner-cell--editing {
  box-shadow: inset 0 0 0 2px #6d5efc !important;
}
.planner-cell-editor {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #fff;
}
.detail-input-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}
.detail-input-card + .detail-input-card {
  margin-top: 18px;
}

/* Multi user picker (담당/할당 공통) */
.user-multi {
  position: relative;
  min-width: 220px;
}
.user-multi__selected {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 34px 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--surface);
  cursor: pointer;
}
.user-multi--armed .user-multi__selected {
  border-color: #a5b4fc;
  box-shadow: inset 0 0 0 1px #a5b4fc;
}
.user-multi__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
}
.user-multi__chip-avatar,
.user-multi__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #2563eb;
  flex-shrink: 0;
}
.user-multi__toggle {
  display: none;
}
.user-multi__toggle:hover {
  background: rgba(99, 102, 241, 0.12);
}
.user-multi__drop {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: #ffffff;
  background: #ffffff;
  isolation: isolate;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.22);
  padding: 10px;
}
.planner-cell--editing .user-multi__drop,
.planner-cell-user-multi .user-multi__drop {
  z-index: 15000;
}
.user-multi__search {
  width: 100%;
  margin-bottom: 8px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  background: #fff;
}
.user-multi__section + .user-multi__section {
  margin-top: 8px;
}
.user-multi__section-title {
  position: relative;
  z-index: 0;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.user-multi__list {
  position: relative;
  z-index: 0;
  background: #fff;
  max-height: 170px;
  overflow: auto;
}
.user-multi__row {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.user-multi__row:hover {
  background: #f1f5f9;
}
.user-multi__txt {
  flex: 1;
  min-width: 0;
}
.user-multi__rm {
  color: var(--muted);
  min-width: 20px;
  text-align: center;
}

/* 담당(멀티) 피커와 동일한 톤의 드롭다운(select) */
select.select-dd,
.planner-inline-select.select-dd,
.deals-list-table select.deal-stage-sel.select-dd,
.planner-cell-editor.select-dd,
.field select.select-dd {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 10px;
  min-height: 38px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.5 4.25L6 7.75l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
select.select-dd:focus,
.planner-inline-select.select-dd:focus,
.planner-cell-editor.select-dd:focus {
  outline: none;
  border-color: #a5b4fc;
  box-shadow: inset 0 0 0 1px #a5b4fc;
}

.sub-rail--planner {
  padding: 12px 10px;
  width: 240px;
}
.planner-rail-top {
  margin-bottom: 8px;
}
.planner-rail-pin-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 16px 4px 8px;
  letter-spacing: 0.02em;
}
.planner-rail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  position: relative;
  border-left: 3px solid transparent;
  margin-left: -2px;
}
.planner-rail-row:hover {
  background: #f1f5f9;
}
.planner-rail-row.is-active {
  background: #eceff3;
  font-weight: 600;
  border-left-color: #2563eb;
}
.planner-rail-ic {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #ca8a04;
  flex-shrink: 0;
}
.planner-rail-ic--task {
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
}
.planner-rail-row--plan .planner-rail-plan-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #7c3aed, #5b21b6);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 1px 3px rgba(91, 33, 182, 0.35);
}
.planner-rail-plan-badge::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.planner-rail-row__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.planner-rail-row__title {
  font-weight: 600;
  font-size: 14px;
}
.planner-rail-row__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.planner-toolbar-split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
}
.planner-toolbar-split__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.planner-toolbar-split__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.planner-data-table tbody td.planner-cell--editing {
  position: relative;
  z-index: 60;
}
.planner-ref-title__text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.planner-ref-title__text--done {
  text-decoration: line-through;
  color: var(--muted);
}

.planner-task-name-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}
.planner-task-name-cell .planner-task-name {
  flex: 1;
  min-width: 0;
}
.planner-task-info-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.planner-data-row:hover .planner-task-info-btn,
.planner-task-name-cell:focus-within .planner-task-info-btn {
  opacity: 1;
  pointer-events: auto;
}
.planner-task-info-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

.planner-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 8000;
}
.planner-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw - 24px);
  height: 100vh;
  background: #fff;
  z-index: 8001;
  box-shadow: -8px 0 32px rgba(2, 6, 23, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.planner-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.planner-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 28px;
}
.planner-drawer__breadcrumb {
  font-size: 12px;
  color: var(--link);
  font-weight: 600;
  margin-bottom: 8px;
}
.planner-drawer__title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.planner-drawer__title {
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  border: 0;
  padding: 4px 0;
  font: inherit;
  width: 100%;
}
.planner-drawer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 420px) {
  .planner-drawer__grid {
    grid-template-columns: 1fr;
  }
}
.planner-drawer__field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.planner-drawer__section {
  margin-top: 22px;
}
.planner-drawer__section h3 {
  font-size: 14px;
  margin: 0 0 10px;
}
.planner-drawer__memo {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
  background: #f8fafc;
}
.planner-drawer__check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.planner-drawer__comments {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
  background: #fafbfc;
  font-size: 13px;
}
.planner-drawer__comment {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.planner-drawer__comment:last-child {
  margin-bottom: 0;
}
.planner-drawer__c-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #2563eb;
  flex-shrink: 0;
}
.planner-drawer__c-body {
  flex: 1;
  min-width: 0;
}
.planner-drawer__c-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.planner-drawer__send-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.planner-assign-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.planner-assign-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.planner-assign-chip .planner-assign__avatar {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.deal-card__dot--yellow {
  background: #eab308;
}
.deal-card__dot--gray {
  background: #94a3b8;
}
.deal-card__dot--green {
  background: var(--accent-green, #21bf73);
}
.deal-card__dot--red {
  background: #ef4444;
}

.deals-toolbar.deals-toolbar--reordered .deals-count {
  margin-left: 0;
}
.deals-toolbar.deals-toolbar--reordered {
  justify-content: flex-start;
}
.planner-inline-owner-multi.user-multi {
  min-width: 0;
  max-width: 100%;
}
.planner-cell-user-multi .user-multi {
  min-width: 0;
  max-width: 100%;
}

/* Deal·Lead 단일 담당자(목록·보드) */
.crm-assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.crm-assignee__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.crm-assignee__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.deal-card__owner-line {
  margin-top: 4px;
}

.planner-quick-cell {
  text-align: center;
  vertical-align: middle;
}
.planner-row-del {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.planner-row-del:hover {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

.deal-product-suggest-dd {
  max-height: min(280px, 42vh);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18);
  padding: 4px 0;
}
.deal-product-suggest-dd__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.deal-product-suggest-dd__item:hover {
  background: #f1f5f9;
}
.deal-product-suggest-dd__item.is-active {
  background: #e0e7ff;
}

/* 담당 2명 이상: 이니셜 원만 */
.crm-assignee--multi {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.crm-assignee--multi .crm-assignee__avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.user-multi__chip--avatars-only {
  padding: 2px 4px;
  min-width: 0;
}
.user-multi__chip--avatars-only .user-multi__chip-avatar {
  margin: 0;
}

.table-email-link {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.table-email-link:hover {
  text-decoration: underline;
}

.leads-data-table,
.deals-list-table,
.planner-data-table,
.products-catalog-table,
.contacts-data-table {
  table-layout: fixed;
}
.leads-data-table > tbody > td,
.deals-list-table > tbody > td,
.planner-data-table > tbody > td,
.products-catalog-table > tbody > td,
.contacts-data-table > tbody > td {
  min-width: 0;
}
.leads-data-table > tbody > td:not(.bulk-select-col):not(.lead-list-preview-td):not(.lead-label-td),
.deals-list-table > tbody > td,
.planner-data-table > tbody > td:not(.cell-done),
.products-catalog-table > tbody > td,
.contacts-data-table > tbody > td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.leads-data-table > tbody > td .link.lead-open-edit,
.leads-data-table > tbody > td .link.lead-convert {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-data-table > tbody > td.cell-done {
  overflow: visible;
  white-space: normal;
}
.lead-list-preview-td .lead-list-preview {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead-list-preview-td .lead-note-preview-edit {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
  overflow: hidden;
}
.lead-list-preview-td .lead-note-preview-edit .lead-list-preview {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-task-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.planner-task-name-cell .planner-task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.products-catalog-row.is-editing > td {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip;
  max-width: none !important;
}
