html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

/* ============================================
   VARIABLES & THÃˆMES
   ============================================ */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --accent-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-color: #2c3e50;
    --border-radius: 10px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --cartouche-graph-background: white;
    --hauteur-note: 260px;
}

/* body.light-mode hÃ©rite de :root â€” pas de redÃ©claration nÃ©cessaire */

body.dark-mode {
    --primary-color: #8ab4f8;
    --secondary-color: #121212;
    --accent-color: #5cb85c;
    --danger-color: #ff6b6b;
    --text-color: #e5e5e5;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    --cartouche-graph-background: #1c1c1c;
}

body.rose-mode {
    --primary-color: #ff69b4;
    --secondary-color: #fff0f6;
    --accent-color: #ff1493;
    --danger-color: #ff4d6d;
    --text-color: #702045;
    --shadow: 0 4px 8px rgba(255, 0, 100, 0.2);
    --cartouche-graph-background: white;
}

body.vert-mode {
    --primary-color: #2ecc71;
    --secondary-color: #e8fff0;
    --accent-color: #27ae60;
    --danger-color: #e74c3c;
    --text-color: #1f4d2e;
    --shadow: 0 4px 8px rgba(0, 100, 50, 0.2);
    --cartouche-graph-background: white;
}

body.glacier-mode {
    --primary-color: #4fd3ff;
    --secondary-color: #e6faff;
    --accent-color: #00aaff;
    --danger-color: #ff4a4a;
    --text-color: #003344;
    --shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
    --cartouche-graph-background: white;
}

body.tangerine-mode {
    --primary-color: #ff7f50;
    --secondary-color: #fff4ef;
    --accent-color: #ff5722;
    --danger-color: #f44336;
    --text-color: #5a2c0a;
    --shadow: 0 4px 12px rgba(255, 100, 50, 0.2);
    --cartouche-graph-background: white;
}

body.rainbow-mode {
    --primary-color: #ff85a2;
    --secondary-color: #f0f9ff;
    --accent-color: #8ae0ff;
    --danger-color: #ff6b6b;
    --text-color: #3b3b3b;
    --shadow: 0 4px 8px rgba(255, 160, 200, 0.25);
    --cartouche-graph-background: white;
}

/* ============================================
   RESET & GLOBAL
   ============================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 2rem;
    position: relative;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
    font-size: 1.25rem;
}

.nav-toggle {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-item a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem 0.5rem;
}

.nav-item a:hover,
.nav-item a.active {
    color: var(--primary-color);
}


.nav-menu .separator {
    position: relative;
    align-self: center;
    margin: 0 8px;
    width: 0;
    list-style: none;
}

.nav-menu .separator::before {
    content: "";
    display: block;
    background-color: silver;
    height: 1px;
    width: 195px;
}
input[type="checkbox"] {
    accent-color: var(--primary-color);
}
/* ============================================
   LAYOUT
   ============================================ */
main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

.title-container {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title-container h2 {
    margin: 0;
    color: var(--primary-color);
    font-weight: normal;
}

/* ============================================
   BOUTONS
   ============================================ */
button {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: var(--primary-color);
    color: white;
}


button.barre-outils {
    padding: 0.45rem 1.45rem;
}

.nav-button {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
}

.nav-button:hover {
    background: var(--primary-color);
    color: white;
}

.bt_active {
    background: var(--text-color);
    color: var(--cartouche-graph-background);
}

.bt_active:hover {
    background: var(--primary-color);
    color: var(--cartouche-graph-background);
}

.delete-row,
.note-row {
    background: transparent;
    color: var(--danger-color);
    padding: 0.5rem;
    font-size: 1.2rem;
}

.delete-row:hover,
.note-row:hover {
    color: var(--text-color);
    background: transparent;
}

/* .btn-primary hÃ©rite du style de base de button â€” surcharges minimales */
.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

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

.btn-danger:hover {
    background: #c0392b;
}

.no-hover:hover {
    background: inherit !important;
    color: inherit !important;
    box-shadow: none !important;
    transform: none !important;
}

/* ============================================
   TABLEAUX
   ============================================ */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow: visible;
    position: relative;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-weight: 600;
    text-align: left;
    line-height: 1.2;
    white-space: nowrap;
    padding: 0.75rem;
}

td {
    padding: 0.20rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

tfoot tr td {
    font-weight: bold;
    background-color: var(--secondary-color);
}

tfoot tr:last-child td {
    padding-top: 1rem;
}

/* Largeurs colonnes - cartouches-table2 */
table.cartouches-table2 th:nth-child(2),
table.cartouches-table2 td:nth-child(2),
table.cartouches-table2 th:nth-child(3),
table.cartouches-table2 td:nth-child(3) {
    width: 0;
}

table.cartouches-table2 th:nth-child(4),
table.cartouches-table2 td:nth-child(4) {
    width: 10%;
}

/* Largeurs colonnes - table-facture */
table.table-facture {
    table-layout: fixed;
    border-collapse: collapse;
}

table.table-facture th,
table.table-facture td {
    overflow: visible !important;
}

table.table-facture input {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

table.table-facture tfoot td {
    vertical-align: middle;
}

table.table-facture th:nth-child(1),
table.table-facture td:nth-child(1),
table.table-facture th:nth-child(2),
table.table-facture td:nth-child(2) {
    width: 40px;
    text-align: center;
}

table.table-facture th:nth-child(3),
table.table-facture td:nth-child(3) {
    width: 400px;
}

table.table-facture th:nth-child(4),
table.table-facture td:nth-child(4),
table.table-facture th:nth-child(6),
table.table-facture td:nth-child(6) {
    width: 80px;
    text-align: center;
}

table.table-facture th:nth-child(5),
table.table-facture td:nth-child(5),
table.table-facture th:nth-child(7),
table.table-facture td:nth-child(7) {
    width: 90px;
}

table.table-facture th:nth-child(8),
table.table-facture td:nth-child(8) {
    width: 100px;
}

table.table-facture th:nth-child(9),
table.table-facture td:nth-child(9) {
    width: 50px;
    text-align: center;
}

table.table-facture th:nth-child(10),
table.table-facture td:nth-child(10) {
    width: 50px;
    text-align: center;
}
/* ============================================
   TOTAUX
   ============================================ */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.totals-container {
    position: relative;
    padding: 0.5rem 0.75rem;
    height: 40px;
}

.totals-wrapper {
    position: absolute;
    right: 0.75rem;
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    top: 50%;
    transform: translateY(-50%);
}

.totals-wrapper strong,
.totals-wrapper span {
    text-align: right;
}

.totals-wrapper strong {
    padding-right: 4px;
}

.totals-wrapper span {
    min-width: 80px;
}

tfoot .text-right strong {
    display: inline-block;
    min-width: 85px;
    text-align: right;
    padding-right: 4px;
}

tfoot .text-right span {
    display: inline-block;
    min-width: 80px;
    text-align: right;
}

/* ============================================
   FORMULAIRES
   ============================================ */
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

input[readonly] {
    background-color: var(--secondary-color);
    border-color: transparent;
    text-align: right;
    cursor: default;
}

td:nth-child(2) input[type="number"],
td:nth-child(4) input[type="number"] {
    width: 80px;
}

td:nth-child(6) input[type="text"] {
    width: 90px;
    text-align: right;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dashboard-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.dashboard-card p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.card-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.card-button:hover {
    background-color: var(--text-color);
    color: white;
}

/* ============================================
   GRAPHIQUE
   ============================================ */
.chart-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin: 1rem 0;
    height: 500px;
}

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

tr {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ============================================
   DROPDOWN & MENUS
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 200px;
    top: 100%;
    left: 0;
    z-index: 10;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.75rem;
    white-space: nowrap;
    line-height: 1;
}

.dropdown-menu li a .material-icons {
    font-size: 18px;
    line-height: 1;
    width: 20px;
    min-width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}
.dropdown-menu li a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.nav-menu.active .dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    min-width: auto;
}

.dropdown-toggle .arrow {
    margin-left: 5px;
    transition: var(--transition);
}

.dropdown-menu .dropdown-toggle .arrow {
    float: right;
    margin-left: 10px;
}

.sub-dropdown {
    position: relative;
}

.submenu-right,
.submenu-left {
    display: none;
    position: absolute;
    top: 0;
    background: white;
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    border-radius: var(--border-radius);
    min-width: 220px;
    z-index: 999;
}

.submenu-right {
    left: 100%;
}

.submenu-left {
    right: 100%;
}

.dropdown-menu.submenu-right hr {
    border: none;
    height: 1px;
    margin: 8px 0;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.25), transparent);
}

/* ============================================
   CONFIGURATION
   ============================================ */
.config-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease-out;
    width: 100%;
}

.config-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.input-group {
    display: flex;
    align-items: center;
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.input-group:hover,
.input-group:focus-within {
    border-color: var(--primary-color);
}

/* form-input & form-select partagent les mÃªmes bases */
.form-input,
.form-select {
    border: none;
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--primary-color);
}

.form-input:focus,
.form-select:focus {
    outline: none;
}

.form-select {
    background-color: white;
}

.input-suffix {
    background: var(--secondary-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-left: 2px solid #eee;
}

.button-container {
    margin-top: 1.5rem;
    text-align: right;
}

/* ============================================
   MODALES
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: var(--transition);
}

.modal.show {
    opacity: 1;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 400px;
    animation: fadeIn 0.3s ease-out;
    text-align: center;
}

.modal-content.largeur-grand {
    width: 900px;
}

.modal-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.modal-message,
.modal-message-area {
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.modal-message {
    margin-bottom: 1.5rem;
}
.modal-message_search {
    margin-bottom: 0.5rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ============================================
   PAGE 404
   ============================================ */
.error-404 {
    text-align: center;
}

.error-404-code {
    font-size: 4.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-404-message {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.error-404-button {
    padding: 0.75rem 2rem;
    text-decoration: none;
}

/* ============================================
   CALCULATRICE
   ============================================ */
.calculator {
    position: fixed;
    top: 150px;
    right: 50px;
    width: 520px;
    background: var(--cartouche-graph-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 9999;
    user-select: none;
}

/* Regroupement de tous les Ã©tats hidden de la calculatrice */
.calculator.hidden,
.calc-history.hidden,
.calculator-buttons.hidden,
.calculator-input.hidden,
.calc-finance.hidden {
    display: none;
}

.calculator-header {
    touch-action: none;
    user-select: none;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.calculator-header button {
    background: transparent;
    color: white;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}

.calculator-body {
    display: flex;
    align-items: stretch;
}

.calc-history {
    width: 200px;
    background: var(--secondary-color);
    padding: 0.75rem;
    font-size: 0.85rem;
    overflow-y: auto;
    max-height: 280px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.calc-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.calc-history h4 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.calc-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calc-history li {
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

.calc-main {
    flex: 1;
    padding: 1rem;
    background: var(--cartouche-graph-background);
}

#calc-display {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.2rem;
    text-align: right;
    background: transparent;
    color: var(--text-color);
    border: 2px solid #eee;
    border-radius: var(--border-radius);
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.calculator-buttons button {
    padding: 1rem;
    border: 1px solid #eee;
    background: transparent;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color);
}

.calculator-buttons button:hover {
    background: var(--secondary-color);
}

.calculator-buttons .equal {
    grid-column: span 4;
    background: var(--primary-color);
    color: white;
}

.calculator-buttons .equal:hover {
    background: var(--text-color);
}

.calc-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calc-header-actions button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
}

.calc-header-actions button:hover {
    opacity: 0.85;
}

.calc-separator {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.35);
    margin: 0 4px;
}

#toggle-history,
#toggle-finance,
#calc-copy,
#clear-history {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

#toggle-history,
#toggle-finance,
#calc-copy {
    color: white;
    font-size: 1rem;
}

#clear-history {
    color: var(--primary-color);
    font-size: 0.9rem;
}

#clear-history:hover {
    color: var(--danger-color);
}

#toggle-history:disabled {
    cursor: default;
}

#toggle-finance:hover,
#calc-copy:hover {
    opacity: 0.85;
}

#calc-copy.copied {
    color: var(--accent-color);
}

.calc-finance {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.calc-finance h4 {
    margin: 0 0 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-align: left;
}

.calc-finance label {
    display: block;
    font-weight: 600;
    margin: 0.5rem 0 0.25rem;
    color: var(--text-color);
    font-size: 0.9rem;
}

.calc-finance input[type="number"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-color);
}

.calc-finance input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

#calc-finance-btn {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
}

#calc-finance-btn:hover {
    background: var(--text-color);
}

.fin-results {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
    display: grid;
    gap: 0.25rem;
    font-size: 0.95rem;
}

.fin-results strong {
    color: var(--primary-color);
}

.calculator-input {
    border: 5px solid #eee;
}

.icone_calculatrice {
    color: var(--primary-color);
}

.icone_calculatrice:hover {
    color: var(--text-color);
}

/* ============================================
   FENÃŠTRE INFO
   ============================================ */
.fenetre-info {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 220px;
    background: white;
    color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 13px;
}

.fenetre-info-header {
    cursor: move;
    padding: 0 8px;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
}

.fenetre-info hr {
    border: none;
    height: 1px;
    margin: 8px 0;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.25), transparent);
}

.fenetre-info.pliee .fenetre-info-contenu {
    display: none;
}

.fenetre-info-contenu {
    padding: 8px;
}

a.bt-fenetre-info {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 28px;
}

.refresh {
    font-size: 0.9em;
    color: var(--primary-color);
    padding-left: 5px;
}

.valeur-infos {
    color: var(--primary-color);
}

/* ============================================
   RECHERCHE & BADGES
   ============================================ */
.bt-recherche {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(50%, -50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 0;
}

.bt-recherche .material-icons {
    color: var(--primary-color);
    font-size: 22px;
}
.bt-corbeille {
    top: 60px; /* distance sous le premier bouton */
}
.bt-corbeille-delete-all {
    top: 120px; /* distance sous le premier bouton */
}

.bt-icon {
    background: transparent;
    border: none;
    padding: 0.25rem 0.4rem;
    border-radius: 10px;
    cursor: pointer;
}

.bt-icon .material-icons {
    color: var(--primary-color);
}

.bt-icon:hover .material-icons {
    color: var(--text-color);
}

.client-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: white;
    padding: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.client-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.search-active {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-search {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

.clear-search:hover {
    text-decoration: underline;
}

/* ============================================
   MODALE NOTE
   ============================================ */
#modal-note .modal-content.largeur-grand {
    width: 85vw;
    max-width: 1400px;
    height: 85vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modal-note .modal-body-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.note-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

#modal-note .note-texte textarea {
    width: 100%;
    height: var(--hauteur-note);
    resize: vertical;
}

#modal-note .form-input {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    transition: var(--transition);
}

#modal-note .form-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.note-fichiers {
    display: flex;
    flex-direction: column;
}

#modal-note .liste-fichiers {
    height: var(--hauteur-note);
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    background: var(--secondary-color);
}

.fichier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.fichier-item:last-child {
    border-bottom: none;
}

.liste-fichiers a.fichier-nom {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
}

.liste-fichiers a.fichier-nom:hover {
    color: var(--text-color);
}

.fichier-supprimer {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    color: var(--danger-color);
}

.fichier-supprimer:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.note-date {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1rem;
}

.zone-upload {
    margin-top: 0.75rem;
}

#modal-note .modal-buttons {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: inherit;
    position: sticky;
    bottom: 0;
}

.note-wrapper {
    position: relative;
    display: inline-block;
}

.note-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(55%, -45%);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary-color);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px white;
    z-index: 5;
}

.btn-upload {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: var(--border-radius);
    border: 2px dashed rgba(0, 0, 0, 0.15);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

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

.upload-progress {
    margin-top: 0.6rem;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--primary-color);
    transition: width 0.15s linear;
}

.upload-progress.hidden {
    display: none;
}

.upload-info {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    opacity: 0.8;
}


/* ============================================
   DARK MODE â€” COMPOSANTS
   ============================================ */
body.dark-mode {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

body.dark-mode .navbar {
    background-color: #1e1e1e;
}

body.dark-mode .nav-item a {
    color: var(--text-color);
}

body.dark-mode .nav-item a:hover,
body.dark-mode .nav-item a.active {
    color: var(--primary-color);
}

body.dark-mode .title-container,
body.dark-mode .table-container,
body.dark-mode .dashboard-card,
body.dark-mode .chart-container,
body.dark-mode .config-section,
body.dark-mode .modal-content,
body.dark-mode .info-box,
body.dark-mode .info-container {
    background-color: #1c1c1c;
    color: var(--text-color);
    box-shadow: var(--shadow);
}

body.dark-mode th {
    background-color: #2b2b2b;
    color: var(--text-color);
}

body.dark-mode td {
    border-bottom: 1px solid #333;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode select {
    background-color: #2b2b2b;
    border: 2px solid #444;
    color: var(--text-color);
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="number"]:focus {
    border-color: var(--primary-color);
}

body.dark-mode .dropdown-menu,
body.dark-mode .submenu-right,
body.dark-mode .submenu-left {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .dropdown-menu li a {
    color: var(--text-color);
}

body.dark-mode .dropdown-menu li a:hover {
    background: #333;
    color: var(--primary-color);
}

body.dark-mode .btn-primary,
body.dark-mode #envoyer,
body.dark-mode #ajouter,
body.dark-mode .action-btn {
    background: var(--primary-color);
    color: white;
}

body.dark-mode .btn-danger {
    background: var(--danger-color);
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.55);
}

body.dark-mode .logout-link:hover svg {
    stroke: var(--danger-color);
}

body.dark-mode .calculator {
    background: #1c1c1c;
}

body.dark-mode .calc-history {
    background: #1e1e1e;
    border-right: 1px solid #333;
}

body.dark-mode .calculator-buttons button {
    border-color: #333;
}

body.dark-mode .fenetre-info {
    background: var(--cartouche-graph-background);
    color: white;
}

body.dark-mode .fenetre-info-header {
    background: var(--secondary-color);
    color: white;
}

/* ============================================
   DIVERS
   ============================================ */
.logout-link:hover {
    color: var(--danger-color);
}

.logout-link svg {
    margin-right: 6px;
    transition: var(--transition);
}

.logout-link:hover svg {
    stroke: var(--danger-color);
}

#neige_canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}
.mobile-cartes{
    display:none
}
.iphone-outils {
    display: none;
}
.div-scroll {
    height: 300px;
    overflow-y: auto;
}
.file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.file-icon {
    font-size: 20px;
    color: var(--primary-color);
}
/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --hauteur-note: 220px;
    }

    .nav-toggle {
        display: block;
        font-size: 1.5rem;
        background: transparent;
        border: none;
        color: var(--primary-color);
        cursor: pointer;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--cartouche-graph-background);
        box-shadow: var(--shadow);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
        transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
        z-index: 1000;
    }

    .nav-menu.active {
        max-height: 100vh;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-item {
        width: 100%;
    }

    .nav-item a {
        display: block;
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .dropdown-menu,
    .submenu-right,
    .submenu-left {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background: var(--secondary-color);
        display: none;
    }

    .dropdown.open > .dropdown-menu,
    .sub-dropdown.open > .submenu-right,
    .sub-dropdown.open > .submenu-left {
        display: block;
    }

    .arrow {
        float: right;
    }

    .title-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    th,
    td {
        padding: 0.75rem;
    }

    input[type="text"],
    input[type="number"] {
        padding: 0.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-card {
        padding: 1.5rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .modal-content.largeur-grand {
        width: 400px;
    }

    .liste-fichiers {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .fichier-item {
        gap: 0.6rem;
        padding: 0.85rem 0.9rem;
        border-radius: 12px;
        background: var(--secondary-color);
        text-decoration: none;
        color: var(--text-color);
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    }

    .fichier-item:active {
        transform: scale(0.99);
    }

    .fichier-icone {
        font-size: 1.1rem;
        width: 1.4rem;
        text-align: center;
    }

    .fichier-nom {
        flex: 1;
        text-align: left;
        line-height: 1.15;
        word-break: break-word;
    }

    .fichier-chev {
        opacity: 0.6;
        font-size: 1.35rem;
        line-height: 1;
    }

    #modal-note textarea {
        resize: none;
    }
}

@media (min-width: 1025px) {
    #modal-note .modal-body-scroll {
        flex: 1;
        min-height: 0;
        overflow: visible;
    }

    #modal-note .note-grid {
        height: 100%;
        align-items: stretch;
    }

    #modal-note .note-texte,
    #modal-note .note-fichiers {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    #modal-note .note-texte textarea {
        height: 100%;
        resize: none;
    }

    #modal-note .liste-fichiers {
        flex: 1;
        overflow-y: auto;
    }

    #modal-note .zone-upload {
        margin-top: 0.75rem;
    }

}

@media (max-width: 479px) and (orientation: portrait),(max-height: 500px) and (orientation: landscape) {

    /* ============================================
       MODES MOBILES (iphone) â€” mutualisÃ©s
       ============================================ */
    .fenetre-info{
        display:none;
    }

    .table-facture {
        display: none;
    }

    .mobile-cartes {
        display: block;
    }

    .iphone-outils {
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top:25px
    }

    .facture-carte {
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 1rem;
        margin-top: 1rem;
    }

    .carte-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }

    .carte-client {
        font-weight: 700;
        color: var(--primary-color);
    }

    .carte-total {
        font-weight: 800;
        white-space: nowrap;
    }

    .carte-libelle {
        margin: 0.35rem 0 0.75rem;
        line-height: 1.2;
    }

    .carte-metas {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        font-size: 0.95rem;
    }

    .carte-actions {
        margin-top: 0.75rem;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    .btn-mini {
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;
    }

    .disabl{
        background-color: grey;
    }
    .titre_h2{
        display:none;
    }

}
@media (max-width: 479px) and (orientation: portrait){
    /* iPhone portrait */
    .bt-corbeille{
        display:none;
    }
    .fenetre-info{
        display:none;
    }
    .carte-metas {
        font-size: 0.70rem;
    }
}
@media (max-height: 500px) and (orientation: landscape) {
    /* iPhone paysage */
    .bt-corbeille{
        display:none;
    }
    .fenetre-info{
        display:none;
    }
    .div-scroll {
        height: 190px;
    }
    #modal-ok .modal-content{
        padding:1rem
    }
}

/* iPad portrait */
@media (min-width: 480px) and (max-width: 1024px) and (orientation: portrait) {
    /* ============================================
       MODES MOBILES (ipad) â€” mutualisÃ©s
       ============================================ */
    .bt-corbeille{
        display:none;
    }

    .table-facture {
        display: none;
    }

    .mobile-cartes {
        display: block;
    }

    .iphone-outils {
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top:25px;
        text-align: left;
    }

    .facture-carte {
        background: white;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
        padding: 1rem;
        margin-top: 1rem;
    }

    .carte-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }

    .carte-client {
        font-weight: 700;
        color: var(--primary-color);
    }

    .carte-total {
        font-weight: 800;
        white-space: nowrap;
    }

    .carte-libelle {
        margin: 0.35rem 0 0.75rem;
        line-height: 1.2;
    }

    .carte-metas {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        font-size: 0.95rem;
    }

    .carte-actions {
        margin-top: 0.75rem;
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    .btn-mini {
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;
    }
    .disabl{
        background-color: grey;
    }
    .modal-content.largeur-grand {
        width: 790px;
    }
}

@media (min-width: 480px) and (max-width: 1366px) and (min-height: 700px) and (orientation: landscape) {
    /* iPad paysage (hauteur mini pour exclure iPhone) */
    .table-facture th{
        font-size: 0.8rem;
        font-weight: normal;
    }
    .dropdown-menu li a {
        font-size: 0.65rem;
    }

}


.zone-upload {
    border: 2px dashed #cfcfcf;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    background: var(--cartouche-graph-background);
    transition: all 0.2s ease;
}

.zone-upload.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.04);
}

.upload-drop-text {
    margin-top: 10px;
    font-size: 13px;
    color: var(--primary-color);
    opacity: 0.8;
}

/* ============================================
   DROPDOWN CHECKBOX - MODALE NOTE
   ============================================ */

/* important : on laisse dÃ©passer le menu */
#modal-note .modal-content.largeur-grand {
    overflow: visible;
}

#modal-note .modal-body-scroll {
    overflow-y: auto;
    overflow-x: visible;
}

#modal-note .modal-buttons.modal-buttons-note {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: inherit;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 56px;
    overflow: visible;
    z-index: 50;
}

#modal-note .dropdown-note {
    position: absolute;
    left: 0px;
    bottom: 0;
    z-index: 200;
}

#modal-note .dropdown-note-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 200px;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d8d8d8;
    border-radius: var(--border-radius);
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow);
}

#modal-note .dropdown-note-toggle:hover {
    border-color: var(--primary-color);
}

#modal-note .dropdown-note-toggle .material-icons {
    font-size: 20px;
    line-height: 1;
}

#modal-note .dropdown-note-menu {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px); /* ouvre au-dessus */
    width: 260px;
    max-height: 220px;        /* hauteur max */
    overflow-y: auto;         /* ascenseur */
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    padding: 0.35rem 0;
}

#modal-note .dropdown-note.open .dropdown-note-menu {
    display: block;
}

#modal-note .dropdown-note-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

#modal-note .dropdown-note-item:hover {
    background: var(--secondary-color);
}

#modal-note .dropdown-note-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

#modal-note #out {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* scrollbar */
#modal-note .dropdown-note-menu::-webkit-scrollbar {
    width: 10px;
}

#modal-note .dropdown-note-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}

#modal-note .dropdown-note-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
}

/* mode sombre */
body.dark-mode #modal-note .dropdown-note-toggle,
body.dark-mode #modal-note .dropdown-note-menu {
    background: #1f1f1f;
    color: var(--text-color);
    border-color: #3a3a3a;
}

body.dark-mode #modal-note .dropdown-note-item:hover {
    background: #2c2c2c;
}

/* mobile */
@media (max-width: 768px) {

    #modal-note .modal-buttons.modal-buttons-note {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-bottom: 0.25rem;
    }

    #modal-note .dropdown-note {
        position: static;
        width: 100%;
    }

    #modal-note .dropdown-note-toggle {
        width: 100%;
    }

    #modal-note .dropdown-note-menu {
        left: 0;
        right: 0;
        width: 100%;
        bottom: calc(100% + 8px);
    }

    #modal-note #out {
        position: static;
        transform: none;
    }
}


/* ============================================
   MODALE RECHERCHE - NOUVELLE VERSION
   ============================================ */

#modal-search .modal-search-content {
    width: 760px;
    max-width: calc(100vw - 40px);
    overflow: visible;
}

#modal-search .search-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 12px;
}

#modal-search .search-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#modal-search .search-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: left;
}

#modal-search .search-filtres-grid {
    display: grid;
    grid-template-columns: 180px 150px 1fr;
    gap: 16px;
    align-items: end;
    overflow: visible;
}

#modal-search .search-bloc {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

#modal-search .search-bloc-tags {
    overflow: visible;
}

#modal-search #Inputsearch,
#modal-search #modeRecherche,
#modal-search #anneeRecherche {
    width: 100%;
    box-sizing: border-box;
}

#modal-search .dropdown-search {
    position: relative;
    width: 100%;
    z-index: 30;
}

#modal-search .dropdown-search-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0.65rem 0.9rem;
    border: 2px solid #d8d8d8;
    border-radius: var(--border-radius);
    background: #fff;
    color: var(--primary-color);
    cursor: pointer;
    box-sizing: border-box;
    min-height: 44px;
    box-shadow: var(--shadow);
    text-align: left;
}

#modal-search .dropdown-search-toggle:hover {
    border-color: var(--primary-color);
}

#modal-search .dropdown-search-toggle .material-icons {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

#modal-search .dropdown-search-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#modal-search .dropdown-search-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 260px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    padding: 0.35rem 0;
    z-index: 200;
}

#modal-search .dropdown-search.open .dropdown-search-menu {
    display: block;
}

#modal-search .dropdown-search-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

#modal-search .dropdown-search-item:hover {
    background: var(--secondary-color);
}

#modal-search .dropdown-search-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

#modal-search .modal-buttons.modal-buttons-search {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* scrollbar */
#modal-search .dropdown-search-menu::-webkit-scrollbar {
    width: 10px;
}

#modal-search .dropdown-search-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}

#modal-search .dropdown-search-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
}

/* mode sombre */
body.dark-mode #modal-search .dropdown-search-toggle,
body.dark-mode #modal-search .dropdown-search-menu {
    background: #1f1f1f;
    color: var(--text-color);
    border-color: #3a3a3a;
}

body.dark-mode #modal-search .dropdown-search-item:hover {
    background: #2c2c2c;
}

/* tablette */
@media (max-width: 900px) {
    #modal-search .modal-search-content {
        width: 620px;
    }

    #modal-search .search-filtres-grid {
        grid-template-columns: 1fr 1fr;
    }

    #modal-search .search-bloc-tags {
        grid-column: 1 / -1;
    }
}

/* mobile */
@media (max-width: 640px) {
    #modal-search .modal-search-content {
        width: calc(100vw - 24px);
    }

    #modal-search .search-filtres-grid {
        grid-template-columns: 1fr;
    }

    #modal-search .modal-buttons.modal-buttons-search {
        flex-direction: column;
    }

    #modal-search .modal-buttons.modal-buttons-search .btn-primary,
    #modal-search .modal-buttons.modal-buttons-search .btn-danger {
        width: 100%;
    }
}
/* uniformiser les listes Mode et AnnÃ©e avec le style du dropdown Tags */
#modal-search .form-select,
#modal-search select.form-select,
#modal-search #modeRecherche,
#modal-search #anneeRecherche {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0.65rem 2.2rem 0.65rem 0.9rem;
    min-height: 44px;
    box-sizing: border-box;

    border: 2px solid #d8d8d8;
    border-radius: var(--border-radius);
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: var(--shadow);
    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

#modal-search .form-select:hover,
#modal-search #modeRecherche:hover,
#modal-search #anneeRecherche:hover {
    border-color: var(--primary-color);
}

#modal-search .form-select:focus,
#modal-search #modeRecherche:focus,
#modal-search #anneeRecherche:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* masque la flÃ¨che native sur IE */
#modal-search select::-ms-expand {
    display: none;
}

/* mode sombre */
body.dark-mode #modal-search .form-select,
body.dark-mode #modal-search #modeRecherche,
body.dark-mode #modal-search #anneeRecherche {
    background-color: #1f1f1f;
    color: var(--text-color);
    border-color: #3a3a3a;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ff5aa7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
/* Bouton de controle audio*/
.modal-buttons-note {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.dropdown-note {
    width: 220px;
}

.dropdown-note-toggle {
    width: 100%;
}

.zone-bouton-ok-note {
    display: flex;
    justify-content: center;
}

.zone-audio-note {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.03);
    padding: 6px 10px;
    border-radius: 999px;
    justify-self: end;
}

.btn-rond-audio {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.btn-rond-audio:hover {
    background: var(--text-color);
}

.btn-rond-audio .material-icons {
    font-size: 20px;
    color: white;
    line-height: 1;
}

.btn-rond-audio:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--primary-color);
}

.audio-timer-inline {
    min-width: 54px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 800px) {
    .modal-buttons-note {
        grid-template-columns: 1fr;
    }

    .dropdown-note {
        width: 100%;
    }

    .zone-bouton-ok-note,
    .zone-audio-note {
        justify-content: center;
        justify-self: center;
    }
}


/* ============================================
   COTISATIONS URSSAF - page de consultation
   ============================================ */
.page-cotis .cotis-synthese {
    padding: 0;
    margin-bottom: 2rem;
}
.page-cotis .cotis-indicateur {
    min-width: 0;
}
.page-cotis .cotis-valeur {
    display: block;
    margin: 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}
.page-cotis .cotis-discret,
.page-cotis .cotis-petit,
.page-cotis .cotis-pied-table {
    font-size: 0.85rem;
}
.page-cotis .cotis-petit {
    display: block;
    font-weight: normal;
}
.page-cotis .cotis-titre-table {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-cotis .cotis-titre-table h2 {
    font-size: 1.15rem;
    color: var(--primary-color);
}
.page-cotis .cotis-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: var(--border-radius);
    background: var(--secondary-color);
    color: var(--text-color);
    font-size: 0.8rem;
    white-space: nowrap;
}
.page-cotis .cotis-en-cours {
    border-left: 3px solid var(--primary-color);
}
.page-cotis .cotis-terminee {
    border-left: 3px solid var(--accent-color);
}
.page-cotis .cotis-defilement {
    max-width: 100%;
    overflow-x: auto;
}
.page-cotis table {
    min-width: 640px;
}
.page-cotis td {
    padding: 0.5rem 0.75rem;
}
.page-cotis .cotis-nombre {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.page-cotis .cotis-annee,
.page-cotis .cotis-taux {
    font-weight: 600;
}
.page-cotis .cotis-pied-table {
    margin-top: 1.25rem;
}
.page-cotis .cotis-explication {
    margin-top: 1.5rem;
}
.page-cotis .cotis-explication strong {
    color: var(--primary-color);
}
/* Statut : À compléter */
.page-cotis .cotis-badge {
    display: inline-block;
    padding: 4px 10px;
    border: none;
    border-radius: 20px;
    background-color: #f0f3f7;
    color: #637083;
    font-size: 12px;
    white-space: nowrap;
}

/* Statut : Terminée */
.page-cotis .cotis-badge.cotis-terminee {
    background-color: #eaf6ef;
    color: #35734e;
}

/* Statut : En cours */
.page-cotis .cotis-badge.cotis-en-cours {
    background-color: #fff2d9;
    color: #88600d;
}
/* Séparation des lignes du tableau Urssaf */
.page-cotis .cotis-historique tbody td {
    border-bottom: 1px solid #e4eaf1;
}

/* Adaptation au thème sombre */
body.dark-mode .page-cotis .cotis-historique tbody td {
    border-bottom-color: #333;
}

@media (min-width: 768px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {

    .page-cotis .cotis-historique th {
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
    }

    /* Bilan annuel client : quatre cartouches sur une ligne sur tablette */

    .page-bilan-client .cotis-synthese {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .page-bilan-client .cotis-indicateur {
        padding: 1rem 0.75rem;
        overflow-wrap: anywhere;
    }

    .page-bilan-client .cotis-valeur {
        font-size: 1.35rem;
    }

    .page-bilan-client .cotis-discret {
        font-size: 0.75rem;
    }

}