/* SmartCart v138 – geräteabhängiges Hell/Dunkel/System-Farbschema */
:root{--sc-muted-2:#888;--sc-border:#aaa;--sc-divider:#bbb;
}
html[data-theme="dark"]{--sc-muted-2:#aaa;--sc-border:#555;--sc-divider:#484848;
 color-scheme:dark;
}
html[data-theme="dark"],html[data-theme="dark"] body{background:#181818!important;color:#f1f1f1!important}
html[data-theme="dark"] body,
html[data-theme="dark"] main{color:#f1f1f1}

/* Kopf-/Werkzeugbereiche und normale Flächen */
html[data-theme="dark"] .syncbar,
html[data-theme="dark"] .top,
html[data-theme="dark"] .tools,
html[data-theme="dark"] .article-tools,
html[data-theme="dark"] .store-tools,
html[data-theme="dark"] header:not(.store-header) {background:#181818!important;color:#f1f1f1!important}
html[data-theme="dark"] .syncbar::after{background:#181818!important}
html[data-theme="dark"] .syncbar::before{background:linear-gradient(to bottom,rgba(24,24,24,1),rgba(24,24,24,0))!important}
html[data-theme="dark"] .bottom-fade{background:linear-gradient(to bottom,rgba(24,24,24,0),rgba(24,24,24,1))!important}

/* Panels, Karten, Modale und normale Inhaltsflächen */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .dialog,
html[data-theme="dark"] .quick-link {background:#222!important;color:#f1f1f1!important;border-color:#484848!important}

html[data-theme="dark"] .quick-link input[readonly]{background:#252525!important;color:#ddd!important}
html[data-theme="dark"] .input-wrap{background:#292929!important;border-color:#555!important}
html[data-theme="dark"] #reducedRate,
html[data-theme="dark"] #standardRate{background:transparent!important}

/* Auswahlsegmente */
html[data-theme="dark"] .status-choice,
html[data-theme="dark"] .choice{background:#222!important;border-color:#666!important}
html[data-theme="dark"] .status-choice button:not(.active),
html[data-theme="dark"] .choice button:not(.active){background:#292929!important;color:#f1f1f1!important;border-color:#666!important}


/* Textfarben und Trennlinien */
html[data-theme="dark"] .hint,
html[data-theme="dark"] .note,
html[data-theme="dark"] .status,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .info-label,
html[data-theme="dark"] .grid label,
html[data-theme="dark"] .color-field label,
html[data-theme="dark"] .status-legend {color:#aaa!important}
html[data-theme="dark"] .option+.option,
html[data-theme="dark"] .color-setting+.color-setting,
html[data-theme="dark"] .section,
html[data-theme="dark"] .row.separator,
html[data-theme="dark"] .list-display-divider,
html[data-theme="dark"] .top{border-color:#484848!important}

/* Suchfelder */
html[data-theme="dark"] .article-search,
html[data-theme="dark"] .store-search,
html[data-theme="dark"] .search:has(> input[type="search"]),
html[data-theme="dark"] .list-search-wrap{background:#292929!important}
html[data-theme="dark"] .article-search>svg,
html[data-theme="dark"] .store-search>svg,
html[data-theme="dark"] .search>svg{stroke:#bbb!important}
html[data-theme="dark"] .article-search-clear,
html[data-theme="dark"] .store-search-clear,
html[data-theme="dark"] .list-search-clear,
html[data-theme="dark"] .clear{color:#bbb!important}

/* Listen: Text/Icon dunkelmodusfähig, benutzerdefinierte Geschäftsfarben bleiben unangetastet */
html[data-theme="dark"] .name-btn,
html[data-theme="dark"] .icon-only,
html[data-theme="dark"] .drag-handle {color:#f1f1f1}
html[data-theme="dark"] .icon-only:active{background:#333!important}
html[data-theme="dark"] .row:not(.ruler):not(.marked):not(.completed-row){background:transparent}
html[data-theme="dark"] .row.ruler{background:#242424}


/* Vorschauen und Medien */
html[data-theme="dark"] .photo-preview,
html[data-theme="dark"] .photo-preview img{background:#222!important;border-color:#555!important}
html[data-theme="dark"] .logo-preview{
 background-color:#292929!important;
 background-image:
  linear-gradient(45deg,#3a3a3a 25%,transparent 25%),
  linear-gradient(-45deg,#3a3a3a 25%,transparent 25%),
  linear-gradient(45deg,transparent 75%,#3a3a3a 75%),
  linear-gradient(-45deg,transparent 75%,#3a3a3a 75%)!important;
 background-size:20px 20px!important;
 background-position:0 0,0 10px,10px -10px,-10px 0!important;
 border-color:#555!important;
}
html[data-theme="dark"] .logo-preview img{background:transparent!important}
html[data-theme="dark"] .preview{border-color:#555!important}

/* Schalter */
html[data-theme="dark"] .smart-switch-track{background:#444;border-color:#666}
html[data-theme="dark"] .smart-switch-text{color:#ccc}
html[data-theme="dark"] .smart-switch-track::before{background:#ddd}

/* Neutrale weiße Buttons, ohne semantische Farbbuttons zu verändern */
html[data-theme="dark"] button:not(.smartcart-btn-primary):not(.smartcart-btn-delete):not(.smartcart-btn-cancel):not(.smartcart-btn-reset):not(.smartcart-btn-load):not(.header-settings):not(.list-search-toggle):not(.round):not(.icon-only):not(.clear):not(.article-search-clear):not(.store-search-clear):not(.list-search-clear):not(.status-choice-button):not([data-status-mode]):not([data-search-mode]):not([data-info-mode]):not([data-empty-mode]):not([data-eye-position]):not([data-completed-display]):not([data-theme-mode]){
 border-color:#666;
}
html[data-theme="dark"] .secondary{background:#292929!important;color:#f1f1f1!important;border-color:#666!important}

/* Darstellung-Muster */
html[data-theme="dark"] .search-field-sample{background:#292929;border-color:#666}
html[data-theme="dark"] .search-field-sample::after{background:#777}
html[data-theme="dark"] .status-phone-sample,
html[data-theme="dark"] .eye-position-phone{border-color:#aaa}

/* Tabellen */
html[data-theme="dark"] table{color:#f1f1f1}
html[data-theme="dark"] th,
html[data-theme="dark"] td{border-color:#484848!important}
html[data-theme="dark"] th{color:#ddd}

/* Neutrale Standardbuttons im Darkmode */
html[data-theme="dark"] .smartcart-btn:not(.smartcart-btn-primary):not(.smartcart-btn-delete):not(.smartcart-btn-cancel):not(.smartcart-btn-reset):not(.smartcart-btn-load):not(.smartcart-btn-rotate):not(.smartcart-btn-blue){
 background:#333!important;color:#f1f1f1!important;border-color:#666!important;
}

/* v140: Erledigt-Durchstreichung im Darkmode mit hohem Kontrast */
html[data-theme="dark"] .inline-completed .hand-strike{
  background:#ff2020!important;
}

/* v141: Lesbare Verwaltungs-/Unterseitenlisten im Darkmode */
html[data-theme="dark"] .article-open,
html[data-theme="dark"] .store-open,
html[data-theme="dark"] .name-btn,
html[data-theme="dark"] .unit-block,
html[data-theme="dark"] .unit-block input,
html[data-theme="dark"] .row-inner,
html[data-theme="dark"] .item-title,
html[data-theme="dark"] .article-label-main,
html[data-theme="dark"] .item-name{
  color:#f1f1f1!important;
}
html[data-theme="dark"] .article-price-icon,
html[data-theme="dark"] .store-priority,
html[data-theme="dark"] .store-drag,
html[data-theme="dark"] .drag-handle,
html[data-theme="dark"] .arrow,
html[data-theme="dark"] .item-price,
html[data-theme="dark"] .label-note,
html[data-theme="dark"] .article-label-note,
html[data-theme="dark"] .item-labels,
html[data-theme="dark"] .item-info,
html[data-theme="dark"] .slot-meta,
html[data-theme="dark"] .room,
html[data-theme="dark"] .separator-preview,
html[data-theme="dark"] .amount-wrap span,
html[data-theme="dark"] .input-wrap span{
  color:#b8b8b8!important;
}
html[data-theme="dark"] .article-open:active,
html[data-theme="dark"] .store-open:active,
html[data-theme="dark"] .store-drag:active{background:#303030!important}

/* Listen/Karten, die im Hellmodus explizit weiß sind */
html[data-theme="dark"] .deposit-row,
html[data-theme="dark"] .sum-header,
html[data-theme="dark"] .calc-footer {
  background:#222!important;
  color:#f1f1f1!important;
  border-color:#555!important;
}


html[data-theme="dark"] .empty{
  color:#aaa!important;
  border-color:#555!important;
}
html[data-theme="dark"] #list .calc-row .counter input.counter-value.zero{
  color:#aaa!important;
  -webkit-text-fill-color:#aaa!important;
}

/* Buttons/Controls innerhalb der Listen */
html[data-theme="dark"] .back-btn,
html[data-theme="dark"] .reset-btn:not(.smartcart-btn-reset):not(.smartcart-danger-action),
html[data-theme="dark"] .separator-add-btn,
html[data-theme="dark"] .actions button:not(.primary):not(.delete-article):not(.smartcart-btn-primary):not(.smartcart-btn-delete):not(.smartcart-btn-rotate):not(.smartcart-btn-blue),
html[data-theme="dark"] .modal-actions button:not(.primary):not(.delete):not(.smartcart-btn-primary):not(.smartcart-btn-delete):not(.smartcart-btn-rotate):not(.smartcart-btn-blue){
  background:#292929!important;
  color:#f1f1f1!important;
  border-color:#666!important;
}

/* Formularsegmente in Artikel-/Verwaltungsseiten */
html[data-theme="dark"] .add,
html[data-theme="dark"] .tax-switch{
 background:#222!important;
 color:#f1f1f1!important;
 border-color:#555!important;
}
html[data-theme="dark"] .tax-switch > button:not(.active):not(.selected):not([aria-pressed="true"]){
 background:#222!important;
 color:#f1f1f1!important;
 border-color:#555!important;
}

/* v142: Einstellungen und geheimes Diagnosefenster */
html[data-theme="dark"] .menu a,
html[data-theme="dark"] .menu .icon,
html[data-theme="dark"] .secret-info,
html[data-theme="dark"] .secret-info .label,
html[data-theme="dark"] .secret-info .value,
html[data-theme="dark"] .secret-info .secret-database a{
  color:#f1f1f1!important;
}
html[data-theme="dark"] .menu .arrow,
html[data-theme="dark"] .secret-info .secret-database .arrow,
html[data-theme="dark"] .secret-resync-status{
  color:#b8b8b8!important;
}
html[data-theme="dark"] .menu a{border-bottom-color:#484848!important}
html[data-theme="dark"] .hidden-panel{
  background:#222!important;
  color:#f1f1f1!important;
  border-color:#555!important;
}
html[data-theme="dark"] .secret-info,
html[data-theme="dark"] .secret-info .secret-separator{
  border-color:#484848!important;
}
html[data-theme="dark"] .secret-info .copy-url-btn{
  background:#292929!important;
  color:#f1f1f1!important;
  border-color:#666!important;
}
html[data-theme="dark"] .secret-resync-btn{
  background:#c62828!important;
  color:#fff!important;
  border-color:#c62828!important;
}

/* v146: Semantische Artikelzeilen behalten ihre berechnete Kontrastfarbe.
   Die allgemeinen Darkmode-Listenregeln dürfen Markiert/Nicht-kaufen nicht überstimmen. */
html[data-theme="dark"] .items li.item-highlighted .item-title,
html[data-theme="dark"] .items li.item-highlighted .item-name,
html[data-theme="dark"] .items li.item-highlighted .item-info,
html[data-theme="dark"] .items li.item-highlighted .item-labels,
html[data-theme="dark"] .items li.item-highlighted .item-qty,
html[data-theme="dark"] .items li.item-highlighted .drag-handle,
html[data-theme="dark"] .items li.item-highlighted .edit-handle,
html[data-theme="dark"] .items li.item-highlighted .restore-handle,
html[data-theme="dark"] .items li.item-do-not-buy-warning .item-title,
html[data-theme="dark"] .items li.item-do-not-buy-warning .item-name,
html[data-theme="dark"] .items li.item-do-not-buy-warning .item-info,
html[data-theme="dark"] .items li.item-do-not-buy-warning .item-labels,
html[data-theme="dark"] .items li.item-do-not-buy-warning .item-qty,
html[data-theme="dark"] .items li.item-do-not-buy-warning .drag-handle,
html[data-theme="dark"] .items li.item-do-not-buy-warning .edit-handle,
html[data-theme="dark"] .items li.item-do-not-buy-warning .restore-handle{
  color:inherit!important;
}

/* v148: zentrale Formular-Farbvariablen */

:root{
 --sc-field-bg:#fff;
 --sc-field-text:#262626;
 --sc-field-border:#aaa;
}
html[data-theme="dark"]{
 --sc-field-bg:#292929;
 --sc-field-text:#f1f1f1;
 --sc-field-border:#555;
}

/* v154: einheitliche Formularbeschriftungen */
.sc-field-label,
.sc-field-label label{
  color:#555!important;
  font-size:.82rem;
  font-weight:600;
}
.sc-field-comment,
.sc-field-label .sc-field-comment{
  color:#777!important;
  font-size:.78rem;
  font-weight:400;
}
html[data-theme="dark"] .sc-field-label,
html[data-theme="dark"] .sc-field-label label{
  color:#d8d8d8!important;
}
html[data-theme="dark"] .sc-field-comment,
html[data-theme="dark"] .sc-field-label .sc-field-comment{
  color:#9e9e9e!important;
}

/* v155: Formular-Feldtitel vollständig vereinheitlichen */
.sc-field-label,
.sc-field-label label,
.sc-field-title {
  color:#555!important;
  font-size:.82rem;
  font-weight:600;
}
.sc-field-comment,
.sc-field-label .sc-field-comment,
.sc-field-title .sc-field-comment{
  color:#777!important;
  font-size:.78rem;
  font-weight:400;
}
html[data-theme="dark"] .sc-field-label,
html[data-theme="dark"] .sc-field-label label,
html[data-theme="dark"] .sc-field-title {
  color:#d8d8d8!important;
}
html[data-theme="dark"] .sc-field-comment,
html[data-theme="dark"] .sc-field-label .sc-field-comment,
html[data-theme="dark"] .sc-field-title .sc-field-comment{
  color:#9e9e9e!important;
}

/* v158: Artikel-Formulare – feste Typografie und dezenter Steuersatzschalter */
html[data-theme="light"] body.article-form .sc-field-label,
html[data-theme="light"] body.article-form .sc-field-label > .sc-field-title,
html[data-theme="light"] body.article-form .tax-field > .sc-field-title{
  color:#555!important;
}
html[data-theme="dark"] body.article-form .sc-field-label,
html[data-theme="dark"] body.article-form .sc-field-label > .sc-field-title,
html[data-theme="dark"] body.article-form .tax-field > .sc-field-title{
  color:#d8d8d8!important;
}
body.article-form .sc-field-label,
body.article-form .sc-field-label > .sc-field-title,
body.article-form .tax-field > .sc-field-title{
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.2!important;
}
body.article-form .sc-field-comment{
  font-size:12px!important;
  font-weight:400!important;
  line-height:1.2!important;
}
html[data-theme="light"] body.article-form .sc-field-comment{color:#777!important}
html[data-theme="dark"] body.article-form .sc-field-comment{color:#9e9e9e!important}

/* Steuersatz: Auswahl nur über eine etwas hellere Fläche, ohne blauen Balken. */
body.article-form .tax-switch button{
  font-size:14px!important;
}
body.article-form .tax-switch button .rate{
  font-size:11px!important;
}
body.article-form .tax-switch button.active,
body.article-form .tax-switch button[aria-pressed="true"],
body.article-form .tax-switch button.selected{
  box-shadow:none!important;
}


html[data-theme="dark"] body.article-form .tax-switch button.active .rate,
html[data-theme="dark"] body.article-form .tax-switch button[aria-pressed="true"] .rate,
html[data-theme="dark"] body.article-form .tax-switch button.selected .rate{
  color:#c0c0c0!important;
}

/* v159: Geschäftsformulare – gleiche Typografie-Systematik wie Artikel */
html[data-theme="light"] body.store-form .sc-field-label,
html[data-theme="light"] body.store-form .sc-field-title{
  color:#555!important;
}
html[data-theme="dark"] body.store-form .sc-field-label:not(.store-theme-color-set-light *),
html[data-theme="dark"] body.store-form .sc-field-title:not(.store-theme-color-set-light *){
  color:#d8d8d8!important;
}
body.store-form .sc-field-label,
body.store-form .sc-field-title{
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.2!important;
}
body.store-form .sc-field-comment,
body.store-form .hint{
  font-size:12px!important;
  font-weight:400!important;
  line-height:1.2!important;
}
html[data-theme="light"] body.store-form .sc-field-comment,
html[data-theme="light"] body.store-form .hint{
  color:#777!important;
}
html[data-theme="dark"] body.store-form .sc-field-comment,
html[data-theme="dark"] body.store-form .hint{
  color:#9e9e9e!important;
}

/* v160: Artikelformulare – Abbrechen und Hauptlisten-Dialoge vereinheitlichen */
body.article-form .header-actions .secondary,
body.article-form .header-actions .cancel,
body.article-form .header-actions button:not(.primary):not(.smartcart-btn-primary){
  border:1px solid #555!important;
}
html[data-theme="light"] body.article-form .header-actions .secondary,
html[data-theme="light"] body.article-form .header-actions .cancel,
html[data-theme="light"] body.article-form .header-actions button:not(.primary):not(.smartcart-btn-primary){
  border-color:#b5b5b5!important;
}
html[data-theme="dark"] body.article-form .header-actions .secondary,
html[data-theme="dark"] body.article-form .header-actions .cancel,
html[data-theme="dark"] body.article-form .header-actions button:not(.primary):not(.smartcart-btn-primary){
  border-color:#4f4f4f!important;
}

/* Hauptliste: Add-/Bearbeiten-Dialoge verwenden dieselbe Formular-Typografie. */
body.main-form-dialog .modal label,
body.main-form-dialog .modal .field-label,
body.main-form-dialog .modal .sc-field-label,
body.main-form-dialog .modal .sc-field-title{
  font-size:13px!important;
  font-weight:600!important;
  line-height:1.2!important;
}
body.main-form-dialog .modal .label-note,
body.main-form-dialog .modal .hint,
body.main-form-dialog .modal .sc-field-comment{
  font-size:12px!important;
  font-weight:400!important;
  line-height:1.2!important;
}
html[data-theme="light"] body.main-form-dialog .modal label,
html[data-theme="light"] body.main-form-dialog .modal .field-label,
html[data-theme="light"] body.main-form-dialog .modal .sc-field-label,
html[data-theme="light"] body.main-form-dialog .modal .sc-field-title{
  color:#555!important;
}
html[data-theme="dark"] body.main-form-dialog .modal label,
html[data-theme="dark"] body.main-form-dialog .modal .field-label,
html[data-theme="dark"] body.main-form-dialog .modal .sc-field-label,
html[data-theme="dark"] body.main-form-dialog .modal .sc-field-title{
  color:#d8d8d8!important;
}
html[data-theme="light"] body.main-form-dialog .modal .label-note,
html[data-theme="light"] body.main-form-dialog .modal .hint,
html[data-theme="light"] body.main-form-dialog .modal .sc-field-comment{color:#777!important}
html[data-theme="dark"] body.main-form-dialog .modal .label-note,
html[data-theme="dark"] body.main-form-dialog .modal .hint,
html[data-theme="dark"] body.main-form-dialog .modal .sc-field-comment{color:#9e9e9e!important}

/* Artikelname im Hauptlisten-Dialog muss im Darkmode lesbar sein. */
html[data-theme="dark"] body.main-form-dialog .modal input,
html[data-theme="dark"] body.main-form-dialog .modal textarea,
html[data-theme="dark"] body.main-form-dialog .modal select{
  color:#f1f1f1!important;
  -webkit-text-fill-color:#f1f1f1!important;
}

/* v164: einheitliche Plus-/Minus-Symbolfarben programmweit */
.smartcart-plus-tint{
  color:#62b875!important;
  -webkit-text-fill-color:#62b875!important;
}
.smartcart-minus-tint{
  color:#cf7777!important;
  -webkit-text-fill-color:#cf7777!important;
}
html[data-theme="dark"] .smartcart-plus-tint{
  color:#8bd39a!important;
  -webkit-text-fill-color:#8bd39a!important;
}
html[data-theme="dark"] .smartcart-minus-tint{
  color:#e79a9a!important;
  -webkit-text-fill-color:#e79a9a!important;
}

/* v165: Hauptliste – fester Artikelname im Bearbeiten-Dialog */
html[data-theme="light"] body.main-form-dialog #addModal .article-name-fixed{
  color:#262626!important;
  -webkit-text-fill-color:#262626!important;
}
html[data-theme="dark"] body.main-form-dialog #addModal .article-name-fixed{
  color:#f1f1f1!important;
  -webkit-text-fill-color:#f1f1f1!important;
}
