/* ═══════════════════════════════════════════
   SALIVACLEAN B2B - ESPACE CLIENT
   ═══════════════════════════════════════════ */

/* --- HEADER WIDE --- */
.header-inner-wide {
    max-width: 1200px;
    width: 100%;
}

/* --- LOGIN --- */
.login-section {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #F5FAFF;
    width: 100%;
    overflow-x: hidden;
}

.login-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 40px 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(11,27,58,0.1);
    border: 1px solid #E2E8F0;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    height: 40px;
    margin: 0 auto 16px;
}

.login-header h1 {
    font-size: 22px;
    color: #0B1B3A;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    color: #6B778C;
}

.login-error {
    background: #FEF2F2;
    color: #DC2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

.login-footer a {
    color: #00B7FF;
}

.login-sep {
    color: #E2E8F0;
    margin: 0 8px;
}

/* --- ESPACE LAYOUT --- */
.espace {
    display: flex;
    min-height: calc(100vh - 60px);
    width: 100vw;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background: #FFFFFF;
    border-right: 1px solid #E2E8F0;
    padding: 24px 0;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 16px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0B1B3A;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-info strong {
    font-size: 14px;
    color: #0B1B3A;
}

.profile-info span {
    font-size: 12px;
    color: #6B778C;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6B778C;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: #F5FAFF;
    color: #0B1B3A;
}

.sidebar-item.active {
    color: #00B7FF;
    background: #EFF6FF;
    border-left-color: #00B7FF;
}

.sidebar-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-logout {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E2E8F0;
    color: #DC2626;
}

.sidebar-logout:hover {
    background: #FEF2F2;
    color: #DC2626;
}

/* --- MOBILE NAV --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    z-index: 100;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.mnav-item {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 16px;
    color: #6B778C;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
}

.mnav-item span {
    font-size: 10px;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

.mnav-item.active {
    color: #00B7FF;
}

/* --- CONTENT --- */
.espace-content {
    flex: 1;
    padding: 32px;
    background: #F5FAFF;
    min-height: calc(100vh - 60px);
    min-width: 0;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section-active {
    display: block;
}

.section-header {
    margin-bottom: 28px;
}

.section-header h1 {
    font-size: 24px;
    color: #0B1B3A;
    margin-bottom: 4px;
}

.section-header p {
    font-size: 14px;
    color: #6B778C;
}

/* --- STATS GRID --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-card-accent {
    border-color: #00B7FF;
    background: #EFF6FF;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #0B1B3A;
    margin-bottom: 4px;
}

.stat-card-accent .stat-value {
    color: #00B7FF;
}

.stat-label {
    font-size: 12px;
    color: #6B778C;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- DASH CARD --- */
.dash-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.dash-card h3 {
    font-size: 14px;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.dash-order {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-order-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-order-info strong {
    font-size: 15px;
    color: #0B1B3A;
}

.dash-order-info span {
    font-size: 13px;
    color: #6B778C;
}

.dash-order-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.dash-order-right strong {
    font-size: 16px;
    color: #0B1B3A;
}

/* --- STATUS BADGES --- */
.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-delivered {
    background: #F0FDF4;
    color: #16A34A;
}

.status-shipped {
    background: #EFF6FF;
    color: #00B7FF;
}

.status-preparing {
    background: #FEF3C7;
    color: #D97706;
}

.status-pending {
    background: #F8FAFC;
    color: #6B778C;
}

/* --- DASH ALERT --- */
.dash-alert {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 16px;
    margin-top: 20px;
    font-size: 14px;
    color: #0B1B3A;
}

.dash-alert strong {
    color: #00B7FF;
}

/* --- ORDERS LIST --- */
.order-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.order-card:hover {
    border-color: #00B7FF;
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-card-ref {
    font-weight: 700;
    font-size: 15px;
    color: #0B1B3A;
}

.order-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-card-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #6B778C;
}

.order-card-amount {
    font-size: 18px;
    font-weight: 700;
    color: #0B1B3A;
}

.order-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F5FAFF;
}

.order-action-btn {
    flex: 1;
    padding: 8px 12px;
    background: #F5FAFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #0B1B3A;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.order-action-btn:hover {
    background: #EFF6FF;
    border-color: #00B7FF;
    color: #00B7FF;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11,27,58,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: #FFFFFF;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    color: #0B1B3A;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B778C;
    cursor: pointer;
    padding: 4px 8px;
}

.modal-body {
    padding: 24px;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #F5FAFF;
}

.modal-row span:first-child {
    color: #6B778C;
}

.modal-row strong {
    color: #0B1B3A;
}

.modal-row-total {
    border-bottom: none;
    padding-top: 12px;
    font-size: 18px;
}

.modal-row-total strong {
    color: #00B7FF;
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
}

.modal-actions .btn {
    flex: 1;
}

/* --- REORDER QUICK --- */
.reorder-quick {
    background: #FFFFFF;
    border: 2px solid #00B7FF;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.reorder-quick h3 {
    font-size: 16px;
    color: #0B1B3A;
    margin-bottom: 4px;
}

.reorder-quick p {
    font-size: 14px;
    color: #6B778C;
    margin-bottom: 12px;
}

.separator-or {
    text-align: center;
    position: relative;
    margin: 24px 0;
}

.separator-or span {
    background: #F5FAFF;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: #6B778C;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.separator-or::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E2E8F0;
}

/* --- SUPPORT --- */
.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.support-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 24px;
}

.support-card h3 {
    font-size: 16px;
    color: #0B1B3A;
    margin-bottom: 16px;
}

.support-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    color: #0B1B3A;
}

.support-card textarea:focus {
    outline: none;
    border-color: #00B7FF;
}

.support-success {
    text-align: center;
    padding: 40px 20px;
}

.support-success-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #16A34A;
    color: #FFFFFF;
    font-size: 24px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.support-success p {
    font-size: 14px;
    color: #6B778C;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #F5FAFF;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #0B1B3A;
    text-decoration: none;
    transition: background 0.2s ease;
}

.doc-item:hover {
    background: #EFF6FF;
    text-decoration: none;
}

.doc-icon {
    font-size: 18px;
}

.contact-direct {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-direct p {
    font-size: 14px;
    color: #6B778C;
}

.contact-direct a {
    color: #00B7FF;
    font-weight: 600;
}

/* --- COMPTE --- */
.compte-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.compte-card h3 {
    font-size: 16px;
    color: #0B1B3A;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
}

.compte-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.compte-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.compte-field-label {
    font-size: 11px;
    font-weight: 700;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.compte-field-value {
    font-size: 14px;
    color: #0B1B3A;
    font-weight: 600;
}

.legal-docs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legal-doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #F5FAFF;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.legal-doc-date {
    font-size: 12px;
    color: #6B778C;
}

.legal-doc-dl {
    font-size: 13px;
    font-weight: 700;
    color: #00B7FF;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar { display: none; }

    .mobile-nav {
        display: flex;
    }

    .espace {
        flex-direction: column;
        overflow-x: hidden;
    }

    .espace-content {
        padding: 20px 16px 100px;
        width: 100%;
        overflow-x: hidden;
    }

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

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

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

    .modal {
        margin: 10px;
        max-height: 90vh;
    }

    .modal-header h2 {
        font-size: 15px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-actions {
        flex-direction: column;
        padding: 12px 16px 20px;
    }

    .order-card-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .order-card-actions {
        flex-wrap: wrap;
    }

    .dash-order {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dash-order-right {
        align-items: flex-start;
    }

    .section-header h1 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 20px;
    }

    .reorder-quick {
        padding: 16px;
    }

    .login-card {
        padding: 28px 20px;
    }

    .legal-doc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 380px) {
    .espace-content {
        padding: 16px 12px 100px;
    }

    .order-action-btn {
        font-size: 11px;
        padding: 6px 8px;
    }

    .stat-card {
        padding: 14px;
    }
}
