/* =====================================================================
   Thème 2026-10 « Billetix Backoffice » (backoffice.html + connect.html)
   Même palette que le scanner (scan.html, bloc bx-theme).
   Uniquement couleurs, arrondis, ombres et graisse du texte : aucune
   dimension, marge ni disposition n'est modifiée (tailles calculées par
   Webix), aucune ligne de JavaScript ne dépend de ce fichier.
   Pour revenir à l'ancien look : retirer la balise <link> de ce fichier.
   ===================================================================== */
:root {
    --bx-night: #13293D;
    --bx-night-2: #1E3A55;
    --bx-blue: #1F7FC9;
    --bx-blue-dark: #186DAF;
    --bx-blue-soft: #E3EFFA;
    --bx-bg: #EEF2F6;
    --bx-card: #FFFFFF;
    --bx-line: #D5DEE8;
    --bx-line-soft: #E6ECF2;
    --bx-text: #1C2B3A;
    --bx-muted: #6B7C8F;
    --bx-ok: #12A150;
    --bx-ko: #E0353B;
}

body { background-color: var(--bx-bg); color: var(--bx-text); }
body .webix_view { color: var(--bx-text); }
body .webix_view.webix_layout_space,
body .webix_view.webix_layout_wide,
body .webix_view.webix_layout_clean { background-color: var(--bx-bg); }

/* ---------- Barre du haut (utilisateur connecté) ---------- */
body [view_id="vwMain"] > .webix_view.webix_toolbar {
    background: var(--bx-night);
    border-color: var(--bx-night);
    box-shadow: 0 2px 6px rgba(19, 41, 61, .3);
}
/* nom de l'application, posé en surimpression : n'occupe aucune place dans la mise en page */
body [view_id="vwMain"] > .webix_view.webix_toolbar { position: relative; }
body [view_id="vwMain"] > .webix_view.webix_toolbar::before {
    content: "Billetix";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .02em;
    pointer-events: none;
}
/* numéro de version : V<version>.<upgrade> — changer ici à chaque upgrade ; « build N » et le ?bN du lien vers ce fichier (backoffice.html, connect.html) sont mis à jour par tools/set_build.py */
body [view_id="vwMain"] > .webix_view.webix_toolbar::after {
    content: "Backoffice V3.0 build 963";
    position: absolute;
    left: 102px;
    top: 50%;
    transform: translateY(-50%);
    color: #8FB3D9;
    font-size: 14px;
    pointer-events: none;
}
body [view_id="vwMain"] > .webix_view.webix_toolbar .webix_el_button.webix_secondary .webix_button {
    background: rgba(255, 255, 255, .12);
    color: #FFFFFF;
}
body [view_id="vwMain"] > .webix_view.webix_toolbar .webix_el_button.webix_secondary .webix_button:hover {
    background: rgba(255, 255, 255, .2);
}

/* ---------- Barres Institution / Lieu : cartes blanches ---------- */
body .webix_view.webix_toolbar.webix_layout_toolbar {
    border-color: var(--bx-line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(19, 41, 61, .06);
}
body [view_id="vwMain"] > .webix_view.webix_toolbar.webix_layout_toolbar { border-radius: 0; }
body .webix_toolbar .webix_el_box > label,
body .webix_toolbar .webix_inp_label { color: var(--bx-night); font-weight: 600; }

/* ---------- Champs, listes déroulantes ---------- */
body .webix_el_text input,
body .webix_el_richselect .webix_inp_static,
body .webix_el_combo input,
body .webix_el_datepicker .webix_inp_static,
body .webix_el_textarea textarea {
    border-color: var(--bx-line);
    border-radius: 8px;
    background: var(--bx-card);
    color: var(--bx-text);
}
body .webix_el_text input:focus,
body .webix_el_richselect .webix_inp_static:focus,
body .webix_el_combo input:focus,
body .webix_el_textarea textarea:focus {
    border-color: var(--bx-blue);
    box-shadow: 0 0 0 3px rgba(31, 127, 201, .16);
    outline: none;
}
body input::placeholder { color: var(--bx-muted); }

/* ---------- Boutons ---------- */
body .webix_el_button .webix_button,
body .webix_el_toggle .webix_button {
    border-radius: 8px;
    font-weight: 500;
    transition: background-color .15s ease;
}
body .webix_el_button.webix_secondary .webix_button {
    background: var(--bx-blue-soft);
    color: var(--bx-blue);
}
body .webix_el_button.webix_secondary .webix_button:hover,
body .webix_el_button.webix_secondary .webix_button:focus { background: #D3E6F7; }
body .webix_el_button .webix_button .webix_icon,
body .webix_el_button .webix_button .webix_icon_btn { color: inherit; }
body .webix_el_button.webix_primary .webix_button { background: var(--bx-blue); }
body .webix_el_button.webix_primary .webix_button:hover { background: var(--bx-blue-dark); }
body .webix_disabled_view .webix_button,
body .webix_el_button.webix_disabled_view .webix_button { background: #F1F4F7; color: #A9B5C2; }

/* ---------- Grilles (représentations, utilisateurs, sources...) ---------- */
body .webix_view.webix_dtable {
    border-color: var(--bx-line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bx-card);
    box-shadow: 0 1px 3px rgba(19, 41, 61, .06);
}
body .webix_dtable .webix_ss_header,
body .webix_dtable .webix_ss_header .webix_hcell,
body .webix_dtable .webix_ss_header .webix_hs_center,
body .webix_dtable .webix_ss_header .webix_hs_left,
body .webix_dtable .webix_ss_header .webix_hs_right {
    background: #F5F8FB;
    color: var(--bx-night);
    font-weight: 600;
}
body .webix_dtable .webix_ss_header { border-bottom-color: var(--bx-line); }
body .webix_dtable .webix_cell { border-color: var(--bx-line-soft); }
body .webix_dtable .webix_column > div.webix_cell { border-bottom-color: var(--bx-line-soft); }
body .webix_dtable .webix_row_select,
body .webix_dtable .webix_cell.webix_row_select,
body .webix_dtable .webix_cell_select { background: var(--bx-blue-soft); color: var(--bx-text); }
body .webix_dtable .webix_cell .webix_icon { color: var(--bx-blue); }
body .webix_dtable .webix_cell input.webix_table_checkbox { accent-color: var(--bx-blue); }
/* états métier conservés, couleurs adoucies */
body .webix_dtable .webix_cell.error,
body .error { background-color: #FBD5D6; }
body .webix_dtable .webix_cell.import_end,
body .import_end { background-color: #FFF1F1; }
body .webix_dtable .webix_cell.warning { background-color: #FDE7C2; }

/* ---------- Listes déroulantes et menus ---------- */
body .webix_view.webix_popup,
body .webix_view.webix_window {
    border-color: transparent;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(19, 41, 61, .25);
}
body .webix_list .webix_list_item.webix_selected,
body .webix_list .webix_list_item:focus { background: var(--bx-blue-soft); color: var(--bx-text); box-shadow: none; }
body .webix_list .webix_list_item:hover { background: #F3F8FD; }
body .webix_window .webix_win_head { background: var(--bx-night); border-color: var(--bx-night); }
body .webix_window .webix_win_head .webix_view,
body .webix_window .webix_win_head .webix_template,
body .webix_window .webix_win_head .webix_el_box { color: #FFFFFF; background: transparent; }
body .webix_modal { background-color: rgba(19, 41, 61, .45); }
body .webix_modal_box { border-radius: 14px; overflow: hidden; box-shadow: 0 12px 32px rgba(19, 41, 61, .3); }
body .webix_modal_box .webix_popup_button { border-radius: 8px; }
body .webix_switch_box.webix_switch_on { background-color: var(--bx-blue); }

/* ---------- Onglets (paramétrage d'institution) ---------- */
body .webix_item_tab.webix_selected { color: var(--bx-blue); }
body .webix_tabbar .webix_item_tab { color: var(--bx-muted); }

/* ---------- Page de connexion (connect.html) ---------- */
body .webix_form.trans,
body .trans { background: transparent; }
body [view_id="vwForm"] .webix_view:has(> .webix_template) { background: transparent; }
body [view_id="vwForm"] .webix_el_button.webix_secondary .webix_button {
    background: var(--bx-blue);
    color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(31, 127, 201, .35);
}
body [view_id="vwForm"] .webix_el_button.webix_secondary .webix_button:hover { background: var(--bx-blue-dark); }

@media (prefers-reduced-motion: reduce) {
    body .webix_el_button .webix_button { transition: none; }
}
