* {
    box-sizing: border-box;
}
 
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f6f4;
    color: #183b2b;
}
 
.app {
    display: flex;
    min-height: 100vh;
}
 
/* Menu lateral */
 
.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: #12372a;
    color: white;
    padding: 25px 16px;
    display: flex;
    flex-direction: column;
}
 
.logo {
    margin: 0 0 35px;
    padding: 0;
    color: #d8f3b0;
    font-size: 27px;
}
 
.menu-title {
    color: #b6c9bc;
    font-size: 11px;
    font-weight: bold;
    margin: 0 0 15px;
}
 
nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
 
.nav-link {
    color: #e6eee8;
    text-decoration: none;
    padding: 13px 12px;
    border-radius: 7px;
    font-size: 14px;
}
 
.nav-link:hover,
.nav-link.active {
    background: #285640;
    color: #ffffff;
}
 
.sidebar-footer {
    margin-top: auto;
    padding-top: 30px;
    color: #b6c9bc;
    font-size: 12px;
    line-height: 1.5;
}
 
/* Zone principale */
 
.main-content {
    flex: 1;
    min-width: 0;
    padding: 30px;
}
 
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 30px;
}
 
.topbar h2 {
    margin: 0 0 8px;
    font-size: 25px;
}
 
.topbar p {
    margin: 0;
    color: #6c7b71;
    font-size: 14px;
}
 
.user-profile {
    background: white;
    border: 1px solid #e0e8e1;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 13px;
}
 
/* Cartes */
 
.dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
 
.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border-left: 5px solid #70ad47;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}
 
.card .label {
    margin: 0 0 14px;
    color: #6c7b71;
    font-size: 14px;
}
 
.card h3 {
    margin: 0;
    font-size: 22px;
    overflow-wrap: anywhere;
}
 
/* Petits ecrans */
 
@media (max-width: 700px) {
    .app {
        flex-direction: column;
    }
 
    .sidebar {
        width: 100%;
        padding: 18px;
    }
 
    .logo {
        margin-bottom: 20px;
    }
 
    nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
 
    .nav-link {
        font-size: 12px;
        padding: 11px 8px;
    }
 
    .sidebar-footer {
        display: none;
    }
 
    .main-content {
        padding: 20px 15px;
    }
 
    .dashboard {
        grid-template-columns: 1fr;
        gap: 14px;
    }
 
    .topbar {
        align-items: flex-start;
    }
 
    .topbar h2 {
        font-size: 21px;
    }
 
    .user-profile {
        font-size: 11px;
        padding: 10px;
    }
}

/* Formulaire de vente KmerBiz */
.page-content {
    margin-top: 25px;
}
 
.page-content h3 {
    margin-bottom: 10px;
    color: #183b2b;
}
 
.sale-form {
    max-width: 650px;
    margin-top: 20px;
    padding: 22px;
    background: white;
    border: 1px solid #e0e8e1;
    border-radius: 12px;
    display: grid;
    gap: 10px;
}
 
.sale-form label {
    font-size: 14px;
    font-weight: bold;
    color: #183b2b;
}
 
.sale-form input {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: 1px solid #cbd8ce;
    border-radius: 7px;
    font-size: 15px;
}
 
.sale-total {
    margin: 10px 0;
    font-size: 17px;
}
 
.primary-button {
    padding: 12px 16px;
    background: #285640;
    color: white;
    border: 0;
    border-radius: 7px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}
 
.primary-button:hover {
    background: #12372a;
}
 
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}
 
.sales-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
 
.sales-table th,
.sales-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e8e1;
    text-align: left;
    white-space: nowrap;
}
 
.sales-table th {
    background: #eaf2ec;
    color: #183b2b;
}
 
@media (max-width: 700px) {
    .sale-form {
        padding: 15px;
    }
 
    .sales-table th,
    .sales-table td {
        padding: 9px;
        font-size: 12px;
    }
}

.stock-form {
    background: white;
    padding: 22px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    max-width: 700px;
}
 
.stock-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d7e0d9;
    border-radius: 7px;
    font: inherit;
    margin-bottom: 8px;
}
 
.stock-form button {
    padding: 13px;
    border: 0;
    border-radius: 7px;
    background: #285640;
    color: white;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}
 
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
 
.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 12px;
}
 
.table-wrapper th,
.table-wrapper td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e0e8e1;
}

.expense-form {
    display: grid;
    gap: 10px;
    max-width: 520px;
    margin: 20px 0;
}

.expense-form label {
    font-weight: 600;
}

.expense-form input,
.expense-form select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d5ddd8;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.expense-form button {
    padding: 11px 14px;
    border: none;
    border-radius: 8px;
    background: #16834a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.expense-form button:hover {
    background: #116b3b;
}


/* Authentification KmerBiz */
#auth-interface {
    max-width: 500px;
    margin: 40px auto;
    padding: 25px;
    background: #ffffff;
    border: 1px solid #e0e8e1;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

#auth-interface h2 {
    margin-top: 0;
    color: #183b2b;
}

#auth-interface form {
    gap: 10px;
    margin-top: 20px;
}

#auth-interface label {
    font-size: 14px;
    font-weight: bold;
}

#auth-interface input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd8ce;
    border-radius: 7px;
    font: inherit;
}

#auth-interface button {
    padding: 12px;
    border: none;
    border-radius: 7px;
    background: #285640;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

#auth-interface button:hover {
    background: #12372a;
}

#auth-message {
    overflow-wrap: anywhere;
}


/* Affichage alternatif des formulaires */
#login-form,
#register-form {
    display: none;
}

#login-form.active,
#register-form.active {
    display: grid;
}

#auth-switch {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

#auth-switch button {
    flex: 1;
}

#auth-interface[hidden],
.app[hidden] {
    display: none !important;
}

/* Recherche globale KmerBiz */
.global-search {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
}

#global-search-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd8ce;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

#global-search-input:focus {
    border-color: #4b9b68;
    box-shadow: 0 0 0 2px rgba(75, 155, 104, 0.15);
}

#global-search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    color: #183b2b;
    border: 1px solid #dce5de;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.global-search-result {
    padding: 10px 12px;
    border-bottom: 1px solid #e8eee9;
    overflow-wrap: anywhere;
}

.global-search-result:last-child {
    border-bottom: none;
}

.global-search-result strong {
    display: block;
    margin-bottom: 5px;
    color: #247344;
    font-size: 13px;
}

.global-search-result p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

#global-search-results:empty {
    display: none;
}


/* =========================================
   KMERBIZ — NOUVELLE INTERFACE VITRÉE
   ========================================= */

:root {
    --kb-green-dark: #073b2b;
    --kb-green: #08764f;
    --kb-green-light: #19a875;
    --kb-glass: rgba(255, 255, 255, 0.13);
    --kb-glass-border: rgba(255, 255, 255, 0.24);
    --kb-white: #ffffff;
}

body {
    background:
        linear-gradient(rgba(3, 35, 26, 0.72), rgba(3, 35, 26, 0.82)),
        url("https://images.unsplash.com/photo-1441986300917-64674bd600d8?auto=format&fit=crop&w=1920&q=80")
        center / cover fixed;
    color: var(--kb-white);
    min-height: 100vh;
}

.app {
    background: transparent;
    gap: 18px;
    padding: 18px;
}

.sidebar {
    background: rgba(3, 48, 35, 0.76);
    border: 1px solid var(--kb-glass-border);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
}

.main-content {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--kb-glass-border);
    border-radius: 22px;
    padding: 24px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-width: 0;
}

.topbar {
    background: var(--kb-glass);
    border: 1px solid var(--kb-glass-border);
    border-radius: 16px;
    padding: 14px 18px;
    color: var(--kb-white);
}

.card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid var(--kb-glass-border);
    border-left: 4px solid var(--kb-green-light);
    border-radius: 18px;
    color: var(--kb-white);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-content {
    color: var(--kb-white);
}

.nav-link {
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.17);
    transform: translateX(3px);
}

.global-search,
.global-search input,
input,
select,
textarea {
    border-radius: 10px;
}

input,
select,
textarea {
    max-width: 100%;
}

@media (max-width: 700px) {
    .app {
        padding: 8px;
        gap: 10px;
    }

    .sidebar,
    .main-content {
        border-radius: 16px;
    }

    .main-content {
        padding: 14px;
    }

    body {
        background-attachment: scroll;
    }
}

/* Tableau de connexion : effet verre */
#auth-interface {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 22px;
    color: #ffffff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* Champs de connexion : style vitré */
#auth-interface input {
    width: 100%;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    padding: 13px 15px;
    color: #ffffff;
    outline: none;
}

#auth-interface input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

#auth-interface input:focus {
    border-color: #19d394;
    box-shadow: 0 0 0 3px rgba(25, 211, 148, 0.18);
}

#auth-interface label {
    color: #ffffff;
}

/* Bouton de connexion */
#auth-interface button {
    background: linear-gradient(135deg, #08764f, #19a875);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 13px 22px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#auth-interface button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

/* Menu latéral KmerBiz : effet verre */
.sidebar {
    background: rgba(3, 48, 35, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.sidebar .logo {
    color: #ffffff;
}

.sidebar .menu-title {
    color: rgba(255, 255, 255, 0.65);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 12px 14px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.sidebar .sidebar-footer {
    color: rgba(255, 255, 255, 0.75);
}

/* Cartes du tableau de bord */
.dashboard .card {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-left: 4px solid #19d394;
    border-radius: 18px;
    padding: 22px;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.dashboard .card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.22);
}

.dashboard .card h2,
.dashboard .card h3,
.dashboard .card p,
.dashboard .card span {
    color: #ffffff;
}

/* Cartes statistiques du tableau de bord */
.dashboard .card {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-left: 4px solid #19a875;
    border-radius: 20px;
    color: #ffffff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dashboard .card h2,
.dashboard .card h3,
.dashboard .card p,
.dashboard .card span {
    color: #ffffff;
}

/* KMERBIZ — EN-TÊTE DU TABLEAU DE BORD */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    color: #ffffff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.topbar h1,
.topbar h2,
.topbar p,
.topbar span,
.user-profile {
    color: #ffffff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
}

/* KMERBIZ — TABLEAUX VITRÉS */

.table-wrap,
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
}

.sales-table th {
    background: rgba(5, 90, 62, 0.75);
    color: #ffffff;
    padding: 14px;
    text-align: left;
    white-space: nowrap;
}

.sales-table td {
    padding: 13px 14px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    white-space: nowrap;
}

.sales-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.10);
}

.table-wrap button,
.table-wrapper button {
    border-radius: 8px;
}

/* CORRECTION DE LA LISIBILITÉ DES TABLEAUX */

.sales-table {
    background: rgba(255, 255, 255, 0.96);
    color: #183b2b;
}

.sales-table th {
    background: #08764f;
    color: #ffffff !important;
}

.sales-table td,
.sales-table td *,
.sales-table tbody tr td {
    color: #183b2b !important;
    background-color: transparent;
}

.sales-table tbody tr {
    background: rgba(255, 255, 255, 0.96);
}

.sales-table tbody tr:nth-child(even) {
    background: rgba(235, 246, 240, 0.96);
}

.sales-table tbody tr:hover {
    background: #dcefe5;
}

/* KMERBIZ — LISIBILITÉ DU TABLEAU DE STOCK */

#stock-interface table,
#stock-interface table tbody {
    background: rgba(255, 255, 255, 0.96);
    color: #183b2b;
}

#stock-interface table th {
    background: #08764f;
    color: #ffffff !important;
}

#stock-interface table td,
#stock-interface table td * {
    color: #183b2b !important;
    background-color: transparent;
}

#stock-interface table tbody tr {
    background: rgba(255, 255, 255, 0.96);
}

#stock-interface table tbody tr:nth-child(even) {
    background: #ebf6f0;
}

#stock-interface table tbody tr:hover {
    background: #dcefe5;
}

/* KMERBIZ — FORMULAIRE DE STOCK LISIBLE */

#stock-interface input,
#stock-interface select,
#stock-interface textarea {
    background: rgba(255, 255, 255, 0.96) !important;
    color: #183b2b !important;
    border: 1px solid #b8d8c8;
    border-radius: 10px;
}

#stock-interface input::placeholder,
#stock-interface textarea::placeholder {
    color: #687c72 !important;
    opacity: 1;
}

#stock-interface label,
#stock-interface form label,
#stock-interface h2,
#stock-interface h3,
#stock-interface p {
    color: #ffffff !important;
}

#stock-interface option {
    background: #ffffff;
    color: #183b2b;
}

/* LIBELLÉS DU FORMULAIRE D'AJOUT DE PRODUIT */

#stock-interface label,
#stock-interface form label,
#stock-interface .stock-form label {
    color: #183b2b !important;
    font-weight: 600 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* KMERBIZ — LISIBILITÉ DE LA RUBRIQUE DÉPENSES */

#expenses-interface h1,
#expenses-interface h2,
#expenses-interface h3,
#expenses-interface p {
    color: #ffffff !important;
    opacity: 1 !important;
}

#expenses-interface table {
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-collapse: collapse;
}

#expenses-interface table th {
    background: #08764f;
    color: #ffffff !important;
    padding: 13px;
}

#expenses-interface table td,
#expenses-interface table td * {
    color: #183b2b !important;
}

#expenses-interface table tbody tr {
    background: #ffffff;
}

#expenses-interface table tbody tr:nth-child(even) {
    background: #ebf6f0;
}

/* KMERBIZ — LISIBILITÉ CLIENTS ET CRÉDITS */

/* Sous-titres et titres */
#clients-interface h1,
#clients-interface h2,
#clients-interface h3,
#clients-interface p {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Total des crédits restants */
#clients-interface .card,
#clients-interface .card h2,
#clients-interface .card h3,
#clients-interface .card p,
#clients-interface .card strong,
#clients-interface .card span {
    color: #ffffff !important;
}

/* Tableaux des clients et des crédits */
#clients-interface table {
    background: #ffffff;
    border-collapse: collapse;
}

#clients-interface table th {
    background: #08764f;
    color: #ffffff !important;
    padding: 13px;
}

#clients-interface table td,
#clients-interface table td * {
    color: #183b2b !important;
}

#clients-interface table tbody tr {
    background: #ffffff;
}

#clients-interface table tbody tr:nth-child(even) {
    background: #ebf6f0;
}

/* KMERBIZ — LISIBILITÉ DE LA RUBRIQUE RAPPORTS */

/* Sous-titres */
#reports-interface h1,
#reports-interface h2,
#reports-interface h3,
#reports-interface p {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Total des ventes */
#reports-interface .card,
#reports-interface .card h2,
#reports-interface .card h3,
#reports-interface .card p,
#reports-interface .card strong,
#reports-interface .card span {
    color: #ffffff !important;
}

/* Tableau des rapports */
#reports-interface table {
    background: #ffffff;
    border-collapse: collapse;
}

#reports-interface table th {
    background: #08764f;
    color: #ffffff !important;
    padding: 13px;
}

#reports-interface table td,
#reports-interface table td * {
    color: #183b2b !important;
}

#reports-interface table tbody tr {
    background: #ffffff;
}

#reports-interface table tbody tr:nth-child(even) {
    background: #ebf6f0;
}

/* KMERBIZ — BOUTON DE DÉCONNEXION */

#logout-button {
    background: rgba(255, 255, 255, 0.13) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.30) !important;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#logout-button:hover {
    background: #08764f !important;
    border-color: #19a875 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
}

/* ==================================
   KMERBIZ - MODE CLAIR
================================== */

body.light-mode {
    background:
        linear-gradient(
            rgba(245, 250, 246, 0.78),
            rgba(245, 250, 246, 0.84)
        ),
        url("https://images.unsplash.com/photo-1441986300917-64674bd600d8?auto=format&fit=crop&w=1920&q=80")
        center / cover fixed !important;

    color: #343f38 !important;
}

body.light-mode .app {
    background: transparent !important;
}

body.light-mode .sidebar {
    background: #ffffff !important;
    color: #183b2e !important;
    border: 1px solid #d5e3db;
}

body.light-mode .sidebar h1,
body.light-mode .sidebar h2,
body.light-mode .sidebar p {
    color: #183b2e !important;
}

body.light-mode .nav-link {
    color: #244b3b !important;
}

body.light-mode .nav-link.active {
    background: #d9eee2 !important;
    color: #08764f !important;
}

body.light-mode .main-content,
body.light-mode .topbar,
body.light-mode .dashboard .card,
body.light-mode #settings-interface,
body.light-mode #business-interface {
    background: #ffffff !important;
    color: #183b2e !important;
    border: 1px solid #dce8e0;
}

body.light-mode .main-content h1,
body.light-mode .main-content h2,
body.light-mode .main-content h3,
body.light-mode .main-content p,
body.light-mode .main-content label {
    color: #183b2e !important;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: #ffffff !important;
    color: #183b2e !important;
    border: 1px solid #b9cfc2 !important;
}

body.light-mode table {
    background: #ffffff !important;
    color: #183b2e !important;
}

body.light-mode table td {
    color: #183b2e !important;
}

body.light-mode .page-content {
    color: #183b2e !important;
}

/* KMERBIZ - CARTES DU TABLEAU DE BORD EN MODE CLAIR */

body.light-mode .dashboard .card {
    background: rgba(255, 255, 255, 0.78) !important;
    color: #343f38 !important;
    border: 1px solid rgba(39, 103, 73, 0.18) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(20, 60, 40, 0.10) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-mode .dashboard .card h2,
body.light-mode .dashboard .card h3,
body.light-mode .dashboard .card p,
body.light-mode .dashboard .card span {
    color: #343f38 !important;
}

/* KMERBIZ - SIDEBAR EN MODE CLAIR */

body.light-mode .sidebar {
    background: rgba(232, 244, 235, 0.88) !important;
    border: 1px solid rgba(39, 103, 73, 0.20) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(20, 60, 40, 0.10) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-mode .sidebar .nav-link {
    color: #24543d !important;
    border-radius: 10px;
}

body.light-mode .sidebar .nav-link.active {
    background: rgba(39, 103, 73, 0.16) !important;
    color: #174d38 !important;
}

/* KMERBIZ - FORMULAIRES EN MODE CLAIR */

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: rgba(255, 255, 255, 0.88) !important;
    color: #263b30 !important;
    border: 1px solid rgba(39, 103, 73, 0.25) !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(20, 60, 40, 0.04);
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
    outline: none;
    border-color: #27845b !important;
    box-shadow: 0 0 0 3px rgba(39, 132, 91, 0.13);
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #819187 !important;
}

/* KMERBIZ - BOUTONS EN MODE CLAIR */

body.light-mode button {
    background: #216b49 !important;
    color: #ffffff !important;
    border: 1px solid #216b49 !important;
    border-radius: 10px !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

body.light-mode button:hover {
    background: #174d38 !important;
    transform: translateY(-1px);
}

/* KMERBIZ - TABLEAUX EN MODE CLAIR */

body.light-mode table {
    background: rgba(255, 255, 255, 0.82) !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(20, 60, 40, 0.08);
}

body.light-mode table th {
    background: rgba(39, 103, 73, 0.12) !important;
    color: #174d38 !important;
}

body.light-mode table td {
    color: #343f38 !important;
    border-bottom: 1px solid rgba(39, 103, 73, 0.10);
}

body.light-mode table tr:hover td {
    background: rgba(39, 103, 73, 0.06) !important;
}

/* KMERBIZ - TOPBAR EN MODE CLAIR */

body.light-mode .topbar {
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(39, 103, 73, 0.16) !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 16px rgba(20, 60, 40, 0.07) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.light-mode .topbar h1,
body.light-mode .topbar h2,
body.light-mode .topbar p,
body.light-mode .topbar span {
    color: #174d38 !important;
}

/* KMERBIZ - MENU LATERAL FIXE */

.sidebar {
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    align-self: flex-start;
    overflow-y: auto;
}

/* Organisation de la rubrique Mon commerce */
#business-interface {
    padding: 25px;
    border-radius: 16px;
    margin-top: 20px;
}

#business-interface h2 {
    margin-bottom: 8px;
}

#business-interface > p {
    margin-bottom: 25px;
}

#business-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 15px 20px;
    align-items: center;
    max-width: 850px;
}

#business-form label {
    font-weight: 600;
    margin: 0;
}

#business-form input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 8px;
}

#business-form button {
    grid-column: 2;
    justify-self: start;
    margin-top: 10px;
}

#business-save-message {
    margin-top: 15px;
}

@media (max-width: 600px) {
    #business-interface {
        padding: 15px;
    }

    #business-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #business-form input {
        margin-bottom: 12px;
    }

    #business-form button {
        grid-column: 1;
        width: 100%;
    }
}

/* Organisation des paramètres KmerBiz */
#settings-interface {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.settings-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-card h3 {
    margin: 0 0 5px;
}

.settings-card p {
    margin: 0 0 8px;
    line-height: 1.5;
}

.settings-card label {
    font-weight: 600;
    margin-top: 5px;
}

.settings-card input:not([type="checkbox"]),
.settings-card select {
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 8px;
}

.settings-card button {
    align-self: flex-start;
    margin-top: 8px;
}

.settings-card input[type="checkbox"] {
    margin-right: 8px;
}

body.light-mode .settings-card {
    background: #ffffff;
    border-color: #dce8e0;
    color: #183b2e;
}

@media (max-width: 600px) {
    #settings-interface {
        padding: 10px;
    }

    .settings-card {
        padding: 16px;
    }

    .settings-card button {
        width: 100%;
    }
}

/* Alignement du formulaire de changement de mot de passe */
#change-password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

#change-password-form label {
    display: block;
    margin-top: 12px;
}

#change-password-form input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

/* Organisation de la rubrique Clients et crédits */
#clients-interface {
    padding: 20px;
}

#client-form {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px 20px;
    align-items: center;
    max-width: 850px;
}

#client-form label {
    font-weight: 600;
}

#client-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 8px;
}

#client-form button {
    grid-column: 2;
    justify-self: start;
    margin-top: 10px;
}

#clients-interface h3 {
    margin-top: 25px;
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    #client-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #client-form input {
        margin-bottom: 10px;
    }

    #client-form button {
        grid-column: 1;
        width: 100%;
    }
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #ffffff;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f0ad4e;
}

.status-dot.online {
    background: #28c76f;
}

.status-dot.offline {
    background: #ea5455;
}
#settings-interface[hidden] {
    display: none !important;
}

/* Lisibilité des labels de connexion en mode clair */
body.light-mode #auth-interface label {
    color: #183b2e !important;
    opacity: 1 !important;
    text-shadow: none !important;
}