/* Thèmes repris de la coopérative. Les clés historiques restent : Clair = blue_corporate, Sombre = odoo_enterprise, Système = systeme. */

html[data-theme="blue_corporate"],
html:not([data-theme]) {
    --uwz-bg: #eef3f8;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #1e293b;
    --uwz-muted: #64748b;
    --uwz-blue: #2563eb;
    --uwz-line: #dbe3ee;
    --uwz-head: #dbeafe;
    --uwz-head-text: #1e3a8a;
    --uwz-brand: linear-gradient(160deg, #071b3b 0%, #0d47a1 58%, #1565c0 100%);
}

html[data-theme="odoo_enterprise"] {
    --uwz-bg: #0f172a;
    --uwz-top: #1e293b;
    --uwz-card: #1e293b;
    --uwz-text: #f8fafc;
    --uwz-muted: #cbd5e1;
    --uwz-blue: #93a6f0;
    --uwz-line: #334155;
    --uwz-head: #1e293b;
    --uwz-head-text: #e2e8f0;
    --uwz-brand: linear-gradient(180deg, #07111f 0%, #0f1d46 100%);
}

html[data-theme="high_contrast"] {
    --uwz-bg: #ffffff;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #000000;
    --uwz-muted: #111827;
    --uwz-blue: #1e3a8a;
    --uwz-line: #0f172a;
    --uwz-head: #0f172a;
    --uwz-head-text: #ffffff;
    --uwz-brand: #0f172a;
}

html[data-theme="odoo"] {
    --uwz-bg: #f8f1f5;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #3b2233;
    --uwz-muted: #6b4f61;
    --uwz-blue: #714b67;
    --uwz-line: #d9c3d0;
    --uwz-head: #efe2ea;
    --uwz-head-text: #5c3b54;
    --uwz-brand: linear-gradient(180deg, #3d2740 0%, #714b67 100%);
}

html[data-theme="sap_fiori"] {
    --uwz-bg: #f5f9fc;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #1a2733;
    --uwz-muted: #4a6073;
    --uwz-blue: #0a6ed1;
    --uwz-line: #c9d8e6;
    --uwz-head: #e5eef6;
    --uwz-head-text: #0854a0;
    --uwz-brand: linear-gradient(180deg, #0a2540 0%, #0a4d8c 100%);
}

html[data-theme="oracle_cloud"] {
    --uwz-bg: #f7f4f1;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #2b2622;
    --uwz-muted: #6b6158;
    --uwz-blue: #c74634;
    --uwz-line: #d8cdc2;
    --uwz-head: #ece4dc;
    --uwz-head-text: #8f3326;
    --uwz-brand: linear-gradient(180deg, #3a3632 0%, #6b2a22 100%);
}

html[data-theme="sage_professional"] {
    --uwz-bg: #f3faf5;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #12301c;
    --uwz-muted: #3f6a4d;
    --uwz-blue: #007a33;
    --uwz-line: #b9d8c4;
    --uwz-head: #dcefe3;
    --uwz-head-text: #005c26;
    --uwz-brand: linear-gradient(180deg, #0d2a18 0%, #14532d 100%);
}

html[data-theme="zoho_modern"] {
    --uwz-bg: #fff7f6;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #1f1616;
    --uwz-muted: #6b4b4b;
    --uwz-blue: #e42527;
    --uwz-line: #f3c5c4;
    --uwz-head: #fde8e7;
    --uwz-head-text: #b81b1d;
    --uwz-brand: linear-gradient(180deg, #1a1f2c 0%, #8f1d22 100%);
}

html[data-theme="emerald_business"] {
    --uwz-bg: #f0fdf6;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #064e3b;
    --uwz-muted: #047857;
    --uwz-blue: #047857;
    --uwz-line: #a7f3d0;
    --uwz-head: #d1fae5;
    --uwz-head-text: #065f46;
    --uwz-brand: linear-gradient(180deg, #022c22 0%, #065f46 100%);
}

html[data-theme="graphite"] {
    --uwz-bg: #f4f5f7;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #111827;
    --uwz-muted: #4b5563;
    --uwz-blue: #374151;
    --uwz-line: #d1d5db;
    --uwz-head: #e5e7eb;
    --uwz-head-text: #1f2937;
    --uwz-brand: linear-gradient(180deg, #111827 0%, #374151 100%);
}

html[data-theme="copper"] {
    --uwz-bg: #fdf6ef;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #3f2a12;
    --uwz-muted: #7c4a1a;
    --uwz-blue: #b45309;
    --uwz-line: #e7c9a3;
    --uwz-head: #f3e0c8;
    --uwz-head-text: #9a3412;
    --uwz-brand: linear-gradient(180deg, #431407 0%, #7c2d12 100%);
}

html[data-theme="indigo"] {
    --uwz-bg: #f5f4ff;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #1e1b4b;
    --uwz-muted: #4338ca;
    --uwz-blue: #4338ca;
    --uwz-line: #c7d2fe;
    --uwz-head: #e0e7ff;
    --uwz-head-text: #312e81;
    --uwz-brand: linear-gradient(180deg, #1e1b4b 0%, #3730a3 100%);
}

html[data-theme="forest"] {
    --uwz-bg: #f3faf3;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #14532d;
    --uwz-muted: #3f6b4b;
    --uwz-blue: #166534;
    --uwz-line: #bbf7d0;
    --uwz-head: #dcfce7;
    --uwz-head-text: #14532d;
    --uwz-brand: linear-gradient(180deg, #052e16 0%, #166534 100%);
}

html[data-theme="burgundy"] {
    --uwz-bg: #fdf4f6;
    --uwz-top: #ffffff;
    --uwz-card: #ffffff;
    --uwz-text: #4c0519;
    --uwz-muted: #9f1239;
    --uwz-blue: #9f1239;
    --uwz-line: #f5c2ce;
    --uwz-head: #fce7ec;
    --uwz-head-text: #881337;
    --uwz-brand: linear-gradient(180deg, #4c0519 0%, #9f1239 100%);
}

html[data-theme="sand"] {
    --uwz-bg: #faf6ee;
    --uwz-top: #fffdf8;
    --uwz-card: #fffdf8;
    --uwz-text: #3f2e12;
    --uwz-muted: #7c5c20;
    --uwz-blue: #a16207;
    --uwz-line: #e4d3b0;
    --uwz-head: #f0e6d2;
    --uwz-head-text: #854d0e;
    --uwz-brand: linear-gradient(180deg, #422006 0%, #854d0e 100%);
}

html[data-theme] {
    --erp-primary: var(--uwz-blue);
}

html[data-theme] body.ndalos-shell {
    background: var(--uwz-bg) !important;
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .ndalos-topbar {
    background: var(--uwz-top) !important;
    color: var(--uwz-text) !important;
    border-bottom: 1px solid var(--uwz-line) !important;
}

html[data-theme] body.ndalos-shell .ndalos-pos-switch {
    flex: 0 0 auto;
    background: var(--uwz-card) !important;
    color: var(--uwz-text) !important;
    border: 1px solid var(--uwz-line);
}

html[data-theme] body.ndalos-shell .ndalos-pos-switch select,
html[data-theme] body.ndalos-shell .ndalos-pos-switch span {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .ndalos-pos-caisse {
    border-left-color: var(--uwz-line);
}

html[data-theme] body.ndalos-shell .erp-sidebar {
    background: var(--uwz-brand) !important;
}

html[data-theme] body.ndalos-shell .erp-content.container-erp,
html[data-theme] body.ndalos-shell .ndalos-brand,
html[data-theme] body.ndalos-shell .ndalos-brand-name,
html[data-theme] body.ndalos-shell .ndalos-tab {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .erp-card,
html[data-theme] body.ndalos-shell .card,
html[data-theme] body.ndalos-shell .uw-card,
html[data-theme] body.ndalos-shell .uw-side,
html[data-theme] body.ndalos-shell .uw-modal-card,
html[data-theme] body.ndalos-shell .modal-content {
    background: var(--uwz-card) !important;
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell table thead,
html[data-theme] body.ndalos-shell .erp-table thead th {
    background: var(--uwz-head) !important;
    color: var(--uwz-head-text) !important;
}

html[data-theme] body.ndalos-shell .uw-btn-primary,
html[data-theme] body.ndalos-shell .btn-primary,
html[data-theme] body.ndalos-shell .ndalos-company-pill {
    background: var(--uwz-blue) !important;
    border-color: var(--uwz-blue) !important;
    color: #fff !important;
}

html[data-theme] body.ndalos-shell .form-control,
html[data-theme] body.ndalos-shell .form-select,
html[data-theme] body.ndalos-shell .uwz-theme-menu summary {
    background: var(--uwz-card);
    color: var(--uwz-text);
    border-color: var(--uwz-line);
}

html[data-theme] body.uwz-auth {
    background: var(--uwz-bg);
    color: var(--uwz-text);
}

html[data-theme] body.uwz-auth-login .uwz-top,
html[data-theme] body.uwz-auth-login .uwz-card,
html[data-theme] body.uwz-auth-login .uwz-input,
html[data-theme] body.uwz-auth-login .uwz-btn.ghost {
    background: var(--uwz-card);
    color: var(--uwz-text);
    border-color: var(--uwz-line);
}

html[data-theme] body.uwz-auth-login .uwz-stepper,
html[data-theme] body.uwz-auth-login .uwz-login-brand,
html[data-theme] body.uwz-auth-login .uwz-login-brand strong {
    color: #fff;
}

html[data-theme] body.uwz-auth-login .uwz-login-brand p {
    color: rgba(255, 255, 255, .82);
}

html[data-theme] body.uwz-auth-login .uwz-stepper {
    background: var(--uwz-brand);
}

html[data-theme] body.uwz-auth-login .uwz-btn:not(.ghost) {
    background: var(--uwz-blue);
    color: #fff;
}

html[data-theme] body.uwz-auth-login .uwz-input i,
html[data-theme] body.uwz-auth-login .uwz-link,
html[data-theme] body.uwz-auth .uwz-link {
    color: var(--uwz-blue);
}

html[data-theme] body.uwz-auth-login .uwz-foot,
html[data-theme] body.uwz-auth-login .uwz-muted {
    color: var(--uwz-muted);
}

.uwz-theme-menu { position: relative; }
.uwz-theme-menu summary {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 36px;
    padding: .35rem .75rem;
    border: 1px solid var(--uwz-line, #dbe3ee);
    border-radius: 999px;
    background: var(--uwz-card, #fff);
    color: var(--uwz-text, #1e293b);
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: .85rem;
}
.uwz-theme-menu summary::-webkit-details-marker { display: none; }
.uwz-theme-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .35rem);
    z-index: 50;
    width: min(18rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 28rem);
    overflow: auto;
    padding: .35rem;
    border: 1px solid var(--uwz-line, #dbe3ee);
    border-radius: .9rem;
    background: var(--uwz-card, #fff);
    color: var(--uwz-text, #1e293b);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
}
.uwz-theme-group {
    margin: .45rem .4rem .15rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--uwz-muted, #64748b);
}
.uwz-theme-choice {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    min-height: 40px;
    padding: .35rem .5rem;
    border: 1px solid transparent;
    border-radius: .65rem;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.uwz-theme-choice.is-on,
.uwz-theme-choice:hover {
    border-color: var(--uwz-blue, #2563eb);
    background: color-mix(in srgb, var(--uwz-blue, #2563eb) 10%, transparent);
}
.uwz-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid var(--uwz-line, #dbe3ee);
    flex: none;
}
.uwz-swatch[data-theme-swatch="systeme"] { background: linear-gradient(90deg, #f8fafc 50%, #0f172a 50%); }
.uwz-swatch[data-theme-swatch="blue_corporate"] { background: linear-gradient(135deg, #ffffff, #1e3a8a); }
.uwz-swatch[data-theme-swatch="odoo_enterprise"] { background: linear-gradient(135deg, #0b1220, #93a6f0); }
.uwz-swatch[data-theme-swatch="high_contrast"] { background: linear-gradient(135deg, #000000, #ffffff); border: 2px solid #000; }
.uwz-swatch[data-theme-swatch="odoo"] { background: linear-gradient(135deg, #f8f1f5, #714b67); }
.uwz-swatch[data-theme-swatch="sap_fiori"] { background: linear-gradient(135deg, #f5f9fc, #0a6ed1); }
.uwz-swatch[data-theme-swatch="oracle_cloud"] { background: linear-gradient(135deg, #f7f4f1, #c74634); }
.uwz-swatch[data-theme-swatch="sage_professional"] { background: linear-gradient(135deg, #f3faf5, #007a33); }
.uwz-swatch[data-theme-swatch="zoho_modern"] { background: linear-gradient(135deg, #fff7f6, #e42527); }
.uwz-swatch[data-theme-swatch="emerald_business"] { background: linear-gradient(135deg, #f0fdf6, #047857); }
.uwz-swatch[data-theme-swatch="graphite"] { background: linear-gradient(135deg, #f4f5f7, #374151); }
.uwz-swatch[data-theme-swatch="copper"] { background: linear-gradient(135deg, #fdf6ef, #b45309); }
.uwz-swatch[data-theme-swatch="indigo"] { background: linear-gradient(135deg, #f5f4ff, #4338ca); }
.uwz-swatch[data-theme-swatch="forest"] { background: linear-gradient(135deg, #f3faf3, #166534); }
.uwz-swatch[data-theme-swatch="burgundy"] { background: linear-gradient(135deg, #fdf4f6, #9f1239); }
.uwz-swatch[data-theme-swatch="sand"] { background: linear-gradient(135deg, #faf6ee, #a16207); }

body.ndalos-shell .uwz-theme-menu summary {
    min-height: 34px;
    border-radius: .7rem;
}

html[data-theme] body.ndalos-shell .ndalos-icon-btn,
html[data-theme] body.ndalos-shell .ndalos-top-actions select,
html[data-theme] body.ndalos-shell .ndalos-site-chip {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .ndalos-icon-btn,
html[data-theme] body.ndalos-shell .ndalos-top-actions select {
    width: auto;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0 .7rem;
    border: 1px solid var(--uwz-line);
    border-radius: 999px;
    background: var(--uwz-card);
}

html[data-theme] body.ndalos-shell .ndalos-icon-btn {
    width: 40px;
    padding: 0;
}

html[data-theme] body.ndalos-shell .ndalos-icon-btn:hover,
html[data-theme] body.ndalos-shell .ndalos-top-actions select:hover {
    border-color: var(--uwz-blue);
}

.uwz-home {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: .5rem 0 2rem;
}

.uwz-home-intro,
.uwz-home-card,
.uwz-home-settings a {
    background: var(--uwz-card, #fff);
    color: var(--uwz-text, #1e293b);
    border: 1px solid var(--uwz-line, #dbe3ee);
}

.uwz-home-intro {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.uwz-home-mark {
    width: 84px;
    height: 84px;
    object-fit: contain;
    flex: none;
    border-radius: 1.1rem;
    background: #fff;
    padding: .35rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

body.ndalos-shell .uwz-home h1 {
    margin: 0;
    font-size: 1.85rem;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--uwz-text, #1e293b) !important;
}

.uwz-home-kicker {
    margin: 0 0 .2rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--uwz-blue, #2563eb);
}

.uwz-home-lead,
.uwz-home-card small,
.uwz-home-site {
    color: var(--uwz-muted, #64748b);
}

.uwz-home-lead { margin: .35rem 0 0; }

.uwz-home-site {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: .7rem 0 0;
    font-weight: 600;
}

.uwz-home-site label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.uwz-home-site select {
    border: 0;
    background: transparent;
    color: var(--uwz-text, #1e293b);
    font-weight: 700;
}

.uwz-home-apps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.uwz-home-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 108px;
    padding: 1.05rem 1.15rem;
    border-radius: 1.1rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.uwz-home-card:hover {
    border-color: var(--uwz-blue, #2563eb);
    transform: translateY(-1px);
}

.uwz-home-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    color: #fff;
    font-size: 1.3rem;
    background: var(--uwz-blue, #2563eb);
}

.uwz-home-icon--violet { background: #7c5cbf; }
.uwz-home-icon--amber { background: #e08a2e; }

.uwz-home-card-text { min-width: 0; }
.uwz-home-card strong { display: block; font-size: 1.05rem; }
.uwz-home-card small { display: block; margin-top: .15rem; }
.uwz-home-card .bi-chevron-right { margin-left: auto; color: var(--uwz-muted, #64748b); }

.uwz-home-settings {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.uwz-home-settings a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 42px;
    padding: .4rem .9rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.uwz-home-settings a:hover { border-color: var(--uwz-blue, #2563eb); }

@media (max-width: 720px) {
    .uwz-home-apps { grid-template-columns: 1fr; }
    .uwz-home-intro { align-items: flex-start; padding: 1.1rem; }
    .uwz-home-mark { width: 64px; height: 64px; }
    body.ndalos-shell .uwz-home h1 { font-size: 1.45rem; }
}

/* Le fond clair ne doit plus garder les textes prévus pour le fond sombre. */
html[data-theme] body.ndalos-shell .uw-modal {
    z-index: 5000;
    background: rgba(15, 23, 42, .55);
}

html[data-theme] body.ndalos-shell .uw-modal-card {
    background: var(--uwz-card) !important;
    color: var(--uwz-text) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

html[data-theme] body.ndalos-shell .uw-modal h1,
html[data-theme] body.ndalos-shell .uw-modal h2,
html[data-theme] body.ndalos-shell .uw-modal h3,
html[data-theme] body.ndalos-shell .uw-modal p,
html[data-theme] body.ndalos-shell .uw-modal li,
html[data-theme] body.ndalos-shell .uw-modal strong {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .uw-modal a:not(.uw-btn) {
    color: var(--uwz-blue) !important;
}

html[data-theme] body.ndalos-shell .uw-close {
    background: #dc2626 !important;
    color: #fff !important;
}

html[data-theme] body.ndalos-shell .erp-content h1,
html[data-theme] body.ndalos-shell .erp-content h2,
html[data-theme] body.ndalos-shell .erp-content h3,
html[data-theme] body.ndalos-shell .erp-content h4,
html[data-theme] body.ndalos-shell .erp-content p,
html[data-theme] body.ndalos-shell .erp-content li,
html[data-theme] body.ndalos-shell .erp-content label,
html[data-theme] body.ndalos-shell .erp-content dt,
html[data-theme] body.ndalos-shell .erp-content dd,
html[data-theme] body.ndalos-shell .erp-page-title,
html[data-theme] body.ndalos-shell .erp-module-sidebar-title,
html[data-theme] body.ndalos-shell .ndalos-session,
html[data-theme] body.ndalos-shell .ndalos-session strong {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .text-muted,
html[data-theme] body.ndalos-shell .erp-page-subtitle,
html[data-theme] body.ndalos-shell .small,
html[data-theme] body.ndalos-shell .ndalos-session small {
    color: var(--uwz-muted) !important;
}

html[data-theme] body.ndalos-shell .erp-module-sidebar,
html[data-theme] body.ndalos-shell .erp-module-main,
html[data-theme] body.ndalos-shell .erp-list-toolbar,
html[data-theme] body.ndalos-shell .erp-table-wrap,
html[data-theme] body.ndalos-shell .erp-card-footer,
html[data-theme] body.ndalos-shell .erp-card-header,
html[data-theme] body.ndalos-shell .card-header,
html[data-theme] body.ndalos-shell .card-body,
html[data-theme] body.ndalos-shell .erp-table-footer,
html[data-theme] body.ndalos-shell .erp-combo-trigger,
html[data-theme] body.ndalos-shell .list-group-item,
html[data-theme] body.ndalos-shell .page-link,
html[data-theme] body.ndalos-shell .dropdown-menu,
html[data-theme] body.ndalos-shell .pos-page,
html[data-theme] body.ndalos-shell .pos-panel,
html[data-theme] body.ndalos-shell .pos-block,
html[data-theme] body.ndalos-shell .ndalos-app-card,
html[data-theme] body.ndalos-shell .ndalos-hub-card {
    background: var(--uwz-card) !important;
    color: var(--uwz-text) !important;
    border-color: var(--uwz-line) !important;
}

html[data-theme] body.ndalos-shell .erp-module-sidebar-link {
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .erp-module-sidebar-link.active,
html[data-theme] body.ndalos-shell .erp-module-sidebar-link:hover {
    background: color-mix(in srgb, var(--uwz-blue) 14%, transparent) !important;
    color: var(--uwz-blue) !important;
}

html[data-theme] body.ndalos-shell .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--uwz-text);
    color: var(--uwz-text) !important;
}

html[data-theme] body.ndalos-shell .table td,
html[data-theme] body.ndalos-shell .table th {
    color: var(--uwz-text) !important;
    border-color: var(--uwz-line) !important;
}

html[data-theme] body.ndalos-shell .table thead th {
    background: var(--uwz-head) !important;
    color: var(--uwz-head-text) !important;
}

html[data-theme] body.ndalos-shell .form-control,
html[data-theme] body.ndalos-shell .form-select,
html[data-theme] body.ndalos-shell .input-group-text {
    background: var(--uwz-card) !important;
    color: var(--uwz-text) !important;
    border-color: var(--uwz-line) !important;
}

html[data-theme] body.ndalos-shell .ndalos-session {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 40px;
    padding: .2rem .75rem;
    border: 1px solid var(--uwz-line);
    border-radius: 999px;
    background: var(--uwz-card);
}

html[data-theme] body.ndalos-shell .ndalos-tab {
    color: var(--uwz-muted) !important;
}

html[data-theme] body.ndalos-shell .ndalos-tab.is-active,
html[data-theme] body.ndalos-shell .ndalos-tab:hover {
    background: color-mix(in srgb, var(--uwz-blue) 16%, var(--uwz-card));
    color: var(--uwz-blue) !important;
}

.uwz-licence {
    max-width: 760px;
    margin: .5rem auto 2rem;
    padding: 1.5rem 1.6rem 1.35rem;
    background: var(--uwz-card, #fff);
    color: var(--uwz-text, #1e293b);
    border: 1px solid var(--uwz-line, #dbe3ee);
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.uwz-licence-key { margin: 0 0 .35rem; font-size: 1.4rem; }

body.ndalos-shell .uwz-licence h1 {
    margin: 0 0 .8rem;
    font-size: 1.55rem;
    color: var(--uwz-text, #1e293b) !important;
}

body.ndalos-shell .uwz-licence h2 {
    margin: 1.2rem 0 .65rem;
    font-size: 1.05rem;
    color: var(--uwz-text, #1e293b) !important;
}

.uwz-licence p { margin: 0 0 .85rem; line-height: 1.45; }
.uwz-licence .badge { margin: .15rem .3rem .15rem 0; }
.uwz-licence .btn { min-height: 42px; border-radius: .75rem; padding: .5rem 1rem; }

@media (max-width: 640px) {
    .uwz-theme-menu summary span { display: none; }
}

/* Point de vente dans le même cadre que les autres écrans */
body.erp-pos-app .erp-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

body.erp-pos-app .erp-content.container-erp {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px 16px !important;
}

.pos-screen {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: 0;
    background: transparent;
    color: #1e293b;
}

.pos-screen .pos-workspace { flex: 1; }

.pos-screen .pos-remise-line,
.pos-screen .pos-line-discount {
    display: none !important;
}

.pos-screen .pos-extra-fields:not(:has(.pos-mobile-inline:not(.d-none))) {
    display: none;
}

.pos-screen .pos-topbar {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) 150px 150px;
    gap: .55rem;
    align-items: center;
}

.pos-screen .pos-back,
.pos-screen .pos-icon-btn,
.pos-screen .pos-rail-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
}

.pos-screen .pos-icon-btn {
    background: #fff;
    color: #2563eb;
    border: 1px solid #dbe3ee;
}

.pos-screen .pos-date-operation {
    display: flex;
    align-items: center;
    gap: .35rem;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: .7rem;
    padding: .25rem .45rem;
}

.pos-screen .pos-weekday {
    font-weight: 700;
    text-transform: capitalize;
    min-width: 2.2rem;
}

.pos-screen .pos-date-operation .uw-date3 {
    display: flex;
    gap: .3rem;
    align-items: center;
}

.pos-screen .pos-date-operation .uw-date3::before {
    content: "";
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%232563eb' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pos-screen .pos-date-operation input,
.pos-screen .pos-date-operation select,
.pos-screen .pos-top-select,
.pos-screen .pos-client-slot .form-select {
    height: 36px;
    border: 1px solid #dbe3ee;
    border-radius: .55rem;
    background: #fff;
    color: #1e293b;
    box-shadow: none;
}

.pos-screen .pos-date-operation input { width: 58px; text-align: center; }
.pos-screen .pos-date-operation select { width: 118px; text-transform: capitalize; }

.pos-screen .pos-client-slot {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}

.pos-screen .pos-client-slot .form-select { flex: 1; min-width: 0; }
.pos-screen .pos-client-summary.is-empty,
.pos-screen .pos-mobile-client-row { display: none; }
.pos-screen .pos-client-summary:not(.is-empty) {
    font-size: .75rem;
    color: #475569;
    white-space: nowrap;
}

.pos-screen .pos-extra-fields {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: end;
}

.pos-screen .pos-extra-fields:not(:has(.d-none)) { display: flex; }
.pos-screen .pos-extra-fields .d-none { display: none !important; }
.pos-screen .pos-remise-line { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.pos-screen .pos-remise-line input { width: 90px; }

.pos-screen .pos-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) 56px;
    gap: .55rem;
    min-height: 0;
}

.pos-screen .pos-catalog,
.pos-screen .pos-ticket,
.pos-screen .pos-rail {
    background: #f4f7fb;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    min-height: 0;
}

.pos-screen .pos-catalog {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: .55rem;
    background: #fff;
    height: 100%;
    overflow: hidden;
}

.pos-screen #pos-categorie-filter,
.pos-screen .pos-products-pagination {
    display: none;
}

.pos-screen .pos-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid #dbe3ee;
    border-radius: .65rem;
    padding: 0 .65rem;
    background: #fff;
}

.pos-screen .pos-search i { color: #64748b; }
.pos-screen .pos-search input {
    border: 0;
    height: 40px;
    width: 100%;
    outline: none;
    background: transparent;
}

.pos-screen .pos-products {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: .4rem;
    overflow: auto;
    min-height: 0;
    flex: 1;
}

.pos-screen .pos-product {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start;
    gap: .55rem;
    width: 100%;
    min-height: 58px;
    height: auto;
    text-align: left;
    border: 1px solid var(--uwz-line, #e2e8f0);
    background: #fff;
    border-radius: .7rem;
    padding: .5rem .6rem;
    transform: none !important;
    box-shadow: none;
}

.pos-screen .pos-product-icon {
    color: var(--uwz-blue, #3b82f6);
    flex: 0 0 auto;
}
.pos-screen .pos-product-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}
.pos-screen .pos-product-name {
    font-weight: 800;
    text-transform: uppercase;
    font-size: .78rem;
    line-height: 1.15;
    min-height: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-screen .pos-product-meta {
    color: #64748b;
    font-size: .72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-screen .pos-product-price {
    margin: 0 0 0 auto !important;
    flex: 0 0 auto;
    background: var(--uwz-blue, #3b82f6);
    color: #fff !important;
    border-radius: 999px;
    padding: .28rem .6rem;
    font-weight: 700;
    font-size: .75rem;
    line-height: 1.2;
    white-space: nowrap;
}
.pos-screen .pos-stock-badge { display: none; }

.pos-screen .pos-ticket {
    overflow: auto;
    background: #f3f6fa;
}

.pos-screen .pos-cart-table { width: 100%; border-collapse: collapse; }
.pos-screen .pos-cart-table thead th {
    background: var(--uwz-head, #dbeafe);
    color: var(--uwz-head-text, #1e3a8a);
    font-weight: 700;
    padding: .7rem .8rem;
    position: sticky;
    top: 0;
}
.pos-screen .pos-cart-table td { padding: .55rem .7rem; vertical-align: middle; background: transparent; }
.pos-screen .pos-cart-empty td { height: 46vh; }
.pos-screen .pos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: #64748b;
    height: 100%;
}
.pos-screen .pos-empty i { font-size: 1.8rem; color: #94a3b8; }
.pos-screen .pos-empty small { font-size: .82rem; color: #94a3b8; max-width: 16rem; text-align: center; }
.pos-screen .pos-qty-group { display: flex; align-items: center; gap: .2rem; }
.pos-screen .pos-qty { width: 64px; }
.pos-screen .pos-price,
.pos-screen .pos-line-discount { width: 88px; margin-bottom: .2rem; }
.pos-screen .pos-remove { margin-left: .35rem; }

.pos-screen .pos-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: .55rem .25rem;
    background: #fff;
}
.pos-screen .pos-rail-btn { background: transparent; color: var(--uwz-blue, #3b82f6); width: 40px; height: 40px; }

.pos-screen .pos-bottom {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 64px 1.3fr;
    gap: .5rem;
    align-items: stretch;
}

.pos-screen .pos-hold,
.pos-screen .pos-save,
.pos-screen .pos-wait,
.pos-screen .pos-grand {
    min-height: 52px;
    border-radius: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-weight: 800;
}

.pos-screen .pos-hold {
    background: #fff;
    border: 1px solid #dbe3ee;
    color: #334155;
}
.pos-screen .pos-save {
    background: var(--uw-primary, #0f4c3a);
    border: 0;
    color: #fff;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
}
.pos-screen .pos-wait {
    background: #fff;
    border: 1px solid #dbe3ee;
    color: #3b82f6;
    font-size: 1.25rem;
}
.pos-screen .pos-grand {
    background: var(--uwz-blue, #3b82f6);
    color: #fff;
    justify-content: space-between;
    padding: 0 1rem;
}

@media (max-width: 991.98px) {
    body.erp-pos-app .erp-main { height: auto; max-height: none; overflow: visible; }
    body.erp-pos-app .erp-content.container-erp { height: auto; overflow: auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
    .pos-screen { height: auto; min-height: 0; }
    .pos-screen .pos-topbar,
    .pos-screen .pos-workspace,
    .pos-screen .pos-bottom { grid-template-columns: 1fr; }
    .pos-screen .pos-rail { flex-direction: row; justify-content: center; }
    .pos-screen .pos-cart-empty td { height: 180px; }
    .pos-screen .pos-mobile-client-row { display: none; }
}

body.ndalos-shell .uw-modal {
    z-index: 6000 !important;
}

body.ndalos-shell .uw-modal h2,
body.ndalos-shell .uw-modal p,
body.ndalos-shell .uw-modal strong {
    color: var(--uwz-text, #064e3b) !important;
}

.client-create .erp-page-header { align-items: center; margin-bottom: 1rem; }
.client-create .erp-page-subtitle { margin-top: .25rem; }

.client-create .erp-form-section {
    background: var(--uwz-card, #fff) !important;
    border: 1px solid var(--uwz-line, #dbe3ee) !important;
    border-radius: 1rem !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04) !important;
    padding: 0 0 1.05rem !important;
    margin-bottom: .85rem;
    overflow: hidden;
}

.client-create .erp-form-section-title {
    display: block;
    margin: 0 0 1rem;
    padding: .75rem 1.1rem;
    background: var(--uwz-head, #d1fae5);
    color: var(--uwz-head-text, #065f46) !important;
    text-transform: none;
    letter-spacing: 0;
    font-size: .95rem;
}

.client-create .erp-form-section-title::before { display: none; }
.client-create .erp-form-section > .row { padding: 0 1.1rem; }
.client-create .form-label { color: var(--uwz-text, #1e293b); }
.client-create .form-control,
.client-create .form-select {
    min-height: 42px;
    border-radius: .7rem;
}

.client-create .client-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    padding: .35rem 0 1.25rem;
}

.client-create .client-form-actions .btn {
    min-height: 44px;
    border-radius: .75rem;
    padding: .5rem 1.15rem;
    font-weight: 700;
}

body.ndalos-app-clients .erp-module-sidebar {
    background: #f3f4f6 !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: .85rem !important;
    padding: .65rem .4rem;
}

body.ndalos-app-clients .erp-module-sidebar-head { display: none; }

.clients-site-pick {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: .15rem .35rem .7rem;
    padding: .35rem .55rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .45rem;
}

.clients-site-pick i { color: #2563eb; }
.clients-site-pick select {
    border: 0;
    background: transparent;
    font-weight: 700;
    width: 100%;
    outline: none;
}

body.ndalos-app-clients .erp-module-sidebar-link {
    border-radius: .45rem;
    color: #334155 !important;
}

body.ndalos-app-clients .erp-module-sidebar-link.active {
    background: #e5e7eb !important;
    color: #111827 !important;
}

.clients-list-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .8rem;
}

.clients-list-title i { color: #2563eb; font-size: 1.15rem; }
.clients-list-title h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--uwz-text, #1e293b) !important;
}

.clients-list-tools {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .7rem;
}

.clients-list-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex: 1;
    max-width: 420px;
    height: 38px;
    padding: 0 .7rem;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: .35rem;
}

.clients-list-search i { color: #64748b; }
.clients-list-search input {
    border: 0;
    outline: none;
    width: 100%;
    background: transparent;
}

.clients-list-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 .85rem;
    border-radius: .3rem;
    background: #2563eb;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}

.clients-list-table {
    background: transparent;
    overflow: auto;
}

.clients-list-table table { width: 100%; border-collapse: collapse; }
html[data-theme] body.ndalos-shell .clients-list-table thead th {
    background: #dbe7f8 !important;
    color: #1e3a8a !important;
    font-weight: 700;
    text-align: left;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: .65rem .8rem;
}

.clients-site-pick button,
.clients-site-pick .erp-quick-add-btn { display: none !important; }

.clients-list-table td {
    padding: .7rem .8rem;
    border-bottom: 1px solid #e8eef5;
    background: transparent;
    color: #1e293b;
}

.clients-list-table a { color: inherit; text-decoration: none; font-weight: 600; }
.clients-list-empty { text-align: center; color: #64748b; padding: 2rem !important; }

.clients-switch {
    display: inline-block;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #e2e8f0;
    position: relative;
    vertical-align: middle;
}

.clients-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
}

.clients-switch.is-on { background: #60a5fa; }
.clients-switch.is-on::after { left: 18px; }

.clients-list .erp-actions-btn {
    border: 0;
    background: transparent;
    color: #64748b;
    font-weight: 800;
    letter-spacing: .12em;
}
