@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors light theme */
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-active: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #0b63e5;
    --primary-light: rgba(11, 99, 229, 0.1);
    --border: #e2e8f0;
    
    --success: #18a875;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    
    --font-outfit: 'Outfit', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Charte LASS DIGITAL et finition visuelle harmonisée avec ESGES-IMMO. */
body { background: radial-gradient(circle at 85% 0, rgba(11,99,229,.13), transparent 28%), linear-gradient(145deg,#f8fbff,#eef4fb); }
header { border-bottom-color: rgba(11,99,229,.16); box-shadow: 0 10px 35px rgba(7,27,54,.08); }
.brand-logo { background: linear-gradient(135deg,#0b63e5,#18a875); box-shadow: 0 10px 25px rgba(11,99,229,.24); }
.card,.modal-content { border: 1px solid rgba(11,99,229,.12); box-shadow: 0 16px 42px rgba(7,27,54,.08); }
.btn-primary { background: linear-gradient(135deg,#0b63e5,#0753c3); box-shadow: 0 8px 20px rgba(11,99,229,.2); }
.btn-success { background: linear-gradient(135deg,#18a875,#0f8d61); }
.tab-btn.active { color:#fff; background:linear-gradient(135deg,#0b63e5,#18a875); border-color:transparent; }
.toast { width:min(390px,calc(100vw - 24px)); max-height:110px; overflow:auto; padding:.75rem .9rem; line-height:1.3; }
.modal-content { max-height:88vh; overflow:hidden; }
.modal-body,.settings-modal-body { overflow-y:auto; max-height:calc(88vh - 120px); }
[data-theme="dark"] body { background: radial-gradient(circle at 85% 0,rgba(11,99,229,.2),transparent 30%),#09111f; }

.agency-select-shell { width:min(920px,94vw); margin:0 auto; padding:clamp(22px,4vw,42px); border:1px solid rgba(11,99,229,.18); border-radius:28px; background:rgba(255,255,255,.97); box-shadow:0 28px 80px rgba(7,27,54,.16); }
.agency-select-heading span { color:#18a875; font-size:.72rem; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.agency-select-heading h2 { margin:.35rem 0; color:#071b36; font:800 clamp(30px,5vw,48px)/1 Georgia,serif; }
.agency-select-heading p { margin:0 0 1.25rem; color:#627086; }
.dist-agency-list { display:grid; gap:11px; }
.dist-agency-card { display:grid; grid-template-columns:52px 1fr auto; gap:14px; align-items:center; width:100%; padding:14px 16px; border:1px solid #dce5f0; border-radius:16px; background:#fff; color:#071b36; text-align:left; cursor:pointer; transition:.2s ease; }
.dist-agency-card:hover { transform:translateY(-2px); border-color:#0b63e5; box-shadow:0 12px 28px rgba(11,99,229,.1); }
.dist-agency-card.direction { border-color:rgba(24,168,117,.35); background:linear-gradient(135deg,rgba(24,168,117,.1),rgba(11,99,229,.06)); }
.dist-agency-icon { display:grid; width:48px; height:48px; place-items:center; border-radius:14px; background:#0b63e5; color:#fff; font-weight:900; }
.dist-agency-card.direction .dist-agency-icon { background:#18a875; }
.dist-agency-card span:nth-child(2) { display:grid; gap:2px; }
.dist-agency-card strong { font-size:1rem; }.dist-agency-card small { color:#627086; }.dist-agency-card b { color:#0b63e5; font-size:.78rem; }
.agency-select-actions { display:flex; gap:10px; margin-top:18px; flex-wrap:wrap; }
@media(max-width:600px){.dist-agency-card{grid-template-columns:44px 1fr}.dist-agency-card b{display:none}.agency-select-actions>*{width:100%;justify-content:center}}

[data-theme="dark"] {
    /* Colors dark theme */
    --bg-primary: #0b0f19;
    --bg-card: #151c2c;
    --bg-active: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary: #818cf8;
    --primary-light: rgba(129, 140, 248, 0.15);
    --border: #223049;
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-outfit);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
    flex: 1;
}

/* App Header */
header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #4f46e5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}
.brand-logo img { width:100%; height:100%; object-fit:contain; border-radius:inherit; }

.brand-info h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.brand-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toggle Theme Button */
.btn-toggle-theme {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-toggle-theme:hover {
    background-color: var(--bg-active);
}

.pointe-settings-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-active);
}
.pointe-settings-number {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}
.extra-pointe-purchase-row input { padding: 0.3rem; margin: 0; font-size: 0.8rem; height: auto; }

/* Navigation Tabs */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    background-color: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.tab-btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-active);
}

.tab-btn.active {
    color: white;
    background-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Content Views */
.tab-view {
    display: none;
}

.tab-view.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards Grid Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.icon-blue { background-color: rgba(99, 102, 241, 0.1); color: var(--primary); }
.icon-green { background-color: rgba(16, 185, 129, 0.1); color: var(--success); }
.icon-orange { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); }
.icon-red { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card-footer {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Charts and grids */
.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Common form inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #4f46e5;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
    background-color: var(--bg-active);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background-color: var(--bg-active);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--bg-active);
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

/* Client Directory grid */
.client-directory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding-left: 2.5rem;
}

.search-bar::before {
    content: "🔍";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.zone-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.zone-card-header {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--primary);
    display: flex;
    justify-content: space-between;
}

.zone-client-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.zone-client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: transform 0.1s;
}

.zone-client-item:hover {
    transform: translateX(4px);
    background-color: var(--bg-active);
}

.zone-client-name {
    font-weight: 500;
}

.zone-client-tel {
    color: var(--text-secondary);
}

/* Sales Tracking Delivery selector */
.delivery-selector-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10005;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 500px;
    width: 90%;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.settings-suppliers-hero {
    background: linear-gradient(135deg, rgba(34,197,94,0.10), rgba(59,130,246,0.08));
    border: 1px solid rgba(34,197,94,0.22);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.settings-suppliers-table th,
.settings-suppliers-table td {
    vertical-align: top;
}

.settings-suppliers-table td {
    padding: 0.55rem;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.settings-suppliers-table .supplier-name {
    font-weight: 700;
    color: var(--text-primary);
}

.settings-suppliers-table .supplier-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Interactive custom number input inside tables */
.qty-input {
    width: 70px;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.85rem;
}

/* Floating message toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.52rem 0.8rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    max-width: min(360px, calc(100vw - 1rem));
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Professional messages centered inside the application. */
.toast-container {
    position:fixed;
    inset:50% auto auto 50%;
    z-index:12050;
    display:flex;
    width:min(440px,calc(100vw - 28px));
    flex-direction:column;
    gap:.65rem;
    transform:translate(-50%,-50%);
    pointer-events:none;
}
.toast-container .toast {
    position:relative;
    inset:auto!important;
    display:grid;
    grid-template-columns:42px 1fr 28px;
    width:100%;
    max-width:none;
    min-height:82px;
    margin:0;
    padding:.85rem .9rem;
    transform:none;
    opacity:1;
    border:1px solid rgba(255,255,255,.22);
    border-radius:18px;
    background:#111d33;
    color:#fff;
    box-shadow:0 24px 70px rgba(0,0,0,.35);
    pointer-events:auto;
    animation:messageReveal .24s ease both;
}
.toast-icon { display:grid; width:36px; height:36px; place-items:center; border-radius:12px; background:rgba(255,255,255,.13); font-size:1.05rem; font-weight:900; }
.toast-copy { min-width:0; }
.toast-title { display:block; margin-bottom:.15rem; color:#fff; font-size:.9rem; font-weight:800; }
.toast-message { display:block; color:#dce7f5; font-size:.8rem; line-height:1.4; }
.toast-close { border:0; background:transparent; color:#b8c7da; font-size:1.2rem; cursor:pointer; }
.toast.success { border-left:5px solid #1BA97B; }
.toast.error { border-left:5px solid #ef4444; }
.toast.warning,.toast.info { border-left:5px solid #f59e0b; }
@keyframes messageReveal { from { opacity:0; transform:translateY(12px) scale(.97); } to { opacity:1; transform:none; } }

.app-dialog { position:fixed; inset:0; z-index:12100; display:none; width:100vw; min-height:100dvh; place-items:center; align-items:center; justify-items:center; padding:18px; background:rgba(4,10,22,.72); backdrop-filter:blur(8px); }
.app-dialog.active { display:grid; }
.app-dialog-card { position:relative; width:min(470px,100%); padding:1.35rem; border:1px solid rgba(58,95,205,.3); border-radius:22px; background:var(--bg-card); color:var(--text-primary); box-shadow:0 28px 85px rgba(0,0,0,.38); text-align:center; }
.app-dialog-icon { display:grid; width:54px; height:54px; margin:0 auto .8rem; place-items:center; border-radius:18px; background:linear-gradient(135deg,#3A5FCD,#1BA97B); color:#fff; font-size:1.35rem; font-weight:900; }
.app-dialog-card h3 { margin:0 0 .45rem; font-size:1.1rem; }
.app-dialog-card p { margin:0; color:var(--text-secondary); font-size:.88rem; line-height:1.55; white-space:pre-line; }
.app-dialog-actions { display:flex; justify-content:center; gap:.65rem; margin-top:1.1rem; }
.app-dialog-actions .btn { min-width:120px; }

.sale-modal-content { overflow:hidden!important; }
.sale-modal-scroll { max-height:calc(88vh - 74px); overflow-y:scroll; padding-right:.7rem; scrollbar-gutter:stable; }
.sale-modal-scroll::-webkit-scrollbar,.pointes-management-body::-webkit-scrollbar { width:10px; }
.sale-modal-scroll::-webkit-scrollbar-thumb,.pointes-management-body::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:999px; background:linear-gradient(#3A5FCD,#1BA97B); background-clip:padding-box; }
.sale-stock-line{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.45rem;margin:0 0 .55rem;padding:.45rem .55rem;border-radius:9px;background:rgba(27,169,123,.08);color:var(--text-secondary);font-size:.7rem}.sale-stock-line span{display:flex;flex-direction:column;gap:.12rem}.sale-stock-line strong{font-size:.88rem;color:var(--text-primary)}.sale-stock-line span:last-child strong{color:var(--success)}.sale-pointe-card.stock-exceeded{border-color:var(--danger)!important;box-shadow:0 0 0 2px rgba(239,68,68,.12)}.sale-pointe-card.stock-exceeded .sale-stock-line{background:rgba(239,68,68,.1)}.sale-pointe-card.stock-exceeded .sale-stock-remaining{color:var(--danger)}
.pointes-management-body { max-height:calc(88vh - 76px); overflow-y:auto; padding-right:.35rem; }
.pointes-management-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5rem; }
.cloud-distribution-account-card { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin:0 0 1rem; }
.cloud-distribution-account-card>div { padding:.85rem; border:1px solid var(--border); border-radius:14px; background:var(--bg-active); }
.cloud-distribution-account-card span,.cloud-distribution-account-card strong { display:block; }
.cloud-distribution-account-card span { margin-bottom:.25rem; color:var(--text-secondary); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.cloud-distribution-account-card strong { color:var(--text-primary); font-size:.86rem; overflow-wrap:anywhere; }
.cloud-encryption-card { margin:0 0 1rem; padding:1rem; border:1px solid rgba(27,169,123,.34); border-radius:16px; background:linear-gradient(135deg,rgba(58,95,205,.10),rgba(27,169,123,.10)); }
.cloud-encryption-card>div:first-child { display:flex; justify-content:space-between; gap:.75rem; align-items:center; }
.cloud-encryption-card strong,.cloud-encryption-card span { display:block; }
.cloud-encryption-card span { color:#1BA97B; font-size:.78rem; font-weight:700; text-align:right; }
.cloud-encryption-card small { display:block; margin-top:.75rem; color:var(--text-secondary); line-height:1.45; }
.cloud-encryption-actions { display:flex; gap:.5rem; flex-wrap:wrap; margin-top:.8rem; }
@media(max-width:600px) { .pointes-management-actions,.cloud-distribution-account-card { grid-template-columns:1fr; } }

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }

.update-reminder-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10090;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: min(360px, calc(100vw - 1rem));
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(59,130,246,0.08));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

.update-reminder-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.2;
    font-size: 0.8rem;
}

.update-reminder-text strong {
    font-size: 0.83rem;
}

.update-reminder-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .modal-content {
        width: calc(100vw - 1rem);
        padding: 0.85rem;
    }

    .toast {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.75rem;
        width: auto;
        max-width: none;
        font-size: 0.78rem;
    }

    .update-reminder-banner {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.75rem;
        width: auto;
        max-width: none;
        padding: 0.5rem 0.65rem;
        gap: 0.45rem;
    }

    .update-reminder-text {
        font-size: 0.76rem;
    }

    .update-reminder-actions {
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .update-reminder-actions .btn {
        padding: 0.3rem 0.55rem !important;
        font-size: 0.72rem !important;
    }
}

/* ==========================================================================
   PRINT STYLES (PDF EXPORT)
   ========================================================================== */
@media print {
    @page {
        size: portrait;
        margin: 10mm 10mm 10mm 10mm;
    }
    
    body.print-view-sales,
    body.print-view-expenses {
        @page {
            size: landscape;
            margin: 10mm 10mm 10mm 10mm;
        }
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Hide standard UI elements that shouldn't appear in PDF exports */
    body.print-active header,
    body.print-active .tabs-nav,
    body.print-active button,
    body.print-active .btn,
    body.print-active .btn-pdf,
    body.print-active .modal,
    body.print-active .search-bar,
    body.print-active #clientSearchInput,
    body.print-active .client-directory-header,
    body.print-active #disbursement-form button,
    body.print-active #disbursement-form input[type="text"],
    body.print-active #expense-form button,
    body.print-active #expense-form input[type="text"],
    body.print-active #expense-form div[style*="border-top"],
    body.print-active #disbursement-form div[style*="justify-content"] {
        display: none !important;
    }

    /* Hide the interactive "Action" columns from tables in print mode */
    body.print-active #view-sales table th:last-child,
    body.print-active #view-sales table td:last-child,
    body.print-active #disbursement-form table th:last-child,
    body.print-active #disbursement-form table td:last-child,
    body.print-active table:has(#broken-eggs-table-body) th:last-child,
    body.print-active table:has(#broken-eggs-table-body) td:last-child {
        display: none !important;
    }

    /* Clean checkboxes in print: hide unchecked, style checked as highlighted badges */
    body.print-active label:has(input[type="checkbox"]:not(:checked)) {
        display: none !important;
    }
    
    body.print-active input[type="checkbox"] {
        display: none !important;
    }
    
    body.print-active label:has(input[type="checkbox"]:checked) {
        font-weight: bold !important;
        border: 1px solid #000000 !important;
        padding: 2px 6px !important;
        border-radius: 4px !important;
        background: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Style select elements as clean text without dropdown arrows */
    body.print-active select {
        border: none !important;
        background: transparent !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        color: #000000 !important;
        font-weight: bold !important;
        font-size: 11pt !important;
        padding: 0 !important;
        margin: 0 !important;
        pointer-events: none !important;
        width: auto !important;
        text-align-last: left !important;
    }

    /* Hide views except active print view */
    body.print-active .tab-view {
        display: none !important;
    }

    body.print-view-dashboard #view-dashboard,
    body.print-view-sales #view-sales,
    body.print-view-expenses #view-expenses,
    body.print-view-clients #view-clients {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.print-active .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Table styling for print */
    body.print-active table {
        border-collapse: collapse !important;
        width: 100% !important;
        page-break-inside: auto;
        font-size: 8pt !important; /* Slightly smaller font to guarantee columns fit */
        color: #000000 !important;
    }
    
    body.print-active tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    body.print-active thead {
        display: table-header-group !important;
    }

    body.print-active tfoot {
        display: table-footer-group !important;
    }

    body.print-active th {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        border: 1px solid #cbd5e1 !important;
        font-weight: bold !important;
        padding: 4px 6px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-active td {
        border: 1px solid #cbd5e1 !important;
        padding: 4px 6px !important;
        color: #000000 !important;
        background: transparent !important;
        word-break: break-word !important;
    }

    /* Flatten forms inputs in tables/cards */
    body.print-active input[type="number"],
    body.print-active input[type="text"] {
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
        box-shadow: none !important;
        outline: none !important;
        padding: 0 !important;
        margin: 0 !important;
        font-weight: 500 !important;
        width: 100% !important;
        font-size: inherit !important;
    }

    /* Stats Grid for Dashboard print */
    body.print-active .stats-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
    }

    body.print-active .stat-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 10px !important;
        page-break-inside: avoid !important;
    }

    body.print-active .stat-card-icon {
        display: none !important;
    }

    body.print-active .stat-card-value {
        font-size: 1.4rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    body.print-active .dashboard-row {
        display: block !important;
    }

    body.print-active .card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
        page-break-inside: avoid !important;
    }

    body.print-active .chart-container {
        height: 220px !important;
        page-break-inside: avoid !important;
    }

    body.print-active canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Client view zone grid print */
    body.print-active .zone-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    body.print-active .zone-card {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        background: transparent !important;
        page-break-inside: avoid !important;
    }
}

/* ==========================================
   AUTH SCREEN & PRODUCT SELECTION
   ========================================== */

#auth-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
    overflow-y: auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

#auth-screen::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

#auth-screen.hidden {
    display: none;
}

/* Login Panel */
.auth-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease;
    margin: auto 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 20px rgba(99,102,241,0.6));
}

.auth-logo h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.auth-logo p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

/* Bouton plein écran placé en haut à côté du tracteur (couleur de la page) */
.auth-fullscreen-corner-btn {
    position: absolute;
    top: -1.5rem;
    right: -0.5rem;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255,255,255,0.15);
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    color: rgba(255,255,255,0.75);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, color 0.25s, transform 0.2s, border-color 0.25s;
    z-index: 5;
}
.auth-fullscreen-corner-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.35);
    transform: scale(1.05);
}

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form-group input:not([type="checkbox"]) {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.auth-form-group input::placeholder {
    color: rgba(255,255,255,0.3);
}

.auth-form-group input:not([type="checkbox"]):focus {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.auth-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: none;
}

.auth-error.show { display: block; }

.btn-auth {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    margin-top: 0.5rem;
}

.btn-auth:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}

.auth-hint {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
}

/* Product Selection Screen */
/* Product Selection Screen */
#product-select-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: auto 0;
    padding: 1rem 0;
    text-align: center;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

#product-select-screen.visible { display: flex; }

.product-screen-header {
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease;
}

.product-screen-header .welcome-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 9999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.78rem;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-screen-header h2 {
    font-size: 2.2rem;
    font-weight: 850;
    margin-bottom: 0.25rem;
    letter-spacing: -0.7px;
    background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 70%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.product-screen-header p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

.product-cards-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.5s ease 0.1s both;
    margin-bottom: 1rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    width: 170px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.product-card.active-product:hover::before {
    opacity: 1;
}

#product-card-oeufs::before {
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
}
#product-card-poissons::before {
    background: radial-gradient(circle at center, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
}

.product-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

#product-card-oeufs:hover {
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.12), 0 0 0 1px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.35);
}
#product-card-poissons:hover {
    box-shadow: 0 15px 30px rgba(6, 182, 212, 0.12), 0 0 0 1px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.35);
}

.product-card.active-product {
    border-color: rgba(255, 255, 255, 0.12);
}

.product-card-icon-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
    transition: all 0.4s ease;
    z-index: 1;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
}

#product-card-oeufs .product-card-icon-container {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}
#product-card-oeufs:hover .product-card-icon-container {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

#product-card-poissons .product-card-icon-container {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
}
#product-card-poissons:hover .product-card-icon-container {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.product-card-icon {
    font-size: 2.25rem;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.25));
}

.product-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
    z-index: 1;
    letter-spacing: -0.2px;
}

.product-card-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    z-index: 1;
}

.product-card.coming-soon {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(255,255,255,0.01);
    border-style: dashed;
}

.product-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255,255,255,0.08);
}

.coming-soon-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 0.5px;
}

.product-screen-footer {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    animation: fadeInUp 0.5s ease 0.2s both;
    color: rgba(255,255,255,0.35);
    font-size: 0.8rem;
}

.btn-logout-product {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 9999px;
    padding: 0.4rem 1.15rem;
    color: #fca5a5;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout-product:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

/* Responsive Scaling for Short Heights */
@media (max-height: 720px) {
    .product-screen-header {
        margin-bottom: 1rem;
    }
    .product-screen-header h2 {
        font-size: 1.8rem;
    }
    .product-screen-header .welcome-tag {
        margin-bottom: 0.5rem;
        padding: 0.25rem 0.75rem;
        font-size: 0.72rem;
    }
    .product-cards-row {
        gap: 1rem;
        margin-bottom: 0.75rem;
    }
    .product-card {
        padding: 1.5rem 1rem;
        width: 145px;
        border-radius: 16px;
    }
    .product-card-icon-container {
        width: 50px;
        height: 50px;
        margin-bottom: 0.75rem;
    }
    .product-card-icon {
        font-size: 1.8rem;
    }
    .product-card-name {
        font-size: 0.95rem;
    }
    .product-card-status {
        font-size: 0.7rem;
    }
    .product-screen-footer {
        margin-top: 1rem;
        gap: 0.4rem;
    }
}

/* Header user info */
.header-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-active);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.9rem 0.35rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-user-badge .user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.btn-logout-header {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-logout-header:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-password-header {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-password-header:hover {
    background: var(--bg-active);
    color: var(--primary);
}

/* Admin: User management modal */
.user-role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.user-role-badge.admin {
    background: rgba(99,102,241,0.15);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.3);
}

.user-role-badge.gestionnaire {
    background: rgba(16,185,129,0.12);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.3);
}

.user-role-badge.vendeur {
    background: rgba(245,158,11,0.12);
    color: var(--warning);
    border: 1px solid rgba(245,158,11,0.3);
}

/* Broken eggs alternating row colors */
.broken-row-group-a {
    background-color: rgba(99, 102, 241, 0.07) !important;
}

.broken-row-group-b {
    background-color: transparent !important;
}

[data-theme="dark"] .broken-row-group-a {
    background-color: rgba(99, 102, 241, 0.12) !important;
}

/* Reset button in admin zone */
.btn-reset-danger {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-danger:hover {
    background: var(--danger);
    color: white;
}

/* Authentication Screen Signatures & Links */
.auth-signature {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.auth-bottom-link {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    z-index: 100;
    letter-spacing: 0.5px;
}

.auth-bottom-link:hover {
    color: var(--primary);
}

/* Product Selection Settings Wheel Trigger */
.product-settings-trigger {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-settings-trigger:hover {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.3) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-settings-trigger:active {
    transform: translateY(0);
}

/* Settings Modal Specifics */
.settings-tabs .tab-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.settings-tabs .tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.settings-tabs .tab-btn:hover:not(.active) {
    background: var(--bg-active);
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE & MOBILE COMPATIBILITY (TABLETS & MOBILE)
   ============================================ */

/* Force vertical overflow containment for tables with inline vertical scrolls and add momentum scrolling */
div[style*="overflow-y: auto"],
.table-responsive,
.settings-modal-body {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

@media (max-width: 768px) {
    /* Header layout */
    header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem !important;
        align-items: stretch;
        text-align: center;
    }
    
    .brand {
        justify-content: center;
    }
    
    .header-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Modal responsiveness */
    .modal-content {
        width: 95% !important;
        padding: 1rem !important;
        margin: 10px !important;
    }

    /* Stack grid layouts */
    .dashboard-row,
    #view-expenses .dashboard-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    #expense-inputs-container {
        grid-template-columns: 1fr !important;
    }
    
    #create-user-form,
    #settings-create-user-form {
        grid-template-columns: 1fr !important;
    }
    
    #create-user-form button,
    #settings-create-user-form button {
        grid-column: span 1 !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    /* Login screen adjustments */
    .auth-panel {
        padding: 1.5rem !important;
        max-width: 90% !important;
    }
    
    .auth-logo-icon {
        font-size: 2.5rem !important;
    }
    
    .auth-logo h1 {
        font-size: 1.75rem !important;
    }

    /* Product screen adjustments */
    .product-screen-header h2 {
        font-size: 1.75rem !important;
    }
    
    .product-card {
        width: 100% !important;
        max-width: 280px;
        padding: 1.5rem 1rem !important;
    }

    /* Tab navigation buttons compact view */
    .tab-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* Table cells compact padding */
    th, td {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
    }
}

/* ==========================================================
   ESPELEVA DISTRIBUTION 2026 - CHARTE LASS DIGITAL
   Direction Generale -> Distribution -> Fournisseur -> Produit
   ========================================================== */
:root {
    --lass-blue: #0B0BE2;
    --lass-blue-soft: #3A5FCD;
    --lass-green: #1BA97B;
    --lass-mint: #00D4AA;
    --lass-black: #000000;
    --lass-gray: #797D87;
    --lass-white: #FFFFFF;
    --dist-navy: #071326;
    --dist-navy-2: #0d1e34;
    --primary: var(--lass-blue-soft);
    --success: var(--lass-green);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

body {
    background:
        radial-gradient(circle at 92% 4%, rgba(0, 212, 170, .13), transparent 24%),
        linear-gradient(145deg, #f8fbff, #edf4fb);
}

#auth-screen {
    background:
        radial-gradient(circle at 87% 14%, rgba(0, 212, 170, .18), transparent 24%),
        radial-gradient(circle at 8% 90%, rgba(58, 95, 205, .20), transparent 26%),
        var(--dist-navy);
}

#auth-screen::before {
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
}

.auth-panel {
    border-color: rgba(0, 212, 170, .24);
    background: linear-gradient(155deg, rgba(13,30,52,.97), rgba(7,19,38,.96));
    box-shadow: 0 30px 90px rgba(0,0,0,.42);
}

.auth-logo-icon { filter: drop-shadow(0 8px 20px rgba(0,212,170,.28)); }
.btn-auth { background: linear-gradient(135deg, var(--lass-blue-soft), var(--lass-green)); }
.btn-auth:hover { background: linear-gradient(135deg, var(--lass-blue), var(--lass-mint)); box-shadow: 0 12px 28px rgba(0,212,170,.24); }
.auth-form-group input:not([type="checkbox"]):focus,
.auth-form-group select:focus { border-color: var(--lass-mint); box-shadow: 0 0 0 3px rgba(0,212,170,.15); background: rgba(0,212,170,.08); }

/* Direction Generale */
.direction-workspace {
    position: absolute;
    inset: 0;
    min-height: 100vh;
    grid-template-columns: 330px minmax(0, 1fr);
    background: var(--dist-navy);
    color: #fff;
    overflow: auto;
    z-index: 5;
}

.direction-sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: 28px 22px 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.08);
    background: rgba(4, 13, 29, .94);
}

.direction-brand { display:flex; align-items:center; gap:13px; padding:0 4px 22px; border-bottom:1px solid rgba(255,255,255,.08); }
.direction-brand-mark { display:grid; width:52px; height:52px; place-items:center; border-radius:16px; background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-mint)); font-size:1.65rem; font-weight:900; }
.direction-brand-logo{flex:0 0 52px;width:52px;height:52px;padding:3px;border-radius:16px;background:#fff;object-fit:contain}
.direction-brand div { display:grid; gap:2px; }
.direction-brand strong { font-size:1.35rem; letter-spacing:-.04em; }
.direction-brand small { color:#9db0ca; }
.direction-version { width:max-content; margin:14px 4px 30px; padding:5px 10px; border-radius:7px; background:var(--lass-mint); color:#04121d; font-size:.72rem; font-weight:900; letter-spacing:.08em; }
.direction-sidebar nav button { width:100%; min-height:66px; display:flex; align-items:center; gap:14px; padding:0 18px; border:0; border-left:4px solid var(--lass-mint); border-radius:18px; background:rgba(0,212,170,.12); color:#fff; font:800 1rem var(--font-outfit); text-align:left; }
.direction-sidebar nav button > span:first-child { font-size:1.8rem; }
#direction-distribution-nav-label { font-size:1rem; line-height:1.25; }
.direction-access-nav { display:flex; flex:1; min-height:0; flex-direction:column; gap:12px; }
.direction-tools-nav { min-height:0; overflow-y:auto; padding:4px 7px 10px 0; scrollbar-width:thin; scrollbar-color:var(--lass-mint) rgba(255,255,255,.06); }
.direction-tools-nav::-webkit-scrollbar { display:block!important; width:7px!important; }
.direction-tools-nav::-webkit-scrollbar-track { background:rgba(255,255,255,.05); border-radius:99px; }
.direction-tools-nav::-webkit-scrollbar-thumb { background:linear-gradient(var(--lass-mint),var(--lass-blue-soft)); border-radius:99px; }
.direction-tools-nav>small { display:block; margin:4px 8px 9px; color:#7f96b4; font-size:.67rem; font-weight:900; letter-spacing:.13em; }
.direction-sidebar .direction-tools-nav button { min-height:46px; margin-bottom:5px; padding:8px 11px; border-left:3px solid transparent; border-radius:11px; background:transparent; color:#aebed3; font-size:.84rem; font-weight:750; line-height:1.18; }
.direction-sidebar .direction-tools-nav button>span:first-child { display:grid; flex:0 0 27px; width:27px; height:27px; place-items:center; border-radius:8px; background:rgba(255,255,255,.06); color:var(--lass-mint); font-size:.9rem; }
.direction-sidebar .direction-tools-nav button:hover,.direction-sidebar .direction-tools-nav button.active { border-left-color:var(--lass-mint); background:rgba(0,212,170,.1); color:#fff; }
.direction-profile { margin-top:auto; transform:translateY(8px); display:grid; grid-template-columns:42px 1fr; gap:8px; align-items:center; padding:12px; border:1px solid rgba(255,255,255,.09); border-radius:18px; background:rgba(255,255,255,.03); }
.direction-avatar { display:grid; width:42px; height:42px; place-items:center; border-radius:50%; background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-green)); font-weight:900; }
.direction-profile div:nth-child(2) { display:grid; gap:2px; }
.direction-profile small { color:var(--lass-mint); }
.direction-profile button { grid-column:1/-1; min-height:38px; border:1px solid rgba(255,255,255,.11); border-radius:10px; background:rgba(255,255,255,.04); color:#fff; font-weight:800; cursor:pointer; }

.direction-content { padding:clamp(24px,4vw,58px); min-width:0; }
.direction-hero { position:relative; overflow:hidden; padding:clamp(26px,4vw,48px); border:1px solid rgba(58,95,205,.62); border-radius:0 0 28px 28px; background:linear-gradient(115deg,rgba(11,11,226,.35),rgba(27,169,123,.18) 55%,rgba(13,30,52,.96)); }
.direction-hero::after { content:""; position:absolute; width:260px; height:260px; right:-90px; bottom:-150px; border-radius:50%; background:rgba(0,212,170,.12); }
.direction-eyebrow,.distribution-heading span { color:var(--lass-mint); font-size:.76rem; font-weight:900; letter-spacing:.13em; }
.direction-hero h1 { margin:.45rem 0 .25rem; font-size:clamp(2rem,4vw,3.4rem); letter-spacing:-.05em; }
.direction-hero p { margin:0 0 1.3rem; color:#adc0db; font-size:1rem; }
.direction-hero button { position:relative; z-index:1; width:100%; min-height:62px; border:1px solid rgba(255,255,255,.12); border-radius:16px; background:rgba(255,255,255,.06); color:#fff; font:800 1.05rem var(--font-outfit); cursor:pointer; }
.direction-hero button span { margin-right:10px; color:var(--lass-mint); font-size:1.7rem; }
.distribution-heading { display:flex; justify-content:space-between; align-items:end; gap:18px; margin:34px 0 20px; padding-bottom:18px; border-bottom:1px solid rgba(255,255,255,.09); }
.distribution-heading h2 { margin:.35rem 0 0; font-size:1.8rem; }
.distribution-heading button { min-height:46px; padding:0 18px; border:0; border-radius:12px; background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-green)); color:#fff; font-weight:900; cursor:pointer; }
.dist-agency-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.dist-agency-list .dist-agency-card:first-child { grid-column:1 / -1; }
.dist-agency-card { position:relative; display:block; width:auto; min-height:310px; padding:28px; border:1px solid rgba(0,212,170,.35); border-radius:26px; background:linear-gradient(125deg,rgba(27,169,123,.34),rgba(13,30,52,.92) 58%,rgba(58,95,205,.20)); color:#fff; }
.dist-agency-card:hover { transform:translateY(-3px); border-color:var(--lass-mint); box-shadow:0 18px 45px rgba(0,0,0,.28); }
.dist-agency-top { display:flex; justify-content:space-between; align-items:start; }
.dist-agency-icon { display:grid; width:64px; height:64px; place-items:center; border-radius:18px; background:var(--lass-mint); color:#061427; font-size:1.15rem; font-weight:950; }
.dist-agency-badge { padding:6px 11px; border-radius:999px; background:rgba(0,212,170,.13); color:var(--lass-mint); font-size:.72rem; font-weight:900; }
.dist-agency-card h3 { margin:24px 0 4px; font-size:1.55rem; }
.dist-agency-card p { color:#a8bdd8; }
.dist-agency-meta { display:flex; gap:16px; flex-wrap:wrap; margin:22px 0; color:#d8e5f4; font-size:.82rem; }
.dist-agency-meta span:first-child { color:var(--lass-mint); }
.dist-agency-actions { display:flex; gap:10px; flex-wrap:wrap; }
.dist-agency-actions button { min-height:48px; padding:0 16px; border:1px solid rgba(255,255,255,.12); border-radius:13px; background:rgba(255,255,255,.06); color:#fff; font-weight:850; cursor:pointer; }
.dist-agency-actions .enter { border:0; background:var(--lass-mint); color:#061427; }
.direction-bottom-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.direction-bottom-actions button { min-height:42px; padding:0 14px; border:1px solid rgba(255,255,255,.12); border-radius:10px; background:rgba(255,255,255,.05); color:#fff; cursor:pointer; }

/* Supplier before product */
.supplier-workspace { width:min(980px,94vw); margin:auto; color:#fff; }
.supplier-select-shell { padding:clamp(24px,5vw,48px); border:1px solid rgba(0,212,170,.28); border-radius:28px; background:linear-gradient(145deg,rgba(13,30,52,.97),rgba(4,13,29,.97)); box-shadow:0 30px 90px rgba(0,0,0,.38); }
.supplier-select-heading { text-align:center; margin-bottom:24px; }
.supplier-step { color:var(--lass-mint); font-size:.72rem; font-weight:900; letter-spacing:.13em; }
.supplier-heading-icon { display:grid; width:66px; height:66px; place-items:center; margin:14px auto; border-radius:19px; background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-green)); font-size:2rem; }
.supplier-select-heading h2 { margin:0; font-size:clamp(1.9rem,4vw,2.8rem); }
.supplier-select-heading p { max-width:650px; margin:.5rem auto 0; color:#9fb4cf; }
.supplier-add-primary { display:flex; justify-content:center; margin:0 0 18px; }
.supplier-add-primary .btn { width:min(100%,460px); min-height:50px; justify-content:center; }
.supplier-select-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.supplier-choice-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; min-height:92px; padding:10px; border:1px solid rgba(255,255,255,.10); border-radius:17px; background:rgba(255,255,255,.04); color:#fff; }
.supplier-choice-card:hover { border-color:var(--lass-mint); background:rgba(0,212,170,.08); transform:translateY(-2px); }
.supplier-choice-select { display:grid; grid-template-columns:46px minmax(0,1fr) auto; gap:12px; align-items:center; width:100%; padding:4px; border:0; background:transparent; color:#fff; text-align:left; cursor:pointer; }
.supplier-choice-index { display:grid; width:42px; height:42px; place-items:center; border-radius:12px; background:rgba(58,95,205,.25); color:var(--lass-mint); font-weight:900; }
.supplier-choice-copy { display:grid; gap:3px; }
.supplier-choice-copy strong { font-size:1rem; }.supplier-choice-copy small { color:#9fb4cf; }
.supplier-choice-action { color:var(--lass-mint); font-size:.78rem; font-weight:900; }
.supplier-card-actions { display:grid; gap:7px; }
.supplier-card-actions button { min-width:82px; min-height:34px; padding:0 10px; border-radius:9px; font-weight:800; cursor:pointer; }
.supplier-edit-btn { border:1px solid rgba(58,95,205,.55); background:rgba(58,95,205,.16); color:#b8c8ff; }
.supplier-delete-btn { border:1px solid rgba(239,68,68,.48); background:rgba(239,68,68,.12); color:#ff9f9f; }
.supplier-edit-modal-content { width:min(620px,94vw); padding:1rem; }
.supplier-edit-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; padding:14px 4px 4px; }
.supplier-edit-notes,.supplier-edit-actions { grid-column:1/-1; }
.supplier-edit-actions { display:flex; justify-content:flex-end; gap:10px; }
.supplier-select-empty { padding:25px; border:1px dashed rgba(0,212,170,.35); border-radius:16px; color:#afc2d9; text-align:center; }
.supplier-select-actions { display:flex; gap:10px; margin-top:18px; }
.supplier-select-actions .btn { flex:1; min-height:48px; justify-content:center; }
.supplier-back { display:block; margin:18px auto 0; border:0; background:none; color:#9fb4cf; font-weight:800; cursor:pointer; }

/* ESFERME : la ferme produit et distribue directement ses propres produits. */
.esferme-direct-producer #supplier-select-screen,
.esferme-direct-producer #btn-settings-suppliers,
.esferme-direct-producer #settings-view-suppliers,
.esferme-direct-producer #supplier-banner-card,
.esferme-direct-producer [onclick*="showSupplierSelectionForCurrentDistribution"],
.esferme-direct-producer [onclick*="openSupplierSettingsFromSelection"] {
    display: none !important;
}

/* Product selection */
#product-select-screen { width:min(1050px,94vw); max-width:none; padding:clamp(24px,4vw,48px); border:1px solid rgba(58,95,205,.35); border-radius:28px; background:linear-gradient(145deg,rgba(13,30,52,.96),rgba(4,13,29,.96)); box-shadow:0 30px 90px rgba(0,0,0,.35); }
.product-screen-header h2 { background:none; -webkit-text-fill-color:#fff; color:#fff; }
.product-screen-header .welcome-tag { border-color:rgba(0,212,170,.35); background:rgba(0,212,170,.10); color:#dffbf5; }
.product-screen-header .welcome-tag strong { color:var(--lass-mint); }
.product-card { width:210px; min-height:230px; border-color:rgba(255,255,255,.10); background:rgba(255,255,255,.04); }
.product-card:hover { border-color:var(--lass-mint); background:rgba(0,212,170,.07); }
.product-settings-trigger { border-color:rgba(0,212,170,.25)!important; background:rgba(0,212,170,.08)!important; }

/* Main management pages */
#main-app-wrapper > header { background:linear-gradient(100deg,var(--dist-navy),#102c48); color:#fff; border:0; }
#main-app-wrapper .brand-info h1 { color:#fff; }
#main-app-wrapper .brand-info p { color:#a9bdd6; }
#main-app-wrapper .brand-logo { background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-mint)); }
#app-context-bar { border-color:rgba(58,95,205,.18)!important; background:rgba(255,255,255,.92)!important; box-shadow:0 12px 32px rgba(7,19,38,.08); }
.tabs-nav { padding:.55rem; border:1px solid rgba(58,95,205,.14); border-radius:18px; background:rgba(255,255,255,.88); box-shadow:0 12px 34px rgba(7,19,38,.07); }
.tab-btn.active { background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-green)); box-shadow:0 8px 22px rgba(58,95,205,.22); }
.card,.stat-card,.delivery-selector-card,.modal-content { border-color:rgba(58,95,205,.14); border-radius:20px; box-shadow:0 14px 38px rgba(7,19,38,.07); }
table thead th { background:#0d2440; color:#fff; }
tbody tr:hover { background:rgba(0,212,170,.055); }
.btn-primary { background:linear-gradient(135deg,var(--lass-blue-soft),var(--lass-green)); border:0; }
.form-control:focus,select:focus,input:focus,textarea:focus { border-color:var(--lass-mint)!important; box-shadow:0 0 0 3px rgba(0,212,170,.13)!important; }

@media(max-width:980px) {
    .direction-workspace { grid-template-columns:1fr; }
    .direction-sidebar { position:relative; min-height:auto; padding:18px; }
    .direction-sidebar nav { display:flex; max-height:390px; }
    .direction-tools-nav { max-height:255px; }
    .direction-profile { margin-top:16px; grid-template-columns:42px 1fr auto; }
    .direction-profile button { grid-column:auto; }
    .dist-agency-list { grid-template-columns:1fr; }
}

@media(max-width:700px) {
    .direction-content { padding:18px; }
    .distribution-heading { align-items:stretch; flex-direction:column; }
    .distribution-heading button { width:100%; }
    .supplier-select-list { grid-template-columns:1fr; }
    .supplier-select-actions,.dist-agency-actions { flex-direction:column; }
    .supplier-choice-card { grid-template-columns:1fr; }
    .supplier-choice-select { grid-template-columns:42px 1fr; }
    .supplier-choice-action { grid-column:2; }
    .supplier-card-actions { grid-template-columns:1fr 1fr; }
    .supplier-edit-form { grid-template-columns:1fr; }
    .supplier-edit-notes,.supplier-edit-actions { grid-column:1; }
}

/* Direction Generale control center */
.dist-direction-dashboard { animation:fadeIn .28s ease; }
.direction-dashboard-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; padding:28px; border:1px solid rgba(58,95,205,.38); border-radius:24px; background:linear-gradient(120deg,rgba(11,11,226,.22),rgba(27,169,123,.14),rgba(13,30,52,.94)); }
.direction-dashboard-head h1 { margin:.4rem 0 .25rem; font-size:clamp(2rem,4vw,3rem); }
.direction-dashboard-head p,.direction-card-note { color:#a8bad2; }
.direction-dashboard-head-actions { display:flex; align-items:stretch; gap:10px; flex-wrap:wrap; }
.direction-dashboard-head-actions button { min-height:44px; padding:0 16px; border:1px solid rgba(255,255,255,.14); border-radius:12px; background:rgba(255,255,255,.06); color:#fff; font-weight:800; cursor:pointer; }
.direction-dashboard-head-actions button:first-child { border-color:rgba(0,212,170,.35); background:rgba(0,212,170,.10); }
.direction-own-connection{flex:1 0 100%;display:flex;align-items:center;gap:.65rem;min-height:42px;padding:.65rem .8rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:rgba(5,15,29,.34);color:#a8bad2;font-size:.78rem;font-weight:750;line-height:1.35}.direction-own-connection::before{content:"";flex:0 0 .65rem;width:.65rem;height:.65rem;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.12)}.direction-own-connection>span{flex:1;min-width:0}.direction-own-connection>button{flex:0 0 auto;border:1px solid rgba(69,219,201,.45);border-radius:9px;background:rgba(0,161,133,.16);color:#fff;padding:.45rem .6rem;font-size:.72rem;font-weight:850;cursor:pointer}.direction-own-connection>button:hover{background:rgba(0,161,133,.3)}.direction-own-connection.connected{color:#75e6c0;border-color:rgba(0,212,170,.3)}.direction-own-connection.connected::before{background:#00d4aa;box-shadow:0 0 0 4px rgba(0,212,170,.12)}.direction-own-connection.waiting::before{background:#ffb62e}.direction-own-connection.offline::before{background:#f59e0b}@media(max-width:700px){.direction-own-connection{align-items:stretch;flex-wrap:wrap}.direction-own-connection>button{flex:1 0 100%}}
.direction-dashboard-back { align-self:flex-start; margin:0; }
.direction-stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.direction-stat-card { padding:20px; border:1px solid rgba(58,95,205,.28); border-radius:18px; background:rgba(255,255,255,.045); color:#a8bad2; }
.direction-stat-card strong { display:block; margin-top:7px; color:var(--lass-mint); font-size:1.8rem; }
.direction-dashboard-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(300px,1fr); gap:18px; }
.direction-control-card { margin-bottom:18px; padding:24px; border:1px solid rgba(58,95,205,.25); border-radius:22px; background:rgba(255,255,255,.04); box-shadow:0 16px 45px rgba(0,0,0,.16); }
.direction-control-card h2 { margin:.42rem 0 1.2rem; font-size:1.55rem; }
.direction-mother-code { padding:18px; border:1px solid rgba(229,169,59,.38); border-radius:17px; background:rgba(229,169,59,.10); }
.direction-child-code-card { padding:18px; border:1px solid rgba(0,212,170,.25); border-radius:18px; background:linear-gradient(135deg,rgba(0,212,170,.08),rgba(58,95,205,.08)); box-shadow:0 12px 28px rgba(0,0,0,.12); }
.direction-child-code-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.direction-child-code-head strong,.direction-child-code-head small { display:block; }
.direction-child-code-head strong { margin-top:5px; color:#fff; font-size:1rem; }
.direction-child-code-head small { margin-top:3px; color:#91a5c1; }
.direction-child-code-label { color:var(--lass-mint); font-size:.64rem; font-weight:950; letter-spacing:.13em; }
.direction-child-code-badge { display:grid; min-width:40px; height:32px; place-items:center; border:1px solid rgba(0,212,170,.28); border-radius:10px; background:rgba(0,212,170,.11); color:var(--lass-mint); font-size:.72rem; font-weight:950; }
.direction-child-code-shell { overflow:hidden; margin:14px 0 12px; padding:13px 14px; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:#071426; }
.direction-child-code-shell code { display:block; overflow-wrap:anywhere; color:#eaf4ff; font-size:.79rem; font-weight:750; line-height:1.55; letter-spacing:.025em; }
.direction-child-code-grid { display:grid!important; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; filter:none; }
.direction-child-code-grid.secret-masked span { filter:blur(7px); user-select:none; }
.direction-child-code-grid span { display:grid; min-width:0; min-height:40px; place-items:center; border:1px solid rgba(0,212,170,.25); border-radius:9px; background:rgba(13,41,73,.82); color:#eef8ff; font-size:.8rem; font-weight:950; letter-spacing:.09em; }
.direction-child-code-actions { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.direction-child-code-actions button { min-height:36px; padding:0 12px; border:1px solid rgba(148,163,184,.30); border-radius:9px; background:rgba(15,35,59,.86); color:#fff; font-weight:800; cursor:pointer; }
.direction-child-code-actions button:not(.danger):hover { border-color:rgba(0,212,170,.55); background:rgba(0,212,170,.11); }
.direction-child-code-actions .danger { border-color:rgba(239,68,68,.35); background:rgba(127,29,29,.45); }
.direction-code-value { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:7px; }
.direction-code-value code { color:#fff; font-size:.98rem; font-weight:850; letter-spacing:.08em; word-break:break-word; }
.direction-code-value button,.direction-users-title button { min-height:38px; padding:0 14px; border:1px solid rgba(255,255,255,.13); border-radius:10px; background:rgba(255,255,255,.07); color:#fff; font-weight:800; cursor:pointer; }
.direction-list { display:grid; gap:10px; margin-top:14px; }
.direction-list-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 17px; border:1px solid rgba(255,255,255,.09); border-radius:15px; background:rgba(255,255,255,.035); }
.direction-list-row strong,.direction-list-row small { display:block; }
.direction-list-row small { margin-top:4px; color:#91a5c1; }
.direction-cloud-account-row { display:grid; grid-template-columns:minmax(0,1fr); align-items:start; }
.direction-cloud-identity { min-width:0; padding-top:4px; }
.direction-cloud-button-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; min-width:0; gap:7px; }
.direction-cloud-button-row button { overflow:hidden; width:100%; min-width:0; min-height:36px; padding:0 7px; white-space:nowrap; text-align:center; font-size:clamp(.66rem,1.15vw,.78rem); line-height:1.1; }
.direction-cloud-button-row button.danger { border-color:rgba(239,68,68,.42); background:rgba(127,29,29,.55); }
.direction-cloud-button-row button.manual-sync{grid-column:1/-1;border-color:rgba(16,185,129,.52);background:linear-gradient(135deg,rgba(37,99,235,.88),rgba(16,185,129,.88));color:#fff}
.direction-cloud-button-row button.direction-restore{grid-column:1/-1;border-color:rgba(96,165,250,.5);background:rgba(30,64,175,.5);color:#dbeafe}
.direction-cloud-button-row button:disabled { opacity:.38; cursor:not-allowed; filter:saturate(.4); }
.direction-status { padding:7px 11px; border-radius:999px; font-size:.75rem; font-weight:900; white-space:nowrap; }
.direction-status.connected { background:rgba(0,212,170,.14); color:var(--lass-mint); }
.direction-status.offline { background:rgba(245,158,11,.15); color:#f59e0b; }
.direction-status.waiting { background:rgba(245,158,11,.15); color:#ffb62e; }
.direction-table-wrap { overflow:auto; border:1px solid rgba(255,255,255,.08); border-radius:15px; }
.direction-table-wrap table { width:100%; border-collapse:collapse; }
.direction-table-wrap th,.direction-table-wrap td { padding:13px 15px; text-align:left; border-bottom:1px solid rgba(255,255,255,.07); }
[data-theme="dark"] .direction-table-wrap th { background:#0d2949; color:#f8fbff; }
[data-theme="dark"] .direction-table-wrap td { background:#101e33; color:#dce8f7; }
[data-theme="dark"] .direction-table-wrap tbody tr:hover td { background:#142944; color:#fff; }
[data-theme="dark"] #dist-direction-performance td strong { color:#fff; }
.direction-users-groups { display:grid; gap:12px; }
.direction-users-group { overflow:hidden; border:1px solid rgba(255,255,255,.09); border-radius:16px; }
.direction-users-title { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; background:rgba(255,255,255,.05); }
.direction-users-title strong,.direction-users-title small { display:block; }
.direction-users-title small { margin-top:3px; color:#91a5c1; }
.direction-empty { padding:16px; color:#91a5c1; }
.direction-tool-section { scroll-margin-top:24px; }
.direction-audit-controls { display:grid; grid-template-columns:minmax(220px,2fr) minmax(130px,.7fr) minmax(150px,.8fr) auto; gap:10px; align-items:center; margin:16px 0; }
.direction-audit-controls input,.direction-audit-controls select { min-width:0; min-height:44px; padding:0 12px; border:1px solid rgba(255,255,255,.13); border-radius:11px; background:#14233a; color:#fff; }
.direction-audit-controls output { justify-self:end; color:#8fe7d6; font-weight:800; white-space:nowrap; }
.direction-audit-group + .direction-audit-group { margin-top:18px; }
.direction-audit-group h3 { margin:0; padding:10px 12px; border:1px solid rgba(45,212,191,.2); border-bottom:0; border-radius:12px 12px 0 0; background:rgba(45,212,191,.08); color:#8fe7d6; font-size:.92rem; text-transform:capitalize; }
.collapsible-body { padding-top:12px; }
@media(max-width:850px){.direction-audit-controls{grid-template-columns:1fr 1fr}.direction-audit-controls output{justify-self:start}}
@media(max-width:560px){.direction-audit-controls{grid-template-columns:1fr}}
.direction-accounting-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:18px 0; }
.direction-accounting-form input,.direction-accounting-form select { min-width:0; min-height:44px; padding:0 12px; border:1px solid rgba(255,255,255,.13); border-radius:11px; background:#14233a; color:#fff; }
.direction-accounting-form button { min-height:44px; white-space:nowrap; }
.direction-subheading { margin:22px 0 10px; color:#dbe8f7; font-size:1.05rem; }
.direction-accounting-delete { min-height:32px; padding:0 10px; border:1px solid rgba(239,68,68,.28); border-radius:8px; background:rgba(239,68,68,.1); color:#ff9b9b; font-weight:800; cursor:pointer; }
.direction-financial-kpis { margin-top:16px; }
.direction-result-positive { color:var(--lass-mint); font-weight:900; }
.direction-result-negative { color:#fb7185; font-weight:900; }
.direction-alert-list { display:grid; gap:10px; }
.direction-alert-item { display:grid; grid-template-columns:38px 1fr; gap:12px; align-items:start; padding:14px 16px; border:1px solid rgba(255,255,255,.09); border-radius:14px; background:rgba(255,255,255,.035); }
.direction-alert-item>span { display:grid; width:34px; height:34px; place-items:center; border-radius:10px; font-weight:950; }
.direction-alert-item strong,.direction-alert-item small { display:block; }
.direction-alert-item small { margin-top:4px; color:#91a5c1; }
.direction-alert-item.warning>span { background:rgba(245,158,11,.16); color:#fbbf24; }
.direction-alert-item.danger>span { background:rgba(239,68,68,.16); color:#fb7185; }
.direction-alert-item.success>span { background:rgba(0,212,170,.14); color:var(--lass-mint); }

/* Distribution workspace sidebar */
#main-app-wrapper { min-height:100vh; padding-left:250px; background:radial-gradient(circle at 90% 10%,rgba(0,212,170,.08),transparent 25%),#f4f7fb; }
.module-sidebar { position:fixed; inset:0 auto 0 0; z-index:120; display:flex; flex-direction:column; width:232px; padding:18px 12px; border-right:1px solid rgba(255,255,255,.08); background:#071123; color:#fff; }
.module-sidebar-brand { display:flex; align-items:center; gap:12px; padding:0 6px 22px; border-bottom:1px solid rgba(255,255,255,.09); }
.module-sidebar-brand>img { flex:0 0 46px; width:46px; height:46px; padding:3px; border-radius:14px; background:#fff; object-fit:contain; }
.module-sidebar-brand strong,.module-sidebar-brand small { display:block; }
.module-sidebar-brand strong { font-size:1.08rem; }.module-sidebar-brand small { margin-top:3px; color:#91a5c1; font-size:.76rem; }
.module-tabs { display:flex!important; flex:1; flex-direction:column; gap:6px; margin:16px 0 0!important; padding:0 4px 0 0!important; overflow-y:auto; overflow-x:hidden!important; scrollbar-width:none; border:0!important; border-radius:0!important; background:transparent!important; box-shadow:none!important; }
.module-tabs::-webkit-scrollbar{display:none;width:0;height:0}
.module-tabs .tab-btn,.module-change-distribution { width:100%; min-height:54px; justify-content:flex-start; padding:0 15px; border:0; border-radius:14px; background:transparent; color:#9eacc2; font:750 .95rem var(--font-outfit); text-align:left; cursor:pointer; }
.module-tabs .tab-btn span,.module-change-distribution span { width:26px; font-size:1.12rem; text-align:center; }
.module-tabs .tab-btn.active { background:linear-gradient(100deg,rgba(58,95,205,.38),rgba(27,169,123,.24)); color:#fff; box-shadow:inset 3px 0 0 var(--lass-mint); }
.module-change-distribution { display:flex; align-items:center; gap:.5rem; }
.module-change-distribution:hover,.module-tabs .tab-btn:hover { background:rgba(255,255,255,.06); color:#fff; }
.module-sidebar-footer { display:grid; gap:8px; padding-top:15px; border-top:1px solid rgba(255,255,255,.09); }
.module-sidebar-footer button { min-height:40px; border:1px solid rgba(255,255,255,.11); border-radius:10px; background:rgba(255,255,255,.05); color:#d8e4f2; cursor:pointer; }
.main-top-tabs { display:none!important; }
#main-app-wrapper>.container { width:auto; max-width:none; margin:0; padding:1.25rem 1.5rem 2rem; }
#main-app-wrapper>.container>div:first-child { display:none!important; }
#main-app-wrapper>header { position:relative; z-index:50; }
#main-app-wrapper>header .header-controls { min-width:0; padding-right:142px; gap:.65rem; }
#main-app-wrapper .header-user-badge { min-width:0; max-width:310px; }
#main-app-wrapper #header-user-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#app-context-bar,#app-context-bar * { color:#000!important; }
#app-context-bar { background:#fff!important; }
#cloud-status-badge-container { border:1px solid #f59e0b; background:rgba(245,158,11,.16); color:#f59e0b; }
#cloud-status-badge-container[data-status="connected"] { border-color:var(--lass-mint); background:rgba(0,212,170,.14); color:#008f74; }
#cloud-status-badge-container[data-status="syncing"] { border-color:#3a5fcd; background:rgba(58,95,205,.14); color:#3a5fcd; }
#cloud-sync-label,#cloud-sync-badge { color:inherit!important; }

/* Tableau des ventes : affichage complet sans défilement horizontal sur ordinateur. */
.sales-list-table-wrap{overflow-x:hidden!important}
.sales-list-table{width:100%;table-layout:fixed;font-size:.76rem}
.sales-list-table th{padding:.58rem .28rem;font-size:.72rem;line-height:1.2;overflow-wrap:anywhere}
.sales-list-table td{padding:.58rem .28rem;line-height:1.35;overflow-wrap:anywhere;vertical-align:middle}
.sales-list-table th:nth-child(1){width:14%}.sales-list-table th:nth-child(2){width:6%}.sales-list-table th:nth-child(3){width:5%}.sales-list-table th:nth-child(4){width:6%}.sales-list-table th:nth-child(5){width:5%}.sales-list-table th:nth-child(6){width:7%}.sales-list-table th:nth-child(7){width:8%}.sales-list-table th:nth-child(8),.sales-list-table th:nth-child(9){width:8%}.sales-list-table th:nth-child(10){width:8%}.sales-list-table th:nth-child(11){width:7%}.sales-list-table th:nth-child(12){width:8%}
.sales-list-table .qty-input{width:100%!important;min-width:0;max-width:76px;padding:.25rem .15rem;font-size:.74rem}
.sales-row-actions{display:flex;align-items:center;justify-content:center;gap:.2rem;white-space:nowrap}
.sales-row-actions .btn{width:27px;min-width:27px;height:27px;padding:0!important;display:inline-grid;place-items:center;font-size:.7rem}
.sale-total-preview{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:.75rem 0;padding:.75rem 1rem;border:1px solid rgba(27,169,123,.35);border-radius:12px;background:linear-gradient(100deg,rgba(58,95,205,.12),rgba(27,169,123,.14))}.sale-total-preview span{font-size:.82rem;font-weight:700;color:var(--text-secondary)}.sale-total-preview strong{font-size:1.12rem;color:var(--success)}
.delivery-refresh-btn{height:34px;align-self:flex-end;padding:0 .75rem;font-size:.8rem;font-weight:700}
.delivery-scope-controls{gap:.55rem!important}
.delivery-scope-option{position:relative;min-width:168px;min-height:42px;justify-content:flex-start;padding:.55rem .75rem;border:1px solid rgba(148,163,184,.28);border-radius:12px;background:linear-gradient(145deg,rgba(148,163,184,.08),rgba(58,95,205,.06));font-weight:700!important;font-size:.8rem!important;line-height:1.2;box-shadow:0 5px 14px rgba(15,23,42,.08);transition:border-color .2s ease,background .2s ease,transform .2s ease,box-shadow .2s ease}
.delivery-scope-option:hover{transform:translateY(-1px);border-color:rgba(58,95,205,.55);box-shadow:0 8px 18px rgba(15,23,42,.13)}
.delivery-scope-option:has(input:checked){border-color:rgba(27,169,123,.72);background:linear-gradient(135deg,rgba(58,95,205,.18),rgba(27,169,123,.2));box-shadow:inset 3px 0 0 var(--lass-mint),0 7px 18px rgba(27,169,123,.12)}
.delivery-scope-option input{width:18px!important;height:18px!important;min-width:18px;margin:0;accent-color:var(--lass-mint);cursor:pointer}
[data-theme="dark"] .delivery-scope-option{border-color:rgba(255,255,255,.13);background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(58,95,205,.08));color:#e8eef8!important}
[data-theme="dark"] .delivery-scope-option:has(input:checked){border-color:rgba(0,212,170,.55);background:linear-gradient(135deg,rgba(58,95,205,.24),rgba(0,212,170,.15))}
@media(max-width:760px){.delivery-scope-controls{width:100%;margin-left:0!important}.delivery-scope-option{flex:1 1 100%;min-width:100%}}
@media(max-width:1050px){.sales-list-table-wrap{overflow-x:auto!important}.sales-list-table{min-width:920px}}

@media(max-width:1100px) {
    .direction-stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .direction-dashboard-grid { grid-template-columns:1fr; }
    .direction-accounting-form { grid-template-columns:1fr 1fr; }
}
@media(max-width:820px) {
    #main-app-wrapper { padding-left:0; }
    .module-sidebar { position:relative; width:auto; min-height:auto; padding:14px; }
    .module-tabs { flex-direction:row; overflow-x:auto; }
    .module-tabs .tab-btn,.module-change-distribution { min-width:max-content; width:auto; }
    .module-sidebar-footer { display:none; }
    .direction-dashboard-head { flex-direction:column; }
    .direction-dashboard-back { margin:0; }
    .direction-stats-grid { grid-template-columns:1fr 1fr; }
    .direction-accounting-form { grid-template-columns:1fr; }
}
@media(max-width:560px) {
    .direction-stats-grid { grid-template-columns:1fr; }
    .direction-list-row,.direction-code-value,.direction-users-title { align-items:flex-start; flex-direction:column; }
}

@media (min-width:901px) {
    .direction-workspace .direction-content { scrollbar-width:thin!important; scrollbar-color:var(--lass-mint) #071123!important; }
    .direction-workspace .direction-content::-webkit-scrollbar { display:block!important; width:10px!important; }
    .direction-workspace .direction-content::-webkit-scrollbar-track { background:#071123; }
    .direction-workspace .direction-content::-webkit-scrollbar-thumb { border:2px solid #071123; border-radius:99px; background:linear-gradient(var(--lass-mint),var(--lass-blue-soft)); }
}

/* Preserve the deep navy workspace when dark mode is active. */
[data-theme="dark"] #main-app-wrapper {
    background:radial-gradient(circle at 88% 8%,rgba(0,212,170,.08),transparent 24%),#071123;
    color:#f8fafc;
}
[data-theme="dark"] #main-app-wrapper > header {
    background:linear-gradient(100deg,#071123,#102c48);
}
[data-theme="dark"] #app-context-bar {
    border-color:rgba(58,95,205,.32)!important;
    background:#111d33!important;
    box-shadow:0 14px 34px rgba(0,0,0,.28);
}
[data-theme="dark"] #app-context-bar * { color:#f8fafc!important; }
[data-theme="dark"] #main-app-wrapper .card,
[data-theme="dark"] #main-app-wrapper .stat-card,
[data-theme="dark"] #main-app-wrapper .delivery-selector-card,
[data-theme="dark"] #main-app-wrapper .client-zone-card,
[data-theme="dark"] #main-app-wrapper .zone-card,
[data-theme="dark"] #main-app-wrapper .search-bar,
[data-theme="dark"] #main-app-wrapper .table-responsive {
    border-color:rgba(255,255,255,.10);
    background:#111d33;
    color:#f8fafc;
    box-shadow:0 16px 38px rgba(0,0,0,.24);
}
[data-theme="dark"] #main-app-wrapper input,
[data-theme="dark"] #main-app-wrapper select,
[data-theme="dark"] #main-app-wrapper textarea {
    border-color:rgba(255,255,255,.12);
    background:#0b172a;
    color:#f8fafc;
}
[data-theme="dark"] #main-app-wrapper .text-secondary,
[data-theme="dark"] #main-app-wrapper .stat-card-header,
[data-theme="dark"] #main-app-wrapper .stat-card-footer {
    color:#a9b8cc!important;
}
[data-theme="dark"] #main-app-wrapper .btn-primary,
[data-theme="dark"] #main-app-wrapper #btn-add-client {
    background:linear-gradient(135deg,#3A5FCD,#1BA97B);
    color:#fff;
}
.global-fullscreen-control{position:fixed!important;top:10px;right:10px;z-index:13050!important;display:inline-grid!important;width:36px;height:36px;place-items:center;border:1px solid rgba(255,255,255,.22);border-radius:11px;background:#0b1730;color:#fff;padding:0!important;font-size:.94rem;font-weight:800;box-shadow:0 7px 18px rgba(0,0,0,.2);cursor:pointer}.global-fullscreen-control span{display:none!important}.auth-fullscreen-corner-btn{display:none!important}.direction-secret-actions,.direction-cloud-actions{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem}.direction-secret-actions button,.direction-cloud-actions button{border:1px solid rgba(148,163,184,.35);border-radius:8px;padding:.35rem .55rem;background:rgba(15,23,42,.65);color:#fff;font-weight:700;cursor:pointer}.secret-masked{filter:blur(7px);user-select:none}@media(max-width:700px){.global-fullscreen-control{top:7px;right:7px;width:34px;height:34px}}
.direction-cloud-actions{width:100%;min-width:0;align-items:stretch!important;margin-top:10px}.direction-cloud-actions .direction-status{align-self:flex-start}.direction-child-code-grid.secret-masked{filter:none}
@media(max-width:850px){.direction-cloud-account-row{grid-template-columns:1fr}.direction-cloud-actions{min-width:0;align-items:stretch}.direction-status{align-self:flex-start}.direction-child-code-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:480px){.direction-list-row{padding:14px 12px}.direction-cloud-button-row{gap:5px}.direction-cloud-button-row button{min-height:38px;padding:0 3px;font-size:.64rem;letter-spacing:-.01em}.direction-child-code-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
.global-theme-control { position:fixed; top:10px; right:54px; z-index:13050; display:grid; width:36px; height:36px; place-items:center; padding:0; border:1px solid rgba(255,255,255,.22); border-radius:11px; background:#0b1730; color:#fff; box-shadow:0 7px 18px rgba(0,0,0,.2); font-size:1rem; font-weight:850; cursor:pointer; }
.global-refresh-control { position:fixed; top:10px; right:98px; z-index:13050; display:grid; width:36px; height:36px; place-items:center; padding:0; border:1px solid rgba(255,255,255,.22); border-radius:11px; background:#0b1730; color:#fff; box-shadow:0 7px 18px rgba(0,0,0,.2); font-size:1.15rem; line-height:1; font-weight:900; cursor:pointer; }
.global-refresh-icon{display:inline-block;transform-origin:50% 50%}.global-refresh-control.is-refreshing{cursor:wait;opacity:.82}.global-refresh-control.is-refreshing .global-refresh-icon{animation:espeleva-refresh-spin .72s linear infinite}@keyframes espeleva-refresh-spin{to{transform:rotate(360deg)}}
.global-back-control { position:fixed; top:10px; right:142px; z-index:13050; display:grid; width:36px; height:36px; place-items:center; padding:0; border:1px solid rgba(255,255,255,.22); border-radius:11px; background:#0b1730; color:#fff; box-shadow:0 7px 18px rgba(0,0,0,.2); font-size:1.15rem; line-height:1; font-weight:900; cursor:pointer; }
.global-theme-control:hover,.global-refresh-control:hover,.global-fullscreen-control:hover,.global-back-control:hover { border-color:rgba(0,212,170,.62); background:#123053; transform:translateY(-1px); }
[data-theme="light"] .global-theme-control,[data-theme="light"] .global-refresh-control,[data-theme="light"] .global-fullscreen-control,[data-theme="light"] .global-back-control { border-color:#b9c9dc; background:#fff; color:#17385f; box-shadow:0 8px 22px rgba(28,52,83,.16); }
@media(max-width:700px){.global-theme-control{top:7px;right:49px;width:34px;height:34px}.global-refresh-control{top:7px;right:91px;width:34px;height:34px}.global-back-control{top:7px;right:133px;width:34px;height:34px}}
.fullscreen-toggle-btn:not(.global-fullscreen-control){display:none!important}
.floating-theme-control{flex:0 0 36px!important;width:36px!important;height:36px!important;padding:0!important;border-radius:11px!important;border:1px solid rgba(148,163,184,.35)!important;background:linear-gradient(145deg,#102441,#071426)!important;color:#fff!important;box-shadow:0 7px 18px rgba(7,20,38,.16);font-size:1rem}
.floating-theme-control:hover{transform:translateY(-1px);border-color:rgba(27,169,123,.65)!important;background:linear-gradient(145deg,#17365f,#0b243d)!important}
.collapsible-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem}.collapsible-heading button{width:34px;height:34px;border-radius:9px;border:1px solid rgba(148,163,184,.35);background:rgba(15,23,42,.65);color:#fff;font-size:1.25rem;cursor:pointer}.collapsible-body.is-collapsed{display:none}.direction-user-actions{display:flex;align-items:center;justify-content:flex-end;gap:.35rem;flex-wrap:wrap}.direction-user-actions button,.direction-secret-actions .danger{border:1px solid rgba(239,68,68,.45);border-radius:8px;background:rgba(127,29,29,.55);color:#fff;padding:.35rem .55rem;cursor:pointer}

/* Parcours obligatoire : secteur, produit mere, espace de distribution. */
.dist-catalog-screen{width:min(1180px,94vw);margin:auto;align-items:center;justify-content:center;padding:28px 0;color:#fff}
.dist-catalog-shell{width:100%;padding:clamp(24px,4vw,46px);border:1px solid rgba(45,212,191,.28);border-radius:28px;background:linear-gradient(145deg,rgba(7,26,47,.98),rgba(8,18,35,.98));box-shadow:0 30px 90px rgba(0,0,0,.38)}
.dist-catalog-heading{text-align:center;max-width:720px;margin:0 auto 2rem}.dist-catalog-heading h2{margin:.65rem 0 .45rem;font-size:clamp(1.65rem,3vw,2.35rem);color:#fff}.dist-catalog-heading p{margin:0;color:#a9b8d0;line-height:1.55}
.dist-catalog-connection-card{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 auto 1.35rem;padding:.9rem 1rem;border:1px solid rgba(148,163,184,.28);border-radius:16px;background:rgba(3,13,27,.48);color:#dce8f6}.dist-catalog-connection-card.connected{border-color:rgba(0,212,170,.42);background:rgba(0,124,102,.14)}.dist-catalog-connection-card.waiting{border-color:rgba(245,158,11,.38);background:rgba(120,75,5,.14)}.dist-catalog-connection-copy{display:flex;align-items:flex-start;gap:.7rem;min-width:0}.dist-catalog-connection-dot{flex:0 0 .72rem;width:.72rem;height:.72rem;margin-top:.22rem;border-radius:50%;background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.13)}.dist-catalog-connection-card.connected .dist-catalog-connection-dot{background:#00d4aa;box-shadow:0 0 0 4px rgba(0,212,170,.13)}.dist-catalog-connection-copy strong,.dist-catalog-connection-copy small{display:block}.dist-catalog-connection-copy strong{font-size:.86rem}.dist-catalog-connection-copy small{margin-top:.2rem;color:#9fb2ca;line-height:1.4}.dist-catalog-connection-card button{flex:0 0 auto;border:1px solid rgba(69,219,201,.5);border-radius:11px;background:rgba(0,161,133,.2);color:#fff;padding:.62rem .8rem;font-weight:800;cursor:pointer}.dist-catalog-connection-card button:hover{background:rgba(0,161,133,.34)}
.dist-catalog-step{display:inline-flex;align-items:center;justify-content:center;padding:.38rem .72rem;border:1px solid rgba(45,212,191,.34);border-radius:999px;background:rgba(45,212,191,.1);color:#45dbc9;font-size:.72rem;font-weight:900;letter-spacing:.12em}
.dist-catalog-icon{display:grid;place-items:center;width:58px;height:58px;margin:.9rem auto 0;border-radius:18px;background:linear-gradient(135deg,#315ec9,#22b49d);font-size:1.75rem;box-shadow:0 12px 28px rgba(35,117,198,.25)}
.dist-catalog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.3rem}
.dist-catalog-card{min-height:155px;padding:1.2rem;border:1px solid rgba(54,199,181,.25);border-radius:20px;background:linear-gradient(145deg,rgba(20,54,78,.82),rgba(11,27,49,.96));color:#fff;text-align:left;cursor:pointer;display:flex;flex-direction:column;justify-content:space-between;gap:.65rem;transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease}
.dist-catalog-card:hover{transform:translateY(-4px);border-color:#38d2be;box-shadow:0 18px 38px rgba(0,0,0,.28)}.dist-catalog-card-icon{font-size:2rem}.dist-catalog-card strong{font-size:1rem;line-height:1.35}.dist-catalog-card small{color:#70e0d1;font-weight:750}
@media(max-width:700px){.dist-catalog-connection-card{align-items:stretch;flex-direction:column}.dist-catalog-connection-card button{width:100%}}
.dist-catalog-footer{display:flex;justify-content:center;margin-top:1.7rem}.dist-catalog-empty{grid-column:1/-1;padding:2rem;text-align:center;border:1px dashed rgba(255,255,255,.2);border-radius:18px;color:#a9b8d0}
.dist-catalog-direction-actions{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;margin-top:1rem}.dist-catalog-manager-modal{width:min(900px,94vw);max-width:900px}.dist-catalog-manager-body{max-height:64vh;overflow-y:auto;padding:.3rem .2rem 1rem}.dist-catalog-manager-note{padding:.85rem 1rem;border-radius:12px;background:rgba(49,94,201,.1);color:var(--text-secondary)}
.dist-manager-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin:1rem 0}.dist-manager-list label{display:flex;align-items:center;gap:.65rem;padding:.75rem;border:1px solid var(--border);border-radius:12px;background:var(--bg-active);cursor:pointer}.dist-manager-list input{width:18px;height:18px;accent-color:#21b9a6}.dist-animal-manager-sections{display:grid;gap:1rem}.dist-animal-manager-sections section{padding:1rem;border:1px solid var(--border);border-radius:16px;background:rgba(255,255,255,.025)}.dist-animal-manager-sections h4{margin:0;color:#25c5b2}.dist-manager-add-row{display:grid;grid-template-columns:1fr 120px;gap:.65rem}
.dist-delivery-manager-group{margin-top:.85rem;padding:.85rem;border:1px solid rgba(255,255,255,.09);border-radius:13px;background:rgba(0,0,0,.12)}.dist-delivery-manager-group h5{margin:0 0 .65rem;color:#fff;font-size:.95rem}.dist-delivery-add-row{display:grid;grid-template-columns:minmax(0,1fr) 130px 130px 85px;gap:.65rem}
#product-card-animal::before{background:radial-gradient(circle at center,rgba(34,197,179,.18) 0%,transparent 70%)}#product-card-animal:hover{box-shadow:0 15px 30px rgba(34,197,179,.15),0 0 0 1px rgba(34,197,179,.25);border-color:rgba(34,197,179,.42)}
@media(max-width:850px){.dist-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dist-catalog-direction-actions,.dist-manager-list{grid-template-columns:1fr}}
@media(max-width:560px){.dist-catalog-grid{grid-template-columns:1fr}.dist-catalog-card{min-height:130px}.dist-manager-add-row{grid-template-columns:1fr}}
@media(max-width:700px){.dist-delivery-add-row{grid-template-columns:1fr}}

/* Fenetres de confirmation professionnelles, compactes et centrees. */
.app-dialog-card{
    width:min(400px,calc(100vw - 30px));
    padding:1.15rem 1.2rem;
    border:1px solid rgba(58,95,205,.34);
    border-radius:20px;
    background:linear-gradient(155deg,var(--bg-card),var(--bg-primary));
    box-shadow:0 30px 90px rgba(4,10,22,.42);
}
.app-dialog-icon{
    width:48px;
    height:48px;
    margin-bottom:.65rem;
    border-radius:15px;
    box-shadow:0 10px 24px rgba(49,94,201,.22);
}
.app-dialog-card h3{font-size:1.05rem;color:var(--text-primary)}
.app-dialog-card p{max-width:330px;margin:0 auto;font-size:.84rem;line-height:1.5}
.app-dialog-card #app-dialog-input{width:100%;margin-left:auto;margin-right:auto;text-align:center;font-weight:800;letter-spacing:.025em}
.app-dialog-actions{margin-top:.95rem;gap:.5rem}
.app-dialog-actions .btn{min-width:105px;min-height:38px;padding:.45rem .75rem}

/* Mode clair lisible : fonds doux, surfaces blanches et contraste renforce. */
[data-theme="light"]{
    --bg-primary:#edf3fa;
    --bg-card:#ffffff;
    --bg-active:#e7eef8;
    --text-primary:#10233f;
    --text-secondary:#42556f;
    --border:#cbd8e8;
    --primary:#2459bd;
    --success:#118664;
}
[data-theme="light"] body{
    background:
        radial-gradient(circle at 86% 5%,rgba(27,169,123,.11),transparent 27%),
        radial-gradient(circle at 56% -5%,rgba(58,95,205,.13),transparent 30%),
        linear-gradient(150deg,#f6f9fd,#e8f0f8);
    color:#10233f;
}
[data-theme="light"] #main-app-wrapper{
    background:
        radial-gradient(circle at 90% 8%,rgba(27,169,123,.10),transparent 24%),
        linear-gradient(145deg,#eef4fb,#e6eef7);
    color:#10233f;
}
[data-theme="light"] #main-app-wrapper>header{
    background:rgba(255,255,255,.95);
    border-bottom:1px solid #cbd8e8;
    box-shadow:0 12px 34px rgba(30,57,91,.10);
    backdrop-filter:blur(16px);
}
[data-theme="light"] #main-app-wrapper .brand-info h1{color:#10233f}
[data-theme="light"] #main-app-wrapper .brand-info p{color:#526681}
[data-theme="light"] #main-app-wrapper .card,
[data-theme="light"] #main-app-wrapper .stat-card,
[data-theme="light"] #main-app-wrapper .delivery-selector-card,
[data-theme="light"] #main-app-wrapper .client-zone-card,
[data-theme="light"] #main-app-wrapper .zone-card,
[data-theme="light"] #main-app-wrapper .search-bar,
[data-theme="light"] #main-app-wrapper .table-responsive{
    background:rgba(255,255,255,.96);
    border-color:#cbd8e8;
    color:#10233f;
    box-shadow:0 14px 34px rgba(30,57,91,.09);
}
[data-theme="light"] #main-app-wrapper .card-title{color:#16345d}
[data-theme="light"] #main-app-wrapper th{
    background:#dce8f6;
    color:#17385f;
    border-bottom-color:#b9cbe0;
}
[data-theme="light"] #main-app-wrapper td{
    color:#162b46;
    border-bottom-color:#d7e1ed;
}
[data-theme="light"] #main-app-wrapper tr:hover td{background:#edf4fb}
[data-theme="light"] #main-app-wrapper input,
[data-theme="light"] #main-app-wrapper select,
[data-theme="light"] #main-app-wrapper textarea{
    background:#fff;
    border:1px solid #bdccdd;
    color:#10233f;
    box-shadow:inset 0 1px 2px rgba(30,57,91,.04);
}
[data-theme="light"] #main-app-wrapper input::placeholder,
[data-theme="light"] #main-app-wrapper textarea::placeholder{color:#70829a}
[data-theme="light"] #main-app-wrapper label,
[data-theme="light"] #main-app-wrapper .text-secondary,
[data-theme="light"] #main-app-wrapper .stat-card-header,
[data-theme="light"] #main-app-wrapper .stat-card-footer{color:#42556f!important}
[data-theme="light"] #app-context-bar{
    background:#fff!important;
    border-color:#cbd8e8!important;
    box-shadow:0 10px 26px rgba(30,57,91,.08);
}
[data-theme="light"] #app-context-bar,
[data-theme="light"] #app-context-bar *{color:#10233f!important}
[data-theme="light"] .app-dialog-card{
    background:linear-gradient(155deg,#fff,#eef4fb);
    color:#10233f;
}
[data-theme="light"] .delivery-scope-option{
    background:linear-gradient(145deg,#fff,#edf3fa);
    border-color:#c3d2e3;
    color:#1a3454!important;
}

/* Centre de contrôle Direction — thème clair professionnel et fortement contrasté. */
[data-theme="light"] .direction-workspace { background:linear-gradient(145deg,#eef4fb,#e4edf7); color:#132b49; }
[data-theme="light"] .direction-sidebar { border-right-color:#c9d7e7; background:linear-gradient(180deg,#f9fbfe,#e8f0f8); color:#132b49; box-shadow:12px 0 34px rgba(28,52,83,.08); }
[data-theme="light"] .direction-brand { border-bottom-color:#cfdae8; }
[data-theme="light"] .direction-brand strong { color:#102a49; }
[data-theme="light"] .direction-brand small { color:#59708d; }
[data-theme="light"] .direction-version { background:#0bbf9b; color:#032d29; }
[data-theme="light"] .direction-sidebar nav>button { border-left-color:#0aaa8d; background:#d9f3ee; color:#123c46; }
[data-theme="light"] .direction-sidebar .direction-tools-nav button { color:#405a78; }
[data-theme="light"] .direction-sidebar .direction-tools-nav button>span:first-child { background:#dfe9f5; color:#147d76; }
[data-theme="light"] .direction-sidebar .direction-tools-nav button:hover,
[data-theme="light"] .direction-sidebar .direction-tools-nav button.active { border-left-color:#0aaa8d; background:#d8f2ed; color:#103f46; }
[data-theme="light"] .direction-tools-nav>small { color:#617997; }
[data-theme="light"] .direction-profile { border-color:#c5d4e4; background:rgba(255,255,255,.78); box-shadow:0 12px 28px rgba(30,57,91,.10); }
[data-theme="light"] .direction-profile strong { color:#15324f; }
[data-theme="light"] .direction-profile small { color:#087c69; }
[data-theme="light"] .direction-profile button { border-color:#bdccdd; background:#edf3fa; color:#17385f; }
[data-theme="light"] .direction-content { color:#132b49; }
[data-theme="light"] .direction-hero,
[data-theme="light"] .direction-dashboard-head { border-color:#b8cae0; background:linear-gradient(125deg,#fff,#e5effa 60%,#d8f3ec); box-shadow:0 18px 42px rgba(30,57,91,.10); }
[data-theme="light"] .direction-hero h1,
[data-theme="light"] .direction-dashboard-head h1,
[data-theme="light"] .direction-control-card h2,
[data-theme="light"] .distribution-heading h2 { color:#102a49; }
[data-theme="light"] .direction-hero p,
[data-theme="light"] .direction-dashboard-head p,
[data-theme="light"] .direction-card-note { color:#526a87; }
[data-theme="light"] .direction-hero button,
[data-theme="light"] .direction-dashboard-head-actions button,
[data-theme="light"] .direction-dashboard-back { border-color:#b7c8dc; background:#fff; color:#17385f; }
[data-theme="light"] .distribution-heading { border-bottom-color:#c8d6e6; }
[data-theme="light"] .direction-control-card,
[data-theme="light"] .direction-stat-card { border-color:#c4d3e4; background:rgba(255,255,255,.92); color:#506984; box-shadow:0 14px 36px rgba(30,57,91,.09); }
[data-theme="light"] .direction-stat-card strong { color:#137d70; }
[data-theme="light"] .direction-table-wrap { border-color:#c4d3e4; background:#fff; }
[data-theme="light"] .direction-table-wrap th { background:#dbe8f6; color:#153b63; border-bottom-color:#b8cade; }
[data-theme="light"] .direction-table-wrap td { background:#fff; color:#18334f; border-bottom-color:#d4dfeb; }
[data-theme="light"] .direction-table-wrap tbody tr:hover td { background:#edf5fc; color:#102a49; }
[data-theme="light"] .direction-list-row,
[data-theme="light"] .direction-users-group { border-color:#c9d7e6; background:#f7fafd; color:#173550; }
[data-theme="light"] .direction-list-row small,
[data-theme="light"] .direction-users-title small,
[data-theme="light"] .direction-empty { color:#5c728d; }
[data-theme="light"] .direction-users-title { background:#e8f0f8; }
[data-theme="light"] .direction-mother-code { border-color:#d7b76e; background:#fff8e8; color:#173550; }
[data-theme="light"] .direction-code-value code { color:#102a49; }
[data-theme="light"] .direction-child-code-card { border-color:#b9d9d2; background:linear-gradient(135deg,#f4fcfa,#eef4fb); box-shadow:0 12px 28px rgba(30,57,91,.08); }
[data-theme="light"] .direction-child-code-head strong { color:#15324f; }
[data-theme="light"] .direction-child-code-head small { color:#5c728d; }
[data-theme="light"] .direction-child-code-shell { border-color:#c6d5e5; background:#fff; }
[data-theme="light"] .direction-child-code-shell code { color:#163552; }
[data-theme="light"] .direction-child-code-actions button,
[data-theme="light"] .direction-secret-actions button,
[data-theme="light"] .direction-cloud-actions button,
[data-theme="light"] .collapsible-heading button { border-color:#b9cadd; background:#edf3fa; color:#17385f; }
[data-theme="light"] .direction-accounting-form input,
[data-theme="light"] .direction-accounting-form select { border-color:#b9cadd; background:#fff; color:#15324f; }
[data-theme="light"] .direction-audit-controls input,
[data-theme="light"] .direction-audit-controls select { border-color:#b9cadd; background:#fff; color:#15324f; }
[data-theme="light"] .direction-audit-group h3 { border-color:#b9d9d4; background:#eefaf8; color:#176b62; }
[data-theme="light"] .direction-alert-item { border-color:#c8d7e6; background:#f7fafd; color:#173550; }
[data-theme="light"] .direction-alert-item small { color:#5c728d; }

/* Masque les longues barres verticales sans desactiver le defilement. */
html,
body,
#main-app-wrapper,
.module-sidebar,
.tabs-nav.module-tabs,
.sale-modal-scroll,
.pointes-management-body,
.modal-body,
.settings-modal-body{
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
}
.direction-workspace,
#agency-select-screen,
#auth-screen,
.supplier-workspace,
.dist-catalog-screen{
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
#main-app-wrapper::-webkit-scrollbar,
.module-sidebar::-webkit-scrollbar,
.tabs-nav.module-tabs::-webkit-scrollbar,
.sale-modal-scroll::-webkit-scrollbar,
.pointes-management-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.settings-modal-body::-webkit-scrollbar{
    width:0!important;
    display:none!important;
}
.direction-workspace::-webkit-scrollbar,
#agency-select-screen::-webkit-scrollbar,
#auth-screen::-webkit-scrollbar,
.supplier-workspace::-webkit-scrollbar,
.dist-catalog-screen::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
}

/* Défilement vertical dédié au centre de contrôle de la Direction. */
@media (min-width:901px){
    .direction-workspace,
    #agency-select-screen{
        height:100vh!important;
        max-height:100vh!important;
        min-height:0!important;
        overflow:hidden!important;
    }
    .direction-workspace .direction-content{
        height:100vh;
        min-height:0;
        overflow-y:auto;
        overflow-x:hidden;
        scrollbar-width:thin!important;
        scrollbar-color:var(--lass-mint) #071123!important;
        -ms-overflow-style:none!important;
    }
    .direction-workspace .direction-content::-webkit-scrollbar{
        width:10px!important;
        height:auto!important;
        display:block!important;
    }
    .direction-workspace .direction-content::-webkit-scrollbar-track{
        background:#071123;
    }
    .direction-workspace .direction-content::-webkit-scrollbar-thumb{
        border:2px solid #071123;
        border-radius:99px;
        background:linear-gradient(var(--lass-mint),var(--lass-blue-soft));
    }
}

/* Paramètres 2026 : centre de configuration professionnel et défilement explicite. */
#settingsModal{
    align-items:center;
    justify-content:center;
    padding:18px;
    background:rgba(2,9,20,.78);
    backdrop-filter:blur(12px);
}
#settingsModal .modal-content{
    display:flex;
    flex-direction:column;
    width:min(960px,96vw)!important;
    max-width:960px!important;
    max-height:92vh;
    padding:0!important;
    overflow:hidden;
    border:1px solid rgba(75,118,205,.38);
    border-radius:26px;
    background:linear-gradient(155deg,#12223a 0%,#0a172a 58%,#0d2034 100%);
    box-shadow:0 36px 110px rgba(0,0,0,.52),0 0 0 1px rgba(255,255,255,.025) inset;
}
#settingsModal .modal-header{
    min-height:68px;
    padding:16px 22px;
    border-bottom:1px solid rgba(148,163,184,.16);
    background:linear-gradient(105deg,rgba(58,95,205,.24),rgba(0,212,170,.10));
    font-size:1.12rem;
    font-weight:900;
    letter-spacing:.01em;
}
#settingsModal .modal-close{
    display:grid;
    width:38px;
    height:38px;
    place-items:center;
    border:1px solid rgba(148,163,184,.25);
    border-radius:12px;
    background:rgba(4,14,29,.42);
    color:#eaf2ff;
}
#settingsModal #header-google-account{margin:10px 22px 0;max-width:330px!important}
#settingsModal .settings-tabs{
    flex-wrap:nowrap!important;
    gap:8px!important;
    margin:0!important;
    padding:13px 18px!important;
    overflow-x:auto;
    border-bottom:1px solid rgba(148,163,184,.14)!important;
    background:rgba(3,12,25,.32);
    scrollbar-width:thin;
    scrollbar-color:#20bda5 transparent;
}
#settingsModal .settings-tabs .tab-btn{
    flex:0 0 auto;
    min-height:42px;
    padding:0 15px!important;
    border:1px solid rgba(148,163,184,.20)!important;
    border-radius:12px!important;
    background:rgba(255,255,255,.035)!important;
    color:#b8c8dc!important;
    font-size:.82rem!important;
    font-weight:800!important;
    white-space:nowrap;
    box-shadow:none!important;
}
#settingsModal .settings-tabs .tab-btn:hover{
    border-color:rgba(0,212,170,.45)!important;
    background:rgba(0,212,170,.08)!important;
    color:#fff!important;
}
#settingsModal .settings-tabs .tab-btn.active{
    border-color:rgba(0,212,170,.58)!important;
    background:linear-gradient(135deg,#3769d4,#19ad8c)!important;
    color:#fff!important;
    box-shadow:0 10px 25px rgba(25,173,140,.18)!important;
}
#settingsModal .settings-modal-body{
    flex:1 1 auto;
    min-height:0;
    height:min(62vh,620px)!important;
    max-height:none!important;
    margin:0!important;
    padding:18px 12px 18px 22px!important;
    overflow:hidden!important;
    background:linear-gradient(180deg,rgba(255,255,255,.012),rgba(0,0,0,.055));
}
#settingsModal .settings-tab-view{
    height:100%;
    max-height:100%;
    padding:2px 12px 18px 2px;
    overflow-x:auto;
    overflow-y:auto!important;
    scrollbar-width:thin!important;
    scrollbar-color:#19c3a4 rgba(3,13,27,.62)!important;
}
#settingsModal .settings-tab-view::-webkit-scrollbar{display:block!important;width:10px!important;height:8px!important}
#settingsModal .settings-tab-view::-webkit-scrollbar-track{border-radius:99px;background:rgba(3,13,27,.62)}
#settingsModal .settings-tab-view::-webkit-scrollbar-thumb{border:2px solid rgba(3,13,27,.62);border-radius:99px;background:linear-gradient(#1bd0ac,#4776db)}
#settingsModal .settings-tab-view>div,
#settingsModal .settings-tab-view>form>div{
    border-radius:17px!important;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
}
#settingsModal .settings-suppliers-hero,
#settingsModal .settings-update-hero,
#settingsModal .settings-client-update-card{
    border:1px solid rgba(72,118,211,.28)!important;
    background:linear-gradient(135deg,rgba(55,105,212,.13),rgba(25,173,140,.08))!important;
}
#settingsModal .form-group label{
    display:block;
    margin-bottom:6px;
    color:#b8c9de;
    font-weight:750;
    letter-spacing:.01em;
}
#settingsModal .form-control{
    min-height:42px!important;
    border:1px solid rgba(148,163,184,.24)!important;
    border-radius:11px!important;
    background:rgba(4,16,32,.70)!important;
    color:#f4f8ff!important;
    box-shadow:0 1px 0 rgba(255,255,255,.025) inset;
}
#settingsModal .form-control:focus{
    border-color:#21c3a5!important;
    box-shadow:0 0 0 3px rgba(33,195,165,.13)!important;
}
#settingsModal table{border-collapse:separate!important;border-spacing:0;color:#dce7f5}
#settingsModal th{position:sticky;top:0;z-index:2;background:#132d4b!important;color:#f4f8ff}
#settingsModal td{border-bottom:1px solid rgba(148,163,184,.10)}
#settingsModal .modal-footer{
    min-height:62px;
    padding:11px 20px;
    border-top:1px solid rgba(148,163,184,.14);
    background:rgba(3,12,25,.42);
}
#settingsModal .modal-footer .btn{min-width:120px;min-height:40px;border-radius:11px}
.settings-installed-version{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
    padding:12px 14px;
    border:1px solid rgba(0,212,170,.22);
    border-radius:13px;
    background:rgba(0,212,170,.07);
}
.settings-installed-version span{color:#f6fbff;font-size:1rem;font-weight:900}
.settings-installed-version strong{padding:6px 10px;border-radius:999px;background:rgba(58,95,205,.22);color:#a9c6ff;font-size:.74rem;white-space:nowrap}
.settings-client-update-card{padding:18px}
.settings-update-instructions{margin-bottom:12px;padding:13px 14px;border-radius:13px;background:rgba(255,255,255,.035)}
.settings-update-instructions strong{color:#fff;font-size:.96rem}
.settings-update-instructions p{margin:6px 0 0;color:#b6c5d9;font-size:.82rem;line-height:1.55}
.settings-update-url{display:grid;gap:5px;margin:12px 0;padding:12px 14px;border:1px solid rgba(245,158,11,.24);border-radius:13px;background:rgba(245,158,11,.07);font-size:.77rem;word-break:break-all}
.settings-update-url strong{color:#ffc45c;font-size:.85rem}.settings-update-url a{color:#9ec4ff}
.settings-update-notes{margin-bottom:12px;color:#aebed2;font-size:.8rem;white-space:pre-wrap}
[data-theme="light"] #settingsModal{background:rgba(28,48,75,.48)}
[data-theme="light"] #settingsModal .modal-content{border-color:#b9cce1;background:linear-gradient(150deg,#fff,#eef4fa);box-shadow:0 30px 90px rgba(35,63,96,.28)}
[data-theme="light"] #settingsModal .modal-header{border-color:#c7d6e6;background:linear-gradient(105deg,#e7effd,#def5ef);color:#123250}
[data-theme="light"] #settingsModal .settings-tabs{border-color:#ccd9e7!important;background:#f5f8fc}
[data-theme="light"] #settingsModal .settings-tabs .tab-btn{border-color:#c8d6e5!important;background:#fff!important;color:#405a77!important}
[data-theme="light"] #settingsModal .settings-tabs .tab-btn.active{color:#fff!important}
[data-theme="light"] #settingsModal .settings-modal-body{background:#edf3f9}
[data-theme="light"] #settingsModal .form-group label{color:#415b77}
[data-theme="light"] #settingsModal .form-control{border-color:#bccdde!important;background:#fff!important;color:#15334f!important}
[data-theme="light"] #settingsModal table{color:#193753}
[data-theme="light"] #settingsModal th{background:#dce9f6!important;color:#15334f}
[data-theme="light"] .settings-installed-version span,[data-theme="light"] .settings-update-instructions strong{color:#15334f}
[data-theme="light"] .settings-update-instructions p,[data-theme="light"] .settings-update-notes{color:#526b86}
@media(max-width:700px){
    #settingsModal{padding:7px}
    #settingsModal .modal-content{width:100%!important;max-height:96vh;border-radius:19px}
    #settingsModal .modal-header{min-height:58px;padding:12px 15px}
    #settingsModal .settings-tabs{padding:10px!important}
    #settingsModal .settings-modal-body{height:64vh!important;padding:12px 5px 12px 12px!important}
    #settingsModal .settings-tab-view{padding-right:8px}
    .settings-installed-version{align-items:flex-start;flex-direction:column}
}

.settings-users-scope-card{display:flex;align-items:center;gap:13px;margin-bottom:.8rem;padding:13px 15px;border:1px solid rgba(0,212,170,.28);border-radius:14px;background:linear-gradient(135deg,rgba(58,95,205,.13),rgba(0,212,170,.09))}
.settings-users-scope-icon{display:grid;flex:0 0 44px;height:44px;place-items:center;border-radius:13px;background:linear-gradient(135deg,#3a5fcd,#1ba97b);color:#fff;font-size:.78rem;font-weight:950}
.settings-users-scope-card span,.settings-users-scope-card strong,.settings-users-scope-card small{display:block}.settings-users-scope-card span{color:var(--lass-mint);font-size:.62rem;font-weight:950;letter-spacing:.11em}.settings-users-scope-card strong{margin-top:2px;font-size:1rem}.settings-users-scope-card small{margin-top:2px;color:var(--text-secondary);font-size:.75rem}
.settings-users-scope-card .settings-users-scope-email{margin-top:4px;color:var(--lass-mint);font-size:.78rem;font-weight:800;letter-spacing:0;overflow-wrap:anywhere}
.settings-direction-authority{padding:12px;border:1px solid rgba(58,95,205,.25);border-radius:13px;background:rgba(58,95,205,.07)}
.settings-authority-label{display:block;margin:10px 0 6px;color:var(--text-secondary);font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.settings-permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.settings-permission-option{display:flex;align-items:flex-start;gap:7px;min-width:0;padding:8px 9px;border:1px solid var(--border);border-radius:10px;background:var(--bg-card);cursor:pointer}.settings-permission-option input{flex:0 0 auto;width:16px!important;height:16px!important;margin:2px 0 0!important;accent-color:var(--lass-mint)}.settings-permission-option strong,.settings-permission-option small{display:block}.settings-permission-option strong{font-size:.72rem}.settings-permission-option small{margin-top:2px;color:var(--text-secondary);font-size:.64rem;line-height:1.25}
.settings-permission-option.is-disabled{opacity:.48;cursor:not-allowed}
.settings-scope-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:rgba(58,95,205,.13);color:#6f91ff;font-size:.66rem;font-weight:850;white-space:nowrap}.settings-scope-badge.direction{background:rgba(0,212,170,.13);color:var(--lass-mint)}
@media(max-width:620px){.settings-permission-grid{grid-template-columns:1fr}.settings-users-scope-card{align-items:flex-start}.settings-modal-body{max-height:62vh!important}}
.usage-assistant-toggle{position:fixed;right:1rem;bottom:1rem;z-index:1050;border:0;border-radius:999px;padding:.75rem 1rem;background:linear-gradient(135deg,#166534,#22c55e);color:#fff;font-weight:800;box-shadow:0 10px 30px rgba(0,0,0,.24);display:flex;align-items:center;gap:.45rem;cursor:pointer}.usage-assistant-panel{position:fixed;right:1rem;bottom:4.8rem;z-index:1051;width:min(390px,calc(100vw - 2rem));height:min(590px,calc(100vh - 7rem));display:none;flex-direction:column;background:var(--bg-primary,#fff);color:var(--text-primary,#172033);border:1px solid var(--border,#dce3ea);border-radius:20px;overflow:hidden;box-shadow:0 24px 65px rgba(0,0,0,.28)}.usage-assistant-panel.open{display:flex}.usage-assistant-header{display:flex;align-items:center;justify-content:space-between;padding:1rem;background:linear-gradient(135deg,#14532d,#16a34a);color:#fff}.usage-assistant-header div{display:flex;flex-direction:column}.usage-assistant-header small{opacity:.85;margin-top:.15rem}.usage-assistant-header button{border:0;background:transparent;color:#fff;font-size:1.6rem;cursor:pointer}.usage-assistant-messages{flex:1;overflow:auto;padding:1rem;display:flex;flex-direction:column;gap:.7rem;background:var(--bg-secondary,#f4f7f5)}.usage-assistant-message{max-width:86%;padding:.7rem .85rem;border-radius:14px;line-height:1.4;font-size:.9rem;white-space:pre-wrap}.usage-assistant-message.assistant{align-self:flex-start;background:var(--bg-primary,#fff);border:1px solid var(--border,#dce3ea);border-bottom-left-radius:4px}.usage-assistant-message.user{align-self:flex-end;background:#16a34a;color:#fff;border-bottom-right-radius:4px}.usage-assistant-suggestions{padding:.6rem .8rem;display:flex;gap:.4rem;overflow-x:auto;border-top:1px solid var(--border,#dce3ea)}.usage-assistant-suggestions button{flex:0 0 auto;border:1px solid #16a34a;border-radius:999px;padding:.38rem .62rem;background:transparent;color:var(--text-primary,#172033);font-size:.74rem;cursor:pointer}.usage-assistant-form{display:flex;gap:.5rem;padding:.75rem;border-top:1px solid var(--border,#dce3ea)}.usage-assistant-form input{flex:1;min-width:0;border:1px solid var(--border,#ccd5df);border-radius:12px;padding:.7rem;background:var(--bg-primary,#fff);color:var(--text-primary,#172033)}.usage-assistant-form button{width:42px;border:0;border-radius:12px;background:#16a34a;color:#fff;cursor:pointer}.usage-assistant-panel footer{text-align:center;padding:0 .5rem .55rem;color:var(--text-secondary,#64748b);font-size:.68rem}@media(max-width:520px){.usage-assistant-toggle span:last-child{display:none}.usage-assistant-toggle{width:50px;height:50px;justify-content:center;padding:0}.usage-assistant-panel{right:.5rem;bottom:4.3rem;width:calc(100vw - 1rem);height:min(620px,calc(100vh - 5.3rem))}}

/* Gestion du matériel */
.app-context-grid{display:grid;grid-template-columns:minmax(280px,1fr) minmax(360px,1.35fr);grid-template-areas:"distribution products" "subtitle products" "date supplier";gap:.38rem 2rem;align-items:center;padding:.85rem 1rem;margin:0 1rem 1rem;background:linear-gradient(135deg,rgba(255,255,255,.05),rgba(66,133,244,.06));border:1px solid var(--border);border-radius:var(--radius-md);position:sticky;top:.5rem;z-index:40;backdrop-filter:blur(10px)}.app-context-distribution{grid-area:distribution;font-weight:800;color:var(--text-primary)}.app-context-subtitle{grid-area:subtitle;font-size:.82rem;color:var(--text-secondary)}.app-context-products{grid-area:products;font-size:.88rem;font-weight:700;color:var(--text-primary);text-align:right}.app-context-date{grid-area:date;font-size:.84rem;color:var(--text-secondary);white-space:nowrap}.app-context-supplier{grid-area:supplier;font-size:.88rem;font-weight:700;color:var(--text-secondary);text-align:right}.direction-company-type-control{display:flex;align-items:center;gap:.45rem;padding:0 .55rem;border:1px solid rgba(148,163,184,.28);border-radius:10px;color:#cbd5e1;font-size:.75rem;font-weight:800}.direction-company-type-control select{min-height:36px;border:0;background:#14233a;color:#fff;font-weight:800}.direction-dashboard-head-actions{flex-wrap:wrap}@media(max-width:1100px){#main-app-wrapper>header{align-items:flex-start;gap:.75rem}#main-app-wrapper>header .header-controls{flex-wrap:wrap;padding-right:142px}}@media(max-width:900px){.app-context-grid{grid-template-columns:1fr;grid-template-areas:"distribution" "subtitle" "products" "date" "supplier";gap:.4rem}.app-context-products,.app-context-supplier{text-align:left}.app-context-date{white-space:normal}#main-app-wrapper>header .header-controls{padding-right:0;margin-right:142px}}

.materials-heading{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin-bottom:1.25rem;padding:1.2rem 1.3rem;border:1px solid var(--border);border-radius:var(--radius-lg);background:linear-gradient(135deg,rgba(58,95,205,.13),rgba(0,212,170,.08))}.materials-heading span{color:var(--success);font-size:.7rem;font-weight:900;letter-spacing:.12em}.materials-heading h2{margin:.25rem 0;font-size:1.65rem}.materials-heading p{margin:0;color:var(--text-secondary)}.material-heading-actions{display:flex;gap:.55rem;align-items:center}.materials-summary{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:.8rem;margin-bottom:1rem}.materials-summary article{padding:1rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-secondary);display:grid;gap:.3rem}.materials-summary span{color:var(--text-secondary);font-size:.76rem}.materials-summary strong{font-size:1.45rem;color:var(--text-primary)}.materials-card{padding:1rem}.materials-table th,.materials-table td{vertical-align:middle}.material-actions{display:flex;gap:.4rem}.material-actions button{border:1px solid var(--border);border-radius:8px;padding:.35rem .55rem;background:var(--bg-primary);color:var(--text-primary);cursor:pointer}.material-actions .danger{border-color:rgba(239,68,68,.35);color:#ef4444}.materials-empty{text-align:center!important;padding:2rem!important;color:var(--text-secondary)}.material-modal-content{max-width:680px}.materials-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.85rem;padding-top:.6rem}@media(max-width:800px){.materials-summary{grid-template-columns:repeat(2,minmax(120px,1fr))}.materials-heading{align-items:stretch;flex-direction:column}.materials-form-grid{grid-template-columns:1fr}}

@media print{body.print-view-materials #view-materials{display:block!important}}

/* Fermeture explicite de l'assistant d'utilisation. */
#usage-assistant-close{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border:1px solid rgba(255,255,255,.58);border-radius:50%;background:rgba(91,13,13,.38);color:#fff;font-size:1.45rem;line-height:1;cursor:pointer;transition:transform .15s ease,background .15s ease}
#usage-assistant-close:hover,#usage-assistant-close:focus-visible{background:#b91c1c;transform:scale(1.06);outline:2px solid rgba(255,255,255,.75);outline-offset:2px}
#usage-assistant-toggle{z-index:14000!important}#usage-assistant-panel{z-index:14001!important}

.direction-operation-form{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:.65rem;margin:.9rem 0 1rem}.direction-operation-form input,.direction-operation-form select,.direction-operation-form output{min-height:42px;padding:.55rem .65rem;border:1px solid var(--border);border-radius:10px;background:var(--bg-primary);color:var(--text-primary)}.direction-operation-form output{display:flex;align-items:center;font-weight:800;color:var(--success)}.direction-operation-form button{min-height:42px}.direction-table-actions{display:flex;gap:.35rem;flex-wrap:wrap}.direction-table-actions button{border:1px solid var(--border);border-radius:8px;padding:.35rem .55rem;background:var(--bg-primary);color:var(--text-primary);cursor:pointer}.direction-table-actions .danger{border-color:rgba(239,68,68,.45);color:#ef4444}.distribution-closure-notice{margin:-.45rem 1rem 1rem;padding:.75rem 1rem;border:1px solid rgba(245,158,11,.5);border-radius:13px;background:rgba(120,75,5,.2);color:var(--text-primary);font-size:.84rem;font-weight:700}.distribution-closure-notice strong{color:#f59e0b}.distribution-closure-notice.is-paid{border-color:rgba(16,185,129,.48);background:rgba(6,95,70,.18)}.distribution-closure-notice.is-paid strong{color:#10b981}@media(max-width:950px){.direction-operation-form{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:560px){.direction-operation-form{grid-template-columns:1fr}}

/* Ajustements de lisibilité et d'alignement */
#main-app-wrapper>header #toggleThemeBtn,
#main-app-wrapper>header #btn-header-back-menu{display:none!important}
.app-context-grid{grid-template-areas:"distribution mother" "subtitle delivery" "date supplier"}
.app-context-mother-product{grid-area:mother}.app-context-delivery-product{grid-area:delivery}
.app-context-mother-product,.app-context-delivery-product,.app-context-supplier{font-size:.88rem;font-weight:700;text-align:right;color:var(--text-primary)}
.two-line-label{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;line-height:1.15}
.two-line-label>span,.two-line-label>small{display:block;width:100%;text-align:center}.two-line-label>small{margin-top:.14rem;font-size:.92em;font-weight:inherit}
.user-create-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;align-items:end}
.app-name-double{display:flex!important;flex-direction:column;align-items:center;text-align:center;line-height:1.02}.app-name-double>span{display:block;width:100%;text-align:center}
.module-sidebar-brand>div,.direction-brand>div{text-align:center}
.user-create-grid>button{grid-column:1/-1;justify-self:center;min-width:150px}
@media(max-width:900px){.app-context-grid{grid-template-areas:"distribution" "subtitle" "date" "mother" "delivery" "supplier"}.app-context-mother-product,.app-context-delivery-product,.app-context-supplier{text-align:left}}
@media(max-width:640px){.user-create-grid{grid-template-columns:1fr}}
.remote-company-login {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 170, 0.08);
}

.remote-company-login-btn {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-color: rgba(0, 212, 170, 0.45);
    color: #fff;
    font-weight: 800;
}

.remote-company-login-btn:disabled {
    cursor: wait;
    opacity: 0.7;
}

.remote-company-login-status {
    display: none;
    margin-top: 0.65rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.remote-company-login-status.show {
    display: block;
}
