/* DEWA-FROID - Styles principaux */

:root {
    --sidebar-width: 260px;
    --primary-color: #1e40af;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --body-bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    margin: 0;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #e2e8f0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.brand i { font-size: 1.5rem; }

.sidebar-nav { padding: 1rem 0; }

.sidebar-nav .nav-link {
    color: #94a3b8;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link i { width: 20px; text-align: center; }

.sidebar-nav .nav-section {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.35rem;
    list-style: none;
}

.client-search-results {
    top: 100%;
    left: 0;
    margin-top: 2px;
    border-radius: 0.375rem;
}

.client-search-results .list-group-item {
    cursor: pointer;
    border-left: 0;
    border-right: 0;
}

.client-search-results .list-group-item:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.client-search-results .list-group-item:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-navbar {
    background: #fff;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-area { flex: 1; }

/* Stat cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    height: 100%;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.mini-stat {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mini-stat.highlight {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
}

.mini-stat.highlight .mini-label { color: rgba(255,255,255,0.8); }

.mini-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.mini-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.card {
    border: none;
    border-radius: 12px;
}

.card-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
}

/* Auth */
.auth-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container { width: 100%; max-width: 420px; padding: 1rem; }

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: #fff;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* Form validation */
.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback { display: none; }
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback { display: block; }

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

/* Chambre cards */
.chambre-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.chambre-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.chambre-meta span {
    display: inline-block;
}

.nav-tabs .nav-link {
    color: #64748b;
    border: none;
    padding: 0.75rem 1.25rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    background: transparent;
}

table.dataTable thead th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}

/* Billing preview */
.billing-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.billing-item span {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

.billing-item strong {
    font-size: 1rem;
}

.billing-total {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billing-total strong {
    font-size: 1.5rem;
}

.list-group-item-action:hover {
    background: #f1f5f9;
}

/* PWA — bandeau d'installation */
.pwa-install-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2000;
    animation: pwaSlideUp 0.35s ease;
}

.pwa-install-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}

.pwa-install-icon {
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 0.15rem;
}

.pwa-install-text span {
    display: block;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.35;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.pwa-install-close {
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none !important;
}

.pwa-ios-hint {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2000;
    animation: pwaSlideUp 0.35s ease;
}

.pwa-ios-inner {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}

.pwa-ios-inner p {
    margin: 0.5rem 0 0.85rem;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.45;
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .pwa-install-inner {
        flex-wrap: wrap;
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
