/* User-selectable TelPOS ERP appearance. The default follows the operating system. */
html[data-telpos-theme="light"] { color-scheme: light; }
html[data-telpos-theme="dark"] {
    --telpos-dark-canvas: #0b1220;
    --telpos-dark-surface: #111c2e;
    --telpos-dark-surface-raised: #142238;
    --telpos-dark-surface-muted: #0c1728;
    --telpos-dark-border: #34445e;
    --telpos-dark-divider: #2a3952;
    --telpos-dark-text: #e5edf8;
    --telpos-dark-text-strong: #f8fbff;
    --telpos-dark-text-muted: #aebed3;
    --telpos-dark-link: #67d5f0;
    --telpos-dark-selection: #2563eb;
    color-scheme: dark;
}

html[data-telpos-theme="dark"] ::selection {
    background: var(--telpos-dark-selection) !important;
    color: #ffffff !important;
    text-shadow: none !important;
}
html[data-telpos-theme="dark"] ::-moz-selection {
    background: var(--telpos-dark-selection) !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

.telpos-theme-picker > summary { list-style: none; }
.telpos-theme-picker > summary::-webkit-details-marker { display: none; }
.telpos-theme-menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #475569;
    display: grid;
    font-weight: 600;
    gap: 10px;
    grid-template-columns: 18px 1fr 14px;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}
.telpos-theme-menu button:hover,
.telpos-theme-menu button:focus,
.telpos-theme-menu button.is-active { background: #eef5ff; color: var(--theme-800, #0040c1); outline: 0; }
.telpos-theme-menu button .theme-check { opacity: 0; }
.telpos-theme-menu button.is-active .theme-check { opacity: 1; }

html[data-telpos-theme="dark"] body,
html[data-telpos-theme="dark"] body:not(.lockscreen),
html[data-telpos-theme="dark"],
html[data-telpos-theme="dark"] main.tw-bg-gray-100,
html[data-telpos-theme="dark"] #scrollable-container,
html[data-telpos-theme="dark"] .content-wrapper,
html[data-telpos-theme="dark"] .right-side {
    background-color: #0b1220 !important;
    color: #e5edf8;
}

html[data-telpos-theme="dark"] main.tw-bg-gray-100,
html[data-telpos-theme="dark"] #scrollable-container {
    background-image: radial-gradient(circle at 92% 0, rgba(21, 112, 239, .13), transparent 28rem), linear-gradient(180deg, #101a2c, #0b1220 34rem) !important;
}

html[data-telpos-theme="dark"] aside.side-bar:not(.telpos-ignore-theme),
html[data-telpos-theme="dark"] .side-bar.tw-bg-white { background-color: #07111f !important; border-color: #23324a !important; }
html[data-telpos-theme="dark"] aside.side-bar > div,
html[data-telpos-theme="dark"] #side-bar,
html[data-telpos-theme="dark"] #sidebar-no-results { border-color: #23324a !important; }
html[data-telpos-theme="dark"] aside.side-bar > div:nth-of-type(1) > div { background: #111d30 !important; border-color: #2b3a52 !important; }
html[data-telpos-theme="dark"] #sidebar-search { color: #e7eef9 !important; }

html[data-telpos-theme="dark"] .box,
html[data-telpos-theme="dark"] .panel,
html[data-telpos-theme="dark"] .well,
html[data-telpos-theme="dark"] .modal-content,
html[data-telpos-theme="dark"] .dropdown-menu,
html[data-telpos-theme="dark"] [role="menu"],
html[data-telpos-theme="dark"] .tw-bg-white,
html[data-telpos-theme="dark"] .hms-card,
html[data-telpos-theme="dark"] .hms-nav,
html[data-telpos-theme="dark"] .hms-total,
html[data-telpos-theme="dark"] .hms-dashboard-room-card,
html[data-telpos-theme="dark"] .hms-hotel-pos-card,
html[data-telpos-theme="dark"] .cd-card,
html[data-telpos-theme="dark"] .card {
    background-color: #111c2e !important;
    border-color: #293852 !important;
    color: #e5edf8;
}

html[data-telpos-theme="dark"] .box-header,
html[data-telpos-theme="dark"] .box-footer,
html[data-telpos-theme="dark"] .panel-heading,
html[data-telpos-theme="dark"] .panel-footer,
html[data-telpos-theme="dark"] .modal-header,
html[data-telpos-theme="dark"] .modal-footer,
html[data-telpos-theme="dark"] .hms-modal .modal-header,
html[data-telpos-theme="dark"] .hms-table thead {
    background-color: #142238 !important;
    border-color: #293852 !important;
    color: #eef4fc !important;
}

html[data-telpos-theme="dark"] h1,
html[data-telpos-theme="dark"] h2,
html[data-telpos-theme="dark"] h3,
html[data-telpos-theme="dark"] h4,
html[data-telpos-theme="dark"] h5,
html[data-telpos-theme="dark"] h6,
html[data-telpos-theme="dark"] label,
html[data-telpos-theme="dark"] legend,
html[data-telpos-theme="dark"] .box-title,
html[data-telpos-theme="dark"] .page-header,
html[data-telpos-theme="dark"] .content-header > h1,
html[data-telpos-theme="dark"] .hms-section-title,
html[data-telpos-theme="dark"] .hms-stat .value,
html[data-telpos-theme="dark"] .hms-mini-stat strong,
html[data-telpos-theme="dark"] .hms-dashboard-room-rate,
html[data-telpos-theme="dark"] .hms-hotel-pos-title,
html[data-telpos-theme="dark"] .hms-hotel-pos-meta strong,
html[data-telpos-theme="dark"] .tw-text-gray-900 { color: #f3f7fc !important; }

html[data-telpos-theme="dark"] p,
html[data-telpos-theme="dark"] small,
html[data-telpos-theme="dark"] .help-block,
html[data-telpos-theme="dark"] .text-muted,
html[data-telpos-theme="dark"] .tw-text-gray-600,
html[data-telpos-theme="dark"] .tw-text-gray-500,
html[data-telpos-theme="dark"] .hms-stat .label-text { color: #9fb0c8 !important; }

html[data-telpos-theme="dark"] .form-control,
html[data-telpos-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-telpos-theme="dark"] select,
html[data-telpos-theme="dark"] textarea,
html[data-telpos-theme="dark"] .select2-selection,
html[data-telpos-theme="dark"] .select2-dropdown,
html[data-telpos-theme="dark"] .select2-search__field {
    background-color: #0c1728 !important;
    border-color: #34445e !important;
    color: #eef4fc !important;
}
html[data-telpos-theme="dark"] input::placeholder,
html[data-telpos-theme="dark"] textarea::placeholder { color: #7f91aa !important; }
html[data-telpos-theme="dark"] .select2-results__option { background: #111c2e; color: #dce6f4; }
html[data-telpos-theme="dark"] .select2-results__option--highlighted { background: var(--theme-800, #0040c1) !important; color: #fff !important; }

html[data-telpos-theme="dark"] table,
html[data-telpos-theme="dark"] .table,
html[data-telpos-theme="dark"] .dataTable { color: #dce6f4 !important; }
html[data-telpos-theme="dark"] .table > thead > tr > th,
html[data-telpos-theme="dark"] .table > tbody > tr > td,
html[data-telpos-theme="dark"] .table > tfoot > tr > td,
html[data-telpos-theme="dark"] .dataTable th,
html[data-telpos-theme="dark"] .dataTable td { border-color: #2a3952 !important; }
html[data-telpos-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
html[data-telpos-theme="dark"] .table-hover > tbody > tr:hover { background-color: #16243a !important; }

/* Platform surfaces and data grids. Premium/module styles are intentionally
 * overridden here because this stylesheet is loaded last by every layout. */
html[data-telpos-theme="dark"] .content,
html[data-telpos-theme="dark"] .content-header,
html[data-telpos-theme="dark"] .container-fluid,
html[data-telpos-theme="dark"] .table-responsive,
html[data-telpos-theme="dark"] .dataTables_wrapper,
html[data-telpos-theme="dark"] .dataTables_scroll,
html[data-telpos-theme="dark"] .dataTables_scrollHead,
html[data-telpos-theme="dark"] .dataTables_scrollHeadInner,
html[data-telpos-theme="dark"] .dataTables_scrollBody,
html[data-telpos-theme="dark"] .dataTables_scrollFoot,
html[data-telpos-theme="dark"] .tab-content,
html[data-telpos-theme="dark"] .nav-tabs-custom,
html[data-telpos-theme="dark"] .list-group-item,
html[data-telpos-theme="dark"] .input-group-addon,
html[data-telpos-theme="dark"] .tw-bg-gray-50,
html[data-telpos-theme="dark"] .tw-bg-gray-100,
html[data-telpos-theme="dark"] .bg-light-gray,
html[data-telpos-theme="dark"] .bg-gray-light,
html[data-telpos-theme="dark"] .bg-white {
    background-color: var(--telpos-dark-surface) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] {
    background-color: var(--telpos-dark-surface-raised) !important;
    border-color: var(--telpos-dark-border) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] a,
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] button {
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] a:hover,
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] a:focus,
html[data-telpos-theme="dark"] .navbar-default[class~="!tw-bg-white"] .active > a {
    background-color: #203653 !important;
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] .nav-tabs-custom > .nav-tabs > li > a {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] .nav-tabs-custom > .nav-tabs > li.active > a,
html[data-telpos-theme="dark"] .nav-tabs-custom > .nav-tabs > li.active:hover > a {
    background: var(--telpos-dark-surface-raised) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text-strong) !important;
}

html[data-telpos-theme="dark"] table.table,
html[data-telpos-theme="dark"] table.dataTable,
html[data-telpos-theme="dark"] .telpos-premium-erp table.table,
html[data-telpos-theme="dark"] .telpos-premium-erp .table-responsive {
    background-color: var(--telpos-dark-surface) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .table > thead > tr,
html[data-telpos-theme="dark"] .table > tfoot > tr,
html[data-telpos-theme="dark"] table.dataTable > thead > tr,
html[data-telpos-theme="dark"] table.dataTable > tfoot > tr {
    background-color: var(--telpos-dark-surface-raised) !important;
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] .table > tbody > tr,
html[data-telpos-theme="dark"] table.dataTable > tbody > tr,
html[data-telpos-theme="dark"] table.dataTable tbody tr.odd,
html[data-telpos-theme="dark"] table.dataTable tbody tr.even {
    background-color: var(--telpos-dark-surface) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd),
html[data-telpos-theme="dark"] table.dataTable.stripe tbody tr.odd,
html[data-telpos-theme="dark"] table.dataTable.display tbody tr.odd {
    background-color: #15243a !important;
}
html[data-telpos-theme="dark"] .table-hover > tbody > tr:hover,
html[data-telpos-theme="dark"] table.dataTable.hover tbody tr:hover,
html[data-telpos-theme="dark"] table.dataTable.display tbody tr:hover,
html[data-telpos-theme="dark"] table.dataTable tbody tr.selected {
    background-color: #203653 !important;
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] .table > thead > tr > th,
html[data-telpos-theme="dark"] .table > tbody > tr > td,
html[data-telpos-theme="dark"] .table > tfoot > tr > td,
html[data-telpos-theme="dark"] table.dataTable th,
html[data-telpos-theme="dark"] table.dataTable td {
    background-color: transparent !important;
    border-color: var(--telpos-dark-divider) !important;
    color: inherit !important;
}
html[data-telpos-theme="dark"] .dataTables_info,
html[data-telpos-theme="dark"] .dataTables_length,
html[data-telpos-theme="dark"] .dataTables_filter,
html[data-telpos-theme="dark"] .dataTables_paginate,
html[data-telpos-theme="dark"] .dataTables_wrapper label {
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] .dataTables_empty,
html[data-telpos-theme="dark"] .dataTables_processing {
    background: var(--telpos-dark-surface-raised) !important;
    color: var(--telpos-dark-text) !important;
}

html[data-telpos-theme="dark"] a:not(.btn):not(.tw-text-white),
html[data-telpos-theme="dark"] .btn-link { color: var(--telpos-dark-link); }
html[data-telpos-theme="dark"] a:not(.btn):not(.tw-text-white):hover,
html[data-telpos-theme="dark"] a:not(.btn):not(.tw-text-white):focus { color: #a5edff; }
html[data-telpos-theme="dark"] .text-dark,
html[data-telpos-theme="dark"] .text-black,
html[data-telpos-theme="dark"] .tw-text-black,
html[data-telpos-theme="dark"] .tw-text-gray-700,
html[data-telpos-theme="dark"] .tw-text-gray-800 { color: var(--telpos-dark-text) !important; }
html[data-telpos-theme="dark"] .text-muted,
html[data-telpos-theme="dark"] .text-secondary,
html[data-telpos-theme="dark"] .tw-text-gray-400,
html[data-telpos-theme="dark"] .tw-text-gray-500,
html[data-telpos-theme="dark"] .tw-text-gray-600 { color: var(--telpos-dark-text-muted) !important; }
html[data-telpos-theme="dark"] .text-warning,
html[data-telpos-theme="dark"] .tw-text-yellow-500,
html[data-telpos-theme="dark"] .tw-text-yellow-600 { color: #fcd34d !important; }
html[data-telpos-theme="dark"] .text-success { color: #6ee7b7 !important; }
html[data-telpos-theme="dark"] .text-danger { color: #fda4af !important; }
html[data-telpos-theme="dark"] .text-info { color: #7dd3fc !important; }

html[data-telpos-theme="dark"] .form-control[disabled],
html[data-telpos-theme="dark"] .form-control[readonly],
html[data-telpos-theme="dark"] fieldset[disabled] .form-control,
html[data-telpos-theme="dark"] input:disabled,
html[data-telpos-theme="dark"] select:disabled,
html[data-telpos-theme="dark"] textarea:disabled,
html[data-telpos-theme="dark"] .select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #17243a !important;
    border-color: #394a65 !important;
    color: #aebed3 !important;
    opacity: 1;
}
html[data-telpos-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-telpos-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-telpos-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #213653 !important;
    border-color: #49617f !important;
}
html[data-telpos-theme="dark"] .dropdown-menu > li > a,
html[data-telpos-theme="dark"] [role="menu"] > li > a { color: var(--telpos-dark-text) !important; }
html[data-telpos-theme="dark"] .dropdown-menu > li > a:hover,
html[data-telpos-theme="dark"] .dropdown-menu > li > a:focus,
html[data-telpos-theme="dark"] [role="menu"] > li > a:hover,
html[data-telpos-theme="dark"] [role="menu"] > li > a:focus {
    background-color: #203653 !important;
    color: var(--telpos-dark-text-strong) !important;
}

html[data-telpos-theme="dark"] .alert-info { background: #133651 !important; border-color: #27668f !important; color: #d7f2ff !important; }
html[data-telpos-theme="dark"] .alert-success { background: #123d31 !important; border-color: #267a61 !important; color: #d1fae5 !important; }
html[data-telpos-theme="dark"] .alert-warning { background: #49360c !important; border-color: #8a6718 !important; color: #fef3c7 !important; }
html[data-telpos-theme="dark"] .alert-danger { background: #4b2027 !important; border-color: #90404c !important; color: #ffe4e6 !important; }
html[data-telpos-theme="dark"] .close { color: #e5edf8 !important; opacity: .82; text-shadow: none; }
html[data-telpos-theme="dark"] .close:hover,
html[data-telpos-theme="dark"] .close:focus { color: #fff !important; opacity: 1; }

html[data-telpos-theme="dark"] .btn-primary,
html[data-telpos-theme="dark"] .label-primary,
html[data-telpos-theme="dark"] .bg-light-blue { background-color: #1d4ed8 !important; border-color: #1e40af !important; color: #fff !important; }
html[data-telpos-theme="dark"] .btn-info,
html[data-telpos-theme="dark"] .label-info { background-color: #0e7490 !important; border-color: #155e75 !important; color: #fff !important; }
html[data-telpos-theme="dark"] .btn-success,
html[data-telpos-theme="dark"] .label-success { background-color: #047857 !important; border-color: #065f46 !important; color: #fff !important; }
html[data-telpos-theme="dark"] .btn-danger,
html[data-telpos-theme="dark"] .label-danger { background-color: #be123c !important; border-color: #9f1239 !important; color: #fff !important; }
html[data-telpos-theme="dark"] .btn-warning,
html[data-telpos-theme="dark"] .label-warning { background-color: #fbbf24 !important; border-color: #d97706 !important; color: #172033 !important; }
html[data-telpos-theme="dark"] .label.bg-light-green { color: #12351f !important; }

/* POS uses a dedicated full-screen layout with several light-only utility
 * backgrounds. Keep its cart, totals and checkout deck inside the same dark
 * visual system without weakening the colour-coded payment actions. */
html[data-telpos-theme="dark"] body.lockscreen .pos-cart-scroll-shell,
html[data-telpos-theme="dark"] body.lockscreen .pos_product_div,
html[data-telpos-theme="dark"] body.lockscreen #pos_table,
html[data-telpos-theme="dark"] body.lockscreen #pos_table > tbody,
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row,
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row > td,
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row > td > div {
    background: var(--telpos-dark-surface) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row .tw-rounded-full {
    background: #1b304b !important;
    box-shadow: inset 0 0 0 1px #405b7a !important;
    color: #7dd3fc !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row .tw-text-slate-600 {
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-empty-state-row .tw-text-slate-400 {
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] body.lockscreen #pos_table > thead > tr > th {
    background: var(--telpos-dark-surface-raised) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] body.lockscreen #pos_table tbody tr.product_row {
    background: var(--telpos-dark-surface) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen #pos_table tbody tr.product_row:hover {
    background: #203653 !important;
}
html[data-telpos-theme="dark"] body.lockscreen #pos_table .pos-unit-label {
    color: #b8c7da !important;
}
html[data-telpos-theme="dark"] body.lockscreen #pos_table .pos_line_total_text {
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .quantity-down,
html[data-telpos-theme="dark"] body.lockscreen .quantity-up {
    background: #1b304b !important;
    border-color: #405b7a !important;
    color: #d8f4ff !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -2px 0 rgba(0,0,0,.24) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals,
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_cell {
    background: var(--telpos-dark-surface-raised) !important;
    border-color: var(--telpos-dark-border) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_left {
    background: #17243a !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_right {
    background: linear-gradient(135deg, #0b3b48, #0f5b59) !important;
    border-color: #297875 !important;
    color: #ffffff !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_right * {
    color: #ffffff !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_value {
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos_form_totals .pos_totals_value--danger {
    color: #fda4af !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-form-actions {
    background:
        radial-gradient(circle at 66% -180%, rgba(50,184,180,.18), transparent 24rem),
        linear-gradient(110deg, #071426, #0d2139 62%, #123150) !important;
    border-color: #344c68 !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-form-actions .pos-footer-secondary > button {
    color: #dce8f6 !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-form-actions button:disabled {
    color: #93a4ba !important;
    opacity: .68 !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-form-actions .pos-footer-divider {
    background: #48617f !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-form-actions .pos-express-finalize[data-pay_method="cash"] {
    background: #047857 !important;
    border-color: #065f46 !important;
    color: #ffffff !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel,
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-body {
    background: var(--telpos-dark-surface) !important;
    border-color: var(--telpos-dark-divider) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .pos-card {
    background: var(--telpos-dark-surface-raised) !important;
    border-color: #3b4e69 !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .pos-card:hover,
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .pos-card.is-active {
    background: #203653 !important;
    border-color: #60a5fa !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .pos-card-name,
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .tw-text-slate-900 {
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .tw-text-slate-500 {
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] body.lockscreen .pos-drawer-panel .tw-bg-slate-100 {
    background: #1b304b !important;
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] body.lockscreen #featured_products_box:not(:empty) {
    background: #3c300f !important;
    border-color: #8a6b18 !important;
}
html[data-telpos-theme="dark"] body.lockscreen #featured_products_box:not(:empty)::before {
    color: #fcd34d !important;
}

/* Highcharts renders its own SVG colours, so these rules are a resilient
 * fallback while the JavaScript adapter supplies the canonical theme. */
html[data-telpos-theme="dark"] .highcharts-container,
html[data-telpos-theme="dark"] .highcharts-root,
html[data-telpos-theme="dark"] .highcharts-background,
html[data-telpos-theme="dark"] .highcharts-plot-background {
    background: transparent !important;
    fill: transparent !important;
}
html[data-telpos-theme="dark"] .highcharts-title,
html[data-telpos-theme="dark"] .highcharts-subtitle,
html[data-telpos-theme="dark"] .highcharts-axis-title,
html[data-telpos-theme="dark"] .highcharts-axis-labels text,
html[data-telpos-theme="dark"] .highcharts-legend-item text,
html[data-telpos-theme="dark"] .highcharts-data-label text,
html[data-telpos-theme="dark"] .highcharts-data-label span {
    color: var(--telpos-dark-text) !important;
    fill: var(--telpos-dark-text) !important;
    text-shadow: none !important;
}
html[data-telpos-theme="dark"] .highcharts-grid-line,
html[data-telpos-theme="dark"] .highcharts-axis-line,
html[data-telpos-theme="dark"] .highcharts-tick { stroke: #33445e !important; }
html[data-telpos-theme="dark"] .highcharts-tooltip-box { fill: #17243a !important; stroke: #48617f !important; }
html[data-telpos-theme="dark"] .highcharts-tooltip text,
html[data-telpos-theme="dark"] .highcharts-tooltip span { color: #f8fbff !important; fill: #f8fbff !important; }
html[data-telpos-theme="dark"] .highcharts-contextmenu,
html[data-telpos-theme="dark"] .highcharts-menu {
    background: #17243a !important;
    border-color: #3b4e69 !important;
    box-shadow: 0 14px 36px rgba(0,0,0,.4) !important;
}
html[data-telpos-theme="dark"] .highcharts-menu-item { background: #17243a !important; color: #e5edf8 !important; }
html[data-telpos-theme="dark"] .highcharts-menu-item:hover { background: #26415f !important; color: #fff !important; }

/* TinyMCE is used by product, notification and CMS forms. Its chrome and
 * editable iframe need explicit dark treatment because they do not inherit
 * application colours. The iframe document is handled by the JS adapter. */
html[data-telpos-theme="dark"] .tox-tinymce,
html[data-telpos-theme="dark"] .tox .tox-menubar,
html[data-telpos-theme="dark"] .tox .tox-toolbar,
html[data-telpos-theme="dark"] .tox .tox-toolbar-overlord,
html[data-telpos-theme="dark"] .tox .tox-toolbar__overflow,
html[data-telpos-theme="dark"] .tox .tox-toolbar__primary,
html[data-telpos-theme="dark"] .tox .tox-statusbar,
html[data-telpos-theme="dark"] .tox .tox-edit-area,
html[data-telpos-theme="dark"] .tox .tox-edit-area__iframe,
html[data-telpos-theme="dark"] .tox .tox-dialog,
html[data-telpos-theme="dark"] .tox .tox-dialog__header,
html[data-telpos-theme="dark"] .tox .tox-dialog__body,
html[data-telpos-theme="dark"] .tox .tox-dialog__footer,
html[data-telpos-theme="dark"] .tox .tox-menu,
html[data-telpos-theme="dark"] .tox .tox-collection {
    background-color: var(--telpos-dark-surface-muted) !important;
    border-color: var(--telpos-dark-border) !important;
    color: var(--telpos-dark-text) !important;
}
html[data-telpos-theme="dark"] .tox .tox-mbtn,
html[data-telpos-theme="dark"] .tox .tox-tbtn,
html[data-telpos-theme="dark"] .tox .tox-statusbar__path-item,
html[data-telpos-theme="dark"] .tox .tox-statusbar a,
html[data-telpos-theme="dark"] .tox .tox-collection__item {
    background: transparent !important;
    color: var(--telpos-dark-text-muted) !important;
}
html[data-telpos-theme="dark"] .tox .tox-mbtn:hover,
html[data-telpos-theme="dark"] .tox .tox-tbtn:hover,
html[data-telpos-theme="dark"] .tox .tox-tbtn--enabled,
html[data-telpos-theme="dark"] .tox .tox-collection__item--active {
    background: #203653 !important;
    color: var(--telpos-dark-text-strong) !important;
}
html[data-telpos-theme="dark"] .tox .tox-mbtn__select-label,
html[data-telpos-theme="dark"] .tox .tox-collection__item-label { color: inherit !important; }
html[data-telpos-theme="dark"] .tox .tox-tbtn svg,
html[data-telpos-theme="dark"] .tox .tox-mbtn svg { fill: var(--telpos-dark-text-muted) !important; }

html[data-telpos-theme="dark"] .nav-tabs,
html[data-telpos-theme="dark"] hr { border-color: #2a3952 !important; }
html[data-telpos-theme="dark"] .nav-tabs > li > a { color: #aebed3; }
html[data-telpos-theme="dark"] .nav-tabs > li.active > a,
html[data-telpos-theme="dark"] .nav-tabs > li.active > a:hover,
html[data-telpos-theme="dark"] .nav-tabs > li.active > a:focus { background: #142238; border-color: #2a3952; color: #fff; }
html[data-telpos-theme="dark"] .hms-nav > a { color: #b9c9dc !important; }
html[data-telpos-theme="dark"] .hms-nav > a:hover,
html[data-telpos-theme="dark"] .hms-nav > a.active {
    background: #20334f !important;
    color: #fff !important;
}

/* Semantic HMS states retain their meaning and contrast on dark surfaces. */
html[data-telpos-theme="dark"] .hms-badge.available,
html[data-telpos-theme="dark"] .hms-badge.paid { background: #123d31 !important; color: #86efc4 !important; }
html[data-telpos-theme="dark"] .hms-badge.occupied,
html[data-telpos-theme="dark"] .hms-badge.checked_in { background: #173b63 !important; color: #93c5fd !important; }
html[data-telpos-theme="dark"] .hms-badge.confirmed,
html[data-telpos-theme="dark"] .hms-badge.reserved { background: #34245f !important; color: #c4b5fd !important; }
html[data-telpos-theme="dark"] .hms-badge.pending,
html[data-telpos-theme="dark"] .hms-badge.partial,
html[data-telpos-theme="dark"] .hms-badge.cleaning,
html[data-telpos-theme="dark"] .hms-badge.due { background: #49360c !important; color: #fde68a !important; }
html[data-telpos-theme="dark"] .hms-badge.maintenance,
html[data-telpos-theme="dark"] .hms-badge.inactive,
html[data-telpos-theme="dark"] .hms-badge.cancelled,
html[data-telpos-theme="dark"] .hms-badge.no_show { background: #4b2027 !important; color: #fda4af !important; }
html[data-telpos-theme="dark"] .hms-guest-payment {
    background: #3d310f !important;
    border-left-color: #fbbf24 !important;
    color: #fff4c2 !important;
}
html[data-telpos-theme="dark"] .hms-guest-payment strong,
html[data-telpos-theme="dark"] .hms-guest-payment span { color: #fff4c2 !important; }
html[data-telpos-theme="dark"] .hms-extension-summary,
html[data-telpos-theme="dark"] .hms-mini-stat,
html[data-telpos-theme="dark"] .hms-room-row,
html[data-telpos-theme="dark"] .hms-extra-row,
html[data-telpos-theme="dark"] .hms-hotel-pos-summary span {
    background: #0f1b2d !important;
    border-color: #30415b !important;
    color: #dce6f4 !important;
}
html[data-telpos-theme="dark"] .hms-extension-summary .total { border-color: #30415b !important; color: #f3f7fc !important; }
html[data-telpos-theme="dark"] .hms-extension-choice label { border-color: #34445e !important; color: #dce6f4 !important; }
html[data-telpos-theme="dark"] .hms-extension-choice label:has(input:checked) { background: #173b63 !important; border-color: #60a5fa !important; color: #eff6ff !important; }

html[data-telpos-theme="dark"] .pagination > li > a,
html[data-telpos-theme="dark"] .pagination > li > span { background: #111c2e; border-color: #2a3952; color: #bcd0e9; }
html[data-telpos-theme="dark"] .daterangepicker,
html[data-telpos-theme="dark"] .datepicker,
html[data-telpos-theme="dark"] .popover { background: #111c2e; border-color: #2a3952; color: #dce6f4; }
html[data-telpos-theme="dark"] .daterangepicker td.off,
html[data-telpos-theme="dark"] .daterangepicker td.off.in-range,
html[data-telpos-theme="dark"] .daterangepicker td.off.start-date,
html[data-telpos-theme="dark"] .daterangepicker td.off.end-date { background: #0c1728; color: #62748e; }

html[data-telpos-theme="dark"] .telpos-theme-menu { background: #111c2e !important; border-color: #31415b !important; }
html[data-telpos-theme="dark"] .telpos-theme-menu button { color: #c6d4e6; }
html[data-telpos-theme="dark"] .telpos-theme-menu button:hover,
html[data-telpos-theme="dark"] .telpos-theme-menu button:focus,
html[data-telpos-theme="dark"] .telpos-theme-menu button.is-active { background: #1b2d49; color: #7ddcf0; }

html[data-telpos-theme="dark"] .telpos-theme-surface-button,
html[data-telpos-theme="dark"] .pos-header-shell,
html[data-telpos-theme="dark"] .pos-header-shell .tw-bg-white {
    background-color: #142238 !important;
    border-color: #34445e !important;
    color: #dce6f4 !important;
}
html[data-telpos-theme="dark"] .pos-header-shell p,
html[data-telpos-theme="dark"] .pos-header-shell strong,
html[data-telpos-theme="dark"] .pos-header-shell .tw-text-gray-600 { color: #dce6f4 !important; }
html[data-telpos-theme="dark"] body.lockscreen > .wrapper,
html[data-telpos-theme="dark"] body.lockscreen > .wrapper > .container-fluid { background-color: #0b1220 !important; }

/* Premium notification centre and persistent, action-required alerts. */
.telpos-notifications-menu .notifications_count {
    min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid rgba(255,255,255,.9);
    border-radius: 999px; background: #f59e0b !important; color: #172033 !important;
    font-size: 10px; font-weight: 800; line-height: 14px; box-shadow: 0 3px 10px rgba(15,23,42,.28);
}
.telpos-notifications-menu { position: relative; }
.navbar-nav > .notifications-menu > .dropdown-menu.telpos-notification-panel,
.telpos-notification-panel {
    top: calc(100% + 8px) !important; right: 0 !important; left: auto !important;
    width: 420px !important; min-width: 420px !important; max-width: calc(100vw - 24px) !important;
    margin-top: 0 !important; padding: 10px !important; overflow: hidden !important; border: 1px solid #dce4ee !important;
    border-radius: 18px !important; background: rgba(255,255,255,.98) !important;
    box-shadow: 0 22px 60px rgba(15,23,42,.22) !important; backdrop-filter: blur(18px);
}
.telpos-notification-panel > li { float: none !important; width: 100% !important; list-style: none; }
.telpos-notification-panel-heading { display: flex !important; align-items: center; gap: 11px; min-height: 62px; padding: 10px 10px 13px !important; border-bottom: 1px solid #e7edf4; }
.telpos-notification-panel-heading > span:last-child { display: grid; gap: 2px; }
.telpos-notification-panel-heading strong { color: #132238; font-size: 16px; line-height: 1.2; }
.telpos-notification-panel-heading small { color: #708198; font-size: 11px; font-weight: 500; }
.telpos-notification-panel-icon,
.telpos-notification-item-icon,
.telpos-notification-modal-icon,
.telpos-alert-icon {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg,#e1f8fb,#dcecff);
    color: #087da0; box-shadow: inset 0 0 0 1px rgba(8,125,160,.08);
}
.telpos-notification-panel #notifications_list {
    width: 100% !important; height: auto !important; max-height: 56vh !important; margin: 7px 0 0 !important; padding: 0 !important;
    overflow-x: hidden !important; overflow-y: auto !important;
}
.telpos-notification-item { float: none !important; width: 100% !important; margin: 4px 0; padding: 0 !important; border-radius: 13px; list-style: none; }
.telpos-notification-item > a { display: flex !important; align-items: flex-start; gap: 10px; padding: 11px !important; border-radius: inherit; color: #24364d !important; }
.telpos-notification-item > a:hover,
.telpos-notification-item > a:focus { background: #f1f6fb !important; text-decoration: none; }
.telpos-notification-item.unread > a { background: #eef8ff; box-shadow: inset 3px 0 0 #0ea5e9; }
.telpos-notification-item-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.telpos-notification-item-copy { display: grid !important; min-width: 0; flex: 1 1 auto; gap: 5px; }
.telpos-notification-item .notif-info { display: block; color: inherit; font-size: 12px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.telpos-notification-item .time { display: block; color: #7c8ba0; font-size: 10px; font-weight: 600; }
.telpos-notification-empty { display: grid; place-items: center; gap: 6px; padding: 38px 18px !important; color: #8290a3; }
.telpos-notification-empty i { font-size: 24px; color: #b0bdcd; }
.telpos-notification-empty strong { color: #4b5c72; }
.telpos-notification-empty span { font-size: 11px; }
.telpos-notification-more { margin-top: 8px; border-top: 1px solid #e7edf4 !important; }
.telpos-notification-more a { padding: 11px !important; color: #087da0 !important; font-weight: 750 !important; text-align: center; }

#telpos-persistent-notification {
    --alert-accent: #0891b2; --alert-soft: #e8f8fb; position: fixed; top: 76px; right: 22px; z-index: 10050;
    width: min(450px, calc(100vw - 30px)); padding: 18px; overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--alert-accent) 25%, #dce4ee); border-radius: 20px;
    background: rgba(255,255,255,.98); color: #1f2f45; box-shadow: 0 24px 70px rgba(15,23,42,.28);
    animation: telpos-alert-arrive .28s ease-out; backdrop-filter: blur(20px);
}
#telpos-persistent-notification::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--alert-accent); }
#telpos-persistent-notification[data-kind="success"] { --alert-accent: #059669; --alert-soft: #e8f8f1; }
#telpos-persistent-notification[data-kind="warning"] { --alert-accent: #d97706; --alert-soft: #fff7df; }
#telpos-persistent-notification[data-kind="error"] { --alert-accent: #dc2626; --alert-soft: #fff0f0; }
#telpos-persistent-notification[data-kind="new_order"] { --alert-accent: #7c3aed; --alert-soft: #f3edff; }
.telpos-alert-heading { display: flex; align-items: flex-start; gap: 12px; }
#telpos-persistent-notification .telpos-alert-icon { width: 43px; height: 43px; border-radius: 14px; background: var(--alert-soft); color: var(--alert-accent); font-size: 16px; }
.telpos-alert-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.telpos-alert-kicker { color: var(--alert-accent,#0891b2); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
#telpos-persistent-notification h4 { margin: 0; color: #132238; font-size: 17px; font-weight: 800; line-height: 1.3; }
#telpos-persistent-notification time { color: #8290a3; font-size: 10px; font-weight: 600; }
#telpos-persistent-notification .telpos-alert-message { margin: 13px 0 16px; color: #506178; font-size: 13px; line-height: 1.55; }
.telpos-alert-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.telpos-alert-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 10px; font-size: 11px; font-weight: 750; transition: transform .16s ease, background .16s ease; }
.telpos-alert-button:hover,.telpos-alert-button:focus { transform: translateY(-1px); text-decoration: none; }
.telpos-alert-button.subtle { background: transparent; color: #64748b; }
.telpos-alert-button.secondary { background: #edf3f8; color: #334155; }
.telpos-alert-button.primary { background: var(--alert-accent); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb,var(--alert-accent) 24%,transparent); }
@keyframes telpos-alert-arrive { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

.telpos-notification-modal .modal-content { overflow: hidden; border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(15,23,42,.3); }
.telpos-notification-modal .modal-header { display: flex; align-items: center; gap: 11px; padding: 18px 20px; border-color: #e5ebf2; }
.telpos-notification-modal .modal-header .close { margin-left: auto; order: 3; }
.telpos-notification-modal .modal-title { color: #132238; font-weight: 800; }
.telpos-notification-modal-item { padding: 5px 2px; }
.telpos-notification-modal-item header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.telpos-notification-modal-item h4 { margin: 0 0 10px; color: #203149; font-size: 15px; font-weight: 750; }
.telpos-notification-modal-item time { flex: 0 0 auto; color: #8795a8; font-size: 10px; }
.telpos-notification-modal-message { color: #506178; line-height: 1.55; }

html[data-telpos-theme="dark"] .telpos-notification-panel,
html[data-telpos-theme="dark"] #telpos-persistent-notification,
html[data-telpos-theme="dark"] .telpos-notification-modal .modal-content { background: rgba(15,27,45,.98) !important; border-color: #30415b !important; color: #dce6f4 !important; }
html[data-telpos-theme="dark"] .telpos-notification-panel-heading,
html[data-telpos-theme="dark"] .telpos-notification-more,
html[data-telpos-theme="dark"] .telpos-notification-modal .modal-header { border-color: #2d3e57 !important; }
html[data-telpos-theme="dark"] .telpos-notification-panel-heading strong,
html[data-telpos-theme="dark"] .telpos-notification-empty strong,
html[data-telpos-theme="dark"] #telpos-persistent-notification h4,
html[data-telpos-theme="dark"] .telpos-notification-modal .modal-title,
html[data-telpos-theme="dark"] .telpos-notification-modal-item h4 { color: #f2f7fd !important; }
html[data-telpos-theme="dark"] .telpos-notification-panel-heading small,
html[data-telpos-theme="dark"] .telpos-notification-item .time,
html[data-telpos-theme="dark"] #telpos-persistent-notification time,
html[data-telpos-theme="dark"] .telpos-notification-modal-item time { color: #91a4bd !important; }
html[data-telpos-theme="dark"] .telpos-notification-item > a { color: #d6e2f1 !important; }
html[data-telpos-theme="dark"] .telpos-notification-item > a:hover,
html[data-telpos-theme="dark"] .telpos-notification-item > a:focus { background: #1c2e48 !important; }
html[data-telpos-theme="dark"] .telpos-notification-item.unread > a { background: #17304d !important; }
html[data-telpos-theme="dark"] #telpos-persistent-notification .telpos-alert-message,
html[data-telpos-theme="dark"] .telpos-notification-modal-message { color: #bdcce0 !important; }
html[data-telpos-theme="dark"] .telpos-alert-button.subtle { color: #a9bad0; }
html[data-telpos-theme="dark"] .telpos-alert-button.secondary { background: #21344f; color: #e4edf8; }

@media (max-width: 600px) {
    .navbar-nav > .notifications-menu > .dropdown-menu.telpos-notification-panel,
    .telpos-notification-panel { position: fixed !important; top: 64px !important; right: 12px !important; width: calc(100vw - 24px) !important; min-width: 0 !important; max-width: none !important; }
    #telpos-persistent-notification { top: 66px; right: 12px; width: calc(100vw - 24px); padding: 15px; border-radius: 17px; }
    .telpos-alert-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .telpos-alert-button.subtle { grid-column: 1 / -1; order: 3; }
}

@media print {
    html[data-telpos-theme="dark"] { color-scheme: light; }
    html[data-telpos-theme="dark"] body,
    html[data-telpos-theme="dark"] #scrollable-container,
    html[data-telpos-theme="dark"] .box,
    html[data-telpos-theme="dark"] .panel,
    html[data-telpos-theme="dark"] .modal-content,
    html[data-telpos-theme="dark"] table { background: #fff !important; color: #111 !important; }
}
