/* assets/css/style.css */
/* Système de design premium pour DIQUARKS IMMO */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2b6cb0;
    --primary-hover: #1a5696;
    --secondary-color: #4a5568;
    --success-color: #2f855a;
    --danger-color: #c53030;
    --warning-color: #dd6b20;
    --info-color: #3182ce;
    --dark-bg: #1a202c;
    --light-bg: #f7fafc;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --border-color: #e2e8f0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-bg);
    color: #2d3748;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Structure Sidebar Responsive */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--dark-bg);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
    z-index: 1000;
}

#sidebar.active {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 16px 18px;
    background: #111827;
    border-bottom: 1px solid #2d3748;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.sidebar-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand-text span {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0;
    color: #fff;
}

.sidebar-brand-text small {
    color: #a0aec0;
    font-size: 0.78rem;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    color: #a0aec0;
    padding: 10px;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: block;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
    color: #fff;
    background: #2d3748;
    border-left-color: var(--primary-color);
}

#sidebar ul li.active > a {
    color: #fff;
    background: #2d3748;
    border-left-color: var(--primary-color);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

/* Contenu Principal */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.navbar-custom {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.navbar-brand-logo {
    display: block;
    width: 230px;
    max-width: 34vw;
    height: 48px;
    object-fit: contain;
}

.main-content {
    padding: 30px;
    flex: 1;
}

/* Cartes Personnalisées */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}

.card-header-custom {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    font-weight: 600;
}

/* Page de connexion Glassmorphism */
.login-bg {
    background: linear-gradient(135deg, #1a202c 0%, #2b6cb0 100%);
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.login-brand-logo {
    width: 300px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Couleurs des statuts pour appartements */
.status-libre {
    background-color: #ffffff !important;
    color: #2d3748 !important;
    border: 2px solid #cbd5e0 !important;
}

.status-reserve {
    background-color: #e53e3e !important;
    color: #ffffff !important;
    border: 2px solid #e53e3e !important;
}

.status-vendu {
    background-color: #38a169 !important;
    color: #ffffff !important;
    border: 2px solid #38a169 !important;
}

.status-annule {
    background-color: #a0aec0 !important;
    color: #ffffff !important;
    border: 2px solid #a0aec0 !important;
}

.status-conciergerie {
    background: repeating-linear-gradient(45deg, #f6e05e, #f6e05e 10px, #d69e2e 10px, #d69e2e 20px) !important;
    color: #1a202c !important;
    border: 2px solid #d69e2e !important;
}

.status-bloque {
    background-color: #1a202c !important;
    color: #ffffff !important;
    border: 2px solid #1a202c !important;
}

/* Badges standards */
.badge-status {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 4px;
    display: inline-block;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Grilles Visuelles des schémas d'immeubles */
.schema-grid {
    display: grid;
    grid-gap: 15px;
    margin-top: 20px;
}

.floor-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.floor-label {
    min-width: 100px;
    font-weight: 600;
}

.floor-units {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.apartment-box {
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.apartment-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.apartment-box .box-sub {
    font-size: 0.65rem;
    font-weight: normal;
    margin-top: 2px;
}

/* Grille des lots */
.lots-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.lot-box {
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.lot-box:hover {
    transform: scale(1.05);
}

.lot-box .lot-surface {
    font-size: 0.75rem;
    font-weight: normal;
    margin-top: 4px;
}

/* Plan de lotissement coordonnées absolues */
.plan-relative-container {
    position: relative;
    width: 100%;
    border: 1px solid var(--border-color);
    background-color: #edf2f7;
    overflow: auto;
    border-radius: 8px;
}

.plan-background-img {
    display: block;
    max-width: 100%;
    height: auto;
}

.absolute-lot-box {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 0.8rem;
    transition: transform 0.2s;
    opacity: 0.85;
}

.absolute-lot-box:hover {
    transform: scale(1.05);
    opacity: 1;
    z-index: 10;
}

/* Styles d'impression A4 */
@media print {
    #sidebar, .navbar-custom, .btn, .no-print, header, footer, .breadcrumb, .alert {
        display: none !important;
    }
    
    #content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    body {
        background-color: #fff !important;
        color: #000 !important;
        font-size: 12pt !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .print-container {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
        padding: 10mm;
        box-sizing: border-box;
    }
    
    table {
        page-break-inside: avoid;
    }
    
    /* Forcer le rendu des couleurs pour l'impression */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Formulaires structurés par sections */
.form-section-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 20px;
    margin-top: 10px;
    font-weight: 600;
}

/* Modèle d'affichage de quittance éditable */
.quittance-editor-container {
    border: 2px dashed var(--primary-color);
    background: #fff;
    min-height: 500px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.quittance-editor-container[contenteditable="true"]:focus {
    outline: 2px solid var(--primary-hover);
}

/* Responsive sidebar */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
    }
    #sidebar.active {
        margin-left: 0;
    }
    .main-content {
        padding: 15px;
    }
}
