/* data-ui-theme 는 theme-script-inline.ejs 에서 data-ui-theme-pref(system|light|dark) 기준으로 설정 */

html[data-ui-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #141414;
  --bg-white: #1e1e1e;
  --text-primary: #e5e7eb;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-light: #3f3f3f;
  --border-dashed: #52525b;
  --bg-overlay: rgba(0, 0, 0, 0.82);
  /* 모달 전용: 페이지/카드보다 한 단 밝은 회색 셸, 필드는 살짝 더 어두운 인셋(순검정 회피) */
  --modal-surface: #2b2c36;
  --modal-surface-inset: #1f2029;
}

html[data-ui-theme="dark"] * {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
html[data-ui-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}
html[data-ui-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* 설정·요금제 등 본문 영역 */
html[data-ui-theme="dark"] .settings .content.maincontent,
html[data-ui-theme="dark"] .plans-page .content.maincontent {
  background-color: var(--bg-primary);
}

/* 하단 자료실 패널 */
html[data-ui-theme="dark"] .bottom-panel {
  background: var(--bg-primary);
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.45);
}
html[data-ui-theme="dark"] .bottom-panel-archive-tab {
  color: var(--text-secondary);
  border-color: var(--border-light);
}
html[data-ui-theme="dark"] .bottom-panel-archive-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
html[data-ui-theme="dark"] .bottom-panel-archive-ym-prev,
html[data-ui-theme="dark"] .bottom-panel-archive-ym-next {
  background: var(--bg-white);
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] .bottom-panel-archive-ym-prev:hover,
html[data-ui-theme="dark"] .bottom-panel-archive-ym-next:hover {
  background: #2a2a2a;
  color: var(--text-primary);
}
html[data-ui-theme="dark"] .bottom-panel-archive-card {
  background: var(--bg-white);
  border-color: var(--border-light);
}
html[data-ui-theme="dark"] .bottom-panel-archive-card:hover {
  background: #2a2a2a;
}
html[data-ui-theme="dark"] .bottom-panel-archive-empty {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] .archive-preview-popup {
  background: var(--bg-white);
  border-color: var(--border-light);
}
html[data-ui-theme="dark"] .archive-preview-popup-title {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

/* 우측 패널 본문 (흰 배경 계열) */
html[data-ui-theme="dark"] .right-panel-body,
html[data-ui-theme="dark"] .right-panel-content {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .dataListBox,
html[data-ui-theme="dark"] .optionListBox,
html[data-ui-theme="dark"] .setting-group {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings-tab-btn {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] .settings-tab-btn.active {
  color: var(--text-primary);
}

/* 고객 카드·목록 등 자주 쓰는 흰 카드 */
html[data-ui-theme="dark"] .customers-container,
html[data-ui-theme="dark"] .customer-list-panel,
html[data-ui-theme="dark"] .customers-card-main {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] input,
html[data-ui-theme="dark"] select,
html[data-ui-theme="dark"] textarea {
  background-color: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .modal-content,
html[data-ui-theme="dark"] .confirm-modal {
  background: var(--bg-white);
  color: var(--text-primary);
}

/* 고객 삭제 확인: 본문 안내 문구는 customers-card.css #333 고정 → 다크에서 본문색에 맞춤 */
html[data-ui-theme="dark"] #deleteCustomerModalOverlay
  .confirm-modal.delete-customer-confirm-modal
  .delete-customer-confirm-lead {
  color: var(--text-primary);
}

/* 이용약관·개인정보 (legal.css) */
html[data-ui-theme="dark"] body.legal-page {
  background: var(--bg-primary);
  color: var(--text-primary);
}
html[data-ui-theme="dark"] .legal-page-header {
  background: var(--bg-white);
  border-bottom-color: var(--border-light);
}
html[data-ui-theme="dark"] .legal-page-brand {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] .legal-page-title,
html[data-ui-theme="dark"] .legal-page-content h2 {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] .legal-page-updated,
html[data-ui-theme="dark"] .legal-page-content p,
html[data-ui-theme="dark"] .legal-page-content li {
  color: var(--text-secondary);
}

/* 결제 결과 (인라인 스타일 보조) */
html[data-ui-theme="dark"] body.pay-result-page {
  background: var(--bg-primary) !important;
}
html[data-ui-theme="dark"] body .pay-result-box {
  background: var(--bg-white);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
html[data-ui-theme="dark"] body .pay-result-box h1 {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body .pay-result-box p {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] body .pay-result-box .pay-meta {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

/* ---------- 설정 페이지 (settings.css 특이도·고정 색상 대응) ---------- */
html[data-ui-theme="dark"] .settings .content.maincontent {
  background-color: var(--bg-primary) !important;
}

html[data-ui-theme="dark"] .settings .settings-page-container .dataListBox {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .dataListBox .settings-tabs {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .dataListBox .settings-tabs-inner:hover {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

html[data-ui-theme="dark"]
  .settings
  .dataListBox
  .settings-tabs-inner:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
}

html[data-ui-theme="dark"] .settings-tab-btn {
  color: var(--text-secondary) !important;
}

html[data-ui-theme="dark"] .settings-tab-btn:hover {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .settings-tab-btn.active {
  color: var(--text-primary) !important;
  border-bottom-color: #3b82f6 !important;
}

html[data-ui-theme="dark"] .settings .setting-group {
  background-color: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .setting-group h4 {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .settings .help-icon {
  color: var(--text-muted) !important;
}

/* 자동완성문자 섹션 진입 강조(다크: 붉은 계열·라이트와 동일 길이·두 번 피크) */
@keyframes sms-autocomplete-section-flash-dark {
  0% {
    background-color: rgba(248, 113, 113, 0.2);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.45);
  }
  18% {
    background-color: rgba(248, 113, 113, 0.38);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.55);
  }
  36% {
    background-color: rgba(248, 113, 113, 0.2);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.32);
  }
  52% {
    background-color: rgba(248, 113, 113, 0.38);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.55);
  }
  72% {
    background-color: rgba(248, 113, 113, 0.16);
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.28);
  }
  100% {
    background-color: var(--bg-primary);
    box-shadow: none;
  }
}
html[data-ui-theme="dark"]
  .settings
  .sms-autocomplete-section.sms-autocomplete-section-highlight {
  animation: sms-autocomplete-section-flash-dark 3.2s ease-in-out forwards;
}

html[data-ui-theme="dark"] .settings .settings-ui-theme-lead,
html[data-ui-theme="dark"] .settings .settings-app-install-lead,
html[data-ui-theme="dark"] .settings .fcm-push-summary,
html[data-ui-theme="dark"] .settings .fcm-push-retry-result,
html[data-ui-theme="dark"] .settings #fcmPushRetryResult {
  color: var(--text-secondary) !important;
}

html[data-ui-theme="dark"] .settings button.add_btn {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}

html[data-ui-theme="dark"] .settings button.add_btn:hover {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
}

html[data-ui-theme="dark"] .settings a.add_btn {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border-color: var(--primary-color) !important;
}

html[data-ui-theme="dark"] .settings a.add_btn:hover {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #fff !important;
}

html[data-ui-theme="dark"] .settings .input-group input {
  background-color: var(--bg-white) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
}

/* 목록 컨테이너는 살짝 어둡게, 행(.setting-item)은 카드 톤 */
html[data-ui-theme="dark"] .settings .setting-list {
  background-color: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .color-mapping-list {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
}

/* 상태 색상 인라인 배경·그라데이션(JS)보다 !important로 덮이면 안 됨 → 특이도만 사용 */
html[data-ui-theme="dark"] .settings .setting-item {
  background-color: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .setting-item:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* 상태에 색이 없는 행만 호버 시 테두리 강조 (data-color 가 # 으로 시작하는 행은 인라인 테두리 유지) */
html[data-ui-theme="dark"]
  .settings
  .setting-item:not([data-color^="#"]):hover {
  border-color: var(--primary-color);
}

html[data-ui-theme="dark"] #statusList .setting-item .status-color-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .setting-text {
  color: var(--text-primary);
}

/* 색상 코드 매치표: 코드(strong)만 primary 고정색이면 다크 카드에서 대비 부족할 수 있음 */
html[data-ui-theme="dark"] .settings .color-mapping-item .setting-text strong {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .current-ip-value {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .settings .ip-whitelist-label {
  color: var(--text-secondary) !important;
}

/* 로그인 기기 목록 */
html[data-ui-theme="dark"] .settings .device-sessions-item {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-item--current {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: #059669 !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-label {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-empty {
  color: var(--text-secondary) !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-logout-btn {
  background-color: var(--primary-color) !important;
  color: #fff !important;
  border: 1px solid var(--primary-color) !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-logout-btn:hover {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  color: #fff !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-keep-btn {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .device-sessions-keep-btn:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

/* OTP 등록(보안 탭) — QR·수동 입력 박스 */
html[data-ui-theme="dark"] .settings .otp-qr-inner {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .otp-qr-title {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .settings .otp-qr-manual {
  color: var(--text-secondary) !important;
}

html[data-ui-theme="dark"] .settings .otp-secret-code {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-light);
}

html[data-ui-theme="dark"] .settings .otp-status .status-text {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .color-mapping-input-group > input {
  background-color: var(--bg-white) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .settings .mobile-bottom-nav-settings-select {
  background-color: var(--bg-white) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
}

/* 보안·기타 탭 공통 카드 */
html[data-ui-theme="dark"] body.settings .setting-group {
  background-color: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
}

/* 요금제 페이지(plans) */
html[data-ui-theme="dark"] .plans-page .settings-page-container .dataListBox,
html[data-ui-theme="dark"] body.settings.plans-page .settings-page-container .dataListBox {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
}

/* ---------- 설정 · 사전설정 탭 (마진 템플릿, 문자 템플릿, 날짜 알림) ---------- */
html[data-ui-theme="dark"] .settings .margin-template-item {
  background-color: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .margin-template-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] .settings .margin-template-item.sortable-ghost {
  background-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .sms-template-item {
  background-color: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .sms-template-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-ui-theme="dark"] .settings .sms-template-item.sortable-ghost {
  background-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .sms-template-item .template-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .template-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .template-items::after {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .settings .template-item-tag {
  background-color: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.35);
}

html[data-ui-theme="dark"] .settings .template-btn-group .edit_btn,
html[data-ui-theme="dark"] .settings .template-btn-group .delete_btn {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .template-btn-group .edit_btn:hover {
  background-color: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

html[data-ui-theme="dark"] .settings .template-btn-group .delete_btn:hover {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

html[data-ui-theme="dark"] .settings .date-alert-preset-item {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-item.sortable-ghost {
  background-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-label {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-offset {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-select,
html[data-ui-theme="dark"] .settings .date-alert-preset-input {
  background-color: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-item .delete_btn {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .settings .date-alert-preset-item .delete_btn:hover {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

/* ---------- 요금제 안내 (plans.css + login 푸터) ---------- */
html[data-ui-theme="dark"] .plans-section .pricing-main-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-section .pricing-banner {
  background-color: rgba(234, 179, 8, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

html[data-ui-theme="dark"] .plans-pro-legal-consent-row {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-pro-legal-consent-row--error {
  background: rgba(127, 29, 29, 0.35);
  border-color: #f87171;
}

html[data-ui-theme="dark"] .plans-pro-legal-consent-row .plans-pro-legal-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-pro-legal-consent-row .plans-pro-legal-link {
  color: #60a5fa;
}

html[data-ui-theme="dark"] .plans-pro-legal-consent-row .plans-pro-legal-link:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] .plans-section .pricing-toggle {
  border-color: var(--border-light);
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] .plans-section .toggle-option {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-section .toggle-option:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] .plans-section .pricing-card {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] .plans-section .pricing-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] .plans-section .pricing-card-current {
  border-color: #0ea5e9;
  background: linear-gradient(
    180deg,
    rgba(14, 165, 233, 0.14) 0%,
    var(--bg-white) 52%
  );
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.15);
}

html[data-ui-theme="dark"] .plans-section .pricing-card-pro {
  background: linear-gradient(
    180deg,
    rgba(0, 147, 216, 0.2) 0%,
    var(--bg-white) 48%
  );
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-section .pricing-card-title,
html[data-ui-theme="dark"] .plans-section .pricing-price-amount {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-section .pricing-card-description,
html[data-ui-theme="dark"] .plans-section .pricing-price-unit,
html[data-ui-theme="dark"] .plans-section .pricing-price-note,
html[data-ui-theme="dark"] .plans-section .pricing-price-period {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-section .pricing-plan-current {
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-section .pricing-plan-tier-hint {
  color: var(--text-muted);
  background-color: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-section .pricing-feature-item {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-section .pricing-feature-limited {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-section .pricing-feature-disabled {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .plans-section .pricing-feature-icon {
  color: #2dd4bf;
}

html[data-ui-theme="dark"] .plans-section .pricing-feature-limited .pricing-feature-icon-limited {
  color: #fbbf24;
}

html[data-ui-theme="dark"] .pricing-cards-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

/* 결제 내역 탭 */
html[data-ui-theme="dark"] .plans-billing-heading {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-billing-summary {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-billing-dl dt {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .plans-billing-dl dd {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-billing-empty {
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-billing-table-wrap {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-billing-table th {
  color: var(--text-primary);
  background: var(--bg-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-billing-table td {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

/* 쿠폰 탭 버튼: 라이트용 핑크 깜빡임 → 다크용 톤 */
@keyframes plans-coupon-tab-blink-dark {
  0% {
    background-color: transparent;
    box-shadow: none;
    color: var(--text-secondary);
  }
  8.3333%,
  50% {
    background-color: rgba(248, 113, 113, 0.2);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
    color: #fecaca;
  }
  58.3333%,
  100% {
    background-color: transparent;
    box-shadow: none;
    color: var(--text-secondary);
  }
}

html[data-ui-theme="dark"] .plans-page.settings .settings-tabs-inner .plans-coupon-tab-btn {
  animation: plans-coupon-tab-blink-dark 2.4s linear infinite;
}

html[data-ui-theme="dark"] .plans-page.settings .settings-tabs-inner .plans-coupon-tab-btn:hover {
  color: #fecaca;
  animation-play-state: paused;
  background-color: rgba(248, 113, 113, 0.2);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4);
}

/* 쿠폰 모달 */
html[data-ui-theme="dark"] .plans-coupon-modal-header {
  background: var(--bg-white);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-coupon-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-coupon-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-coupon-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-coupon-modal-body {
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] .plans-coupon-desc {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-coupon-input {
  background: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-coupon-input::placeholder {
  color: #9ca3af;
}

html[data-ui-theme="dark"] .plans-coupon-benefit {
  color: #7dd3fc;
}

/* 결제 위젯 모달 · 준비중 모달 */
html[data-ui-theme="dark"] .plans-payment-modal-header {
  background: var(--bg-white);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .plans-payment-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-payment-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-payment-modal-close:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-payment-modal-hint {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .plans-modal {
  background: var(--bg-white);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .plans-modal p {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.plans-page .login-business-footer {
  background: var(--bg-primary);
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.plans-page .login-business-summary-text,
html[data-ui-theme="dark"] body.plans-page .login-business-reg,
html[data-ui-theme="dark"] body.plans-page .login-business-line {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.plans-page .login-business-entity {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.plans-page .login-business-rep-name {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.plans-page .login-business-policy-link,
html[data-ui-theme="dark"] body.plans-page .login-business-link {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.plans-page .login-business-sep,
html[data-ui-theme="dark"] body.plans-page .login-business-placeholder {
  color: var(--text-muted);
}

/* 홈: 메모지 등록·고정 메모/노트 위젯만 라이트(노트 페이지 팔레트), 나머지 위젯은 html 다크 변수 유지 */
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="notesComposer"],
html[data-ui-theme="dark"] body.dashboard .home-widget.home-widget--pinned-ws {
  color-scheme: light;
  --bg-white: #ffffff;
  --bg-primary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --border-light: #e5e7eb;
  --border-dashed: #d1d5db;
}

/* 전역 다크 textarea 규칙(위)보다 구체적으로 — 고정 메모 편집은 투명 배경 + 진한 글자 */
html[data-ui-theme="dark"] body.dashboard .home-widget.home-widget--pinned-ws textarea.dashboard-home-pinned-ws-memo-ta {
  background-color: transparent !important;
  color: #111 !important;
  border-color: transparent !important;
}

/* 메모지 등록 카드: 입력·플레이스홀더 명시(브라우저 다크 자동 보정·상속 방지) */
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="notesComposer"] .notes-sticky-composer {
  background: #fff4bd;
}
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="notesComposer"] .notes-sticky-composer .notes-sticky-composer-input {
  color: #3e2723 !important;
  background: transparent !important;
}
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="notesComposer"] .notes-sticky-composer .notes-sticky-composer-input::placeholder {
  color: rgba(62, 39, 35, 0.45);
}

/* 홈 달력 위젯: dashboard.css 라이트 고정색 → 다크 팔레트 */
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-widget-tabs,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-widget-tabs {
  border-bottom-color: var(--border-light);
}

/* 달력|목록 탭: .is-active 가 primary(#00367e)라 다크 배경에서 선택 탭만 안 보임 → 밝은 글자 + 밑줄 */
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-widget-tab:not(.is-active),
html[data-ui-theme="dark"] .calendar-page .calendar-widget-tab:not(.is-active) {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-widget-tab:not(.is-active):hover,
html[data-ui-theme="dark"] .calendar-page .calendar-widget-tab:not(.is-active):hover {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-widget-tab.is-active,
html[data-ui-theme="dark"] .calendar-page .calendar-widget-tab.is-active {
  color: #f9fafb;
  border-bottom-color: #60a5fa;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-title,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-grid,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-grid {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-weekdays,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-weekdays {
  background-color: #2a2a2a;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-weekdays .weekday,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-weekdays .weekday {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-weekdays .weekday:nth-child(1),
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-weekdays .weekday:nth-child(1) {
  color: #f87171;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-weekdays .weekday:nth-child(7),
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-weekdays .weekday:nth-child(7) {
  color: #60a5fa;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-days,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-days {
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day.other-month,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day.other-month {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day.selected,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day.selected {
  background-color: rgba(59, 130, 246, 0.22);
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.55);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day.today,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day.today {
  background-color: rgba(234, 179, 8, 0.2);
  box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.45);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .day-number,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .day-number {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day:nth-child(7n + 1) .day-number,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day:nth-child(7n + 1) .day-number {
  color: #f87171;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .dashboard-calendar .calendar-day:nth-child(7n + 7) .day-number,
html[data-ui-theme="dark"] .calendar-page .dashboard-calendar .calendar-day:nth-child(7n + 7) .day-number {
  color: #60a5fa;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-title,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-title {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-empty,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-empty {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-add-btn,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-add-btn {
  background: var(--bg-white);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-add-btn:hover,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-add-btn:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary-color, #2563eb);
  color: var(--primary-color, #60a5fa);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item[data-calendar-type-key],
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item[data-calendar-type-key] {
  /* 유형색은 옅게만 비치도록 그라데이션 투명도 완화 */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--calendar-date-type-color, var(--bg-white)) 22%, var(--bg-white)) 0%,
    var(--bg-white) 38%,
    var(--bg-white) 100%
  );
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item[data-calendar-type-key="todo"],
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item[data-calendar-type-key="todo"] {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--calendar-date-type-color, #ffb4b4) 28%, var(--bg-white)) 0%,
    color-mix(in srgb, var(--calendar-date-type-color, #ffb4b4) 12%, var(--bg-white)) 52%,
    var(--bg-white) 100%
  );
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item:hover,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary-color, #2563eb);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item[data-calendar-type-key]:hover,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item[data-calendar-type-key]:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--calendar-date-type-color, var(--bg-white)) 26%, var(--bg-white)) 0%,
    rgba(37, 99, 235, 0.12) 38%,
    rgba(37, 99, 235, 0.12) 100%
  );
  border-color: var(--primary-color, #2563eb);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item[data-calendar-type-key="todo"]:hover,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item[data-calendar-type-key="todo"]:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--calendar-date-type-color, #ffb4b4) 32%, var(--bg-white)) 0%,
    color-mix(in srgb, var(--calendar-date-type-color, #ffb4b4) 14%, rgba(37, 99, 235, 0.12)) 52%,
    rgba(37, 99, 235, 0.12) 100%
  );
  border-color: var(--primary-color, #2563eb);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item-date,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item-date {
  color: #d4d4d8;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item-path,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item-path {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item-phone,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item-phone {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="calendar"] .calendar-date-list-item-note-saved,
html[data-ui-theme="dark"] .calendar-page .calendar-date-list-item-note-saved {
  color: var(--text-secondary);
}

/* 홈 캘린더 모달(위젯 밖 고정 배치) */
html[data-ui-theme="dark"] body.dashboard .calendar-date-note-modal-box {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.dashboard .calendar-date-note-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .calendar-date-note-modal-btn.cancel {
  background: #3f3f46;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .calendar-date-note-modal-btn.cancel:hover {
  background: #52525b;
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-modal {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-choice {
  border-color: var(--border-light);
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-choice:hover {
  border-color: var(--primary-color, #2563eb);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: none;
}

html[data-ui-theme="dark"] body.dashboard .calendar-widget-add-type-choice-icon {
  color: var(--text-secondary);
}

/* 홈 — 고객 입력 알림 위젯: 라이트 반투명 배경 + 다크 텍스트 변수 → 대비 붕괴 → 다크 카드로 통일 */
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-title .material-symbols-outlined {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-title .help-icon {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-loading,
html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-empty {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-li {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-li:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-name {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-bracket {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .home-widget[data-widget-id="publicFormAlerts"] .dashboard-public-form-alerts-time {
  color: var(--text-muted);
}

/* 고객카드 기록탭 — 할일 추가/수정 (#customerCardTodoModalOverlay, nav 할일 모달과 동일 토큰·레이어) */
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .todo-edit-modal-title-completed-note {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal-search {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay.unified-notes-customer-modal-overlay textarea:focus {
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-text,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormText,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormDetail {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormDueDate {
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-text::placeholder,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormText::placeholder,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormDetail::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .todo-list-customer-name {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .customer-card-todo-linked-phone {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .todo-edit-due-date-placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"]
  #customerCardTodoModalOverlay
  .todo-edit-modal-due-date-wrap.todo-edit-due-date--empty
  #customerCardTodoFormDueDate {
  caret-color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-text:focus,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormText:focus,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal #customerCardTodoFormDetail:focus {
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"]
  #customerCardTodoModalOverlay
  .unified-notes-customer-modal
  .todo-list-form-save.todo-edit-form-save-with-icon:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .customer-card-timeline-modal-delete-btn {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerCardTodoModalOverlay .customer-card-timeline-modal-delete-btn:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
  border-color: #f87171;
  color: #fecaca;
}

/* nav — 기록할 고객 선택 (#unifiedNotesCustomerModalOverlay): 할일 고객연결 등 */
html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-modal-search {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-search-input {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-search-input::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-search-input:focus {
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-search-list {
  background: var(--modal-surface);
  border-top: 1px solid var(--border-light);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-search-hint {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-option {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay .unified-notes-customer-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"]
  #unifiedNotesCustomerModalOverlay
  .unified-notes-customer-option.unified-notes-customer-option-focused {
  background: rgba(37, 99, 235, 0.22);
}

/* nav — 상담메모 조회 기간 (#unifiedNotesDateRangeModalOverlay) */
html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-range-modal-body {
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-range-modal-desc {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-use-range-switch-wrap {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-use-range-switch-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-label,
html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-sep {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-wrapper {
  background-color: var(--modal-surface-inset);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .unified-notes-date-wrapper .unified-notes-date-input {
  color: var(--text-primary);
  background: transparent;
}

html[data-ui-theme="dark"]
  #unifiedNotesDateRangeModalOverlay
  .unified-notes-date-range-row.unified-notes-date-range-row-disabled
  .unified-notes-date-label,
html[data-ui-theme="dark"]
  #unifiedNotesDateRangeModalOverlay
  .unified-notes-date-range-row.unified-notes-date-range-row-disabled
  .unified-notes-date-sep {
  color: var(--text-muted);
}

html[data-ui-theme="dark"]
  #unifiedNotesDateRangeModalOverlay
  .unified-notes-date-range-row.unified-notes-date-range-row-disabled
  .unified-notes-date-wrapper {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"]
  #unifiedNotesDateRangeModalOverlay
  .unified-notes-date-range-row.unified-notes-date-range-row-disabled
  .unified-notes-date-input {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .todo-list-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .todo-list-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .todo-list-form-save {
  border-color: var(--primary-color, #00367e);
}

html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay .todo-list-form-save:hover {
  filter: brightness(1.08);
}

/* 할일 추가·수정·통합검색 할일 모달 (nav #todoAddModalOverlay 등): 셸·버튼·보더 라이트 고정 → 다크 통일 */
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal-header,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal-header,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal-header,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal-title,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal-title,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal-title,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .todo-edit-modal-title-completed-note,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-edit-modal-title-completed-note {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal-close,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal-close,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal-close,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal-close:hover,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal-close:hover,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal-close:hover,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal-search,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal-search,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal-search,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal-search {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #todoAddModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #todoAddModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #todoEditModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #todoEditModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #unifiedNotesCustomerModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #unifiedNotesDateRangeModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay.unified-notes-customer-modal-overlay textarea:focus,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay.unified-notes-customer-modal-overlay input:focus,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay.unified-notes-customer-modal-overlay textarea:focus {
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal .todo-list-form-text,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormText,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormDetail,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormText,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormDetail,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormText,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormDetail,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal .unified-notes-form-text,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal #unifiedNotesEditModalText,
html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal .unified-notes-form-text,
html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal #usSearchConsultEditModalText,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal .unified-notes-form-text,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal #customerCardConsultModalText {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormDueDate,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormDueDate,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormDueDate {
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal .todo-list-form-text::placeholder,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text::placeholder,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text::placeholder,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormText::placeholder,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormDetail::placeholder,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormText::placeholder,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormDetail::placeholder,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormText::placeholder,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormDetail::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay textarea#unifiedNotesEditModalText {
  background: var(--modal-surface-inset) !important;
  color: var(--text-primary);
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay textarea#unifiedNotesEditModalText::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay #unifiedNotesEditModalText::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay #unifiedNotesEditModalText::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay a.unified-notes-edit-modal-header-customer-link.unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay a.unified-notes-edit-modal-header-customer-link.unified-notes-customer-modal-title:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-edit-modal-phone-outer {
  color: var(--text-muted);
}

html[data-ui-theme="dark"]
  #unifiedNotesEditModalOverlay
  a.unified-notes-edit-modal-header-customer-link.unified-notes-customer-modal-title:hover
  .unified-notes-edit-modal-phone-outer {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-form-save {
  border-color: var(--primary-color, #00367e);
}

html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-form-save:hover {
  filter: brightness(1.08);
}

/* 고객카드 기록탭 — 상담 등록/수정 모달: 셸·헤더·푸터·본문이 라이트(#fafafa/#fff) 고정 → 다크 통일 */
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal-header,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .customer-card-consult-modal-header {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .customer-card-consult-modal-title-label {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal-search {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay textarea#customerCardConsultModalText {
  background: var(--modal-surface-inset) !important;
  color: var(--text-primary);
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay textarea#customerCardConsultModalText::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay #customerCardConsultModalText::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay #customerCardConsultModalText::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

html[data-ui-theme="dark"]
  #customerCardConsultModalOverlay
  .customer-card-consult-modal-header-customer-block
  a.unified-notes-edit-modal-header-customer-link.unified-notes-customer-modal-title {
  color: var(--text-secondary) !important;
}

html[data-ui-theme="dark"]
  #customerCardConsultModalOverlay
  .customer-card-consult-modal-header-customer-block
  .unified-notes-edit-modal-phone-outer {
  color: var(--text-muted) !important;
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-form-save {
  border-color: var(--primary-color, #00367e);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-form-save:hover {
  filter: brightness(1.08);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .customer-card-consult-modal-footer {
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .customer-card-timeline-modal-delete-btn {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerCardConsultModalOverlay .customer-card-timeline-modal-delete-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal .todo-list-form-text:focus,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text:focus,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-text:focus,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormText:focus,
html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal #todoListFormDetail:focus,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormText:focus,
html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal #todoEditFormDetail:focus,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormText:focus,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal #usSearchTodoEditFormDetail:focus,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal .unified-notes-form-text:focus,
html[data-ui-theme="dark"] #unifiedNotesEditModalOverlay .unified-notes-customer-modal #unifiedNotesEditModalText:focus,
html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  .unified-notes-customer-modal
  #usSearchConsultEditModalText:focus,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal .unified-notes-form-text:focus,
html[data-ui-theme="dark"] #customerCardConsultModalOverlay .unified-notes-customer-modal #customerCardConsultModalText:focus {
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #todoAddModalOverlay #todoListCustomerLink.todo-list-customer-link,
html[data-ui-theme="dark"] #todoEditModalOverlay #todoEditCustomerLink,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay #usSearchTodoEditCustomerLink {
  font-size: 12px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 3px;
  border-style: solid;
  border-width: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  color: #93c5fd !important;
  background: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] #todoAddModalOverlay #todoListCustomerLink.todo-list-customer-link:hover,
html[data-ui-theme="dark"] #todoEditModalOverlay #todoEditCustomerLink:hover,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay #usSearchTodoEditCustomerLink:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: #52525b !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] #todoEditModalOverlay a#todoEditCustomerName.todo-edit-customer-card-link,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay a#usSearchTodoEditCustomerName.todo-edit-customer-card-link {
  background: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] #todoEditModalOverlay a#todoEditCustomerName.todo-edit-customer-card-link:hover,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay a#usSearchTodoEditCustomerName.todo-edit-customer-card-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: #52525b !important;
  color: #93c5fd !important;
}

html[data-ui-theme="dark"] #todoAddModalOverlay .todo-list-customer-name,
html[data-ui-theme="dark"] #todoEditModalOverlay .todo-list-customer-name,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-list-customer-name {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .todo-edit-due-date-placeholder,
html[data-ui-theme="dark"] #todoEditModalOverlay .todo-edit-due-date-placeholder,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-edit-due-date-placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .todo-edit-modal-due-date-wrap.todo-edit-due-date--empty #todoListFormDueDate,
html[data-ui-theme="dark"] #todoEditModalOverlay .todo-edit-modal-due-date-wrap.todo-edit-due-date--empty #todoEditFormDueDate,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-edit-modal-due-date-wrap.todo-edit-due-date--empty #usSearchTodoEditFormDueDate {
  caret-color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoAddModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon:hover:not(:disabled),
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon:hover:not(:disabled),
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-save.todo-edit-form-save-with-icon:hover:not(:disabled) {
  border-color: #60a5fa;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon:hover:not(:disabled),
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon:hover:not(:disabled),
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .unified-notes-customer-modal .todo-list-form-delete.todo-edit-form-delete-icon:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.12);
  border-color: #f87171;
  color: #fecaca;
}

html[data-ui-theme="dark"] #todoEditModalOverlay .todo-edit-form-complete--completed-state,
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-edit-form-complete--completed-state,
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .todo-edit-form-complete--completed-state {
  border-color: var(--border-light);
  background: var(--bg-primary);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #todoEditModalOverlay .todo-edit-form-complete--completed-state:hover:not(:disabled),
html[data-ui-theme="dark"] #usSearchTodoEditModalOverlay .todo-edit-form-complete--completed-state:hover:not(:disabled),
html[data-ui-theme="dark"] #customerCardTodoModalOverlay .todo-edit-form-complete--completed-state:hover:not(:disabled) {
  border-color: #71717a;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* 홈 캘린더 — 날짜 알림 등록 모달 (#dashboardHomeDateAlertModal, dashboard.css 라이트 고정) */
html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-box {
  background: var(--modal-surface);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-header {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-close:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-body {
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-footer {
  border-top-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-input,
html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-textarea {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-input::placeholder,
html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-textarea::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-input:focus,
html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .record-composer-textarea:focus {
  outline: none;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal #dashboardDateAlertCustomerLink.todo-list-customer-link {
  font-size: 12px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 3px;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  cursor: pointer;
  color: #93c5fd !important;
  background: var(--bg-primary) !important;
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal #dashboardDateAlertCustomerLink.todo-list-customer-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: #52525b !important;
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal #dashboardDateAlertCustomerName.todo-list-customer-name {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal #dashboardDateAlertCustomerClear.todo-list-customer-clear {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal #dashboardDateAlertCustomerClear.todo-list-customer-clear:hover {
  color: #fecaca;
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-footer .btn-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
}

html[data-ui-theme="dark"] #dashboardHomeDateAlertModal .customer-record-post-modal-footer .btn-primary:hover {
  filter: brightness(1.08);
}

/* 고객카드 기록탭 — 기록 등록/수정 모달 (#customerRecordPostModal, customers-card.css 라이트 고정) */
html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-box {
  background: var(--modal-surface);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-header {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-body {
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-footer {
  border-top-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-input,
html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-textarea {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-input::placeholder,
html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-textarea::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-input:focus,
html[data-ui-theme="dark"] #customerRecordPostModal .record-composer-textarea:focus {
  outline: none;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-hint {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-toggle-btn {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #71717a;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-popover {
  border-color: var(--border-light);
  background: var(--modal-surface);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-option-btn {
  background: var(--modal-surface);
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-option-btn--muted {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-option-btn--muted:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-settings-btn {
  border-top-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-settings-btn-icon {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-preset-settings-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"]
  #customerRecordPostModal
  .record-post-doc-title-input-wrap
  #recordPostDocTitle.record-composer-input.is-preset-selected {
  background-image: linear-gradient(
    to left,
    rgba(34, 197, 94, 0.28) 0%,
    rgba(34, 197, 94, 0.14) 38%,
    rgba(34, 197, 94, 0) 52%
  );
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-file-add.customer-timeline-add-upload {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-file-add.customer-timeline-add-upload:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #71717a;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-attach-stack.record-post-doc-attach-stack--drag-over {
  background: rgba(37, 99, 235, 0.18);
  outline-color: #60a5fa;
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-file-thumb-wrap {
  border-color: var(--border-light);
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-file-name {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .record-post-doc-file-fallback {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-delete-btn {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-delete-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-footer .btn-secondary {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] #customerRecordPostModal .customer-record-post-modal-footer .btn-primary:hover {
  filter: brightness(1.08);
}

html[data-ui-theme="dark"] #customerRecordPostModal #recordPostAlertTitle:-webkit-autofill,
html[data-ui-theme="dark"] #customerRecordPostModal #recordPostAlertTitle:-webkit-autofill:hover,
html[data-ui-theme="dark"] #customerRecordPostModal #recordPostAlertTitle:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--modal-surface-inset) inset !important;
  box-shadow: 0 0 0 1000px var(--modal-surface-inset) inset !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

/* 홈 할일 위젯 + 할일 페이지: 라이트 행/입력바 + 다크 글자색 → 대비 붕괴 / input만 다크 박스 — 통일 */
html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-bar,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-bar {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box;
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-bar .todo-page-add-icon,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-bar .todo-page-add-icon {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-input,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-input {
  background: transparent !important;
  color: var(--text-primary);
  border: none;
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-input::placeholder,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-input::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-cal-btn,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-cal-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-cal-btn:hover,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-cal-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-date-dd,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-date-dd {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-item,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-item {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-item:hover,
html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-item:focus-visible,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-item:hover,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-ico,
html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-ico-sub,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-ico,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-ico-sub {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-meta,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-meta {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-page-add-dd-sep,
html[data-ui-theme="dark"] body.todos-page .todo-page-add-dd-sep {
  background: var(--border-light);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .dashboard-home-todos-cell {
  /* 위젯/목록 영역(#1e1e1e 등)과 겹쳐 보이지 않도록 행마다 살짝 올린 회색 톤 */
  background: #2c2c30;
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos-row:hover .dashboard-home-todos-cell {
  background: #38383e;
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-list-check {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos a.todo-list-content-cell.dashboard-home-todos-content-link,
html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos button.todo-list-content-cell.dashboard-home-todos-content-link {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos a.todo-list-content-cell.dashboard-home-todos-content-link:hover,
html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos button.todo-list-content-cell.dashboard-home-todos-content-link:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.dashboard .dashboard-home-todos .todo-list-customer-link {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-table tbody td {
  background: var(--bg-white) !important;
  border: none;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-table tbody tr.todo-list-row-completed td {
  background: rgba(255, 255, 255, 0.05) !important;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-check {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-content-cell {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-content-cell:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-customer-link {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-row-completed .todo-list-content-cell {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-list-row-completed .todo-list-customer-link {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap #todoPageTable tr.todo-drag-row-dragging {
  background: var(--bg-white) !important;
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-todos-resize-handle.todo-completed-header-empty:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.todos-page #todoPageTableWrap .todo-completed-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

/* 우측 슬라이드: 통합 상담메모 + 할일 (nav.css 라이트 고정 — 헤더 흰 띠·표 흰 행·할일 흰 배경) */
html[data-ui-theme="dark"] .right-panel .unified-notes-header-buttons {
  background-color: transparent;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-add-btn,
html[data-ui-theme="dark"] .right-panel .unified-notes-search-toggle-btn,
html[data-ui-theme="dark"] .right-panel .unified-notes-date-range-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-add-btn:hover,
html[data-ui-theme="dark"] .right-panel .unified-notes-search-toggle-btn:hover,
html[data-ui-theme="dark"] .right-panel .unified-notes-date-range-btn:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-search-close-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-search-close-btn:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-header-buttons .dataTables_filter input {
  background: var(--bg-white) !important;
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-search-slot.unified-notes-search-slot-has-input .dataTables_filter,
html[data-ui-theme="dark"]
  .right-panel
  .unified-notes-search-slot.unified-notes-search-slot-has-input
  .dataTables_filter
  input {
  background: var(--bg-white) !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-form {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-form-customer {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-form-text {
  background: var(--bg-white) !important;
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table th,
html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table td {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table tbody tr,
html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table tbody td {
  background-color: var(--bg-white);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table th:nth-child(3),
html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .unified-notes-table td:nth-child(3) {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap table.dataTable tbody td.sorting_1,
html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap table.dataTable tbody td.sorting_2,
html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap table.dataTable tbody td.sorting_3 {
  background-color: var(--bg-white) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap table.dataTable tbody tr:hover td {
  background-color: color-mix(in srgb, var(--bg-white) 82%, var(--border-light)) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-content-cell {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-content-cell:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-name-link {
  color: #93c5fd !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-name-link:hover {
  color: #bfdbfe !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-loading,
html[data-ui-theme="dark"] .right-panel .unified-notes-empty,
html[data-ui-theme="dark"] .right-panel .unified-notes-error {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .table-footer {
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .list-scroll-settings-btn {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .list-scroll-settings-btn .list-scroll-settings-btn-icon {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .list-scroll-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #71717a;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .list-scroll-settings-btn:hover .list-scroll-settings-btn-icon {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-primary) !important;
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-light) !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--bg-white) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .right-panel .unified-notes-table-wrap .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .right-panel .todo-list-section {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-title-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] .right-panel .todo-list-add-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-add-btn:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-form {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .todo-list-form .todo-list-customer-link {
  color: #93c5fd;
}

html[data-ui-theme="dark"] .right-panel .todo-list-customer-name {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-customer-clear {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .right-panel .todo-list-form-text {
  background: transparent !important;
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .todo-list-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] .right-panel .todo-list-table-wrap {
  background-color: var(--bg-primary);
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

html[data-ui-theme="dark"] .right-panel .todo-list-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

html[data-ui-theme="dark"] .right-panel .todo-list-table-wrap .todo-list-table.dataTable {
  background-color: transparent;
}

html[data-ui-theme="dark"] .right-panel .todo-list-table-wrap .todo-list-table tbody td {
  background-color: var(--bg-white);
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .right-panel .todo-list-table-wrap .todo-list-table tbody tr.todo-list-row-completed td {
  background-color: rgba(255, 255, 255, 0.05);
}

html[data-ui-theme="dark"] .right-panel .todo-list-check {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

html[data-ui-theme="dark"] .right-panel .todo-list-content-cell {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-list-content-cell:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] .right-panel .todo-list-customer-link {
  color: #93c5fd;
}

html[data-ui-theme="dark"] .right-panel .todo-list-customer-link:hover {
  color: #bfdbfe;
}

html[data-ui-theme="dark"] .right-panel .todo-list-row-completed .todo-list-content-cell {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .right-panel .todo-list-row-completed .todo-list-customer-link {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .right-panel .todo-completed-header {
  border-top-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .right-panel .todo-completed-header:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .right-panel .todo-completed-count {
  color: var(--text-muted);
}

/* =============================================================================
   비설정·비순수할일(todos만) 페이지 다크 보강 — 대시보드(홈 BG)·약관·결제·로그인 제외
   ============================================================================= */

html[data-ui-theme="dark"]
  body:not(.dashboard):not(.settings):not(.legal-page):not(.pay-result-page):not(.login-body) {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .page-preloader {
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] body:not(.settings) .dataListBox {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] body:not(.settings) .optionListBox {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .calendar-page.todos-page .calendar-main {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .table-footer {
  background: var(--bg-primary);
  border-top-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-table tbody td {
  background-color: var(--bg-white);
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

/* 상담·통합상담: DataTables 정렬열 — CDN #fff 계열 제거, 패널색·호버만 (흰색 디폴트 금지) */
html[data-ui-theme="dark"] .consultations-page .consultations-main table.dataTable tbody td.sorting_1,
html[data-ui-theme="dark"] .consultations-page .consultations-main table.dataTable tbody td.sorting_2,
html[data-ui-theme="dark"] .consultations-page .consultations-main table.dataTable tbody td.sorting_3 {
  background-color: var(--bg-white) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main table.dataTable tbody tr:hover td {
  background-color: color-mix(in srgb, var(--bg-white) 82%, var(--border-light)) !important;
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-content-cell {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-name-link {
  color: #93c5fd;
}

/* 통합 상담메모: 표 헤더를 본문 톤에 맞춤 + 하단 페이지네이션·스크롤 설정 버튼 */
html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-table thead th {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_info,
html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_length label,
html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_filter label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button {
  color: var(--text-primary) !important;
  background: var(--bg-white) !important;
  border: 1px solid var(--border-light) !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button.current,
html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button.current:hover {
  color: #bfdbfe !important;
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button:hover:not(.disabled) {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button.disabled,
html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button.disabled:hover,
html[data-ui-theme="dark"] .consultations-page .consultations-main .dataTables_paginate .paginate_button.disabled:active {
  color: var(--text-muted) !important;
  background: var(--bg-primary) !important;
  border-color: var(--border-light) !important;
  opacity: 1 !important;
  cursor: default !important;
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .list-scroll-settings-btn,
html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-list-scroll-settings-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .list-scroll-settings-btn:hover,
html[data-ui-theme="dark"] .consultations-page .consultations-main .unified-notes-list-scroll-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .list-scroll-settings-btn:hover .list-scroll-settings-btn-icon,
html[data-ui-theme="dark"]
  .consultations-page
  .consultations-main
  .unified-notes-list-scroll-settings-btn:hover
  .list-scroll-settings-btn-icon {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .consultations-page .consultations-main .list-scroll-settings-btn .list-scroll-settings-btn-icon,
html[data-ui-theme="dark"]
  .consultations-page
  .consultations-main
  .unified-notes-list-scroll-settings-btn
  .list-scroll-settings-btn-icon {
  color: var(--text-secondary);
}

/* 리스트 스크롤 감도 모달 — nav(#navUnifiedNotesListScrollSettingsModal) · 고객목록(#listScrollSettingsModal) */
html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-backdrop,
html[data-ui-theme="dark"] .list-scroll-settings-modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-content,
html[data-ui-theme="dark"] .list-scroll-settings-modal-content {
  background: var(--modal-surface);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-header,
html[data-ui-theme="dark"] .list-scroll-settings-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-header h3,
html[data-ui-theme="dark"] .list-scroll-settings-modal-header h3 {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-close,
html[data-ui-theme="dark"] .list-scroll-settings-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-close:hover,
html[data-ui-theme="dark"] .list-scroll-settings-modal-close:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-help,
html[data-ui-theme="dark"] .list-scroll-settings-help {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-input-row label,
html[data-ui-theme="dark"] .list-scroll-settings-input-row label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-input-row input,
html[data-ui-theme="dark"] .list-scroll-settings-input-row input {
  background-color: var(--modal-surface-inset);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-hint,
html[data-ui-theme="dark"] .list-scroll-settings-hint {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] .nav-unified-notes-scroll-settings-modal-footer,
html[data-ui-theme="dark"] .list-scroll-settings-modal-footer {
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-section {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* 통합검색: 유형별 접기 헤더(#f7f7f7) → 다크 표면 + 가독 텍스트·더보기·치브론 */
html[data-ui-theme="dark"]
  body.unified-search-page
  .customer-timeline-body.unified-search-type-frame
  > .customer-timeline-month-separator.customer-timeline-type-group-separator {
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  .customer-timeline-body.unified-search-type-frame
  > .customer-timeline-month-separator.customer-timeline-type-group-separator:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  .customer-timeline-body.unified-search-type-frame
  > .customer-timeline-month-separator.customer-timeline-type-group-separator:hover
  .customer-timeline-separator-chevron-wrap {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page .customer-timeline-separator-chevron-wrap {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-separator-more-btn {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.45);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-separator-more-btn:hover {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(147, 197, 253, 0.65);
  color: #bfdbfe;
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-empty-li {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-read-modal-header-actions .us-search-read-icon-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-read-modal-header-actions .us-search-read-icon-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-customer-modal-search {
  border-bottom-color: var(--border-light);
  background: var(--modal-surface);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  a#usSearchConsultEditModalHeaderCustomerLink.unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  a#usSearchConsultEditModalHeaderCustomerLink.unified-notes-customer-modal-title:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay #usSearchConsultEditModalPhoneOuter {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .us-search-consult-edit-modal-footer {
  background: var(--modal-surface);
  border-top: 1px solid var(--border-light);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-form-cancel {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-form-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-form-save {
  border-color: var(--primary-color, #00367e);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalOverlay .unified-notes-form-save:hover {
  filter: brightness(1.08);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  textarea#usSearchConsultEditModalText {
  border-color: var(--border-light) !important;
  background-color: var(--modal-surface-inset) !important;
  color: var(--text-primary);
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  textarea#usSearchConsultEditModalText::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"]
  body.unified-search-page
  #usSearchConsultEditModalOverlay
  textarea#usSearchConsultEditModalText:focus {
  border-color: var(--border-light) !important;
  outline: none;
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalText::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchConsultEditModalText::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-li {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-li a:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-li-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-li-meta {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page .unified-search-loading,
html[data-ui-theme="dark"] body.unified-search-page .unified-search-error {
  color: var(--text-secondary);
}

/* 통합검색 — 검색 결과 조작 안내 모달 (#usSearchHelpOverlay, nav 라이트 셸) */
html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .unified-notes-customer-modal {
  background: var(--modal-surface);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .unified-notes-customer-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .unified-notes-customer-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .unified-notes-customer-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .unified-notes-customer-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .us-search-help-body {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .us-search-help-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchHelpOverlay .us-search-help-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-help-lead {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-help-lead strong {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-help-dl dt {
  color: var(--text-primary);
  background-color: var(--modal-surface-inset);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-help-dl dd {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-help-dl dd strong {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page .us-search-read-modal-body {
  background: var(--modal-surface);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.unified-search-page #usSearchReadNoteOverlay .us-search-read-note-ql-body.ql-editor {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-box {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-intro {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.report-page .report-drop-zone {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .report-drop-zone.report-drop-zone-over {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .report-drop-zone-empty {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.report-page .report-drop-zone-hint {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.report-page .report-drop-zone-chip {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-item-section-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-tabs-block-title,
html[data-ui-theme="dark"] body.report-page .report-drop-zone-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-tabs-block.report-collapsible {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .report-tabs .tab-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .bulk-actions button {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .bulk-actions button.bulk-on,
html[data-ui-theme="dark"] body.report-page .bulk-actions button.bulk-off {
  background: var(--bg-white);
  color: var(--text-primary);
}

/* 보고서 항목 토글: 다크모드에서만 on↔off 시각을 라이트와 반대로 (켜짐=옅게, 꺼짐=강조) */
html[data-ui-theme="dark"] body.report-page .item-btn.on {
  background: var(--bg-white);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .item-btn.off {
  background: #9ca3af;
  color: #000;
  border-color: #9ca3af;
}

html[data-ui-theme="dark"] body.report-page .report-date-range-section {
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .report-date-range-switch-wrap {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-date-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.report-page .report-date-wrapper {
  border-color: var(--border-light);
  background-color: var(--bg-white);
}

html[data-ui-theme="dark"] body.report-page .report-date-range-row.report-date-range-row-disabled .report-date-wrapper {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.report-page .report-date-sep {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.report-page .report-placeholder {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.report-page .report-data-table thead th {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.report-page .report-data-table td.report-data-cell {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-white);
}

html[data-ui-theme="dark"] body.customers-card-page .back-to-list-btn-container,
html[data-ui-theme="dark"] body.customers-card-page .customer-basic-info {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] body.customers-card-page .customers-card-page-bg::before {
  background: rgba(0, 0, 0, 0.55);
}

/* 고객카드 — 기본·차량·마진 탭: basic-tab-card / form-fields (customers-card.css 라이트 고정) */
html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .add-customer-form,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .add-customer-form,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .add-customer-form {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-section-title {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .customers-card-pane-title-row .basic-tab-cards-collapse-all-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customers-card-pane-title-row .basic-tab-cards-collapse-all-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .basic-tab-card__header,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .basic-tab-card__header,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .basic-tab-card__header {
  background: rgba(255, 255, 255, 0.06);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .basic-tab-card__title,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .basic-tab-card__title,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .basic-tab-card__title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .basic-tab-card__title-icon,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .basic-tab-card__title-icon,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .basic-tab-card__title-icon {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .basic-tab-card__collapse-chevron,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .basic-tab-card__collapse-chevron,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .basic-tab-card__collapse-chevron {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields .list_1,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields .list_1,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields .list_1 {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields .list_2,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields .list_2,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields .list_2 {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields input,
html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields select,
html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields textarea,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields input,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields select,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields textarea,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields input,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields select,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields textarea {
  color: var(--text-primary);
  caret-color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:first-child:not(:last-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:last-child:not(:first-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #basicTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:only-child::after,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:first-child:not(:last-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:last-child:not(:first-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #vehicleTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:only-child::after,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:first-child:not(:last-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:last-child:not(:first-child)::after,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-section.basic-tab-card .form-fields tr:not(:last-child) td:only-child::after {
  background-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields tr:not(:last-child) td:first-child:not(:last-child)::after,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields tr:not(:last-child) td:last-child:not(:first-child)::after,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields tr:not(:last-child) td:only-child::after {
  background-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields .list_1 {
  background-color: rgba(255, 255, 255, 0.04);
  border-right-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields .list_2 {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields input,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields select,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields textarea {
  color: var(--text-primary);
  caret-color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields td .company-type-label {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields td .phone-settings-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields td .phone-settings-btn:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customers-card-page .phone-input-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .phone-input-btn:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customers-card-page .phone-input-btn.has-note {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customers-card-page .customerNoteBox {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .customerNoteBox .title {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .free-storage-box {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .free-storage-box .title {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.doc-preset-page {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.doc-preset-page h1 {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.doc-preset-page .desc {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.doc-preset-page .tab-btn:not(.is-active) {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.doc-preset-page .recommend-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.doc-preset-page .recommend-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.doc-preset-page .setting-list {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.doc-preset-page .setting-item,
html[data-ui-theme="dark"] body.doc-preset-page .template-list-row {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.doc-preset-page .template-list-row {
  background: var(--bg-white);
}

html[data-ui-theme="dark"] body.doc-preset-page .template-list-row:has(.template-item.is-active) {
  background: rgba(37, 99, 235, 0.15);
}

html[data-ui-theme="dark"] body.doc-preset-page .template-list-row .icon-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
}

/* 사전 서류항목 — 템플릿 설정 탭: 포함(.template-check-group--on) / 미포함 목록 */
html[data-ui-theme="dark"] body.doc-preset-page .tab-btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-editor {
  background: var(--bg-primary);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-group-title {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-group-hint {
  color: var(--text-muted);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-list {
  border-color: var(--border-light);
  background: var(--bg-white);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-list--on {
  background: var(--modal-surface-inset, #1f2029);
  border-color: var(--border-light);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-list--off {
  background: var(--bg-white);
  border-color: var(--border-light);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-row {
  border-bottom-color: var(--border-light);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-list .template-check-row--off:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-row--on {
  background: linear-gradient(
    180deg,
    rgba(0, 147, 216, 0.2) 0%,
    rgba(0, 54, 126, 0.14) 100%
  );
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-list .template-check-row--on:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 147, 216, 0.28) 0%,
    rgba(0, 54, 126, 0.2) 100%
  );
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-label {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-row--on .template-check-label {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-empty {
  color: var(--text-muted);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-check-hit:focus-visible {
  outline-color: var(--primary-light, #0093d8);
}
html[data-ui-theme="dark"] body.doc-preset-page .template-item,
html[data-ui-theme="dark"] body.doc-preset-page .template-item-text {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body.doc-preset-page .empty {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.sms-template-page,
html[data-ui-theme="dark"] body.sms-template-page .container {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-template-page .container .title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-template-page .chips-tab-btn:not(.active) {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-template-page .chips-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.margin-template-page,
html[data-ui-theme="dark"] body.margin-template-page .container {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.margin-template-page .title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.margin-template-page .items-list {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.app-install-guide-page {
  background: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .handok-mobile-apk-hint-modal {
  background: var(--bg-white);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .handok-mobile-apk-hint-modal h2 {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .handok-mobile-apk-hint-modal .handok-apk-lead,
html[data-ui-theme="dark"] .handok-mobile-apk-hint-modal ul {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .handok-mobile-apk-hint-actions .btn-secondary-apk {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-template-page .body-wrap {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.sms-template-page .template-body {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-template-page .sms-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* 문자 자동 완성 (/sms-compose) — 본문·폼·고객 검색 드롭다운 */
html[data-ui-theme="dark"] body.sms-compose-page,
html[data-ui-theme="dark"] body.sms-compose-page .container {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page .page-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page .btn-sms-compose-settings {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page .btn-sms-compose-settings:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page .form-group label {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page select,
html[data-ui-theme="dark"] body.sms-compose-page input[type="text"],
html[data-ui-theme="dark"] body.sms-compose-page textarea {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page select:focus,
html[data-ui-theme="dark"] body.sms-compose-page input[type="text"]:focus,
html[data-ui-theme="dark"] body.sms-compose-page textarea:focus {
  border-color: var(--border-light);
  box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.25);
}

html[data-ui-theme="dark"] body.sms-compose-page #templateSelect {
  background-color: var(--bg-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.75 4.25L6 7.5l3.25-3.25' stroke='%239ca3af' stroke-width='1.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-ui-theme="dark"] body.sms-compose-page .customer-list-wrap {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.sms-compose-page .customer-option {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.sms-compose-page .customer-option:hover,
html[data-ui-theme="dark"] body.sms-compose-page .customer-option.focused {
  background: rgba(96, 165, 250, 0.12);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.sms-compose-page .customer-option .phone {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.sms-compose-page .search-hint {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.sms-compose-page input::placeholder,
html[data-ui-theme="dark"] body.sms-compose-page textarea::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.margin-template-page .item-row {
  background-color: var(--bg-white);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

/* 사이드바 프로필: 이미지 등록·이름 변경 모달 (nav .avatar-modal) */
html[data-ui-theme="dark"] .avatar-modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

html[data-ui-theme="dark"] .avatar-modal-content {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .avatar-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] .avatar-modal-header h3 {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .avatar-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .avatar-modal-close:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .avatar-modal-desc {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .avatar-modal-preview-wrap .avatar-modal-preview-circle {
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] .avatar-modal-preview-initial {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] .avatar-modal-message {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] .name-edit-input {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] .name-edit-input:focus {
  border-color: var(--primary-color, #60a5fa);
}

html[data-ui-theme="dark"] .name-edit-input::placeholder {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] #avatarModal .btn-primary:disabled,
html[data-ui-theme="dark"] #nameEditModal .btn-primary:disabled {
  background: #3f3f46;
  color: var(--text-muted);
  border-color: var(--border-light);
  opacity: 1;
  cursor: not-allowed;
}

html[data-ui-theme="dark"] #avatarModal .avatar-modal-actions .btn-secondary,
html[data-ui-theme="dark"] #nameEditModal .avatar-modal-actions .btn-secondary {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] #avatarModal .avatar-modal-actions .btn-secondary:hover,
html[data-ui-theme="dark"] #nameEditModal .avatar-modal-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] #avatarModal .avatar-modal-actions .btn-primary:not(:disabled),
html[data-ui-theme="dark"] #nameEditModal .avatar-modal-actions .btn-primary:not(:disabled) {
  border-color: var(--primary-color, #2563eb);
}

/* ---------- 고객 관리(목록) body.customerList ---------- */
html[data-ui-theme="dark"] body.customerList .maincontent.dataPage {
  background-color: var(--bg-primary);
}

html[data-ui-theme="dark"] body.statistics-page .maincontent.dataPage {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.statistics-page .maincontent.dataPage.statistics-page-main {
  background-color: transparent;
}

html[data-ui-theme="dark"] body.statistics-page .customers-page-bg::before {
  background: rgba(0, 0, 0, 0.55);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-panel,
html[data-ui-theme="dark"] body.statistics-page .statistics-summary-block,
html[data-ui-theme="dark"] body.statistics-page .statistics-table-panel,
html[data-ui-theme="dark"] body.statistics-page .stats-table {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] body.statistics-page .stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

html[data-ui-theme="dark"] body.statistics-page .statistics-section-title,
html[data-ui-theme="dark"] body.statistics-page .statistics-summary-heading,
html[data-ui-theme="dark"] body.statistics-page .statistics-margin-table-title,
html[data-ui-theme="dark"] body.statistics-page .stats-table h3 {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-filter-panel {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-title-info-btn--panel {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-light);
  color: var(--primary-light, #0093d8);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-title-info-btn--panel:hover,
html[data-ui-theme="dark"] body.statistics-page .statistics-title-info-btn--panel:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-filter-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.statistics-page .date-wrapper.statistics-date-wrapper {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.statistics-page .date-wrapper.statistics-date-wrapper:hover {
  border-color: #71717a;
}

html[data-ui-theme="dark"] body.statistics-page .date-wrapper.statistics-date-wrapper .statistics-date-input {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-filter-input {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* 다크: 셀렉트 체브론만 밝은 회색(배경은 background-color 로만 지정해 SVG 유지) */
html[data-ui-theme="dark"] body.statistics-page .statistics-filters select.statistics-filter-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.75 4.25L6 7.5l3.25-3.25' stroke='%239ca3af' stroke-width='1.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
}

html[data-ui-theme="dark"] body.statistics-page .statistics-filters .statistics-filter-input:focus,
html[data-ui-theme="dark"] body.statistics-page .statistics-filters .statistics-filter-input:focus-visible {
  outline: none;
  border-width: 1px;
  box-shadow: none;
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-filters .date-wrapper.statistics-date-wrapper:focus-within {
  border-width: 1px;
  border-color: var(--border-light);
  outline: none;
  box-shadow: none;
}

/* 스티키 헤더: 본문·패널보다 한 톤 옅은 불투명 회색(비침 방지 유지) */
html[data-ui-theme="dark"] body.statistics-page .statistics-margin-table thead th {
  background: #262626;
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-margin-table td {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-margin-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.07);
}

html[data-ui-theme="dark"] body.statistics-page .statistics-margin-loading,
html[data-ui-theme="dark"] body.statistics-page .statistics-margin-empty {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.statistics-page #statsMarginLoadBtn.btn-primary {
  background-color: var(--primary-color-bright, #00367e);
  border-color: var(--primary-color-bright, #00367e);
  color: #fff;
}

html[data-ui-theme="dark"] body.statistics-page #statsMarginLoadBtn.btn-primary:hover:not(:disabled),
html[data-ui-theme="dark"] body.statistics-page #statsMarginLoadBtn.btn-primary:focus-visible:not(:disabled) {
  background-color: #002a5c;
  border-color: #002a5c;
  color: #fff;
}

html[data-ui-theme="dark"] body.statistics-page #statsMarginLoadBtn.btn-primary:active:not(:disabled) {
  background-color: #00234a;
  border-color: #00234a;
  color: #fff;
}

html[data-ui-theme="dark"] body.customerList .customers-page-bg::before {
  background: rgba(0, 0, 0, 0.55);
}

html[data-ui-theme="dark"] body.customerList .customerListBox {
  background-color: var(--bg-white) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customerList .customerListBox .table-footer {
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody td {
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr.odd,
html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr.even {
  background-color: var(--bg-white) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody td.sorting_1,
html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody td.sorting_2,
html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody td.sorting_3 {
  background-color: var(--bg-white) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr:hover {
  background-color: color-mix(in srgb, var(--bg-white) 82%, var(--border-light));
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr:hover td.sorting_1,
html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr:hover td.sorting_2,
html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody tr:hover td.sorting_3 {
  background-color: color-mix(in srgb, var(--bg-white) 82%, var(--border-light)) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable th {
  border-right-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .customerListBox table.dataTable tbody td button {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-light) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox .status-cell-select {
  background-color: #2a2a2a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.75 4.25L6 7.5l3.25-3.25' stroke='%239ca3af' stroke-width='1.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 6px center !important;
  background-size: 12px 12px !important;
  color: #e5e7eb !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_info,
html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_length,
html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_filter label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_paginate .paginate_button {
  color: var(--text-primary) !important;
  background: var(--bg-white) !important;
  border: 1px solid var(--border-light) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_paginate .paginate_button.current,
html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_paginate .paginate_button.current:hover {
  color: #bfdbfe !important;
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox .dataTables_paginate .paginate_button:hover:not(.disabled) {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--border-light) !important;
}

html[data-ui-theme="dark"] body.customerList .customerListBox .list-scroll-settings-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customerList .customerListBox .list-scroll-settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customerList .customerListBox .copyable-cell:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

html[data-ui-theme="dark"] body.customerList #customersFilterPanelToggleBtn[aria-expanded="true"] {
  background: var(--bg-white);
  color: var(--text-primary);
  border-color: var(--border-light);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] body.customerList #customersFilterPanelToggleBtn[aria-expanded="true"]:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-box,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-box {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-header,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-title,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-close,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-close:hover,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-body,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-body {
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-body::-webkit-scrollbar-thumb,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-modal-body::-webkit-scrollbar-thumb:hover,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item {
  border-color: var(--border-light);
  background: var(--bg-primary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-header,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-header {
  border-bottom-color: var(--border-light);
  background-color: rgba(255, 255, 255, 0.04);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-date,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-date {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-actions .material-symbols-outlined,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-actions .material-symbols-outlined {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-actions .material-symbols-outlined:hover,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-actions .material-symbols-outlined:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-body,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-body {
  background: transparent;
}

html[data-ui-theme="dark"] body.customerList .note-full-list-item-text,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-item-text {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-edit-ta,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-edit-ta {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-edit-ta:focus,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-edit-ta:focus {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-save-edit-btn,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-save-edit-btn {
  border: 1px solid var(--primary-color, #00367e);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-save-edit-btn:hover,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-save-edit-btn:hover {
  filter: brightness(1.08);
}

html[data-ui-theme="dark"] body.customerList .note-full-list-empty,
html[data-ui-theme="dark"] body.customers-card-page .note-full-list-empty {
  color: var(--text-secondary);
}

/* ---------- 고객 카드 body.customers-card-page ---------- */
html[data-ui-theme="dark"] body.customers-card-page {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #addCustomerForm,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

html[data-ui-theme="dark"] body.customers-card-page .form-section-title,
html[data-ui-theme="dark"] body.customers-card-page .form-group label,
html[data-ui-theme="dark"] body.customers-card-page .customer-basic-info .customer-name-input-wrapper label,
html[data-ui-theme="dark"] body.customers-card-page .customer-basic-info .customer-phone-input-wrapper label,
html[data-ui-theme="dark"] body.customers-card-page .form-section .customer-phone-input-wrapper label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-basic-info .customer-name-input {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .margin-item {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .margin-item .form-group label {
  color: var(--text-secondary);
}

/* 고객카드 — 마진 탭: 좌측 표·템플릿은 .basic-tab-card 가 아님(customers-card.css 라이트 고정) */
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-template-selector > label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-template-select {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-template-select:focus {
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table-container {
  background-color: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table thead tr {
  background-color: rgba(255, 255, 255, 0.07);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table thead th {
  color: var(--text-primary);
  border-right-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent #marginTableBody tr,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody tr {
  background-color: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent #marginTableBody tr:hover,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.09);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody td {
  border-right-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody td input {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody td input:focus {
  border-color: #60a5fa;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody .row-number {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-sign-button:not(.minus) {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-sign-button:not(.minus):hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody .delete-btn {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: #f87171;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tbody .delete-btn:hover {
  background-color: rgba(248, 113, 113, 0.22);
  color: #fecaca;
  border-color: #f87171;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tfoot tr {
  background-color: rgba(255, 255, 255, 0.07);
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tfoot td {
  color: var(--text-primary);
}

/* 푸터 금액 셀은 EJS 인라인 color:#007bff — 다크에서 읽기 좋은 파랑으로 덮어씀 */
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-table tfoot td:last-child {
  color: #93c5fd !important;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent #totalMarginDisplay {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-group label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-group input {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-group input:focus {
  border-color: #60a5fa;
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .form-group input[readonly] {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-item .form-group select,
html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .margin-item .form-group input {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .btn-secondary {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page #marginTabContent .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* 실시간 저장 대기(.saving) / 저장 오류(.save-error): 라이트는 옅은 붉은색 — 다크에서는 진한 붉은 배경 + 밝은 글자로 대비 */
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields input.saving,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields select.saving,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields textarea.saving,
html[data-ui-theme="dark"] body.customers-card-page .form-section input.saving,
html[data-ui-theme="dark"] body.customers-card-page .form-section select.saving,
html[data-ui-theme="dark"] body.customers-card-page .form-section textarea.saving,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent input.saving,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent select.saving,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent textarea.saving,
html[data-ui-theme="dark"] body.customers-card-page .file-notes-textarea.saving,
html[data-ui-theme="dark"] body.customers-card-page .margin-item-name.saving,
html[data-ui-theme="dark"] body.customers-card-page .margin-item-amount.saving,
html[data-ui-theme="dark"] body.customers-card-page .contact-label-input.saving {
  background-color: #7f1d1d !important;
  color: #fecaca !important;
  border-color: rgba(254, 202, 202, 0.35) !important;
  caret-color: #fecaca;
}

html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields input.save-error,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields select.save-error,
html[data-ui-theme="dark"] body.customers-card-page .add-customer-form .form-fields textarea.save-error,
html[data-ui-theme="dark"] body.customers-card-page .form-section input.save-error,
html[data-ui-theme="dark"] body.customers-card-page .form-section select.save-error,
html[data-ui-theme="dark"] body.customers-card-page .form-section textarea.save-error,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent input.save-error,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent select.save-error,
html[data-ui-theme="dark"] body.customers-card-page #hisTabContent textarea.save-error,
html[data-ui-theme="dark"] body.customers-card-page .file-notes-textarea.save-error,
html[data-ui-theme="dark"] body.customers-card-page .margin-item-name.save-error,
html[data-ui-theme="dark"] body.customers-card-page .margin-item-amount.save-error,
html[data-ui-theme="dark"] body.customers-card-page .contact-label-input.save-error {
  background-color: #7c2d12 !important;
  color: #fed7aa !important;
  border-color: rgba(253, 186, 116, 0.4) !important;
  caret-color: #fed7aa;
}

html[data-ui-theme="dark"] body.customers-card-page input.saving::placeholder,
html[data-ui-theme="dark"] body.customers-card-page textarea.saving::placeholder {
  color: rgba(254, 202, 202, 0.55);
}

html[data-ui-theme="dark"] body.customers-card-page input.save-error::placeholder,
html[data-ui-theme="dark"] body.customers-card-page textarea.save-error::placeholder {
  color: rgba(253, 230, 138, 0.55);
}

/* 노트 상세: DB 반영 대기(제목 줄) */
html[data-ui-theme="dark"] body.customers-card-page .notes-note-detail-heading.notes-note-detail-heading--pending,
html[data-ui-theme="dark"] body.todos-page .notes-note-detail-heading.notes-note-detail-heading--pending {
  background-color: rgba(127, 29, 29, 0.92);
  color: #fecaca;
}

html[data-ui-theme="dark"] body.todos-page .notes-note-detail-heading.notes-note-detail-heading--pending .notes-note-detail-title-input {
  color: #fecaca;
}

/* 기록 탭 타임라인: 본문 트랙·행은 순흑 대신 살짝 밝은 쪽으로 (가독·층위) */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-body {
  background: #1d1e24;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-month-separator,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-type-group-separator {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-body > .customer-timeline-month-separator:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-body > .customer-timeline-month-separator:hover .customer-timeline-separator-chevron-wrap {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head-toolbar {
  color: var(--text-primary);
  background: #25262d;
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head-toolbar .customer-records-color-filter-btn:hover,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head-toolbar .customer-records-toggle-all-btn:hover {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-head-toolbar
  .customer-records-color-filter-btn:hover
  .material-symbols-outlined,
html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-head-toolbar
  .customer-records-toggle-all-btn:hover
  .customer-records-toggle-all-icon {
  color: var(--text-primary) !important;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-records-color-filter-btn,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-docset-preset-focus-toggle,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-docset-select,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-toggle-all-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-records-color-filter-btn:hover,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-docset-preset-focus-toggle:hover,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-docset-select:hover:not(:disabled),
html[data-ui-theme="dark"] body.customers-card-page .customer-records-toggle-all-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* 기록 탭 헤더 줄: 툴바 아이콘은 원래 투명 배경 — 위 일반 버튼 규칙보다 우선 */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head-toolbar .customer-records-color-filter-btn,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-head-toolbar .customer-records-toggle-all-btn {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-secondary);
}

/* '새 기록' 드롭다운: 항목 배경은 timelineApplyTypeColorsUI() 사용자 색 — 글자·아이콘은 customers-card.css 고정 대비 유지 (다크에서 덮지 않음) */
html[data-ui-theme="dark"] body.customers-card-page .customer-records-new-menu {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-records-toggle-all-icon,
html[data-ui-theme="dark"] body.customers-card-page .customer-records-sort-toggle-icon {
  color: var(--text-secondary);
}

/* 기록 탭 타임라인 행: 유형 아이콘(SVG stroke=currentColor) — 라이트용 어두운 회색이 다크에서 묻힘 */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-type-icon-wrap {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item--pinned .customer-timeline-type-icon-wrap {
  color: #a5b4fc;
}

/* 기록 탭: 펼친 하위(일시·타입·본문) — 라이트용 진한 글자가 다크 배경에서 묻힘 */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-meta {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-meta strong {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-sort {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-body {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-body--editable:hover {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-child-empty {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item {
  border-color: var(--border-light);
  background: #2c2d36 !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item[data-timeline-type-key]:not(.customer-timeline-item--pinned):not(
    .customer-timeline-item--detail-open
  ):not(.customer-timeline-item--docset-placeholder) {
  /* 왼쪽 타입색: 라이트 대비 톤 유지 + transparent 믹스로만 살짝 비침 */
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--customer-timeline-type-color, rgba(255, 255, 255, 0.12)) 42%, transparent) 0%,
    color-mix(in srgb, var(--customer-timeline-type-color, rgba(255, 255, 255, 0.12)) 14%, #2c2d36) 22%,
    #2c2d36 30%,
    #32333d 100%
  ) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item--todo-active.customer-timeline-item[data-timeline-type-key="todo"]:not(
    .customer-timeline-item--pinned
  ):not(.customer-timeline-item--detail-open):not(.customer-timeline-item--docset-placeholder) {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--customer-timeline-type-color, #ffd6d6) 40%, transparent) 0%,
    color-mix(in srgb, var(--customer-timeline-type-color, #ffd6d6) 18%, #32333d) 36%,
    #32333d 100%
  ) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item--todo-completed.customer-timeline-item[data-timeline-type-key="todo"]:not(
    .customer-timeline-item--pinned
  ):not(.customer-timeline-item--detail-open):not(.customer-timeline-item--docset-placeholder) {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--customer-timeline-type-color, #ffd6d6) 38%, transparent) 0%,
    #2c2d36 28%,
    #32333d 100%
  ) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item[data-timeline-type-key]:not(.customer-timeline-item--pinned).customer-timeline-item--detail-open:not(
    .customer-timeline-item--docset-placeholder
  ) {
  background: color-mix(
    in srgb,
    var(--customer-timeline-type-color, #2e2f38) 36%,
    #282931
  ) !important;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item--pinned {
  border-color: rgba(129, 140, 248, 0.55);
  background: rgba(79, 70, 229, 0.18) !important;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item--pinned:hover {
  border-color: rgba(165, 180, 252, 0.65);
  background: rgba(79, 70, 229, 0.26) !important;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item--detail-open {
  border-color: var(--border-light);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-dt-row {
  color: var(--text-primary);
}

/* 본문 한 줄 미리보기: 행 배경이 어두워 기본 #4b5563은 묻힘 → 밝은 글자 */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-body-preview {
  color: rgba(255, 255, 255, 0.92);
}

/* 날짜·제목: customers-card.css 고정 회색(#374151 / #111)이 dt-row 색보다 우선 → 흰색에 가깝게 */
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-td-time,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-td-time-sub {
  color: rgba(255, 255, 255, 0.92);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-td-title,
html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-td-title-text {
  color: rgba(255, 255, 255, 0.92);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-item--thumbs .customer-timeline-dt-row::after {
  background: linear-gradient(to bottom, rgba(44, 45, 54, 0), rgba(44, 45, 54, 0.94)) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item--pinned.customer-timeline-item--thumbs
  .customer-timeline-dt-row::after {
  background: linear-gradient(
    to bottom,
    rgba(49, 46, 129, 0),
    rgba(49, 46, 129, 0.92)
  ) !important;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-timeline-item--thumbs.customer-timeline-item--has-doc-preset.customer-timeline-item--pinned
  .customer-timeline-dt-row
  > .customer-timeline-expand-cell {
  background: linear-gradient(
    270deg,
    rgba(49, 46, 129, 0.95) 0%,
    rgba(49, 46, 129, 0.5) 42%,
    rgba(49, 46, 129, 0) 100%
  ) !important;
}

html[data-ui-theme="dark"] body.customers-card-page .customer-timeline-detail {
  background: #282931;
  color: var(--text-primary);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-attribute-item label,
html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-type-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-is-self-btn {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-is-self-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-attribute-item input[type="text"],
html[data-ui-theme="dark"] body.customers-card-page .phone-attributes-panel-content .phone-attribute-item select {
  background-color: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .phone-attributes-panel-content
  .phone-attribute-item
  input[type="text"]:disabled {
  background-color: var(--bg-primary);
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-card-styled-select__panel {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-card-styled-select__item {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-card-styled-select__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-ui-theme="dark"] body.customers-card-page .customer-card-styled-select__item.is-selected {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

html[data-ui-theme="dark"]
  body.customers-card-page
  .customer-card-styled-select.customer-card-styled-select--empty-label
  .customer-card-styled-select__value {
  color: var(--text-muted);
}

/* ---------- 노트 페이지: 분할(메모·노트) 모바일 탭 + archive 데이터 리스트 (note.css 라이트 고정) ---------- */
html[data-ui-theme="dark"] body.notes-page .notes-modal {
  background: var(--modal-surface, var(--bg-white));
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
html[data-ui-theme="dark"] body.notes-page .notes-modal-title {
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body.notes-page .notes-delete-confirm-message {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] body.notes-page .notes-modal-close {
  color: var(--text-secondary);
}
html[data-ui-theme="dark"] body.notes-page .notes-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body.notes-page .notes-dual-tab {
  /* 비활성: 너무 옅은 흰 반투명 대신 #262626 계열 ~70% 불투명 면 */
  background: rgba(38, 38, 38, 0.72);
  color: rgba(255, 255, 255, 0.82);
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-tab[aria-selected="true"] {
  background: var(--bg-white);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-light);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-dual-boxes .dataListBox.archive-list-box,
html[data-ui-theme="dark"] body.archive .archive-page .archive-dual-boxes .dataListBox.archive-list-box {
  background-color: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-table-wrap,
html[data-ui-theme="dark"] body.archive .archive-page .archive-table-wrap {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-table-wrap.archive-table-wrap--file-dragover,
html[data-ui-theme="dark"] body.archive .archive-page .archive-table-wrap.archive-table-wrap--file-dragover {
  background: rgba(96, 165, 250, 0.1);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-table thead th,
html[data-ui-theme="dark"] body.archive .archive-page .archive-table thead th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-td,
html[data-ui-theme="dark"] body.archive .archive-page .archive-td {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.notes-page .archive-page tr.archive-card:not(.notes-dual-row),
html[data-ui-theme="dark"] body.archive .archive-page tr.archive-card {
  background: var(--bg-white);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.notes-page .archive-page .archive-card-meta,
html[data-ui-theme="dark"] body.archive .archive-page .archive-card-meta {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.notes-page .archive-empty,
html[data-ui-theme="dark"] body.archive .archive-page .archive-empty {
  color: var(--text-muted);
}

/* ---------- 자료실 전용 페이지 (body.archive): 리스트 외 툴바·행 액션·메모·모달 ---------- */
html[data-ui-theme="dark"] body.archive .archive-page .archive-toolbar {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-section-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-ym-prev,
html[data-ui-theme="dark"] body.archive .archive-page .archive-ym-next {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-ym-prev:hover,
html[data-ui-theme="dark"] body.archive .archive-page .archive-ym-next:hover {
  background: #2a2a2a;
  border-color: var(--border-light);
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-ym-wrapper .archive-ym-input:not(.archive-ym-input--concealed) {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-ym-picker-panel {
  background: var(--bg-white);
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-ui-theme="dark"] body.archive .archive-ym-picker-panel .archive-ym-picker-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-ym-picker-panel .archive-ym-picker-select {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-name {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-drag {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-drag:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-btn {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-delete:hover {
  color: #f87171;
}

html[data-ui-theme="dark"] body.notes-page .archive-rename-input,
html[data-ui-theme="dark"] body.archive .archive-rename-input {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}
html[data-ui-theme="dark"] body.notes-page .archive-rename-label,
html[data-ui-theme="dark"] body.archive .archive-rename-label {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap {
  background: transparent;
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

/* 체크됨: 라이트는 빨간 면 — 다크에서는 흰 배경 + 빨간 체크로 선택 여부가 보이게 */
html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap:has(input:checked),
html[data-ui-theme="dark"] body.notes-page .archive-page .archive-card-check-wrap:has(input:checked) {
  background: #fff;
  color: #b91c1c;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap:has(input:checked):hover,
html[data-ui-theme="dark"] body.notes-page .archive-page .archive-card-check-wrap:has(input:checked):hover {
  background: #f4f4f5;
  color: #991b1b;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap:has(input:checked) .archive-card-check-icon,
html[data-ui-theme="dark"] body.archive .archive-page .archive-card-check-wrap input:checked ~ .archive-card-check-icon,
html[data-ui-theme="dark"] body.notes-page .archive-page .archive-card-check-wrap:has(input:checked) .archive-card-check-icon,
html[data-ui-theme="dark"] body.notes-page .archive-page .archive-card-check-wrap input:checked ~ .archive-card-check-icon {
  color: #b91c1c;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-placeholder-td {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.45) !important;
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-section-memo {
  border-top-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-memo-toggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-memo-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-memo {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-carry-btn,
html[data-ui-theme="dark"] body.archive .archive-page .archive-toolbar-btn {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-carry-btn:hover,
html[data-ui-theme="dark"] body.archive .archive-page .archive-toolbar-btn:hover {
  background: #2a2a2a;
  border-color: #60a5fa;
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-carry-btn:disabled:hover,
html[data-ui-theme="dark"] body.archive .archive-page .archive-toolbar-btn:disabled:hover {
  background: var(--bg-white);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-select-all-btn .archive-card-check-icon {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-page .archive-select-all-btn:hover .archive-card-check-icon {
  color: #93c5fd;
}

html[data-ui-theme="dark"] body.archive .archive-upload-modal-content {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

html[data-ui-theme="dark"] body.archive .archive-upload-modal-header {
  border-bottom-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-upload-modal-title {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-upload-modal-close {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-upload-modal-close:hover {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-upload-queue-list {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-upload-queue-empty,
html[data-ui-theme="dark"] body.archive .archive-upload-queue-hint {
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.archive .archive-upload-queue-row {
  background: var(--bg-white);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-upload-queue-file {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-drop-zone {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-light);
}

html[data-ui-theme="dark"] body.archive .archive-drop-zone:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: #71717a;
}

html[data-ui-theme="dark"] body.archive .archive-drop-zone-dragover {
  background: rgba(96, 165, 250, 0.15);
  border-color: #60a5fa;
}

html[data-ui-theme="dark"] body.archive .archive-drop-zone-text {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-drop-zone-filename {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-confirm-content {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

html[data-ui-theme="dark"] body.archive .archive-confirm-message {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .maincontent.archive-page {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .contentTitle,
html[data-ui-theme="dark"] body.archive .contentTitle-text {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-upload-label {
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.archive .archive-preview-loading {
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.archive .archive-section-monthly .archive-ym-title-btn:hover {
  color: #93c5fd;
}

/* 분할 목록 행: #fff 그라데이션 → 패널 배경 + 스티키 색만 비침 */
html[data-ui-theme="dark"] body.notes-page tr.notes-dual-row[data-sticky] {
  background-color: var(--bg-white);
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--notes-dual-list-tint, transparent) 50%, var(--bg-white)) 0%,
    var(--bg-white) 30%,
    var(--bg-white) 100%
  );
}

html[data-ui-theme="dark"] body.notes-page tr.notes-dual-memo-row:hover,
html[data-ui-theme="dark"] body.notes-page tr.notes-dual-note-row:hover {
  background-color: var(--bg-white);
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.07),
      rgba(255, 255, 255, 0.07)
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--notes-dual-list-tint, transparent) 50%, var(--bg-white)) 0%,
      var(--bg-white) 30%,
      var(--bg-white) 100%
    );
}

html[data-ui-theme="dark"] body.notes-page tr.notes-dual-row.is-dual-row-active {
  background-color: var(--bg-white);
  background-image: linear-gradient(
      rgba(96, 165, 250, 0.2),
      rgba(96, 165, 250, 0.2)
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--notes-dual-list-tint, transparent) 50%, var(--bg-white)) 0%,
      var(--bg-white) 30%,
      var(--bg-white) 100%
    );
}

html[data-ui-theme="dark"] body.notes-page tr.notes-dual-row.is-dual-row-active:hover {
  background-color: var(--bg-white);
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05)
    ),
    linear-gradient(
      rgba(96, 165, 250, 0.2),
      rgba(96, 165, 250, 0.2)
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--notes-dual-list-tint, transparent) 50%, var(--bg-white)) 0%,
      var(--bg-white) 30%,
      var(--bg-white) 100%
    );
}

html[data-ui-theme="dark"] body.notes-page tr.notes-dual-sortable-chosen {
  background-color: rgba(96, 165, 250, 0.14);
}

html[data-ui-theme="dark"] body.notes-page tr.notes-dual-new-memo-host-row,
html[data-ui-theme="dark"] body.notes-page tr.notes-dual-new-note-host-row {
  background: var(--bg-white);
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-new-memo-btn,
html[data-ui-theme="dark"] body.notes-page .notes-dual-new-note-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-new-memo-btn:hover,
html[data-ui-theme="dark"] body.notes-page .notes-dual-new-note-btn:hover {
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-note-body-preview {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-row-sort-handle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

html[data-ui-theme="dark"] body.notes-page .notes-dual-row-sort-handle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #bfdbfe;
}

/* 메모지·노트 편집: 배경은 스티키/시트 색 그대로(라이트) — 전역 input/textarea 다크 색·배경 미적용 */
html[data-ui-theme="dark"] body.notes-page textarea.notes-dual-memo-ta {
  color: #1f2937;
  border-color: #ddd;
}

html[data-ui-theme="dark"] body.notes-page textarea.notes-dual-memo-ta::placeholder {
  color: rgba(31, 41, 55, 0.45);
}

html[data-ui-theme="dark"] body.notes-page textarea.notes-dual-memo-ta--cross {
  background-color: transparent !important;
  border-color: transparent !important;
  color: #1f2937;
}

html[data-ui-theme="dark"] body.notes-page .notes-sticky:not(.notes-sticky-composer) .notes-sticky-body-input,
html[data-ui-theme="dark"] body.notes-page .notes-sticky-composer .notes-sticky-composer-input {
  background-color: transparent !important;
  color: var(--notes-sticky-ink, #3e2723);
  border-color: transparent;
}

html[data-ui-theme="dark"] body.notes-page .notes-sticky-composer .notes-sticky-composer-input::placeholder {
  color: rgba(62, 39, 35, 0.45);
}

html[data-ui-theme="dark"] body.notes-page .notes-note-detail-title-input {
  background: transparent !important;
  color: #0f172a;
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-ui-theme="dark"] body.notes-page .notes-note-detail-quill-host .ql-editor {
  color: #0f172a;
}

html[data-ui-theme="dark"] body.notes-page .notes-note-detail-quill-host .ql-editor.ql-blank::before {
  color: rgba(15, 23, 42, 0.38);
}

/* 보드 노트 카드 미리보기 내 Quill 본문 */
html[data-ui-theme="dark"] body.notes-page .notes-board .notes-sticky-note-preview-body .ql-editor {
  color: #0f172a;
}
