/*
 * ABEX — the shell of both panels (light sidebar again, owner 2026-11-01: « keep the old colors, the dark one looks worse ») (2026-11-01, production Clawdya admin + supplier panel).
 *
 * Loaded after abex-ui.css (partials/header), scoped under html.ui-v3 like it. What it draws:
 *   - the full-height light sidebar: brand row + collapse button, account card, UPPERCASE section labels
 *     (« COLIS », « TRANSPORT », « COMMANDES »…), brand-coloured active pill, the signed-in user at the bottom;
 *   - the white top bar beside it: breadcrumb (« Colis › Colis des fournisseurs »), wide search with the « / » hint and
 *     a scan button, language « FR ▾ », dark-mode moon, bell — all solid controls (owner's hybrid rule);
 *   - the page head (partials/page_head: big title, « Total : N », refresh icon button, actions);
 *   - one white card holding tabs + filters + table (.ui-shell-card), the table footer's range text;
 *   - dark mode: html.ui-dark switches the --ui-* tokens (partials/shell_theme_toggle).
 * The phone layout (< 992px: purple bar + burger drawer) stays abex-ui.css's; the drawer shows a copy of the same sidebar.
 * Logical properties keep Arabic (dir="rtl") mirrored.
 */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
html.ui-v3 {
    --shell-bg: var(--ui-card);        /* sidebar: white, as before the production-panel update */
    --shell-bg-hover: var(--ui-accent-soft);
    --shell-active: var(--ui-primary); /* the page you are on: solid brand colour */
    --shell-card: var(--ui-page, #f6f5fa);
    --shell-line: var(--ui-border);
    --shell-text: var(--ui-text);
    --shell-text-2: var(--ui-text-2);
    --shell-on-active: var(--ui-on-primary, #fff);
    --shell-label: var(--ui-text-2);
    --shell-w: 248px;
    --shell-topbar-h: 64px;
    --shell-topbar-bg: #ffffff;
    --shell-pad: 28px;            /* page side padding on desktop */
}

/* ── Sidebar (every width: the phone drawer shows a copy of it) ─────────── */
html.ui-v3 .nav-left-sidebar.ui-shell-sidebar { background: var(--shell-bg) !important; color: var(--shell-text); border: 0 !important; border-inline-end: 1px solid var(--shell-line) !important; }
html.ui-v3 .ui-shell-sidebar .ui-shell-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 4px 14px; }
html.ui-v3 .ui-shell-sidebar .ui-shell-logo { display: inline-flex; align-items: center; min-width: 0; }
html.ui-v3 .ui-shell-sidebar .ui-shell-logo img { max-height: 30px; max-width: 150px; width: auto; }
html.ui-v3 .ui-shell-collapse {
    flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--shell-line); border-radius: 8px; background: var(--shell-card); color: var(--shell-text); cursor: pointer;
}
html.ui-v3 .ui-shell-collapse:hover { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
html.ui-v3 .ui-shell-collapse:focus-visible, html.ui-v3 .ui-shell-sidebar .nav-link:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }

/* Account card: the super admin's office switcher (partials/sidebar_v3), everyone else's company + office, the supplier's shop. */
html.ui-v3 .ui-shell-sidebar .ui-branch-switch { padding: 0 0 6px; }
html.ui-v3 .ui-shell-sidebar .ui-branch-btn { background: var(--shell-card); border: 1px solid var(--shell-line); padding: 10px 12px; }
html.ui-v3 .ui-shell-sidebar .ui-branch-btn.is-office { background: var(--ui-primary); border-color: var(--ui-primary); }
html.ui-v3 .ui-shell-sidebar .ui-branch-user { color: var(--shell-text-2); }
/* Readable in both states (found by the E2E campaign, D1): « Tous les bureaux » is a light card, a chosen office a purple one. */
html.ui-v3 .ui-shell-sidebar .ui-branch-btn:not(.is-office),
html.ui-v3 .ui-shell-sidebar .ui-branch-btn:not(.is-office) .ui-branch-name,
html.ui-v3 .ui-shell-sidebar .ui-branch-btn:not(.is-office) .fa { color: var(--shell-text) !important; }
html.ui-v3 .ui-shell-sidebar .ui-branch-btn.is-office,
html.ui-v3 .ui-shell-sidebar .ui-branch-btn.is-office .ui-branch-name,
html.ui-v3 .ui-shell-sidebar .ui-branch-btn.is-office .ui-branch-user,
html.ui-v3 .ui-shell-sidebar .ui-branch-btn.is-office .fa { color: #fff !important; }
html.ui-v3 .ui-shell-account {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 6px; padding: 10px 12px;
    background: var(--shell-card); border: 1px solid var(--shell-line); border-radius: 10px; color: var(--shell-text); text-align: start;
}
html.ui-v3 button.ui-shell-account { cursor: pointer; }
html.ui-v3 button.ui-shell-account:hover { border-color: var(--shell-label); }
html.ui-v3 .ui-shell-account-icon {
    flex: none; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ui-primary); color: #fff; font-size: 15px;
}
html.ui-v3 .ui-shell-account-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
html.ui-v3 .ui-shell-account-text b { font-size: 14px; font-weight: 700; color: var(--shell-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v3 .ui-shell-account-text small { font-size: 12px; font-weight: 500; color: var(--shell-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v3 .ui-shell-account .ui-shell-caret { flex: none; color: var(--shell-text); }
html.ui-v3 .ui-shell-shop-menu { width: 100%; max-height: 60vh; overflow: auto; }

/* Section labels and the gap before an unlabelled section. */
html.ui-v3 .ui-shell-sidebar .nav-divider {
    color: var(--shell-label) !important; background: transparent !important;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 16px 10px 6px !important; margin: 0;
}
html.ui-v3 .ui-shell-sidebar .nav-divider.ui-nav-gap { padding: 0 !important; margin: 10px 6px; height: 0; border-top: 1px solid var(--shell-line); }

/* Entries: dark text on white; the page you are on = a solid brand-coloured pill. */
html.ui-v3 .ui-shell-sidebar .navbar-nav .nav-link {
    color: var(--shell-text) !important; background: transparent !important;
    font-size: 13.5px; font-weight: 500 !important; border-radius: 8px; padding: 9px 10px !important;
    border: 0 !important;
}
html.ui-v3 .ui-shell-sidebar .nav-link i { color: var(--shell-text) !important; }
html.ui-v3 .ui-shell-sidebar .navbar-nav .nav-link:hover,
html.ui-v3 .ui-shell-sidebar.nav-left-sidebar .navbar-nav .nav-link:focus,
html.ui-v3 .ui-shell-sidebar.nav-left-sidebar .submenu .nav .nav-item .nav-link:hover,
html.ui-v3 .ui-shell-sidebar.nav-left-sidebar .submenu .nav .nav-item .nav-link:focus { background: var(--shell-bg-hover) !important; color: var(--shell-text) !important; }
html.ui-v3 .ui-shell-sidebar .navbar-nav .nav-link[data-toggle="collapse"].active { background: var(--ui-primary-soft) !important; color: var(--ui-primary-strong, var(--shell-text)) !important; font-weight: 700; }
html.ui-v3 .ui-shell-sidebar .navbar-nav .nav-link.active:not([data-toggle="collapse"]),
html.ui-v3 .ui-shell-sidebar .submenu .nav .nav-item .nav-link.active {
    background: var(--shell-active) !important; color: var(--shell-on-active) !important; font-weight: 700 !important;
}
html.ui-v3[dir="rtl"] .ui-shell-sidebar .navbar-nav .nav-link.active:not([data-toggle="collapse"]),
html.ui-v3[dir="rtl"] .ui-shell-sidebar .submenu .nav .nav-item .nav-link.active { box-shadow: none; }
html.ui-v3 .ui-shell-sidebar .navbar-nav .nav-link.active:not([data-toggle="collapse"]) i { color: var(--shell-on-active) !important; }
html.ui-v3 .ui-shell-sidebar .submenu .nav .nav-item .nav-link { font-size: 13px; padding: 7px 10px 7px 38px !important; }
html.ui-v3[dir="rtl"] .ui-shell-sidebar .submenu .nav .nav-item .nav-link { padding: 7px 38px 7px 10px !important; }
html.ui-v3 .ui-shell-sidebar .nav-link[data-toggle="collapse"]::after { color: var(--shell-text); }
html.ui-v3 .ui-shell-sidebar::-webkit-scrollbar-thumb, html.ui-v3 .ui-shell-sidebar .navbar-nav::-webkit-scrollbar-thumb { background: #cfcbdb; border-radius: 6px; }
html.ui-v3 .ui-shell-sidebar .navbar-nav::-webkit-scrollbar { width: 6px; }

/* The signed-in user at the bottom. */
html.ui-v3 .ui-shell-user {
    display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 6px 2px;
    border-top: 1px solid var(--shell-line); color: var(--shell-text); text-decoration: none;
}
html.ui-v3 .ui-shell-user:hover { color: var(--shell-text); text-decoration: none; }
html.ui-v3 .ui-shell-user:hover b { text-decoration: underline; }
html.ui-v3 .ui-shell-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--ui-primary); border: 2px solid var(--shell-line); }
html.ui-v3 .ui-shell-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
html.ui-v3 .ui-shell-user-text b { font-size: 13.5px; font-weight: 700; color: var(--shell-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v3 .ui-shell-user-text small { font-size: 12px; color: var(--shell-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Desktop frame: sidebar full height on the start side, white top bar beside it ─
   Only on pages that carry the shell's sidebar (:has): the driver panel keeps abex-ui.css's floating sidebar and bar. */
@media (min-width: 992px) {
    html.ui-v3:has(.ui-shell-sidebar) .nav-left-sidebar.ui-shell-sidebar {
        top: 0 !important; bottom: 0; inset-inline-start: 0 !important;
        width: var(--shell-w) !important;
        height: 100vh !important; height: 100dvh !important;
        border-radius: 0; padding: 14px 12px 12px !important;
        display: flex !important; flex-direction: column;
        overflow: hidden; z-index: 1035;
    }
    html.ui-v3[dir="rtl"]:has(.ui-shell-sidebar) .nav-left-sidebar.ui-shell-sidebar { left: auto !important; right: 0 !important; }
    html.ui-v3:has(.ui-shell-sidebar) .ui-shell-sidebar > .navbar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; flex-wrap: nowrap; margin: 0 !important; padding: 0 0 8px !important; scrollbar-width: thin; scrollbar-color: #cfcbdb transparent; }

    html.ui-v3:has(.ui-shell-sidebar) .dashboard-main-wrapper { padding-top: calc(var(--shell-topbar-h) + 24px) !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-main-wrapper .main-content { margin-left: var(--shell-w) !important; margin-right: 0 !important; }
    html.ui-v3[dir="rtl"]:has(.ui-shell-sidebar) .dashboard-main-wrapper .main-content { margin-left: 0 !important; margin-right: var(--shell-w) !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-content { padding: 0 var(--shell-pad) 28px !important; }

    /* The top bar: white, beside the sidebar, its items dark (abex-ui.css painted them white on purple). */
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar.fixed-top {
        background: var(--shell-topbar-bg) !important;
        border-bottom: 1px solid var(--ui-border);
        height: var(--shell-topbar-h); min-height: var(--shell-topbar-h);
        left: var(--shell-w); right: 0;
        padding-inline: var(--shell-pad) 20px;
    }
    html.ui-v3[dir="rtl"]:has(.ui-shell-sidebar) .dashboard-header .navbar.fixed-top { right: var(--shell-w); left: 0; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-brand, html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .mobileLocale { display: none !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar a.text-dark,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-globe,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .fa-sign-in-alt,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .nav-link,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-right-top > .nav-item > a,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-right-top > .nav-item > a i { color: var(--ui-text) !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top:not(.merchant-mobile-navbar-nav) { height: var(--shell-topbar-h); }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top:not(.merchant-mobile-navbar-nav) > .nav-item { border-inline-end-color: var(--ui-border); padding: 0 10px !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > .dropdown-menu,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item .lang-dropdown > .dropdown-menu { margin-top: calc((var(--shell-topbar-h) - 32px) / 2) !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-left-top { align-items: center; gap: 18px; flex: 1 1 auto; min-width: 0; height: var(--shell-topbar-h); }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-left-top > .nav-item { padding: 0 !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-left-top.ml-3 { margin-left: 0 !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header #navbarSupportedContent { flex: 1 1 auto; min-width: 0; }

    /* Collapsed: the sidebar slides out, the top bar and the page take the room, the top bar's « ☰ » brings it back. */
    html.ui-v3:has(.ui-shell-sidebar) .ui-shell-reopen { display: none !important; }
    html.ui-v3:has(.ui-shell-sidebar) body.sidebar-collapsed .ui-shell-reopen { display: flex !important; }
    html.ui-v3:has(.ui-shell-sidebar) body.sidebar-collapsed .nav-left-sidebar.ui-shell-sidebar { transform: translateX(calc(-1 * var(--shell-w) - 4px)); }
    html.ui-v3[dir="rtl"]:has(.ui-shell-sidebar) body.sidebar-collapsed .nav-left-sidebar.ui-shell-sidebar { transform: translateX(calc(var(--shell-w) + 4px)); }
    html.ui-v3:has(.ui-shell-sidebar) body.sidebar-collapsed .dashboard-header .navbar.fixed-top { left: 0; right: 0; }
    html.ui-v3:has(.ui-shell-sidebar) body.sidebar-collapsed .dashboard-main-wrapper .main-content { margin-left: 0 !important; margin-right: 0 !important; }
}

/* ── Top bar pieces ─────────────────────────────────────────────────────── */
/* Breadcrumb « Colis › Colis des fournisseurs »: the section in medium weight, the page bold — both dark. */
html.ui-v3 .ui-shell-crumbs-item { flex: none; max-width: 34%; }
html.ui-v3 .ui-shell-crumbs { display: flex; align-items: center; flex-wrap: nowrap; gap: 0; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ui-text); white-space: nowrap; min-width: 0; }
html.ui-v3 .ui-shell-crumbs li { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
html.ui-v3 .ui-shell-crumbs li + li::before { content: '›'; display: inline-block; margin-inline: 10px; font-weight: 700; color: var(--ui-text); }
html.ui-v3[dir="rtl"] .ui-shell-crumbs li + li::before { content: '‹'; }
html.ui-v3 .ui-shell-crumbs li[aria-current="page"] { font-weight: 700; }

/* Search: one white field with a solid « / » key, a solid scan button and the solid search button. */
html.ui-v3 .ui-shell-search .input-group { flex-wrap: nowrap; align-items: stretch; background: var(--ui-card); border: 1.5px solid var(--ui-border-strong); border-radius: 10px; overflow: hidden; }
html.ui-v3 .ui-shell-search .input-group:focus-within { border-color: var(--ui-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary) 20%, transparent); }
html.ui-v3 .ui-shell-search .form-control { border: 0 !important; box-shadow: none !important; background: transparent !important; color: var(--ui-text) !important; height: 38px; font-size: 13.5px; }
html.ui-v3 .ui-shell-search .form-control::placeholder { color: #4d485f; }
html.ui-v3 .ui-shell-search .input-group-append { display: flex; align-items: center; gap: 6px; padding-inline-end: 4px; margin: 0; }
html.ui-v3 .ui-shell-search .input-group-append > .btn { height: 30px; border-radius: 7px !important; padding: 0 12px; }
html.ui-v3 .ui-kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 5px; background: var(--ui-dark); color: #fff; font-family: var(--ui-mono); font-size: 12px; font-weight: 700; box-shadow: none;
}
html.ui-v3 .ui-shell-scan {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
    border: 0; border-radius: 7px; background: var(--ui-dark); color: #fff; cursor: pointer; font-size: 14px;
}
html.ui-v3 .ui-shell-scan:hover { background: var(--ui-primary); color: #fff; }
html.ui-v3 .ui-shell-search.is-scanning .input-group { border-color: var(--ui-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-success) 25%, transparent); }
html.ui-v3 .ui-shell-search.is-scanning .ui-shell-scan { background: var(--ui-success); }

/* The search button in the brand colour (abex-ui.css made the top bar's .btn-primary orange on purple), the search wide. */
html.ui-v3 .dashboard-header .navbar .ui-shell-search .btn-primary { background-color: var(--ui-primary) !important; border-color: var(--ui-primary) !important; color: var(--ui-on-primary) !important; }
@media (min-width: 992px) {
    html.ui-v3 .dashboard-header li.ui-topbar-search { flex: 1 1 auto; max-width: 620px; }
}

/* Language « FR ▾ », the moon, the bell, « Tutoriels »: solid buttons. */
html.ui-v3 .dashboard-header .navbar .ui-shell-lang,
html.ui-v3 .dashboard-header .navbar .navbar-right-top .lang-dropdown > .ui-shell-lang {
    display: inline-flex !important; align-items: center; gap: 6px; height: 34px !important; padding: 0 12px !important;
    border-radius: 8px; background: var(--ui-dark) !important; color: #fff !important; font-size: 13px; font-weight: 700; line-height: 1;
}
html.ui-v3 .dashboard-header .navbar .ui-shell-lang i { color: #fff !important; }
html.ui-v3 .ui-shell-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: 8px; background: var(--ui-dark); color: #fff; cursor: pointer; font-size: 15px;
}
html.ui-v3 .ui-shell-icon-btn:hover, html.ui-v3 .ui-shell-lang:hover { background: var(--ui-primary) !important; color: #fff !important; }
html.ui-v3 .ui-shell-icon-btn[aria-pressed="true"] { background: var(--ui-warning); color: #1a1405; }
html.ui-v3 .ui-shell-tutorials {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px;
    background: #d6001c; color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
html.ui-v3 .ui-shell-tutorials i { color: #fff !important; }
html.ui-v3 .ui-shell-tutorials:hover { background: #a80016; color: #fff; text-decoration: none; }
@media (min-width: 992px) {
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .notification > .nav-link {
        width: 34px; height: 34px; justify-content: center; padding: 0 !important; border-radius: 8px; background: var(--ui-dark); position: relative;
    }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .notification > .nav-link i { color: #fff !important; margin: 0; }
    /* The public site's globe and the check-in: solid icon buttons too. */
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a.me-2,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a[data-bs-target="#attendance-modal"] {
        width: 34px; height: 34px; justify-content: center; border-radius: 8px; background: var(--ui-dark); margin: 0 !important;
    }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a.me-2 i,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a[data-bs-target="#attendance-modal"] i { color: #fff !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top:not(.merchant-mobile-navbar-nav) > .notification .abexNotifCount { top: -6px !important; inset-inline-start: 22px !important; }
}

/* ── Page head (partials/page_head) ─────────────────────────────────────── */
html.ui-v3 .ui-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
html.ui-v3 .ui-page-head-text { min-width: 0; }
html.ui-v3 .ui-page-head-title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--ui-text); letter-spacing: -.01em; }
html.ui-v3 .ui-page-head-sub { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--ui-text-2); }
html.ui-v3 .ui-page-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
html.ui-v3 .ui-page-head-actions .btn { text-transform: none !important; }
html.ui-v3 .ui-page-refresh {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px;
    background: var(--ui-dark); color: #fff !important; font-size: 16px; text-decoration: none;
}
html.ui-v3 .ui-page-refresh:hover, html.ui-v3 .ui-page-refresh:focus-visible { background: var(--ui-primary); color: #fff; text-decoration: none; }
@media (max-width: 575.98px) { html.ui-v3 .ui-page-head { flex-direction: column; } html.ui-v3 .ui-page-head-title { font-size: 22px; } }

/* ── One white card: tabs, filters, table, footer (Clawdya's list page) ─── */
html.ui-v3 .ui-shell-card { background: var(--ui-card); border: 1px solid var(--ui-border); border-radius: 12px; margin-bottom: 18px; }
html.ui-v3 .ui-shell-card > .ui-toolbar { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--ui-border); align-items: center; }
html.ui-v3 .ui-shell-card > .ui-tabs, html.ui-v3 .ui-shell-card > .ui-toolbar > .ui-tabs { border: 0; border-radius: 0; background: transparent; padding: 0; }
html.ui-v3 .ui-shell-card > .ui-tabs { padding: 10px 14px; border-bottom: 1px solid var(--ui-border); border-radius: 12px 12px 0 0; }
html.ui-v3 .ui-shell-card > .ui-chips { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--ui-border); }
html.ui-v3 .ui-shell-card > .ui-filter-card { border: 0; border-radius: 0; margin: 0; border-bottom: 1px solid var(--ui-border); }
html.ui-v3 .ui-shell-card > .ui-table-card { border: 0; border-radius: 0 0 12px 12px; margin: 0; }
html.ui-v3 .ui-shell-card > .ui-table-card:only-child { border-radius: 12px; }
/* « 1–20 · Total 26 éléments » at the start of the footer. */
html.ui-v3 .ui-table-footer-range { font-size: 13px; font-weight: 600; color: var(--ui-text); margin-inline-end: auto; }

/* ── Dark mode (html.ui-dark, the moon in the top bar) ──────────────────── */
html.ui-v3.ui-dark {
    color-scheme: dark;
    --ui-page: #17141f;
    --ui-card: #211d2b;
    --ui-border: #3a3447;
    --ui-border-strong: #6a6180;
    --ui-row-border: #2e2939;
    --ui-row-hover: #2a2536;
    --ui-text: #f5f3fa;
    --ui-text-2: #d9d3e6;
    --ui-dark: #3d3750;
    --ui-primary-soft: #2b1f47;
    --ui-accent-soft: #3d2b17;
    --shell-topbar-bg: #211d2b;
    --shell-bg: #211d2b;
    --shell-bg-hover: #2a2536;
    --shell-card: #17141f;
    --shell-line: #3a3447;
}
html.ui-v3.ui-dark body, html.ui-v3.ui-dark .dashboard-main-wrapper, html.ui-v3.ui-dark .dashboard-ecommerce { background-color: var(--ui-page) !important; color: var(--ui-text); }
html.ui-v3.ui-dark .card, html.ui-v3.ui-dark .card-header, html.ui-v3.ui-dark .card-footer, html.ui-v3.ui-dark .modal-content,
html.ui-v3.ui-dark .dropdown-menu, html.ui-v3.ui-dark .list-group-item, html.ui-v3.ui-dark .footer, html.ui-v3.ui-dark .page-link {
    background-color: var(--ui-card) !important; color: var(--ui-text) !important; border-color: var(--ui-border) !important;
}
html.ui-v3.ui-dark .dropdown-item { color: var(--ui-text) !important; }
html.ui-v3.ui-dark .dropdown-item:hover, html.ui-v3.ui-dark .dropdown-item:focus { background-color: var(--ui-row-hover) !important; }
html.ui-v3.ui-dark .table, html.ui-v3.ui-dark .table td, html.ui-v3.ui-dark .table th, html.ui-v3.ui-dark .ui-table thead th {
    background-color: transparent !important; color: var(--ui-text) !important; border-color: var(--ui-row-border) !important;
}
html.ui-v3.ui-dark .ui-table thead th, html.ui-v3.ui-dark .table thead th { background-color: var(--ui-card) !important; }
html.ui-v3.ui-dark .form-control, html.ui-v3.ui-dark .custom-select, html.ui-v3.ui-dark .form-select,
html.ui-v3.ui-dark .select2-container--default .select2-selection--single, html.ui-v3.ui-dark .select2-container--default .select2-selection--multiple,
html.ui-v3.ui-dark .select2-dropdown, html.ui-v3.ui-dark .input-group-text {
    background-color: #17141f !important; color: var(--ui-text) !important; border-color: var(--ui-border-strong) !important;
}
html.ui-v3.ui-dark .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ui-text) !important; }
html.ui-v3.ui-dark .form-control::placeholder, html.ui-v3.ui-dark .ui-shell-search .form-control::placeholder { color: #c3bcd3; }
html.ui-v3.ui-dark h1, html.ui-v3.ui-dark h2, html.ui-v3.ui-dark h3, html.ui-v3.ui-dark h4, html.ui-v3.ui-dark h5, html.ui-v3.ui-dark h6,
html.ui-v3.ui-dark label, html.ui-v3.ui-dark .text-dark, html.ui-v3.ui-dark .ui-track { color: var(--ui-text) !important; }
html.ui-v3.ui-dark .bg-white, html.ui-v3.ui-dark .bg-light { background-color: var(--ui-card) !important; }

/* ── Top bar: room to breathe, lighter solid buttons (owner 2026-11-01: « too conjuncted », « too dark the icons ») ── */
html.ui-v3 {
    --shell-btn: var(--ui-primary);        /* the bar's icon buttons: the brand colour, not near-black */
    --shell-btn-hover: var(--ui-primary-strong, var(--ui-primary));
}
html.ui-v3 .ui-kbd, html.ui-v3 .ui-shell-scan, html.ui-v3 .ui-shell-icon-btn, html.ui-v3 .ui-page-refresh,
html.ui-v3 .dashboard-header .navbar .ui-shell-lang, html.ui-v3 .dashboard-header .navbar .navbar-right-top .lang-dropdown > .ui-shell-lang { background: var(--shell-btn) !important; }
html.ui-v3 .ui-shell-icon-btn:hover, html.ui-v3 .ui-shell-lang:hover, html.ui-v3 .ui-shell-scan:hover, html.ui-v3 .ui-page-refresh:hover { background: var(--shell-btn-hover) !important; }
@media (min-width: 992px) {
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .notification > .nav-link,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a.me-2,
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > .nav-item > a[data-bs-target="#attendance-modal"] { background: var(--shell-btn) !important; }
    /* Spacing: the left group, the search and the right group no longer touch. */
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-left-top { gap: 28px; padding-inline-end: 24px; }
    html.ui-v3 .dashboard-header li.ui-topbar-search { margin-inline-start: auto; max-width: 480px; min-width: 260px !important; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top:not(.merchant-mobile-navbar-nav) { gap: 6px; }
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top:not(.merchant-mobile-navbar-nav) > .nav-item { padding: 0 12px !important; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
    html.ui-v3 .dashboard-header li.ui-topbar-search { max-width: 340px; min-width: 200px !important; }
}
html.ui-v3 .ui-icon-btn { background: var(--shell-btn) !important; color: #fff !important; }
html.ui-v3 .ui-icon-btn:hover { background: var(--shell-btn-hover) !important; }
@media (min-width: 992px) {
    /* The breadcrumb keeps its whole text; the search takes what is left, never touching it. */
    html.ui-v3 .ui-shell-crumbs-item { max-width: none; flex: 0 0 auto; }
    html.ui-v3 .dashboard-header li.ui-topbar-search { flex: 1 1 200px; max-width: 420px; min-width: 180px !important; margin-inline-start: 12px; }
}
@media (min-width: 992px) and (max-width: 1599.98px) {
    html.ui-v3 .dashboard-header li.ui-topbar-search { max-width: 280px; }
}
/* The « dark » solid (tabs, chips, pills, secondary buttons): a softer plum slate instead of near-black, still white text on it. */
html.ui-v3:not(.ui-dark) { --ui-dark: #4f4768; }

/* Camera scan dialog (public/backend/js/camera-scan.js). */
html.ui-v3 .ui-camera-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(23, 20, 31, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
html.ui-v3 .ui-camera-box { background: var(--ui-card); color: var(--ui-text); border-radius: 14px; width: min(440px, 100%); padding: 14px 16px 16px; }
html.ui-v3 .ui-camera-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
html.ui-v3 .ui-camera-close { width: 34px; height: 34px; border: 0; border-radius: 8px; background: var(--ui-primary); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
html.ui-v3 .ui-camera-view { border-radius: 10px; overflow: hidden; background: #000; min-height: 240px; }
html.ui-v3 .ui-camera-view video { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
html.ui-v3 .ui-camera-msg { margin: 10px 0 0; font-weight: 600; color: var(--ui-danger, #d6001c); }
/* The search takes the room: wider, the camera its only button. */
@media (min-width: 992px) {
    html.ui-v3 .dashboard-header li.ui-topbar-search { flex: 1 1 auto; max-width: none !important; min-width: 320px !important; }
}

/* Language button + menu: breathing room, no flags (owner 2026-11-02). */
html.ui-v3 .dashboard-header .navbar .ui-shell-lang,
html.ui-v3 .dashboard-header .navbar .navbar-right-top .lang-dropdown > .ui-shell-lang { height: 38px !important; padding: 0 16px !important; gap: 8px; letter-spacing: .04em; }
html.ui-v3 .dashboard-header .navbar .ui-shell-lang::after { margin-inline-start: 4px; }
html.ui-v3 .ui-lang-menu {
    min-width: 210px; padding: 8px !important; margin-top: 10px !important;
    border: 1px solid var(--ui-border) !important; border-radius: 14px !important; background: var(--ui-card) !important;
    box-shadow: 0 18px 40px -12px rgba(38, 34, 47, .28), 0 2px 6px rgba(38, 34, 47, .08) !important;
}
html.ui-v3 .ui-lang-item { display: flex !important; align-items: center; gap: 12px; padding: 10px 12px !important; border-radius: 9px; color: var(--ui-text) !important; font-size: 14px; font-weight: 600; }
html.ui-v3 .ui-lang-item + .ui-lang-item { margin-top: 2px; }
html.ui-v3 .ui-lang-item:hover, html.ui-v3 .ui-lang-item:focus { background: var(--ui-primary-soft) !important; color: var(--ui-text) !important; }
html.ui-v3 .ui-lang-code {
    flex: none; width: 32px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; background: var(--ui-primary-soft); color: var(--ui-primary-strong, var(--ui-primary)); font-size: 11.5px; font-weight: 800; letter-spacing: .06em;
}
html.ui-v3 .ui-lang-name { flex: 1 1 auto; }
html.ui-v3 .ui-lang-item.is-current { background: var(--ui-primary-soft); }
html.ui-v3 .ui-lang-item.is-current .ui-lang-code { background: var(--ui-primary); color: #fff; }
html.ui-v3 .ui-lang-check { flex: none; color: var(--ui-primary); font-size: 13px; }

/* Language button aligned with the other bar buttons; the « open the menu » button visible once the sidebar is collapsed
   (owner 2026-11-02). */
html.ui-v3 .dashboard-header .navbar-right-top li.lang { align-items: center; display: flex; }
html.ui-v3 .dashboard-header .navbar-right-top li.lang .form-group { margin: 0 !important; padding: 0 !important; display: flex; align-items: center; width: auto; max-width: none; flex: none; }
html.ui-v3 .dashboard-header .navbar-right-top li.lang .lang-dropdown { display: flex; align-items: center; }
html.ui-v3 .dashboard-header .navbar .ui-shell-lang,
html.ui-v3 .dashboard-header .navbar .navbar-right-top .lang-dropdown > .ui-shell-lang { height: 34px !important; padding: 0 14px !important; margin: 0 !important; }
html.ui-v3 .ui-shell-reopen #sidebarToggle {
    width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; background: var(--ui-primary) !important; color: #fff !important; font-size: 16px;
}
html.ui-v3 .ui-shell-reopen #sidebarToggle i { color: #fff !important; }
html.ui-v3 .ui-shell-reopen { margin-inline-end: 12px; }
@media (min-width: 992px) {
    html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar-right-top > li.lang { height: var(--shell-topbar-h); align-items: center; margin: 0; padding-block: 0 !important; }
}
html.ui-v3 .dashboard-header .navbar-right-top li.lang .lang-dropdown { margin: 0 !important; }
/* Language button: its own padding (an older rule zeroed it), icon + code + caret on one centred line. */
html.ui-v3 .dashboard-header .navbar .navbar-right-top li.lang .lang-dropdown > button.ui-shell-lang.dropdown-toggle {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
    height: 34px !important; padding: 0 14px !important; line-height: 1 !important; box-sizing: border-box;
}
html.ui-v3 .dashboard-header .navbar .navbar-right-top li.lang .lang-dropdown > button.ui-shell-lang.dropdown-toggle::after { margin: 0 !important; vertical-align: 0 !important; }
html.ui-v3 .dashboard-header .navbar .navbar-right-top li.lang .lang-dropdown > button.ui-shell-lang i { margin: 0 !important; }
/* The bell and the site globe sit on purple buttons: white icons (the bar's dark-text rule had won). */
html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-right-top > .nav-item.notification > a.nav-link i,
html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-right-top > .nav-item > a.me-2 i,
html.ui-v3:has(.ui-shell-sidebar) .dashboard-header .navbar .navbar-right-top > .nav-item > a.me-2 { color: #fff !important; }
html.ui-v3 .ui-camera-msg.is-info { color: var(--ui-text-2); font-weight: 500; }
