* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1{color: white;}

#center-image {
    max-width: 80%;
    height: auto;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #639D87;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid white
}

header {
    background: #639D87;
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.calculator-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-section {
    padding: 25px;
}

.form-section:nth-child(even) {
    background: #f8f9fa;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #639D87;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dimensions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.price-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

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

.price-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    padding: 15px 0;
    border-top: 2px solid #639D87;
    margin-top: 10px;
}

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

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.logo {
    max-width: 20rem;
    height: auto;
}

/* Logo du client connecté, à côté du logo Obopano */
.header-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.user-logo-wrapper {
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.user-logo {
    display: block;
    max-height: 70px;
    max-width: 12rem;
    object-fit: contain;
}
.btn-primary {
    background: #639D87;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.preview-section {
    padding: 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.preview-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.preview-info p {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #639D87;
}

.preview-info p:last-child {
    margin-bottom: 0;
}

.preview-info strong {
    color: #639D87;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    header h1 {
        font-size: 2rem;
    }

    .container {
        margin: 10px;
        border-radius: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .form-section {
        padding: 20px;
    }

    .preview-section {
        padding: 20px;
    }
}

/* Animation pour les changements de prix */
.price-animation {
    animation: priceUpdate 0.5s ease-in-out;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #639D87;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Styles pour les informations de remise */
.remise-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
    line-height: 1.4;
}

.remise-info small {
    display: block;
    margin-bottom: 4px;
}

.remise-info small:last-child {
    margin-bottom: 0;
}

/* Style pour le coefficient de réduction */
#coefficient_reduction {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
}

#coefficient_reduction:focus {
    border-color: #639D87;
    box-shadow: 0 0 0 3px rgba(99, 157, 135, 0.1);
}

/* Styles pour les notifications de succès */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.success-notification button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

/* Styles pour l'authentification */
.login-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 20px 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.login-form h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.login-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    top: 0;
    right: 0;
    height: calc(100% - 15px);
    width: 40px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.toggle-password:hover {
    color: #333;
}

.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.user-info span {
    font-weight: 500;
    color: #333;
}

.user-discount-section {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #2196f3;
}

.discount-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.discount-controls input {
    flex: 1;
    max-width: 100px;
}

.discount-info {
    color: #666;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* Styles pour les boutons */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Styles pour les rôles et statuts */
.role-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-user {
    background-color: #6c757d;
    color: white;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-yes {
    background-color: #28a745;
    color: white;
}

.status-no {
    background-color: #dc3545;
    color: white;
}

/* Styles pour les modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Styles pour les tableaux d'administration */
.users-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

/* Animations pour l'affichage du calculateur */
.calculator-form {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.calculator-form[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}

.calculator-form[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

.preview-section {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.preview-section[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}

.preview-section[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Styles pour le message de connexion */
.login-form {
    max-width: 500px;
    margin: 20px auto;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 10px;
}

.login-form p {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 16px;
}

.login-form .btn {
    width: 100%;
    margin-top: 10px;
}

/* Styles pour les groupes de boutons */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.option-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-button:hover {
    border-color: #0D385E;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.option-button.selected {
    border-color: #0D385E;
    background: #0D385E;
    color: white;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.option-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    border-color: #ddd;
}

.option-button.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #ddd;
    background: #f5f5f5;
}

.option-icon {
    font-size: 24px;
    margin-bottom: 8px;
    color: inherit;
}

.option-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.option-description {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.2;
}

.option-price {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

.option-button.selected .option-price {
    background: rgba(255,255,255,0.2);
}

/* Animations pour les boutons */
.option-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.option-button:hover::before {
    left: 100%;
}

/* Responsive pour les boutons */
@media (max-width: 768px) {
    .button-group {
        gap: 8px;
    }

    .option-button {
        min-width: 100px;
        padding: 12px 16px;
    }

    .option-icon {
        font-size: 20px;
    }

    .option-label {
        font-size: 13px;
    }

    .option-description {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .button-group {
        flex-direction: row;
    }

    .option-button {
        width: 48%;
        min-width: auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .discount-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-table {
        font-size: 14px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px;
    }

    .login-form {
        margin: 10px;
        max-width: none;
    }
}

/* ===== STYLES POUR LA MINI-RECHERCHE DE DÉCORS ===== */

.decor-search-container {
    position: relative;
    margin-bottom: 15px;
}

.decor-search-input {
    position: relative;
    width: 100%;
}

.decor-search-input input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.decor-search-input input:focus {
    outline: none;
    border-color: #639D87;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 157, 135, 0.1);
}

.decor-search-input .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
}

.decor-search-input .clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decor-search-input .clear-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.decor-search-input input:not(:placeholder-shown) + .search-icon + .clear-btn {
    opacity: 1;
}

.decor-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

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

.result-image {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.result-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

.result-group.group-1 {
    background: #e8f5e8;
    color: #2d5a2d;
}

.result-group.group-2 {
    background: #fff3cd;
    color: #856404;
}

.result-group.group-3 {
    background: #d1ecf1;
    color: #0c5460;
}

.result-group.group-4 {
    background: #f8d7da;
    color: #721c24;
}

.result-group.group-unclassified {
    background: #e2e3e5;
    color: #6c757d;
}

.result-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-category {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #6c757d;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.no-results i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.no-results p {
    margin: 0;
    font-size: 0.9rem;
}

/* Carte du décor sélectionné */
.selected-decor-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.decor-card-mini {
    display: flex;
    align-items: center;
    gap: 15px;
}

.decor-image-mini {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.decor-image-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.decor-details-mini {
    flex: 1;
}

.decor-details-mini h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.decor-group-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.decor-group-mini.group-1 {
    background: #e8f5e8;
    color: #2d5a2d;
}

.decor-group-mini.group-2 {
    background: #fff3cd;
    color: #856404;
}

.decor-group-mini.group-3 {
    background: #d1ecf1;
    color: #0c5460;
}

.decor-group-mini.group-4 {
    background: #f8d7da;
    color: #721c24;
}

.decor-group-mini.group-unclassified {
    background: #e2e3e5;
    color: #6c757d;
}

.decor-details-mini p {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

/* Responsive pour la mini-recherche */
@media (max-width: 768px) {
    .decor-search-results {
        max-height: 250px;
    }

    .search-result-item {
        padding: 10px 12px;
    }

    .result-image {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    .result-header h4 {
        font-size: 0.9rem;
    }

    .result-group {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .decor-card-mini {
        gap: 12px;
    }

    .decor-image-mini {
        width: 50px;
        height: 50px;
    }

    .decor-details-mini h4 {
        font-size: 1rem;
    }
}

/* ===== Devis multi-lignes ===== */
.lignes-devis {
    margin-bottom: 20px;
}

.lignes-vide {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 8px;
}

.lignes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.lignes-table thead {
    background: #639D87;
    color: #fff;
}

.lignes-table th,
.lignes-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.lignes-table th.num,
.lignes-table td.num {
    text-align: right;
    white-space: nowrap;
}

.lignes-table tbody tr {
    border-bottom: 1px solid #eee;
}

.lignes-table tbody tr:last-child {
    border-bottom: none;
}

.lignes-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.lignes-table small {
    color: #777;
    font-size: 0.78rem;
}

.btn-remove-ligne {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-remove-ligne:hover {
    background: rgba(220, 53, 69, 0.1);
}

.franco-info {
    margin: 8px 0;
    padding: 10px 14px;
    background: #eef6f2;
    border-left: 4px solid #639D87;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #12385B;
}

.franco-info:empty {
    display: none;
}

.franco-info i {
    margin-right: 6px;
}

.ligne-groupe {
    color: #639D87;
    font-weight: 600;
    font-size: 0.8rem;
}
