* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

a {
    text-decoration: none;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: #ffffff;
    border-right: 1px solid #d1d5db;
    min-height: 100vh;
}

.sidebar-title {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    font-size: 22px;
    font-weight: bold;
    border-bottom: 1px solid #d1d5db;
}

.sidebar-menu {
    padding: 25px 0;
}

.sidebar-menu a {
    display: block;
    padding: 16px 32px;
    color: #111827;
    font-size: 16px;
}

.sidebar-menu a:hover {
    background: #f3f4f6;
}

.main-content {
    flex: 1;
    min-height: 100vh;
    background: #f3f4f6;
}

.topbar {
    height: 68px;
    background: #ffffff;
    border-bottom: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.topbar h1 {
    font-size: 20px;
    margin: 0;
}

.logout-btn {
    background: #dc2626;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 7px;
    font-weight: bold;
    font-size: 14px;
}

.logout-btn:hover {
    background: #b91c1c;
}

.content {
    padding: 36px;
}

.stats-grid {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 24px;
}

.green {
    color: #16a34a;
}

.red {
    color: #dc2626;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 380px;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 5px;
}

.login-box p {
    margin-top: 0;
    margin-bottom: 25px;
    color: #6b7280;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: bold;
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #6b7280;
    border-radius: 4px;
    padding: 9px 10px;
    font-size: 14px;
}

.login-box input {
    margin-bottom: 15px;
}

.login-box button {
    width: 100%;
    height: 42px;
    border: none;
    background: #16a34a;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.login-box button:hover {
    background: #15803d;
}

.page-actions {
    max-width: 980px;
    margin: 0 auto 20px auto;
}

.table-card {
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 18px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid #d1d5db;
    font-size: 15px;
}

.data-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-edit {
    color: #2563eb;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
}

.link-delete {
    color: #dc2626;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 0;
}

.status-active {
    color: #111827;
}

.status-inactive {
    color: #dc2626;
}

.form-card {
    max-width: 700px;
    margin: 25px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 18px;
}

.form-group textarea {
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.form-check input {
    width: auto;
}

.form-check label {
    margin: 0;
    font-size: 15px;
    font-weight: normal;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-dark,
.btn-success {
    display: inline-block;
    border: none;
    padding: 11px 17px;
    border-radius: 5px;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #2563eb;
}

.btn-dark {
    background: #374151;
}

.btn-success {
    background: #16a34a;
}

.btn-success:hover {
    background: #15803d;
}

.alert-success {
    max-width: 980px;
    margin: 0 auto 18px auto;
    background: #dcfce7;
    color: #166534;
    padding: 12px 15px;
    border-radius: 5px;
}

.alert-error {
    max-width: 980px;
    margin: 0 auto 18px auto;
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px 15px;
    border-radius: 5px;
}

/*
À copier à la fin de assets/css/style.css si ces classes n'existent pas encore.
*/

.product-thumb {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.current-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.current-image-item {
    width: 120px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    background: #f9fafb;
}

.current-image-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 6px;
}

.current-image-item label {
    font-size: 12px;
    font-weight: normal;
}

.current-image-item input {
    width: auto;
}

/*
À copier à la fin de assets/css/style.css si cette classe n'existe pas encore.
*/

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.form-group small {
    color: #6b7280;
    font-weight: normal;
}
/*
À copier à la fin de assets/css/style.css si ces classes n'existent pas encore.
*/

.product-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.product-card-image,
.product-card-no-image {
    width: 100%;
    height: 190px;
}

.product-card-image {
    object-fit: cover;
}

.product-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
}

.product-card-body {
    padding: 18px;
}

.product-card-body h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.product-category {
    color: #2563eb;
    font-weight: bold;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.product-description {
    color: #4b5563;
    min-height: 45px;
    font-size: 14px;
}

.product-price-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 11px;
    margin: 14px 0;
}

.product-price-list span {
    display: block;
    color: #6b7280;
    font-size: 12px;
}

.product-price-list strong {
    display: block;
    font-size: 14px;
}

.choose-product-form {
    margin-top: 15px;
}

.choose-product-form input {
    margin-bottom: 10px;
}

.status-pending {
    color: #d97706;
    font-weight: bold;
}

/*
À copier à la fin de assets/css/style.css
*/

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 5px;
}

.btn-disabled {
    display: inline-block;
    border: none;
    background: #9ca3af;
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: not-allowed;
    font-size: 12px;
}

.status-pending {
    color: #d97706;
    font-weight: bold;
}

/*
À copier à la fin de assets/css/style.css

Correction :
- le tableau prend plus de largeur utile ;
- l'action reste dans la zone blanche ;
- l'email est affiché sous le nom client au lieu d'avoir une colonne séparée ;
- les colonnes sont plus compactes.
*/

.table-card-full {
    max-width: calc(100vw - 330px);
    width: 100%;
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.choices-table-compact {
    width: 100%;
    min-width: 900px;
    table-layout: auto;
}

.choices-table-compact th,
.choices-table-compact td {
    padding: 11px 8px;
    font-size: 13px;
    vertical-align: middle;
}

.choices-table-compact th {
    white-space: nowrap;
}

.choices-table-compact td {
    white-space: normal;
    word-break: break-word;
}

.choices-table-compact small {
    color: #6b7280;
    font-size: 12px;
}

.action-stack {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
}

.btn-disabled {
    display: inline-block;
    border: none;
    background: #9ca3af;
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: not-allowed;
    font-size: 12px;
    white-space: nowrap;
}

.btn-danger-small {
    display: inline-block;
    border: none;
    background: #dc2626;
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.btn-danger-small:hover {
    background: #b91c1c;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 1000px) {
    .table-card-full {
        max-width: 100%;
    }

    .choices-table-compact {
        min-width: 900px;
    }
}

/*
À copier à la fin de assets/css/style.css
*/

.sales-search-card {
    max-width: 980px;
    margin: 0 auto 18px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
}

.sales-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sales-search-form input {
    flex: 1;
}

.sale-card {
    max-width: 1050px;
    margin: 0 auto 24px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sale-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.sale-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.sale-header p {
    margin: 5px 0;
    font-size: 14px;
}

.sale-actions {
    min-width: 220px;
}

.sale-actions form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.payments-table {
    min-width: 900px;
}

.payment-action-form {
    display: grid;
    gap: 8px;
}

.payment-action-form textarea {
    resize: vertical;
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
}

.btn-danger-small {
    display: inline-block;
    border: none;
    background: #dc2626;
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.btn-danger-small:hover {
    background: #b91c1c;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .sale-header {
        flex-direction: column;
    }

    .sales-search-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/*
À copier à la fin de assets/css/style.css
*/

.dashboard-filter-card {
    max-width: 1050px;
    margin: 0 auto 18px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-bottom: 3px solid #d1d5db;
    border-radius: 6px;
    padding: 18px;
}

.dashboard-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr 1fr;
    gap: 14px;
}

.dashboard-filter-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.dashboard-stats-grid {
    max-width: 1050px;
}

.dashboard-mini-stats {
    max-width: 1050px;
    margin: 18px auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.mini-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mini-stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.mini-stat-card strong {
    font-size: 22px;
}

.dashboard-table-card {
    max-width: 1050px;
    margin-top: 20px;
}

.dashboard-table-card h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table small {
    color: #6b7280;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn-small {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .dashboard-filter-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-mini-stats,
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}



/* Correction formulaire client / utilisateur : aide mot de passe */

.password-help-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.5;
}

.password-help-box span {
    display: block;
    margin-top: 3px;
}

.password-help-box code {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    color: #111827;
}

.input-help {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
}

@media (max-width: 800px) {
    .form-row-2,
    .form-row-3,
    .product-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================
   Recherche client - Modèle 1 intégré dans style.css
   ========================================================== */

/*
À copier à la fin de assets/css/style.css
Recherche client - Modèle 1
*/

.client-product-search-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 22px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.client-product-search-form label {
    display: block;
    font-weight: 700;
    color: #111827;
    margin-bottom: 7px;
}

.client-search-main input,
.client-search-field select {
    width: 100%;
    border: 1px solid #9ca3af;
    border-radius: 7px;
    padding: 11px 12px;
    font-size: 15px;
    background: #ffffff;
}

.client-search-main input:focus,
.client-search-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.client-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    margin-top: 14px;
    align-items: end;
}

.client-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.client-search-actions .btn-primary,
.client-search-actions .btn-dark {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.client-search-info {
    margin-top: 12px;
    font-size: 14px;
    color: #4b5563;
    font-weight: 600;
}

.product-card-no-image {
    height: 210px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: 700;
}

@media (max-width: 850px) {
    .client-search-row {
        grid-template-columns: 1fr;
    }

    .client-search-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .client-search-actions .btn-primary,
    .client-search-actions .btn-dark {
        width: 100%;
    }
}


/* ==========================================================
   Slider images produit - Modèle D intégré
   ========================================================== */

/*
À copier à la fin de assets/css/style.css
Slider images produit - Modèle D
*/

.product-slider {
    width: 100%;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.product-slider-stage {
    position: relative;
    width: 100%;
    height: 230px;
    overflow: hidden;
    background: #f3f4f6;
}

.product-slide {
    display: none;
    width: 100%;
    height: 230px;
    object-fit: cover;
}

.product-slide.is-active {
    display: block;
}

.product-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-slider-btn:hover {
    background: rgba(15, 23, 42, 0.92);
}

.product-slider-prev {
    left: 10px;
}

.product-slider-next {
    right: 10px;
}

.product-slider-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 850px) {
    .product-slider-stage,
    .product-slide {
        height: 220px;
    }
}
