html[data-uplus-theme="dark"] {
  color-scheme: dark;
  --uplus-blush: #3a2030;
  --uplus-peach: #382b24;
  --uplus-cream: #312b24;
  --uplus-text: #f2edf1;
  --uplus-muted: #bdb2b9;
  --uplus-border: #3d353b;
  --bs-body-bg: #171419;
  --bs-body-color: #f2edf1;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: #bdb2b9;
  --bs-tertiary-bg: #211d22;
  --bs-border-color: #3d353b;
}

html[data-uplus-theme="dark"] body.uplus-shell,
html[data-uplus-theme="dark"] .uplus-shell .app-wrapper,
html[data-uplus-theme="dark"] .uplus-shell .app-main,
html[data-uplus-theme="dark"] .uplus-shell .app-content {
  background: #171419 !important;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .uplus-topbar,
html[data-uplus-theme="dark"] .uplus-sidebar,
html[data-uplus-theme="dark"] .uplus-sidebar .sidebar-brand {
  border-color: var(--uplus-border);
  background: #211d22 !important;
}

html[data-uplus-theme="dark"] .uplus-header-brand,
html[data-uplus-theme="dark"] .uplus-menu-toggle,
html[data-uplus-theme="dark"] .uplus-user-menu .nav-link,
html[data-uplus-theme="dark"] .uplus-profile-link,
html[data-uplus-theme="dark"] .uplus-sidebar .sidebar-menu .nav-link,
html[data-uplus-theme="dark"] .uplus-sidebar .brand-link {
  color: #eee7ec;
}

html[data-uplus-theme="dark"] .admin-header-status-link {
  border-color: #756873;
  background: #272228;
  color: #ddd4da;
}

html[data-uplus-theme="dark"] .admin-header-status-link:hover {
  border-color: #ff72b9;
  color: #fff;
}

html[data-uplus-theme="dark"] .uplus-sidebar .sidebar-menu .nav-link:hover {
  background: #32252d;
  color: #ff72b9;
}

html[data-uplus-theme="dark"] .uplus-sidebar .sidebar-menu .nav-link.active {
  background: #452338;
  color: #ff83c3;
}

html[data-uplus-theme="dark"] .dashboard-welcome {
  border-color: #533044;
  background: linear-gradient(115deg, #252025 0%, #30202a 54%, #312720 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

html[data-uplus-theme="dark"] .dashboard-welcome-avatar,
html[data-uplus-theme="dark"] .dashboard-welcome-date {
  border-color: #5a3549;
  background: #211d22;
  color: #f1dce8;
}

html[data-uplus-theme="dark"] .dashboard-panel,
html[data-uplus-theme="dark"] .dashboard-task-panel,
html[data-uplus-theme="dark"] .dashboard-board-card,
html[data-uplus-theme="dark"] .card,
html[data-uplus-theme="dark"] .modal-content,
html[data-uplus-theme="dark"] .dropdown-menu,
html[data-uplus-theme="dark"] .member-mobile-card,
html[data-uplus-theme="dark"] .agreement-document {
  border-color: var(--uplus-border) !important;
  background: #211d22 !important;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .agreement-document h4 {
  color: #fff;
}

html[data-uplus-theme="dark"] .agreement-all {
  border: 1px solid #5a3549;
  background: #32252d;
  color: #f5eff3;
}

html[data-uplus-theme="dark"] .agreement-all .form-check-label {
  color: #f5eff3;
  opacity: 1;
}

html[data-uplus-theme="dark"] .dashboard-panel-header,
html[data-uplus-theme="dark"] .dashboard-task-header,
html[data-uplus-theme="dark"] .dashboard-task-item,
html[data-uplus-theme="dark"] .dashboard-board-header,
html[data-uplus-theme="dark"] .dashboard-notice-item,
html[data-uplus-theme="dark"] .table > :not(caption) > * > * {
  border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .dashboard-notice-item:hover,
html[data-uplus-theme="dark"] .dashboard-task-item:hover,
html[data-uplus-theme="dark"] .dashboard-board-item:hover,
html[data-uplus-theme="dark"] .dropdown-item:hover,
html[data-uplus-theme="dark"] .dropdown-item:focus {
  background: #30252c;
  color: #ff83c3;
}

html[data-uplus-theme="dark"] .dashboard-schedule-item {
  border-color: var(--uplus-border);
  background: #19161a;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .dashboard-schedule-item:hover {
  background: #30252c;
  color: #fff;
}

html[data-uplus-theme="dark"] .dashboard-schedule-copy small,
html[data-uplus-theme="dark"] .dashboard-schedule-empty {
  color: var(--uplus-muted);
}

html[data-uplus-theme="dark"] .dashboard-calendar-header,
html[data-uplus-theme="dark"] .dashboard-rail-schedule-list {
  border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .metric-report {
  border-color: #4a4028;
  background: #302b1f;
}

html[data-uplus-theme="dark"] .dashboard-metric-icon,
html[data-uplus-theme="dark"] .dashboard-task-icon,
html[data-uplus-theme="dark"] .dashboard-board-icon {
  background: rgba(255, 255, 255, .08);
}

html[data-uplus-theme="dark"] .dashboard-metric-content,
html[data-uplus-theme="dark"] .dashboard-board-item time,
html[data-uplus-theme="dark"] .dashboard-notice-item time,
html[data-uplus-theme="dark"] .form-text,
html[data-uplus-theme="dark"] .text-muted {
  color: var(--uplus-muted) !important;
}

html[data-uplus-theme="dark"] .form-control,
html[data-uplus-theme="dark"] .form-select,
html[data-uplus-theme="dark"] .input-group-text,
html[data-uplus-theme="dark"] textarea {
  border-color: #50464d;
  background-color: #181519;
  color: #f5eff3;
}

html[data-uplus-theme="dark"] .form-control:focus,
html[data-uplus-theme="dark"] .form-select:focus,
html[data-uplus-theme="dark"] textarea:focus {
  border-color: #d60078;
  background-color: #1c181d;
  color: #fff;
  box-shadow: 0 0 0 .2rem rgba(214, 0, 120, .18);
}

html[data-uplus-theme="dark"] .table {
  --bs-table-bg: #211d22;
  --bs-table-color: #f2edf1;
  --bs-table-striped-bg: #282328;
  --bs-table-hover-bg: #30252c;
  --bs-table-border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .notification-popup,
html[data-uplus-theme="dark"] .webmail-header-popup,
html[data-uplus-theme="dark"] .session-timeout-dialog {
  border-color: var(--uplus-border);
  background: #211d22;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .notification-popup-item,
html[data-uplus-theme="dark"] .webmail-header-item {
  border-color: var(--uplus-border);
  background: #211d22;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .notification-popup-item.unread,
html[data-uplus-theme="dark"] .webmail-header-item.unread {
  background: #3a2030;
}

html[data-uplus-theme="dark"] .webmail-header-popup-actions {
  background: #19161a;
  border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .webmail-header-popup-title small,
html[data-uplus-theme="dark"] .webmail-sync-status {
  color: var(--uplus-muted);
}

/* Webmail has its own cards, navigation and selection rows, so keep every
   webmail surface in the same dark palette instead of leaving white islands. */
html[data-uplus-theme="dark"] .webmail-mailbox-nav,
html[data-uplus-theme="dark"] .webmail-main .card,
html[data-uplus-theme="dark"] .webmail-main .card-header,
html[data-uplus-theme="dark"] .webmail-main .card-body,
html[data-uplus-theme="dark"] .webmail-select-row,
html[data-uplus-theme="dark"] .webmail-select-row .list-group-item {
  border-color: var(--uplus-border) !important;
  background: #211d22 !important;
  color: var(--uplus-text) !important;
}

html[data-uplus-theme="dark"] .webmail-mailbox-nav-title,
html[data-uplus-theme="dark"] .webmail-mailbox-nav-link,
html[data-uplus-theme="dark"] .webmail-main h1,
html[data-uplus-theme="dark"] .webmail-main h2,
html[data-uplus-theme="dark"] .webmail-main h3,
html[data-uplus-theme="dark"] .webmail-main h4,
html[data-uplus-theme="dark"] .webmail-main h5,
html[data-uplus-theme="dark"] .webmail-main h6 {
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .webmail-mailbox-nav-link:hover,
html[data-uplus-theme="dark"] .webmail-mailbox-nav-link:focus-visible {
  background: #30252c;
  color: #ff83c3;
}

html[data-uplus-theme="dark"] .webmail-mailbox-nav-link.active {
  background: #452338;
  color: #ff9bce;
}

html[data-uplus-theme="dark"] .webmail-nav-divider,
html[data-uplus-theme="dark"] .webmail-address-book-header,
html[data-uplus-theme="dark"] .webmail-address-book-footer {
  border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .webmail-bulk-toolbar {
  border-color: var(--uplus-border);
  background: #19161a;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .webmail-select-row {
  border-bottom: 1px solid var(--uplus-border);
}

html[data-uplus-theme="dark"] .webmail-select-row:last-child {
  border-bottom: 0;
}

html[data-uplus-theme="dark"] .webmail-select-row:hover,
html[data-uplus-theme="dark"] .webmail-select-row:hover .list-group-item {
  background: #30252c !important;
}

html[data-uplus-theme="dark"] .webmail-contact-suggestions,
html[data-uplus-theme="dark"] .webmail-contact-suggestion,
html[data-uplus-theme="dark"] .webmail-address-book-dialog,
html[data-uplus-theme="dark"] .webmail-address-book-footer {
  border-color: var(--uplus-border);
  background: #211d22;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .member-column-picker-panel {
  border-color: var(--uplus-border);
  background: #211d22;
  color: var(--uplus-text);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .4);
}

html[data-uplus-theme="dark"] .member-status-tab {
  border-color: var(--uplus-border);
  background: #211d22;
  color: var(--uplus-muted);
}

html[data-uplus-theme="dark"] .member-status-tab:hover,
html[data-uplus-theme="dark"] .member-status-tab.active {
  border-color: #ff72b9;
  background: #452338;
  color: #ffb0d7;
}

html[data-uplus-theme="dark"] .menu-permission-badges span {
  border-color: #70465d;
  background: #392431;
  color: #ff9dcc;
}

html[data-uplus-theme="dark"] .menu-permission-badges .is-empty {
  border-color: #467da2;
  background: #18364a;
  color: #9edcff;
}

html[data-uplus-theme="dark"] .menu-permission-editor-form {
  border-color: var(--uplus-border);
  background: #252126;
}

/* 협업 회신과 첨부파일 영역도 카드와 동일한 다크 팔레트를 사용한다. */
html[data-uplus-theme="dark"] .table .collection-reply-row {
  --bs-table-bg: #282328;
  --bs-table-color: var(--uplus-text);
  --bs-table-hover-bg: #30252c;
  --bs-table-hover-color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .collection-reply-item,
html[data-uplus-theme="dark"] .collection-attachment-panel,
html[data-uplus-theme="dark"] .collection-existing-files,
html[data-uplus-theme="dark"] .collection-reply-row > * {
  border-color: var(--uplus-border) !important;
  background: #282328 !important;
  color: var(--uplus-text) !important;
}

html[data-uplus-theme="dark"] .collection-reply-item:hover,
html[data-uplus-theme="dark"] .collection-reply-row:hover > * {
  background: #30252c !important;
}

html[data-uplus-theme="dark"] .collection-reply-item .badge.text-bg-light {
  border-color: #5a4f57 !important;
  background: #332d32 !important;
  color: #f2edf1 !important;
}

html[data-uplus-theme="dark"] .collection-reply-content {
  border-color: var(--uplus-border);
  background: #211d21;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .webmail-contact-suggestion,
html[data-uplus-theme="dark"] .webmail-address-book-item {
  border-color: var(--uplus-border);
}

html[data-uplus-theme="dark"] .webmail-contact-suggestion small,
html[data-uplus-theme="dark"] .webmail-contact-suggestion-email,
html[data-uplus-theme="dark"] .webmail-address-book-item-info small,
html[data-uplus-theme="dark"] .webmail-address-book-empty {
  color: var(--uplus-muted);
}

html[data-uplus-theme="dark"] .webmail-contact-suggestion:hover,
html[data-uplus-theme="dark"] .webmail-contact-suggestion:focus-visible,
html[data-uplus-theme="dark"] .webmail-contact-suggestion.active,
html[data-uplus-theme="dark"] .webmail-address-book-item:hover {
  border-color: #7a3a5d;
  background: #452338;
  color: #fff;
}

html[data-uplus-theme="dark"] a:not(.btn):not(.nav-link):not(.dashboard-metric-card):not(.dashboard-notice-item):not(.dashboard-board-item) {
  text-decoration-color: rgba(255, 131, 195, .45);
}

html[data-uplus-theme="dark"] .center-receipt-panel,
html[data-uplus-theme="dark"] .center-receipt-summary,
html[data-uplus-theme="dark"] .center-receipt-body {
  border-color: var(--uplus-border);
  background: #252126;
  color: var(--uplus-text);
}

html[data-uplus-theme="dark"] .center-receipt-summary {
  background: #2d252b;
}

html[data-uplus-theme="dark"] .center-receipt-summary .badge.text-bg-light {
  border-color: #5a4f57 !important;
  background: #3a3438 !important;
  color: #f2edf1 !important;
}

html[data-uplus-theme="dark"] .center-receipt-toggle-label {
  color: #c9bfc5;
}

html[data-uplus-theme="dark"] .center-receipt-confirmed-badge,
html[data-uplus-theme="dark"] .center-receipt-status.is-confirmed {
  color: #94e7bd;
  background: #173d2d;
}

html[data-uplus-theme="dark"] .center-receipt-unconfirmed-badge,
html[data-uplus-theme="dark"] .center-receipt-status.is-unconfirmed {
  color: #ffabc8;
  background: #4b2031;
}

html[data-uplus-theme="dark"] .center-receipt-status.is-no-target {
  color: #c9bfc5;
  background: #3a3438;
}

/* Rich-editor content can contain copied inline colors such as black. In dark
   mode, normalize those foreground colors inside the post body only. */
html[data-uplus-theme="dark"] .rich-post-content {
  color: #f2edf1 !important;
}

html[data-uplus-theme="dark"] .rich-post-content *:not(a):not(img):not(svg) {
  border-color: #51464e;
  color: inherit !important;
}

html[data-uplus-theme="dark"] .rich-post-content a {
  color: #79b8ff !important;
}

html[data-uplus-theme="dark"] .rich-post-content [style*="background"],
html[data-uplus-theme="dark"] .rich-post-content [data-background-color] {
  background-color: #51451c !important;
  color: #fff4bf !important;
}

html[data-uplus-theme="dark"] .rich-post-content table,
html[data-uplus-theme="dark"] .rich-post-content td {
  background: transparent !important;
}

html[data-uplus-theme="dark"] .rich-post-content th {
  background: #302a2f !important;
}

html[data-uplus-theme="dark"] .rich-post-content blockquote,
html[data-uplus-theme="dark"] .rich-post-content pre,
html[data-uplus-theme="dark"] .rich-post-content code {
  background: #19161a;
  color: #f2edf1 !important;
}
