/*
 * Tema Hub Conta — zonele de tip "hartie".
 *
 * RISE tine unele containere pe fundal deschis in orice tema: .invoice-preview-
 * container (previzualizarile si tiparirile de factura, proforma, estimat,
 * comanda, propunere, contract, abonament, extras de cont; 1E202D.css il face
 * #FFF !important) si .bg-all-white (editorul de propunere/contract; app.all.css
 * #fff !important). Pe hartie, textul trebuie sa ramana inchis, ca in tema
 * deschisa. Aici tema Hub Conta se retrage de pe hartie:
 *   1. fundalul hartiei ramane alb (regula .bg-white a temei nu il mai bate);
 *   2. textul mostenit e #444 — culoarea de hartie a RISE (1E202D:
 *      .invoice-preview-container table.header-style, si stilurile inline din
 *      *_pdf.php) — iar variabilele Bootstrap revin la valorile light;
 *   3. regulile de text ale temei (titluri, .text-muted, celule...) nu se aplica:
 *      mostenesc culoarea hartiei sau pe cea inline a documentului.
 * Componentele cu fundal propriu (butoane, badge-uri, dropdown) si culorile de
 * link, status si brand raman cele native.
 *
 * Fisierul se incarca in <head> si e legat de clasa hc-theme-dark de pe <html>,
 * pusa din cookie-ul hc_theme: ramane activ si pe paginile publice (care nu au
 * layout) si la tiparire (RISE inlocuieste continutul din <body>).
 * Generat din regulile de text ale hc_theme_dark.css — nu se editeaza manual.
 *
 * Varianta minimal dark (html.hc-theme-minimal-dark) are aceeasi structura, la
 * finalul fisierului, cu listele din regulile de text ale
 * hc_theme_minimal_dark.css. In plus revin pe valorile temei minimal deschise
 * variabilele pe care minimal dark le inverseaza (--app-*, link, primary).
 */

/* 1. Fundalul hartiei: nativ, .invoice-preview-container vine dupa .bg-white si
      castiga prin ordine; aici castiga prin specificitate, ca fisierul sta in
      <head>, inaintea hc_theme_dark.css. */
:where(html.hc-theme-dark) .invoice-preview-container.bg-white {
  background-color: #FFF !important;
}
/* .bg-light (1E202D il face suprafata inchisa) revine pe hartie la --bs-light
   deschis, resetat mai jos pe container. */
:where(html.hc-theme-dark) :is(.invoice-preview-container, .bg-all-white) .bg-light {
  background-color: rgba(var(--bs-light-rgb), var(--bs-bg-opacity, 1)) !important;
}

/* 2. Textul mostenit si variabilele Bootstrap (valorile light din bootstrap). */
:where(html.hc-theme-dark) :is(.invoice-preview-container, .bg-all-white) {
  color: #444;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
  --bs-body-bg-rgb: 255,255,255;
  --bs-body-color-rgb: 33,37,41;
  --bs-emphasis-color: #000;
  --bs-emphasis-color-rgb: 0,0,0;
  --bs-secondary-color: rgba(33, 37, 41, 0.75);
  --bs-secondary-bg: #e9ecef;
  --bs-secondary-bg-rgb: 233,236,239;
  --bs-tertiary-color: rgba(33, 37, 41, 0.5);
  --bs-tertiary-bg: #f8f9fa;
  --bs-tertiary-bg-rgb: 248,249,250;
  --bs-border-color: #dee2e6;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-light-text-emphasis: #495057;
  --bs-light-bg-subtle: #fcfcfd;
  --bs-light-border-subtle: #e9ecef;
}

/* Regula temei .table { --bs-table-bg: transparent } se retrage de pe hartie:
   celulele revin la fundalul Bootstrap, ca in tema deschisa. */
:where(html.hc-theme-dark) :is(.invoice-preview-container, .bg-all-white) .table {
  --bs-table-bg: var(--bs-body-bg);
}

/* 3. Regulile de text ale temei, neutralizate pe hartie (aceeasi importanta ca
      originalul; specificitatea hartiei le face sa castige). */
:where(html.hc-theme-dark) :is(.invoice-preview-container, .bg-all-white) :is(
  h1,
  h2,
  h3,
  h4,
  .sidebar-menu li a,
  .sidebar-menu li ul li a,
  .dropdown-item,
  .dropdown-menu:not(.notification-dropdown) .list-group-item:not(.inline-loader),
  #profile-image-section,
  .content-sidebar .list-group .list-group-item,
  .search-modal .help-search-box,
  #keyboard-shortcut-modal-form .bg-white,
  .init-chat-icon svg,
  .note-editor .dropdown-menu,
  .note-editor table tbody td,
  .note-editor table tbody tr,
  .datepicker-custom-selector:hover,
  .datepicker.dropdown-menu,
  .awesomplete ul li,
  .awesomplete ul li[aria-selected=true],
  table.dataTable thead th,
  table.header-style,
  .table-bordered > tbody > tr > td,
  .table-bordered > tbody > tr > th,
  .table-bordered > tfoot > tr > td,
  .table-bordered > tfoot > tr > th,
  .table-bordered > thead > tr > td,
  .table-bordered > thead > tr > th,
  .bootstrap-timepicker-widget table td a,
  .social-link,
  .tox .tox-menu .tox-collection__item,
  #pwa-install-message-iphone h4
) {
  color: inherit;
}

:where(html.hc-theme-dark) :is(.invoice-preview-container, .bg-all-white) :is(
  .text-bg-light,
  .dataTable:not(.js-selection-mode) tbody tr.active .badge,
  .dark,
  .text-off,
  .text-default,
  .widget-details h1,
  .settings .list-group-item:not(.active):hover,
  .settings .list-group-item:not(.active):focus,
  .settings .list-group-item:not(.active):active,
  .help-catagory .list-group-item:not(.active):hover,
  .help-catagory .list-group-item:not(.active):focus,
  .help-catagory .list-group-item:not(.active):active,
  .settings .list-group-item.active,
  .help-catagory .list-group-item.active,
  .btn-secondary,
  .btn-secondary:hover,
  .btn-secondary:active,
  .btn-secondary:focus,
  .btn-transparent,
  .color-white,
  .fc-button-group .fc-button-primary,
  .fc-toolbar-chunk .fc-button-primary,
  .dt-container .dt-paging .dt-paging-button a,
  .dt-info,
  td.option a:hover,
  .popover-body,
  .filter-section-container .datepicker-custom-selector,
  .datatable-tools .datepicker-custom-selector,
  .filter-section-container .filter-multi-select .dropdown-toggle,
  .filter-section-container .dynamic-range-filter .dropdown-toggle,
  .datatable-tools .filter-multi-select .dropdown-toggle,
  .datatable-tools .dynamic-range-filter .dropdown-toggle,
  .filter-multi-select .dropdown-toggle,
  .dynamic-range-filter .dropdown-toggle,
  .events-title-button.custom-toolbar .select2-container .select2-choice,
  .events-title-button.custom-toolbar .filter-multi-select .dropdown-toggle,
  .bg-primary,
  .white-link,
  .rounded-pill.bg-transparent,
  .badge.bg-transparent,
  .tox .tox-statusbar .tox-statusbar__wordcount,
  .tox .tox-statusbar .tox-statusbar__path-item,
  #tinymce,
  .automation-form .badge:hover,
  .text-muted,
  .mobile-bottom-menu .menu-item,
  .mobile-bottom-menu #mobile-function-button
) {
  color: inherit !important;
}

/* ═══ Varianta minimal dark (html.hc-theme-minimal-dark) ═══════════════════ */

/* 1. Fundalul hartiei (minimal dark face .bg-white suprafata inchisa). */
:where(html.hc-theme-minimal-dark) .invoice-preview-container.bg-white {
  background-color: #FFF !important;
}

/* 2. Textul mostenit si variabilele: Bootstrap pe valorile light, iar
      token-urile pe care minimal dark le inverseaza revin la tema minimal
      deschisa (f2f4f6.scss): text, titluri, link, primary si textul pe
      accent (--hc-text-pe-accent). */
:where(html.hc-theme-minimal-dark) :is(.invoice-preview-container, .bg-all-white) {
  color: #444;
  color-scheme: light;
  --bs-body-color: #212529;
  --bs-body-bg: #fff;
  --bs-body-bg-rgb: 255,255,255;
  --bs-body-color-rgb: 33,37,41;
  --bs-emphasis-color: #000;
  --bs-emphasis-color-rgb: 0,0,0;
  --bs-secondary-color: rgba(33, 37, 41, 0.75);
  --bs-secondary-bg: #e9ecef;
  --bs-secondary-bg-rgb: 233,236,239;
  --bs-tertiary-color: rgba(33, 37, 41, 0.5);
  --bs-tertiary-bg: #f8f9fa;
  --bs-tertiary-bg-rgb: 248,249,250;
  --bs-border-color: #dee2e6;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.175);
  --bs-primary-text-emphasis: #052c65;
  --bs-secondary-text-emphasis: #2b2f32;
  --bs-success-text-emphasis: #0a3622;
  --bs-info-text-emphasis: #055160;
  --bs-warning-text-emphasis: #664d03;
  --bs-danger-text-emphasis: #58151c;
  --bs-primary-bg-subtle: #cfe2ff;
  --bs-secondary-bg-subtle: #e2e3e5;
  --bs-success-bg-subtle: #d1e7dd;
  --bs-info-bg-subtle: #cff4fc;
  --bs-warning-bg-subtle: #fff3cd;
  --bs-danger-bg-subtle: #f8d7da;
  --bs-primary-border-subtle: #9ec5fe;
  --bs-secondary-border-subtle: #c4c8cb;
  --bs-success-border-subtle: #a3cfbb;
  --bs-info-border-subtle: #9eeaf9;
  --bs-warning-border-subtle: #ffe69c;
  --bs-danger-border-subtle: #f1aeb5;
  --bs-primary: #18181B;
  --bs-primary-rgb: 24, 24, 27;
  --hc-text-pe-accent: #FFF;
  --bs-link-color: #18181B;
  --bs-link-hover-color: #3F3F46;
  --app-text-color: #3F3F46;
  --app-heading-color: #18181B;
  --app-muted-color: #71717A;
  --app-link-color: #18181B;
  --app-placeholder-color: #A1A1AA;
  --bs-light: #f8f9fa;
  --bs-light-rgb: 248, 249, 250;
  --bs-light-text-emphasis: #495057;
  --bs-light-bg-subtle: #fcfcfd;
  --bs-light-border-subtle: #e9ecef;
}

/* Regula temei .table { --bs-table-bg: transparent } se retrage de pe hartie. */
:where(html.hc-theme-minimal-dark) :is(.invoice-preview-container, .bg-all-white) .table {
  --bs-table-bg: var(--bs-body-bg);
}

/* 3. Regulile de text ale temei, neutralizate pe hartie. */
:where(html.hc-theme-minimal-dark) :is(.invoice-preview-container, .bg-all-white) :is(
  .datepicker table tr td.highlighted,
  .datepicker table tr td.highlighted:focus,
  .datepicker table tr td.highlighted.focus,
  .datepicker table tr td.highlighted:hover,
  .datepicker table tr td.highlighted:active,
  .datepicker table tr td.highlighted.active,
  .datepicker table tr td.highlighted:active:hover,
  .datepicker table tr td.highlighted.active:hover,
  .datepicker table tr td.highlighted:active:focus,
  .datepicker table tr td.highlighted.active:focus,
  .datepicker table tr td.highlighted:active.focus,
  .datepicker table tr td.highlighted.active.focus,
  .datepicker table tr td.today,
  .datepicker table tr td.today:focus,
  .datepicker table tr td.today.focus,
  .datepicker table tr td.today:hover,
  .datepicker table tr td.today:active,
  .datepicker table tr td.today.active,
  .datepicker table tr td.today:active:hover,
  .datepicker table tr td.today.active:hover,
  .datepicker table tr td.today:active:focus,
  .datepicker table tr td.today.active:focus,
  .datepicker table tr td.today:active.focus,
  .datepicker table tr td.today.active.focus,
  .datepicker table tr td.range,
  .datepicker table tr td.range:focus,
  .datepicker table tr td.range.focus,
  .datepicker table tr td.range:hover,
  .datepicker table tr td.range:active,
  .datepicker table tr td.range.active,
  .datepicker table tr td.range:active:hover,
  .datepicker table tr td.range.active:hover,
  .datepicker table tr td.range:active:focus,
  .datepicker table tr td.range.active:focus,
  .datepicker table tr td.range:active.focus,
  .datepicker table tr td.range.active.focus,
  .datepicker table tr td.range.highlighted,
  .datepicker table tr td.range.highlighted:focus,
  .datepicker table tr td.range.highlighted.focus,
  .datepicker table tr td.range.highlighted:hover,
  .datepicker table tr td.range.highlighted:active,
  .datepicker table tr td.range.highlighted.active,
  .datepicker table tr td.range.highlighted:active:hover,
  .datepicker table tr td.range.highlighted.active:hover,
  .datepicker table tr td.range.highlighted:active:focus,
  .datepicker table tr td.range.highlighted.active:focus,
  .datepicker table tr td.range.highlighted:active.focus,
  .datepicker table tr td.range.highlighted.active.focus,
  .datepicker table tr td.range.today,
  .datepicker table tr td.range.today:focus,
  .datepicker table tr td.range.today.focus,
  .datepicker table tr td.range.today:hover,
  .datepicker table tr td.range.today:active,
  .datepicker table tr td.range.today.active,
  .datepicker table tr td.range.today:active:hover,
  .datepicker table tr td.range.today.active:hover,
  .datepicker table tr td.range.today:active:focus,
  .datepicker table tr td.range.today.active:focus,
  .datepicker table tr td.range.today:active.focus,
  .datepicker table tr td.range.today.active.focus,
  .bootstrap-timepicker-widget table td a,
  .atwho-view,
  .sidebar-menu li a:active,
  .sidebar-menu li a:hover,
  .sidebar-menu li a:focus,
  .sidebar-menu li ul li a:hover,
  .note-editor.note-standalone-content .note-editing-area .note-editable,
  .sticky-note,
  .mobile-bottom-menu .menu-item:hover .icon,
  .mobile-bottom-menu .menu-item.active .icon,
  .mobile-bottom-menu .menu-item.focus .icon,
  strong,
  b,
  .card-title,
  a:hover,
  a:focus,
  a:active,
  .navbar-custom .dropdown-toggle .user-name,
  .navbar-custom .user-name,
  .public-navbar .dropdown-toggle .user-name,
  .public-navbar .user-name,
  .sidebar-menu li a,
  .sidebar-menu li ul li a,
  .nav-tabs li a,
  .list-group-item.active,
  .list-group-item.active:focus,
  .list-group-item.active:hover,
  .btn-primary,
  .btn-info,
  .btn-primary svg,
  .btn-primary .icon,
  .btn-info svg,
  .btn-info .icon,
  .btn-default,
  .btn-light,
  .btn-outline-light,
  .btn-secondary,
  .circle-done,
  .app-alert.alert-success,
  .form-control,
  .form-select,
  .general-form .form-control,
  .input-group-text,
  .select2-container .select2-choice,
  .select2-container .select2-choices,
  .select2-container-multi .select2-choices,
  .select2-results .select2-highlighted,
  .select2-container-multi .select2-choices .select2-search-choice,
  .dropdown-item,
  .dropdown-item:hover,
  .dropdown-item:focus,
  .dropdown-item.active,
  .dropdown-item:active,
  .table thead th,
  table.dataTable thead th,
  .page-link,
  .init-chat-icon,
  .init-chat-icon svg,
  .init-chat-icon .icon,
  .init-chat-icon.has-message,
  .init-chat-icon.has-message svg,
  .init-chat-icon.has-message .icon,
  .page-wrapper > .bg-primary.card.rounded-bottom-0,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 h1,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 h4,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .btn-transparent,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .btn-transparent:hover,
  #settings-left-menu-accordion .settings-anchor,
  #template-list-box .settings-anchor,
  .help-catagory.list-group .list-group-item,
  .help-catagory.list-group .list-group-item:hover,
  .help-catagory.list-group .list-group-item.active,
  .btn-success,
  .chat-tab .btn,
  .message-row.unread strong,
  .message-row.unread span,
  .chat-other .chat-msg,
  .chat-me .chat-msg,
  .chat-me .chat-msg a,
  #js-ai-chat-messages-container .chat-me .chat-msg,
  #js-ai-chat-messages-container .chat-me .chat-msg a,
  #js-ai-chat-messages-container .chat-other .chat-msg,
  #js-ai-chat-messages-container .chat-msg code,
  .ai-response-container,
  .dt-buttons .btn,
  .dt-buttons .btn span,
  .widget-details span,
  a.dark,
  .kanban-col .kanban-col-title,
  .btn.btn-default,
  .btn.datepicker-custom-selector,
  .app-popover .list-group-item,
  .app-popover .list-group-item:hover,
  .search-modal .select2-container.form-control .select2-choice,
  .search-modal .select2-choice,
  .search-modal .help-search-box,
  .search-modal .help-search-box:focus,
  .search-modal .help-search-box:hover,
  .awesomplete ul li,
  .awesomplete ul li[aria-selected=true],
  #pwa-install-message-iphone,
  .bg-success
) {
  color: inherit;
}

:where(html.hc-theme-minimal-dark) :is(.invoice-preview-container, .bg-all-white) :is(
  .text-bg-light,
  .badge.badge-default,
  .mobile-bottom-menu #mobile-function-button:hover .icon,
  .mobile-bottom-menu #mobile-function-button.active .icon,
  .mobile-bottom-menu #mobile-function-button.focus .icon,
  .text-muted,
  .text-secondary,
  small,
  .navbar-custom .nav-link,
  .navbar-custom .navbar-nav .nav-link,
  .public-navbar .nav-link,
  .public-navbar .navbar-nav .nav-link,
  .navbar-custom .nav-link:hover,
  .navbar-custom .nav-link:focus,
  .navbar-custom .navbar-nav .nav-link:hover,
  .navbar-custom .navbar-nav .nav-link:focus,
  .public-navbar .nav-link:hover,
  .public-navbar .nav-link:focus,
  .public-navbar .navbar-nav .nav-link:hover,
  .public-navbar .navbar-nav .nav-link:focus,
  .sidebar-menu li a:active,
  .sidebar-menu li a:hover,
  .sidebar-menu li a:focus,
  .sidebar-menu li ul li.active > a,
  .sidebar-menu li.active > a,
  .sidebar-menu li.main.active > a,
  .widget-icon,
  .widget-icon[class*=bg-],
  .widget-icon svg,
  .widget-icon .icon,
  .widget-icon[class*=bg-] svg,
  .widget-icon[class*=bg-] .icon,
  .nav-tabs li a:hover,
  .nav-tabs li a:focus,
  .nav-tabs li a:active,
  .nav-tabs li .active,
  .nav-tabs li.active,
  .btn-primary:hover,
  .btn-primary:active,
  .btn-primary:focus,
  .btn-primary.active,
  .btn-info:hover,
  .btn-info:active,
  .btn-info:focus,
  .btn-info.active,
  .btn-default:hover,
  .btn-default:active,
  .btn-default:focus,
  .btn-default.active,
  .btn-light:hover,
  .btn-light:active,
  .btn-light:focus,
  .btn-light.active,
  .btn-outline-light:hover,
  .btn-outline-light:active,
  .btn-outline-light:focus,
  .btn-outline-light.active,
  .btn-secondary:hover,
  .btn-secondary:active,
  .btn-secondary:focus,
  .text-primary,
  .dataTable:not(.js-selection-mode) tbody tr.active td,
  .dataTable:not(.js-selection-mode) tbody tr.active:hover td,
  .dataTable:not(.js-selection-mode) tbody tr.active .badge,
  .dt-container .dt-paging .dt-paging-button.active .page-link,
  .page-item.active .page-link,
  .pagination > .active > a,
  .atwho-view .cur,
  .note-hint-group .active,
  .note-hint-item:hover,
  .fc-button-primary,
  .fc-button,
  .init-chat-icon .cart-badge.badge,
  .badge.bg-primary,
  .badge.bg-secondary,
  .badge.bg-success,
  .badge.bg-info,
  .badge.bg-warning,
  .alert-warning,
  .install-pwa-button,
  .alert-warning a,
  .alert-warning svg,
  .alert-warning .icon,
  .install-pwa-button a,
  .install-pwa-button svg,
  .install-pwa-button .icon,
  .badge.bg-danger,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 p,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 label:not(.badge),
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .box-content,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .color-white,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .white-link,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .profile-image-upload,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .profile-image-upload .btn,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .social-link,
  .page-wrapper > .bg-primary.card.rounded-bottom-0 .social-link:hover,
  .btn:where(:not(.btn-primary, .btn-info, .btn-danger, .btn-success)).active,
  .btn:where(:not(.btn-primary, .btn-info, .btn-danger, .btn-success)):first-child:active,
  .btn:where(:not(.btn-primary, .btn-info, .btn-danger, .btn-success)).show,
  :not(.btn-check) + .btn:where(:not(.btn-primary, .btn-info, .btn-danger, .btn-success)):active,
  .btn-check:checked + .btn:where(:not(.btn-primary)),
  .btn-success:hover,
  .btn-success:active,
  .btn-success:focus,
  .btn-success.active,
  .btn-danger.active,
  .btn-danger:first-child:active,
  .selection-handler-dropdown-btn.active,
  .chat-tab .btn.active,
  .chat-tab .btn:hover,
  .chat-tab .btn:focus,
  .chat-tab .btn:active,
  .text-warning,
  .dt-info,
  .app-popover .list-group-item.active
) {
  color: inherit !important;
}
