/* =========================
   MODE NUIT — overrides
   Activé via html[data-theme="dark"]
========================= */

html[data-theme="dark"] body {
    background: #15171e;
    color: #dde3ef;
}

/* ── Header ──────────────────────────────────── */

html[data-theme="dark"] header {
    background: #1a1e28;
    border-bottom: 1px solid #2a2f3e;
}

html[data-theme="dark"] footer {
    background: #1a1e28 !important;
    color: #7a8298;
}

/* ── Dropdowns nav ───────────────────────────── */

html[data-theme="dark"] .dropdown-menu::after {
    background: #1e2230;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

html[data-theme="dark"] .dropdown-menu a {
    color: #dde3ef;
}

html[data-theme="dark"] .dropdown-menu a:hover {
    background: #252a38;
    color: #fff;
}

/* ── Search dropdown ─────────────────────────── */

html[data-theme="dark"] .search-dropdown {
    background: #1e2230;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

html[data-theme="dark"] .search-item {
    color: #dde3ef;
}

html[data-theme="dark"] .search-item:hover {
    background: #252a38;
}

html[data-theme="dark"] .search-item mark {
    background: #4a3e00;
    color: #fde68a;
}

html[data-theme="dark"] .search-thumb-placeholder {
    background: #252a38;
}

/* ── User / structure dropdowns ──────────────── */

html[data-theme="dark"] .dropdown-content::after,
html[data-theme="dark"] .structure-dropdown::after {
    background: #1e2230;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}

html[data-theme="dark"] .dropdown-company {
    background: #252a38;
    color: #dde3ef;
}

html[data-theme="dark"] .dropdown-divider {
    background: #2d3347;
}

html[data-theme="dark"] .dropdown-content a {
    color: #dde3ef;
}

html[data-theme="dark"] .dropdown-content a:hover {
    background: #252a38;
}

html[data-theme="dark"] .dropdown-item-btn {
    color: #dde3ef;
}

html[data-theme="dark"] .dropdown-item-btn:hover {
    background: #252a38;
}

html[data-theme="dark"] .dropdown-item-link {
    color: #9aa0b4;
}

html[data-theme="dark"] .dropdown-item-link:hover {
    background: #252a38;
}

html[data-theme="dark"] .dropdown-section-title {
    color: #5a6070;
}

/* ── Tables ──────────────────────────────────── */

html[data-theme="dark"] .table {
    background: #1e2230;
    color: #dde3ef;
}

html[data-theme="dark"] .table thead {
    background: #252a38;
}

html[data-theme="dark"] .table th {
    color: #7a8298;
}

html[data-theme="dark"] .table td {
    border-top-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .table tbody tr:hover {
    background: #252a38;
}

html[data-theme="dark"] .table.ultra-compact tr:hover {
    background: #252a38;
}

html[data-theme="dark"] .table.compact td.label {
    color: #dde3ef;
}

/* ── Data table (settings) ───────────────────── */

html[data-theme="dark"] .data-table th {
    color: #7a8298;
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .data-table td {
    border-bottom-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .data-table tbody tr:hover {
    background: #252a38;
}

/* ── Cards ───────────────────────────────────── */

html[data-theme="dark"] .card {
    background: #1e2230;
    color: #dde3ef;
}

html[data-theme="dark"] .main-row {
    background: #1e2230;
}

html[data-theme="dark"] .detail-row {
    background: #191d29;
}

/* ── Editable cells ──────────────────────────── */

html[data-theme="dark"] .editable {
    background: #252a38;
    border-color: #3a4055;
    color: #dde3ef;
}

html[data-theme="dark"] .editable:hover {
    background: #2d3347;
}

html[data-theme="dark"] .editable:focus {
    background: #1e2230;
    border-color: #00a8ff;
}

html[data-theme="dark"] td[contenteditable="true"]:focus {
    background: #1e3a4f;
}

/* ── Inputs ──────────────────────────────────── */

html[data-theme="dark"] .filter-input {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .filter-input:focus {
    border-color: #00a8ff;
    box-shadow: 0 0 0 3px rgba(0,168,255,0.12);
}

html[data-theme="dark"] .crud-add input,
html[data-theme="dark"] .crud-add select {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] select {
    color: #dde3ef;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
    color-scheme: dark;
}

/* ── Form groups (settings) ──────────────────── */

html[data-theme="dark"] .form-group label {
    color: #9aa0b4;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .form-group textarea:focus {
    border-color: #00a8ff;
}

/* ── Settings layout ─────────────────────────── */

html[data-theme="dark"] .settings-layout {
    background: #15171e;
}

html[data-theme="dark"] .settings-sidebar {
    background: #1e2230;
    border-right-color: #2d3347;
}

html[data-theme="dark"] .sidebar-logo {
    color: #dde3ef;
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .sidebar-section {
    color: #5a6070;
}

html[data-theme="dark"] .sidebar-link {
    color: #9aa0b4;
}

html[data-theme="dark"] .sidebar-link:hover {
    background: #252a38;
    color: #00a8ff;
}

html[data-theme="dark"] .sidebar-link.active {
    background: #162840;
    color: #00a8ff;
}

html[data-theme="dark"] .sidebar-divider {
    background: #2d3347;
}

html[data-theme="dark"] .settings-content h1 {
    color: #dde3ef;
}

html[data-theme="dark"] .settings-section {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .settings-section h2 {
    color: #dde3ef;
}

html[data-theme="dark"] .settings-section h3 {
    color: #9aa0b4;
}

/* ── Alerts ──────────────────────────────────── */

html[data-theme="dark"] .alert-success {
    background: #0d2e1a;
    border-color: #1a5c35;
    color: #4ade80;
}

html[data-theme="dark"] .alert-error {
    background: #2e0d0d;
    border-color: #5c1a1a;
    color: #f87171;
}

html[data-theme="dark"] .alert-warning {
    background: #2e1f00;
    border-color: #5c3a00;
    color: #fbbf24;
}

html[data-theme="dark"] .scope-banner--structure {
    background: #0d1f30;
    border-color: #1a3d5e;
    color: #7ab8e8;
}

html[data-theme="dark"] .scope-banner--global {
    background: #2a1a00;
    border-color: #5c3800;
    color: #fbbf24;
}

/* ── Status rows ─────────────────────────────── */

html[data-theme="dark"] .expired,
html[data-theme="dark"] .alert {
    background: #2e1212;
}

html[data-theme="dark"] .warning {
    background: #2a1f00;
}

html[data-theme="dark"] .error-banner {
    background: #2e1212;
    color: #f87171;
}

/* ── Kit cards ───────────────────────────────── */

html[data-theme="dark"] .kit-card.ok {
    background: #0d2e1a;
    color: #4ade80;
}

html[data-theme="dark"] .kit-card.danger {
    background: #2e1212;
    color: #f87171;
}

/* ── Category filters ────────────────────────── */

html[data-theme="dark"] .cat-btn {
    background: #252a38;
    color: #9aa0b4;
    border-color: transparent;
}

html[data-theme="dark"] .cat-btn:hover {
    background: #2d3347;
    color: #dde3ef;
}

/* ── Page button (pagination) ────────────────── */

html[data-theme="dark"] .page-btn {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .page-btn:hover:not(:disabled):not(.page-btn-active) {
    background: #252a38;
    border-color: #00a8ff;
}

html[data-theme="dark"] .page-ellipsis {
    color: #3a4055;
}

html[data-theme="dark"] .page-info {
    color: #5a6070;
}

html[data-theme="dark"] .page-size-select {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .page-size-select:hover {
    border-color: #00a8ff;
}

/* ── Breadcrumb ──────────────────────────────── */

html[data-theme="dark"] .bc-sep {
    color: #3a4055;
}

html[data-theme="dark"] .bc-current {
    color: #9aa0b4;
}

/* ── Confirmation modal ──────────────────────── */

html[data-theme="dark"] #confirm-dialog {
    background: #1e2230;
    box-shadow: 0 12px 40px rgba(0,0,0,.55);
}

html[data-theme="dark"] #confirm-dialog p {
    color: #dde3ef;
}

html[data-theme="dark"] .confirm-actions .btn-cancel {
    background: #252a38;
    border-color: #3a4055;
    color: #9aa0b4;
}

html[data-theme="dark"] .confirm-actions .btn-cancel:hover {
    background: #2d3347;
}

/* ── Generic modal ───────────────────────────── */

html[data-theme="dark"] .modal-content {
    background: #1e2230;
    color: #dde3ef;
}

/* ── Wizard ──────────────────────────────────── */

html[data-theme="dark"] .modal-content.wizard-modal {
    background: #1e2230;
}

html[data-theme="dark"] .wizard-step-dot {
    background: #252a38;
    color: #7a8298;
}

html[data-theme="dark"] .wizard-step-line {
    background: #2d3347;
}

html[data-theme="dark"] .wizard-subtitle {
    color: #7a8298;
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .wizard-footer {
    border-top-color: #2d3347;
}

html[data-theme="dark"] .wizard-gtin {
    background: #252a38;
    border-color: #3a4055;
    color: #dde3ef;
}

html[data-theme="dark"] .wizard-label {
    color: #c0c8dc;
}

html[data-theme="dark"] .wizard-input,
html[data-theme="dark"] .wizard-search {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .wizard-input:focus,
html[data-theme="dark"] .wizard-search:focus {
    border-color: #00a8ff;
}

html[data-theme="dark"] .toggle-btn {
    background: #252a38;
    border-color: #3a4055;
    color: #9aa0b4;
}

html[data-theme="dark"] .toggle-btn.active {
    border-color: #00a8ff;
    background: #0d2035;
    color: #00a8ff;
}

html[data-theme="dark"] .bdpm-item {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .bdpm-item:hover {
    background: #252a38;
    border-color: #00a8ff;
}

html[data-theme="dark"] .bdpm-name {
    color: #dde3ef;
}

html[data-theme="dark"] .bdpm-meta {
    color: #7a8298;
}

html[data-theme="dark"] .item-btn {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .item-btn:hover {
    background: #252a38;
    border-color: #00a8ff;
}

html[data-theme="dark"] .item-btn.selected {
    background: #0d2035;
    border-color: #00a8ff;
    color: #5bc8ff;
}

html[data-theme="dark"] .item-main {
    color: #dde3ef;
}

html[data-theme="dark"] .item-mfg {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .btn-create-new {
    background: #1e2230;
    border-color: #3a4055;
    color: #7a8298;
}

html[data-theme="dark"] .btn-create-new:hover {
    background: #252a38;
    border-color: #00a8ff;
    color: #00a8ff;
}

html[data-theme="dark"] .mode-card {
    background: #252a38;
    border-color: #3a4055;
}

html[data-theme="dark"] .mode-card:hover {
    background: #0d2035;
    border-color: #00a8ff;
}

html[data-theme="dark"] .mode-card-label {
    color: #dde3ef;
}

html[data-theme="dark"] .wizard-gtin-header {
    background: #1a2540;
    color: #9aa0b4;
}

html[data-theme="dark"] .category-chip {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .category-chip:not(.active):hover {
    background: #2d3347;
}

html[data-theme="dark"] .summary-list {
    background: #252a38;
}

html[data-theme="dark"] .summary-label {
    color: #7a8298;
}

html[data-theme="dark"] .wizard-error {
    background: #2e1212;
    color: #f87171;
}

html[data-theme="dark"] .existing-barcodes-list {
    background: #252a38;
    border-color: #3a4055;
}

html[data-theme="dark"] .existing-barcode-code {
    background: #1e2230;
    color: #c0c8dc;
}

html[data-theme="dark"] .existing-barcode-qty {
    color: #7a8298;
}

/* ── Misc ────────────────────────────────────── */

html[data-theme="dark"] .badge-count {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .badge-location {
    background: #252a38;
    color: #c0c8dc;
}

html[data-theme="dark"] .badge-warning {
    background: #3a2a00;
    color: #fbbf24;
}

html[data-theme="dark"] .empty-state {
    color: #5a6070;
}

html[data-theme="dark"] .upload-btn {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .upload-btn:hover {
    background: #2d3347;
}

html[data-theme="dark"] .product-image {
    border-color: #2d3347;
}

html[data-theme="dark"] .btn-light {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .btn-secondary {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .sub-info {
    color: #5a6070;
}

html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
    color: #dde3ef;
}

/* ── Homepage — stat cards ───────────────────── */

html[data-theme="dark"] .stat-card {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .stat-card .s-label {
    color: #7a8298;
}

html[data-theme="dark"] .stat-card.s-danger {
    background: #2e1212;
    border-color: #5c1a1a;
}

html[data-theme="dark"] .stat-card.s-danger .s-value {
    color: #f87171;
}

html[data-theme="dark"] .stat-card.s-warning {
    background: #2e1f00;
    border-color: #5c3a00;
}

html[data-theme="dark"] .stat-card.s-warning .s-value {
    color: #fbbf24;
}

html[data-theme="dark"] .stat-card.s-ok {
    background: #0d2e1a;
    border-color: #1a5c35;
}

html[data-theme="dark"] .stat-card.s-ok .s-value {
    color: #4ade80;
}

html[data-theme="dark"] .stat-card.s-neutral .s-value {
    color: #7a8298;
}

/* ── Homepage — quick links ──────────────────── */

html[data-theme="dark"] .ql-card {
    background: #1e2230;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .ql-card:hover {
    border-color: #00a8ff;
    box-shadow: 0 4px 12px rgba(0,168,255,0.12);
    color: #00a8ff;
}

/* ── Homepage — kits overview ────────────────── */

html[data-theme="dark"] .super-kit-section {
    border-color: #2d3347;
}

html[data-theme="dark"] .super-kit-header {
    background: #252a38;
    border-bottom-color: #2d3347;
    color: #7a8298;
}

html[data-theme="dark"] .kit-row {
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .kit-row a {
    color: #c0c8dc;
}

html[data-theme="dark"] .kit-row a:hover {
    color: #00a8ff;
}

html[data-theme="dark"] .kit-row .kit-hint {
    color: #5a6070;
}

/* ── Homepage — landing (visiteur non connecté) ── */

html[data-theme="dark"] .feat-card {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .feat-card h3 {
    color: #dde3ef;
}

html[data-theme="dark"] .feat-card p {
    color: #7a8298;
}

html[data-theme="dark"] .landing-hero h1 {
    color: #dde3ef;
}

html[data-theme="dark"] .landing-hero .tagline {
    color: #7a8298;
}

/* ── Homepage — alertes BDPM ─────────────────── */

html[data-theme="dark"] .bdpm-alert-item {
    background: #2a1f00 !important;
    border-color: #5c3a00 !important;
}

html[data-theme="dark"] .home-welcome .home-date {
    color: #5a6070;
}

/* ── Stock — valeur totale ───────────────────── */

html[data-theme="dark"] .stock-value-total {
    background: #0d2035;
    border-color: #1a3d5e;
    color: #5bc8ff;
}

html[data-theme="dark"] .col-value {
    color: #7a8298;
}

/* ── Movements — filtres & tableau ──────────── */

html[data-theme="dark"] .badge-count {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .mvt-filters {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .mvt-filter-select,
html[data-theme="dark"] .mvt-filter-input {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .mvt-table th {
    border-bottom-color: #2d3347;
    color: #7a8298;
}

html[data-theme="dark"] .mvt-ts { color: #dde3ef; }
html[data-theme="dark"] .mvt-product a { color: #c0c8dc; }
html[data-theme="dark"] .mvt-ref { color: #7a8298; }
html[data-theme="dark"] .mvt-batch-num { color: #dde3ef; }

html[data-theme="dark"] .loc-stock { background: #0d2e1a; color: #4ade80; }
html[data-theme="dark"] .loc-ext   { background: #2e1f00; color: #fbbf24; }
html[data-theme="dark"] .loc-kit   { background: #0d1f40; color: #7ab8e8; }

html[data-theme="dark"] .mvt-user-badge {
    background: #252a38;
    color: #9aa0b4;
}

/* ── Traçabilité légale — cards ──────────────── */

html[data-theme="dark"] .trac-card {
    background: #1e2230;
    box-shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.04);
}

html[data-theme="dark"] .trac-page h1 { color: #dde3ef; }
html[data-theme="dark"] .trac-card h2 { color: #dde3ef; }
html[data-theme="dark"] .trac-card .desc { color: #7a8298; }
html[data-theme="dark"] .trac-card .ref { color: #5a6070; }

html[data-theme="dark"] .trac-form label { color: #9aa0b4; }

html[data-theme="dark"] .trac-form input[type=date],
html[data-theme="dark"] .trac-form select {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .device-list a,
html[data-theme="dark"] .vehicle-list a {
    background: #252a38;
    border-color: #2d3347;
    color: #c0c8dc;
}

html[data-theme="dark"] .device-list a:hover,
html[data-theme="dark"] .vehicle-list a:hover {
    background: #2d3347;
}

html[data-theme="dark"] .device-list a .sub,
html[data-theme="dark"] .vehicle-list a .sub {
    color: #5a6070;
}

html[data-theme="dark"] .trac-astuce-box {
    background: #2a1f00 !important;
    border-color: #5c3a00 !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .trac-astuce-box a {
    color: #fbbf24 !important;
}

/* ── Kits — super-lot cards ──────────────────── */

html[data-theme="dark"] .sk-card {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .sk-card-title a { color: #dde3ef; }
html[data-theme="dark"] .sk-card-meta    { color: #7a8298; }
html[data-theme="dark"] .sk-card-counts  { color: #9aa0b4; }

html[data-theme="dark"] .sk-card-items {
    border-top-color: #2d3347;
}

html[data-theme="dark"] .sk-card-items li a { color: #9aa0b4; }

html[data-theme="dark"] .sk-card-items li .item-badge.kit {
    background: #0d1f40;
    color: #7ab8e8;
}

html[data-theme="dark"] .sk-card-items li .item-badge.dm {
    background: #0d2e1a;
    color: #4ade80;
}

html[data-theme="dark"] .sk-add-card {
    border-color: #2d3347;
    color: #5a6070;
}

html[data-theme="dark"] .sk-add-card:hover {
    border-color: #6c5ce7;
    color: #a29bfe;
}

html[data-theme="dark"] .barcode-text {
    background: #252a38;
    color: #dde3ef;
}

html[data-theme="dark"] .badge-superlot-inline {
    background: #1a1040;
    color: #a29bfe;
}

/* DM dans kits — table & select */
html[data-theme="dark"] #devices-table td[style*="color:#555"] {
    color: #9aa0b4 !important;
}

html[data-theme="dark"] .dm-superlot {
    background: #1e2230;
    border-color: #2d3347 !important;
    color: #dde3ef;
}

/* DM Wizard (kits settings) */
html[data-theme="dark"] .dm-wizard-box {
    background: #1e2230;
}

html[data-theme="dark"] .dm-wizard-head h3 { color: #dde3ef; }

html[data-theme="dark"] .dm-wdot {
    background: #252a38;
    color: #7a8298;
}

html[data-theme="dark"] .dm-wline { background: #2d3347; }

html[data-theme="dark"] .dm-wizard-step-label { color: #7a8298; }

html[data-theme="dark"] .dm-field label { color: #9aa0b4; }

html[data-theme="dark"] .dm-field input,
html[data-theme="dark"] .dm-field select,
html[data-theme="dark"] .dm-field textarea {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .dm-wizard-foot {
    border-top-color: #2d3347;
}

html[data-theme="dark"] .mfr-results {
    background: #1e2230;
    border-color: #2d3347;
}

html[data-theme="dark"] .mfr-result-item {
    border-bottom-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .mfr-result-item:hover,
html[data-theme="dark"] .mfr-result-item.focused {
    background: #252a38;
}

html[data-theme="dark"] .mfr-empty { color: #5a6070; }

/* ── Véhicules — lien conducteurs & modal ────── */

html[data-theme="dark"] code#mobile-carnet-url {
    color: #dde3ef !important;
}

html[data-theme="dark"] .vehicle-modal-inner {
    background: #1e2230 !important;
}

html[data-theme="dark"] .vehicle-modal-inner h3,
html[data-theme="dark"] .vehicle-modal-inner label {
    color: #dde3ef;
}

html[data-theme="dark"] .vehicle-modal-inner input,
html[data-theme="dark"] .vehicle-modal-inner select,
html[data-theme="dark"] .vehicle-modal-inner textarea {
    background: #15171e !important;
    border-color: #2d3347 !important;
    color: #dde3ef !important;
}

html[data-theme="dark"] .vehicle-modal-inner .modal-footer-bar {
    border-top-color: #2d3347;
}

/* ── Tenues stock — tableau ──────────────────── */

html[data-theme="dark"] .tenues-info-box {
    background: #2a1f00 !important;
    border-color: #5c3a00 !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .tenue-header-row {
    background: #252a38 !important;
}

html[data-theme="dark"] .tenue-type-row {
    background: #1e2230 !important;
    border-top-color: #2d3347 !important;
}

html[data-theme="dark"] .tenue-type-row td {
    color: #9aa0b4 !important;
}

html[data-theme="dark"] .tenues-stock-table td {
    color: #dde3ef !important;
}

html[data-theme="dark"] .tenues-stock-table .stock-input {
    background: #15171e;
    border-color: #2d3347 !important;
    color: #dde3ef;
}

/* ── Settings — structure info ───────────────── */

html[data-theme="dark"] .info-section {
    background: #1e2230;
    box-shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.04);
}

html[data-theme="dark"] .info-form h1 { color: #dde3ef; }
html[data-theme="dark"] .info-form .subtitle { color: #7a8298; }

html[data-theme="dark"] .info-section h2 {
    color: #9aa0b4;
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .form-row label { color: #9aa0b4; }
html[data-theme="dark"] .form-row .hint { color: #5a6070; }

html[data-theme="dark"] .form-row input,
html[data-theme="dark"] .form-row textarea {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .feature-toggle-label { color: #dde3ef; }
html[data-theme="dark"] .feature-toggle-desc  { color: #7a8298; }

html[data-theme="dark"] .feature-toggle-row {
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .toggle-slider {
    background: #3a4055;
}

html[data-theme="dark"] .toggle-slider::before {
    background: #c0c8dc;
}

html[data-theme="dark"] .google-auth-info-box {
    background: #0d1f40 !important;
    border-color: #1a3d6e !important;
}

html[data-theme="dark"] .google-auth-info-box p {
    color: #7ab8e8 !important;
}

html[data-theme="dark"] .auth-mode-toggle {
    border-color: #2d3347 !important;
}

html[data-theme="dark"] .auth-mode-toggle button {
    background: #1e2230;
    color: #9aa0b4;
    border-color: #2d3347;
}

/* ── Dotation tables (kit & DM) ──────────────── */

html[data-theme="dark"] .dotation-table th,
html[data-theme="dark"] .dotation-table td {
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .dotation-table thead th {
    background: #252a38;
    color: #7a8298;
}

html[data-theme="dark"] .dotation-table input[type=number],
html[data-theme="dark"] .dotation-table input[type=text] {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .dotation-table .cat-row td {
    /* category headers have dynamic bg color — keep text readable */
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

html[data-theme="dark"] .dotation-table td.saved,
html[data-theme="dark"] .dotation-table th.saved {
    background: #0d2e1a !important;
}

html[data-theme="dark"] .dotation-table tr.empty-row td { color: #5a6070; }

html[data-theme="dark"] .kit-btn {
    background: #252a38;
    border-color: #2d3347;
    color: #9aa0b4;
}

html[data-theme="dark"] .kit-btn:hover {
    background: #2d3347;
    border-color: #00a8ff;
}

html[data-theme="dark"] .kit-btn.active {
    background: #0d2035;
    border-color: #00a8ff;
    color: #5bc8ff;
}

html[data-theme="dark"] .kit-btn.active .badge-global,
html[data-theme="dark"] .kit-btn.active .badge-structure {
    background: rgba(0,168,255,0.2);
    color: #5bc8ff;
}

html[data-theme="dark"] .kit-selector-wrap {
    scrollbar-color: #2d3347 #1e2230;
}

html[data-theme="dark"] .col-actions-btn {
    background: #252a38;
    border-color: #2d3347;
    color: #9aa0b4;
}

html[data-theme="dark"] .col-actions-btn:hover {
    background: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] #col-dropdown {
    background: #1e2230;
    border-color: #2d3347;
    box-shadow: 0 4px 16px rgba(0,0,0,.45);
}

html[data-theme="dark"] #col-dropdown button {
    color: #dde3ef;
}

html[data-theme="dark"] #col-dropdown button:hover {
    background: #252a38;
}

html[data-theme="dark"] #col-dropdown button.danger:hover {
    background: #2e1212;
}

html[data-theme="dark"] .modal-dialog {
    background: #1e2230;
    color: #dde3ef;
    box-shadow: 0 8px 32px rgba(0,0,0,.55);
}

html[data-theme="dark"] .modal-dialog p { color: #9aa0b4; }

html[data-theme="dark"] .modal-dialog select {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .ignore-toggle { color: #5a6070; }
html[data-theme="dark"] .ignore-toggle:hover,
html[data-theme="dark"] .ignore-toggle.ignored { color: #fbbf24; }

html[data-theme="dark"] tr.ignored-row td:not(:first-child) { opacity: 0.35; }
html[data-theme="dark"] tr.ignored-row td:first-child { color: #5a6070; }

/* ── App — mode scan ─────────────────────────── */

html[data-theme="dark"] .top-bar {
    background: #1a1e28;
    border-bottom-color: #2a2f3e;
}

html[data-theme="dark"] .mode-btn {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .mode-btn[data-mode="in"].active    { background: #0d2035; color: #5bc8ff;  border-color: #00a8ff; }
html[data-theme="dark"] .mode-btn[data-mode="out"].active   { background: #2e1212; color: #f87171;  border-color: #e74c3c; }
html[data-theme="dark"] .mode-btn[data-mode="kit"].active   { background: #1a0d30; color: #c4b5fd;  border-color: #8e44ad; }
html[data-theme="dark"] .mode-btn[data-mode="kit-in"].active{ background: #0d2e1a; color: #4ade80;  border-color: #27ae60; }

html[data-theme="dark"] .mode-sep { background: #2a2f3e; }

html[data-theme="dark"] #selected-kit-name {
    color: #7ab8e8;
    border-left-color: #2d3347;
}

html[data-theme="dark"] .product-card {
    background: #1e2230;
}

html[data-theme="dark"] .app-right {
    background: #1e2230;
}

html[data-theme="dark"] .kit-column {
    background: #252a38;
}

html[data-theme="dark"] .kit-column-title { color: #9aa0b4; }

html[data-theme="dark"] .kit-item {
    background: #1e2230;
    color: #dde3ef;
}

html[data-theme="dark"] .kit-item:hover,
html[data-theme="dark"] .kit-item:active {
    background: #0d2035;
    border-color: #00a8ff;
}

html[data-theme="dark"] #test-scan {
    background: #15171e;
    border-color: #2d3347;
    color: #7a8298;
}

html[data-theme="dark"] #test-scan:focus {
    background: #1e2230;
    border-color: #00a8ff;
    color: #dde3ef;
}

html[data-theme="dark"] .manual-trigger-btn {
    background: #252a38;
    border-color: #2d3347;
    color: #7a8298;
}

html[data-theme="dark"] .manual-trigger-btn:hover,
html[data-theme="dark"] .manual-trigger-btn:active {
    background: #0d2035;
    border-color: #00a8ff;
    color: #00a8ff;
}

html[data-theme="dark"] #quantity {
    background: #252a38;
    border-color: #3a4055;
    color: #dde3ef;
}

html[data-theme="dark"] .history-box {
    border-top-color: #2d3347;
}

html[data-theme="dark"] .history-table th {
    background: #252a38;
    border-bottom-color: #2d3347;
    color: #7a8298;
}

html[data-theme="dark"] .history-table td {
    border-bottom-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .product-sub { color: #7a8298; }
html[data-theme="dark"] .date        { color: #5a6070; }

html[data-theme="dark"] .app-notif.success {
    background: #0d2e1a;
    color: #4ade80;
    border-color: #1a5c35;
}

html[data-theme="dark"] .app-notif.error {
    background: #2e0d0d;
    color: #f87171;
    border-color: #5c1a1a;
}

html[data-theme="dark"] .app-notif.warning {
    background: #2e1f00;
    color: #fbbf24;
    border-color: #5c3a00;
}

html[data-theme="dark"] #confirm-modal-message { color: #dde3ef; }

html[data-theme="dark"] .manual-header {
    border-bottom-color: #2d3347;
    background: #1e2230;
}

html[data-theme="dark"] .manual-back-btn {
    background: #252a38;
    border-color: #2d3347;
    color: #9aa0b4;
}

html[data-theme="dark"] .manual-back-btn:hover { background: #2d3347; }

html[data-theme="dark"] .manual-breadcrumb { color: #dde3ef; }

html[data-theme="dark"] .manual-close-btn { color: #5a6070; }
html[data-theme="dark"] .manual-close-btn:hover { background: #252a38; color: #9aa0b4; }

html[data-theme="dark"] .manual-search {
    background: #15171e;
    border-color: #2d3347;
    color: #dde3ef;
}

html[data-theme="dark"] .manual-search:focus {
    border-color: #00a8ff;
    background: #1e2230;
}

html[data-theme="dark"] .manual-list-item {
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .manual-list-item:hover  { background: #252a38; }
html[data-theme="dark"] .manual-list-item:active { background: #0d2035; }

html[data-theme="dark"] .manual-list-name { color: #dde3ef; }

html[data-theme="dark"] .manual-list-mfg {
    background: #252a38;
    color: #9aa0b4;
}

html[data-theme="dark"] .manual-list-sub    { color: #5a6070; }
html[data-theme="dark"] .manual-list-arrow  { color: #3a4055; }

html[data-theme="dark"] .app-led { background: #252a38; }

html[data-theme="dark"] .expiry-field {
    background: #252a38;
    border-color: #3a4055;
    color: #7a8298;
}

html[data-theme="dark"] .expiry-field.active {
    border-color: #00a8ff;
    background: #15171e;
    color: #dde3ef;
}

html[data-theme="dark"] .expiry-field.filled {
    background: #15171e;
    color: #dde3ef;
}

html[data-theme="dark"] .exp-key {
    background: #252a38;
    color: #dde3ef;
}

html[data-theme="dark"] .exp-key:active { background: #2d3347; }

html[data-theme="dark"] .exp-key-back {
    background: #2e1212;
    color: #f87171;
}

html[data-theme="dark"] .exp-key-back:active { background: #3d1818; }

html[data-theme="dark"] .exp-key-ok {
    background: #0d2e1a;
    color: #4ade80;
}

html[data-theme="dark"] .exp-key-ok:active { background: #1a5c35; }

html[data-theme="dark"] .inv-header {
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] #inv-session-label { color: #9aa0b4; }

html[data-theme="dark"] .inv-progress-bar-wrap { background: #252a38; }

html[data-theme="dark"] .inv-section-title {
    color: #9aa0b4;
    border-bottom-color: #2d3347;
}

html[data-theme="dark"] .inv-ref-name { color: #dde3ef; }
html[data-theme="dark"] .inv-ref-name-sm { color: #c0c8dc; }
html[data-theme="dark"] .inv-batch-row { color: #9aa0b4; }
html[data-theme="dark"] .inv-lot-count { color: #5a6070; }

html[data-theme="dark"] .inv-remaining-row {
    border-bottom-color: #2d3347;
    color: #9aa0b4;
}

html[data-theme="dark"] #inv-progress-label { color: #7a8298; }
html[data-theme="dark"] .inv-start-box      { color: #5a6070; }

html[data-theme="dark"] .btn-inv-zero {
    background: #252a38;
    border-color: #2d3347;
    color: #f87171;
}

html[data-theme="dark"] .btn-inv-zero:hover {
    background: #2e1212;
    border-color: #5c1a1a;
}

/* ── Toggle button ───────────────────────────── */

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

#theme-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

/* ── Véhicules ──────────────────────────────── */

html[data-theme="dark"] .km-dist {
    color: #4ade80;
}

html[data-theme="dark"] .veh-km-badge {
    color: #4ade80 !important;
}

/* ── Mobile link banner ─────────────────────────────────────── */
html[data-theme="dark"] .mobile-link-card .mlc-url {
    background: #1e2535;
    border-color: #2d3347;
    color: #dde3ef;
}

/* ── Info hints ── */
html[data-theme="dark"] .info-hint .icon { color: #4a5270; }
html[data-theme="dark"] .info-hint:hover .icon { color: #6891f5; }
html[data-theme="dark"] .info-hint::after {
    background: #0e1119;
    color: #c8d0e8;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
}
html[data-theme="dark"] .info-hint::before { border-top-color: #0e1119; }
