/* Gestion Foncière - Styles personnalisés */
:root {
    --sidebar-width: 260px;
    --primary-green: #198754;
    --dark-green: #0d3b1a;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
}

#wrapper {
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    background: linear-gradient(180deg, #198754 0%, #0d5c2e 100%) !important;
}

#sidebar .nav-link {
    border-radius: 0.5rem;
    margin-bottom: 2px;
    padding: 0.6rem 1rem;
    transition: background 0.2s;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

#sidebar .nav-link.active {
    font-weight: 600;
}

#page-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

/* Mobile */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    #page-content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

/* Cards stats */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Tables */
.table-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom-width: 1px;
}

/* Map */
#map, .map-container {
    height: 400px;
    border-radius: 0.5rem;
    z-index: 1;
}
#map-full {
    height: 500px;
    border-radius: 0.5rem;
}

/* Forms */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Login page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3b1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 1rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}
.empty-state i {
    font-size: 3rem;
    opacity: 0.4;
}

/* Carte grande (création / édition terrain) */
.map-large {
    height: 55vh;
    min-height: 420px;
    max-height: 650px;
    width: 100%;
    z-index: 1;
}
@media (max-width: 768px) {
    .map-large {
        height: 45vh;
        min-height: 320px;
    }
}

/* ========== Impression ========== */
@media print {
    #sidebar,
    #sidebarToggle,
    .sidebar-overlay,
    .navbar,
    .btn,
    .breadcrumb,
    .alert,
    .no-print {
        display: none !important;
    }
    #page-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    body {
        background: #fff !important;
        font-size: 12pt;
    }
    .card, .table-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
    .stat-card {
        border: 1px solid #ddd !important;
    }
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
    .badge {
        border: 1px solid #999;
        color: #000 !important;
        background: #eee !important;
    }
    .map-container, .map-large, #map-view, #map-dashboard, #map-full {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    .print-header {
        display: block !important;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid #198754;
        padding-bottom: 0.75rem;
    }
    main {
        padding: 0 !important;
    }
}
.print-only {
    display: none;
}
.print-header {
    display: none;
}
