:root[data-theme="dark"] {
  color-scheme:dark;
  --tp-ink:#eee8f1; --tp-gray-700:#c1b7c8; --tp-gray-500:#a69aac; --tp-silver:#80738a;
  --tp-platinum:#3c3344; --tp-smoke:#28222f; --tp-white:#201b26;
  --tp-purple:#d897ed; --tp-violet:#ead0f4; --tp-mauveine:#bc74d1; --tp-pale:#392543;
  --tp-sea:#63d7b7; --tp-mint:#46ceaa; --tp-azure:#18392f; --tp-seashell:#432b23;
  --tp-pink:#462331; --tp-lemon:#3e371f; --tp-folly:#ff7aa5;
  --shadow-sm:0 10px 28px #0003; --shadow-md:0 22px 60px #0006;
}
.theme-floating { position:fixed; right:18px; top:18px; z-index:100; }
:root{color-scheme:light;--tp-gray-800:var(--tp-ink)}
html[data-theme="dark"], html[data-theme="dark"] body { background:#141119; color:var(--tp-ink); }
html[data-theme="dark"] :is(.sidebar,.topbar,.card,.connection-mini,.conversation-pane,.conversation-head,.chat-head,.composer,.contact-drawer,.operation-panel,.modal-card,.global-search-dialog,.queue-menu,.quick-reply-menu,.dropdown-menu,.auth-card) { background:#201b26; border-color:#3c3344; color:var(--tp-ink); }
html[data-theme="dark"] :is(.live-inbox,.chat-pane,.chat-scroll,.chat-live,.chat-empty,.message-system,.global-search-results) { background:#17131e; }
html[data-theme="dark"] :is(input,textarea,select,.field,.select,.icon-btn,.composer-tool,.secondary-action,.mini-action,.btn-secondary,.message-retry-button,.recording-panel button) { background:#29222f; color:#eee8f1; border-color:#4b3d55; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color:#a79aaf; }
html[data-theme="dark"] .sidebar-logo { filter:brightness(0) invert(.92); }
html[data-theme="dark"] :is(.conversation-item,.global-search-item,.quick-reply-item) { background:transparent; color:#eee8f1; border-color:#372e40; }
html[data-theme="dark"] :is(.conversation-item.active,.conversation-item:hover:not(:disabled):not([aria-disabled=true]),.quick-reply-item.active,.quick-reply-item:hover:not(:disabled):not([aria-disabled=true]),.global-search-item:hover:not(:disabled):not([aria-disabled=true]),.nav-link.active,.nav-link:hover:not(:disabled):not([aria-disabled=true])) { background:#392543; }
html[data-theme="dark"] .bubble { background:#2b2532; border-color:#3c3344; color:#eee8f1; }
html[data-theme="dark"] .msg-row.out .bubble { background:#432951; border-color:#563461; }
html[data-theme="dark"] .bubble.failed { background:#452432; border-color:#77334b; }
html[data-theme="dark"] :is(.day-divider span,.message-history-loader,.contact-drawer-tabs,.contact-drawer-tab,.contact-note,.internal-note,.attachment-chip,.operation-history,.global-search-input-wrap,.quick-reply-command-head,.quick-reply-head) { background:#29222f; color:#c9bbd2; border-color:#3c3344; }
html[data-theme="dark"] :is(.btn-primary,.send-btn,.avatar) { background:#853a9c; color:#fff; }
html[data-theme="dark"] .btn-primary:hover:not(:disabled):not([aria-disabled=true]) { background:#9950b0; }
html[data-theme="dark"] .table th { background:#29222f; }
html[data-theme="dark"] .table td { background:#201b26; }
html[data-theme="dark"] :is(.gallery-item small,.wave-meta,.composer-hint,.bubble-meta,.conv-time,.chat-updated) { color:#bfaec8; }
html[data-theme="dark"] tp-audio-player { background:#ffffff09; color:#ddb4eb; }
html[data-theme="dark"] .wave-bars i { background:#86708f; }
html[data-theme="dark"] .wave-bars i.played, html[data-theme="dark"] .recording-wave i { background:#dea8f0; }
html[data-theme="dark"] .recording-panel { background:#3c2233; }
html[data-theme="dark"] .recording-panel [role="timer"], html[data-theme="dark"] .audio-feedback { color:#ffb3cf; }
html[data-theme="dark"] .tag.orange { color:#ffbc8e; }
html[data-theme="dark"] .tag.pink { color:#ffb1d0; }
html[data-theme="dark"] .tag.yellow { color:#f3d96c; }
html[data-theme="dark"] .gallery-item { border-color:#3c3344; }
html[data-theme="dark"] .toast { background:#3b2c46; color:#f8effd; }
html[data-theme="dark"] :is(.modal-backdrop,.global-search-overlay) { background:#08060dc4; }
html[data-theme="dark"] :is(.queue-selector,.queue-option,.assignee-control,.saved-filter-btn,.account-menu,.account-menu button,.account-menu a,.password-card,.member-card,.schedule-row,.rule-card) { background:#29222f; color:#eee8f1; border-color:#4b3d55; }
html[data-theme="dark"] .queue-option.active { background:#392543; }
html[data-theme="dark"] .sla-status { background:#18382e; border-color:#315548; color:#8ce3c4; }
html[data-theme="dark"] .sla-status.warning { background:#40351e; border-color:#635333; color:#f0d485; }
html[data-theme="dark"] .sla-status.breached { background:#432430; border-color:#70404d; color:#ffa7c1; }
html[data-theme="dark"] :is(.conv-sla,.conv-sla.overdue,.sla-mini.breached,.sla-alert) { color:#ff9bbb; }
html[data-theme="dark"] .bubble-media-preview img { background:#f4edf7; border-radius:8px; }
html[data-theme="dark"] .login-brand-panel { background:linear-gradient(145deg,#2e1438,#612677); }
html[data-theme="dark"] .login-form-panel { background:#17131e; }
html[data-theme="dark"] .password-page { background:#17131e; }
html[data-theme="dark"] .password-card > img, html[data-theme="dark"] .login-mobile-logo { filter:brightness(0) invert(.92); }
html[data-theme="dark"] .erp-command-strip { background:linear-gradient(110deg,#261d2f,#392543); }

/* Shared surfaces and states across the administrative pages. */
html[data-theme="dark"] :is(.modal,.quick-admin-card,.super-kpi,.queue-admin-item,.operation-admin-actions button,.quick-template-tools,.quick-variable-button){background:var(--tp-white);border-color:var(--tp-platinum);color:var(--tp-ink)}
html[data-theme="dark"] :is(.quick-template-tools-head strong,.quick-variable-button code){color:var(--tp-violet)}
html[data-theme="dark"] .quick-template-tools-head span{color:var(--tp-gray-700)}
html[data-theme="dark"] :is(.quick-template-chip,.quick-variable-button:hover:not(:disabled):not([aria-disabled=true]),.queue-admin-item.active,.queue-admin-item:hover:not(:disabled):not([aria-disabled=true]),.contact-list .table tr:hover:not(:disabled):not([aria-disabled=true]) td){background:var(--tp-pale);color:var(--tp-violet);border-color:var(--tp-purple)}
html[data-theme="dark"] :is(.login-error,.queue-form-error,.super-kpi.alert){background:#3c202c;color:#ffacc6;border-color:#70404d}
html[data-theme="dark"] .super-table .danger{color:#ffacc6}
html[data-theme="dark"] :is(.btn-danger){background:#aa2851;color:#fff}
html[data-theme="dark"] .unread{background:#853a9c;color:#fff}
html[data-theme="dark"] :is(.account-menu a:hover:not(:disabled):not([aria-disabled=true]),.account-menu button:hover:not(:disabled):not([aria-disabled=true])){background:var(--tp-pale)}
html[data-theme="dark"] input[type=checkbox]{accent-color:#c387da}
html[data-theme="dark"] .field:focus{box-shadow:0 0 0 3px #c387da30}
html[data-theme="dark"] :focus-visible{outline-color:#dea8f0}
button:disabled{cursor:not-allowed;opacity:.55}
[hidden]{display:none!important}
.sidebar{overflow:hidden}
.sidebar .nav-group{flex:1;min-height:0;overflow-y:auto;align-content:start;scrollbar-width:thin;scrollbar-color:var(--tp-platinum) transparent}.sidebar-bottom{padding-top:16px;flex-shrink:0}
.connection-mini{--connection-accent:#697586;--connection-tint:#f1f3f6;padding:0!important;border-radius:18px;overflow:hidden;background:var(--tp-white);border:1px solid var(--tp-platinum);transition:border-color .15s}
.connection-mini[data-state=online]{--connection-accent:#15765d;--connection-tint:#e7f7ef}
.connection-mini[data-state=warning]{--connection-accent:#805700;--connection-tint:#fff5d8}
.connection-mini[data-state=offline]{--connection-accent:#aa2851;--connection-tint:#fff0f4}
.connection-mini .connection-link{display:block;padding:14px;text-decoration:none;color:var(--tp-ink)}
.connection-mini:hover:not(:disabled):not([aria-disabled=true]){border-color:var(--connection-accent)}
.connection-heading{display:flex;align-items:center;gap:10px}
.connection-heading>div{min-width:0;flex:1}.connection-heading small{display:block;font-size:10px;letter-spacing:.07em;font-weight:600;color:var(--tp-gray-700);line-height:1.4}
.connection-mini .connection-heading strong{font-size:16px;color:var(--tp-ink);line-height:1.5}
.connection-symbol{width:36px;height:36px;flex-shrink:0;display:grid;place-items:center;border:1px solid color-mix(in srgb,var(--connection-accent) 24%,transparent);background:var(--connection-tint);color:var(--connection-accent);border-radius:12px;font-size:21px}
.connection-arrow{font-size:15px;color:var(--tp-gray-500)}
.connection-bottom{margin-top:14px;padding-top:12px;border-top:1px solid var(--tp-platinum);display:grid;gap:8px}
.connection-mini .status-line{display:inline-flex;justify-self:start;align-items:center;gap:6px;margin:0;padding:4px 9px;border-radius:7px;background:var(--connection-tint);color:var(--connection-accent);font-size:11px;font-weight:600;line-height:1.4}
.connection-mini .status-line .material-symbols-rounded{font-size:15px}
.connection-bottom>small{font-size:10px;line-height:1.4;color:var(--tp-gray-700);overflow-wrap:anywhere}
html[data-theme=dark] .connection-mini{--connection-accent:#b8adc4;--connection-tint:#342d3c;background:linear-gradient(135deg,#25202c,#1d1923);border-color:#403648}
html[data-theme=dark] .connection-mini[data-state=online]{--connection-accent:#83dfbc;--connection-tint:#203b32}
html[data-theme=dark] .connection-mini[data-state=warning]{--connection-accent:#f1ce7e;--connection-tint:#40361e}
html[data-theme=dark] .connection-mini[data-state=offline]{--connection-accent:#ffa8c1;--connection-tint:#422432}
html[data-theme=dark] .connection-mini:hover:not(:disabled):not([aria-disabled=true]){border-color:var(--connection-accent)}
@media(prefers-reduced-motion:reduce){.connection-mini{transition:none}}
.operation-admin-row strong,.queue-admin-copy strong{font-size:12px}.operation-admin-row span,.queue-admin-copy span{font-size:11px}.operation-admin-head p{font-size:12px}.super-kpi small{font-size:10px}.super-kpi div>span{font-size:12px}.super-table th,.super-table td{font-size:12px}.queue-editor label,.catalog-fields label{font-size:12px}
html[data-theme=dark] .donut::after{background:var(--tp-white)}
