/* CRM OmraDiscount — styles communs. Police Poppins partout (titres compris). */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/poppins-ext-300.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/poppins-300.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-ext-400.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-ext-500.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-ext-600.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-ext-700.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --crm-primaire: #00233C;
  --crm-fonce: #001829;
  --crm-clair: #0B4347;
  --crm-or: #CAA052;
  --crm-fond: #f3f5f7;
  --crm-bord: #dfe6e6;
  --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bs-body-font-size: .875rem;
  --bs-body-color: #1d2a2b;
  --bs-link-color: var(--crm-primaire);
  --bs-link-color-rgb: 0, 35, 60;
  --bs-link-hover-color: var(--crm-fonce);
  --bs-primary: var(--crm-primaire);
  --bs-primary-rgb: 0, 35, 60;
  --bs-border-radius: .45rem;
}
html, body { font-family: 'Poppins', system-ui, sans-serif; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .navbar, .btn, .form-control, .form-select, .dropdown-menu, .badge, .table, .modal, .toast, .ts-control, .ts-dropdown { font-family: 'Poppins', system-ui, sans-serif; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { font-weight: 600; color: var(--crm-fonce); letter-spacing: -.01em; }
body { background: var(--crm-fond); min-height: 100vh; display: flex; flex-direction: column; }
.crm-main { flex: 1 0 auto; }
.crm-footer { flex-shrink: 0; }

/* Boutons et éléments primaires aux couleurs OmraDiscount */
.btn-primary { --bs-btn-bg: var(--crm-primaire); --bs-btn-border-color: var(--crm-primaire); --bs-btn-hover-bg: var(--crm-fonce); --bs-btn-hover-border-color: var(--crm-fonce); --bs-btn-active-bg: var(--crm-fonce); --bs-btn-active-border-color: var(--crm-fonce); --bs-btn-disabled-bg: var(--crm-primaire); --bs-btn-disabled-border-color: var(--crm-primaire); }
.btn-outline-primary { --bs-btn-color: var(--crm-primaire); --bs-btn-border-color: var(--crm-primaire); --bs-btn-hover-bg: var(--crm-primaire); --bs-btn-hover-border-color: var(--crm-primaire); --bs-btn-active-bg: var(--crm-fonce); --bs-btn-active-border-color: var(--crm-fonce); --bs-btn-disabled-color: var(--crm-primaire); --bs-btn-disabled-border-color: var(--crm-primaire); }
.text-primary { color: var(--crm-primaire) !important; }
.bg-primary { background-color: var(--crm-primaire) !important; }
.border-primary { border-color: var(--crm-primaire) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--crm-clair); box-shadow: 0 0 0 .2rem rgba(11, 67, 71, .22); }
.form-check-input:checked { background-color: var(--crm-primaire); border-color: var(--crm-primaire); }
.pagination { --bs-pagination-color: var(--crm-primaire); --bs-pagination-active-bg: var(--crm-primaire); --bs-pagination-active-border-color: var(--crm-primaire); --bs-pagination-hover-color: var(--crm-fonce); }
.nav-tabs .nav-link { color: var(--crm-fonce); }
.nav-tabs .nav-link.active { font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--crm-primaire); }
.nav-pills .nav-link { color: var(--crm-fonce); }
.nav-pills .nav-link.active { color: #fff; }
.dropdown-item.active, .dropdown-item:active { background-color: var(--crm-primaire); }

/* Barre de navigation */
.crm-nav { background: var(--crm-primaire); border-bottom: 3px solid var(--crm-or); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.crm-nav .navbar-brand img { filter: none; }
.crm-nav .nav-link { color: rgba(255, 255, 255, .88); font-size: .82rem; font-weight: 500; padding: .45rem .55rem; border-radius: .4rem; white-space: nowrap; }
@media (min-width: 1200px) and (max-width: 1399.98px) { .crm-nav .nav-link .bi { display: none; } .crm-nav .nav-link { padding: .45rem .45rem; } }
.crm-nav .nav-link:hover, .crm-nav .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .1); }
.crm-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .18); }
.crm-nav .dropdown-menu { border: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .15); font-size: .86rem; }
.crm-recherche .form-control { width: 170px; background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .25); color: #fff; }
.crm-recherche .form-control::placeholder { color: rgba(255, 255, 255, .7); }
.crm-recherche .form-control:focus { background: #fff; color: #222; }
.crm-mode-test { background: #fff3cd; color: #664d03; padding: .2rem .5rem; border-bottom: 1px solid #ffe69c; }

/* Cartes, tableaux */
.card { border-color: var(--crm-bord); box-shadow: 0 1px 2px rgba(16, 40, 41, .04); }
.card-header { background: #fff; border-bottom-color: var(--crm-bord); }
.table { --bs-table-hover-bg: rgba(11, 67, 71, .06); font-size: .84rem; }
.table > thead th { font-weight: 600; color: var(--crm-fonce); white-space: nowrap; border-bottom-width: 2px; background: #fff; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.table td.num, .table th.num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; text-align: right; }
.crm-tuile .fs-5 { color: var(--crm-fonce); font-variant-numeric: tabular-nums; }
.crm-badge-type { background: var(--crm-clair); color: #fff; }
.text-or { color: var(--crm-or) !important; }
.border-or { border-color: var(--crm-or) !important; }
.montant-negatif { color: #b02a37; }
.montant-positif { color: #146c43; }
.ligne-annulee td { color: #8a9393; text-decoration: line-through; }
.ligne-attente td { background: #fffaf0; }
.cursor-move { cursor: move; }
.min-w-0 { min-width: 0; }

/* Barre du séjour */
.crm-menu-sejour .btn-group > .btn { white-space: nowrap; }

/* Diagnostic JS / erreurs */
.crm-diag { position: fixed; top: 0; left: 0; right: 0; z-index: 2147482000; background: #b02a37; color: #fff; padding: .5rem 1rem; font-size: .85rem; }

/* Formulaires */
.form-label { font-weight: 500; font-size: .82rem; margin-bottom: .25rem; color: #354647; }
.form-text { font-size: .75rem; }
.required::after { content: ' *'; color: #b02a37; }
fieldset.crm-bloc { border: 1px solid var(--crm-bord); border-radius: .5rem; padding: .75rem 1rem 1rem; background: #fff; margin-bottom: 1rem; }
fieldset.crm-bloc > legend { float: none; width: auto; font-size: .9rem; font-weight: 600; color: var(--crm-fonce); padding: 0 .4rem; margin-bottom: .25rem; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }

/* Connexion */
.crm-login { display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, var(--crm-fonce), var(--crm-primaire) 55%, var(--crm-clair)); }
.crm-login-carte { border-top: 4px solid var(--crm-or); width: 100%; max-width: 400px; background: #fff; border-radius: 1rem; padding: 2rem 1.75rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.crm-login-logo { max-width: 240px; height: auto; }

/* Rooming / glisser-déposer */
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: 0 0 0 2px var(--crm-clair); }

/* Mobile 390 px : pas de débordement horizontal */
@media (max-width: 575.98px) {
  .crm-main { padding-left: .6rem; padding-right: .6rem; }
  .table { font-size: .8rem; }
  .btn { --bs-btn-padding-x: .6rem; }
  h1.h4 { font-size: 1.1rem; }
  .crm-recherche .form-control { min-width: 0; width: 100%; }
}
img { max-width: 100%; }
@media print {
  .crm-nav, .crm-footer, .crm-menu-sejour, .btn, .crm-mode-test, .no-print { display: none !important; }
  body { background: #fff; }
}
.table-responsive { position: relative; }

/* ==========================================================================
   Couleurs (charte du logo : bleu nuit #00233C, vert canard #0B4347, or #CAA052)
   ========================================================================== */
:root {
  --crm-fond: #edf2f4;
  --crm-canard-vif: #0f7c7d;
  --crm-or-fonce: #9a7428;
  --crm-or-pale: #fbf5e8;
  --crm-canard-pale: #e6f2f1;
}
body { background: var(--crm-fond); }

/* Titres de page : filet or */
main h1.h4 { border-left: 4px solid var(--crm-or); padding-left: .6rem; }

/* Cartes : en-tête teinté vert canard, liseré or */
.card { border-color: #d7e2e4; }
.card-header { background: var(--crm-canard-pale); border-bottom: 2px solid var(--crm-or); color: var(--crm-primaire); }
.card-header .text-muted { color: #46625f !important; }
.card-footer { background: #f6f9f9; }

/* Tableaux : en-tête vert canard, lignes alternées discrètes */
.table > thead th { background: var(--crm-clair); color: #fff; border-bottom: 2px solid var(--crm-or); }
.table > thead th a, .table > thead th a.text-reset { color: #fff !important; }
.table > thead th .bi { color: var(--crm-or); }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #f4f8f8; }
.table > tbody > tr:hover > * { --bs-table-bg-state: rgba(202, 160, 82, .10); }
.table tfoot td, .table tfoot th, .table tr.table-total td, .table tr.fw-semibold td { background: var(--crm-or-pale); }

/* Tuiles de chiffres clés : une couleur par position */
.crm-tuile { --tuile: var(--crm-primaire); border: 0; border-left: 5px solid var(--tuile); background: color-mix(in srgb, var(--tuile) 7%, #fff); }
.crm-tuile .text-muted, .crm-tuile .text-muted .bi { color: color-mix(in srgb, var(--tuile) 80%, #000) !important; font-weight: 500; }
.crm-tuile .fs-5 { color: var(--tuile); font-weight: 700; }
.row > :nth-child(6n+1) .crm-tuile { --tuile: #00233C; }
.row > :nth-child(6n+2) .crm-tuile { --tuile: #0f7c7d; }
.row > :nth-child(6n+3) .crm-tuile { --tuile: #9a7428; }
.row > :nth-child(6n+4) .crm-tuile { --tuile: #198754; }
.row > :nth-child(6n+5) .crm-tuile { --tuile: #c0392b; }
.row > :nth-child(6n+6) .crm-tuile { --tuile: #2d6cb3; }
.crm-tuile.border-success { --tuile: #198754 !important; }
.crm-tuile.border-danger { --tuile: #c0392b !important; }
.crm-tuile.border-warning { --tuile: #b8860b !important; }

/* Barre du séjour : fond or pâle */
.crm-menu-sejour { background: var(--crm-or-pale); border: 1px solid #ead9b0; border-left: 5px solid var(--crm-or); }
.crm-badge-type { background: var(--crm-or); color: var(--crm-primaire); font-weight: 700; }

/* Onglets */
.nav-tabs { border-bottom-color: #cfdcde; }
.nav-tabs .nav-link { color: var(--crm-clair); font-weight: 500; }
.nav-tabs .nav-link:hover { color: var(--crm-primaire); border-color: transparent transparent var(--crm-or); }
.nav-tabs .nav-link.active { color: var(--crm-primaire); border-top: 3px solid var(--crm-or); background: #fff; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--crm-clair); }

/* Boutons secondaires et badges */
.btn-outline-primary { --bs-btn-color: var(--crm-clair); --bs-btn-border-color: var(--crm-clair); --bs-btn-hover-bg: var(--crm-clair); --bs-btn-hover-border-color: var(--crm-clair); --bs-btn-active-bg: var(--crm-primaire); }
.btn-or { --bs-btn-color: var(--crm-primaire); --bs-btn-bg: var(--crm-or); --bs-btn-border-color: var(--crm-or); --bs-btn-hover-bg: #b88f45; --bs-btn-hover-border-color: #b88f45; --bs-btn-hover-color: var(--crm-primaire); font-weight: 600; }
.badge.text-bg-success { background-color: #198754 !important; }
.badge.text-bg-warning { background-color: #f0b429 !important; color: #3d2b00 !important; }
.badge.text-bg-info { background-color: #2d8fb3 !important; color: #fff !important; }

/* Montants */
.montant-positif { color: #198754; font-weight: 600; }
.montant-negatif { color: #c0392b; font-weight: 600; }

/* Formulaires : légendes de blocs */
fieldset.crm-bloc { border-color: #d3e1e2; border-top: 3px solid var(--crm-clair); }
fieldset.crm-bloc > legend { color: var(--crm-clair); }

/* Pied de page */
.crm-footer { color: #5b7273 !important; }
.table > thead th .text-muted, .table > thead th small { color: rgba(255,255,255,.8) !important; }
