/**
 * style.css - Fichier CSS global unique
 * Version ultra-compatible - Toutes propriétés décomposées
 */

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    padding-top: 0;
    padding-right: 1rem;
    padding-bottom: 0;
    padding-left: 1rem;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    padding-top: 2rem;
    padding-right: 1rem;
    padding-bottom: 2rem;
    padding-left: 1rem;
}

.main-content {
    flex: 1;
    padding-top: 2rem;
    padding-right: 0;
    padding-bottom: 2rem;
    padding-left: 0;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: #111827;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    padding-top: 0.75rem;
    padding-right: 0;
    padding-bottom: 0.75rem;
    padding-left: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-content > * {
    margin-top: 0.5rem;
    margin-right: 0;
    margin-bottom: 0.5rem;
    margin-left: 0;
}

.logo a {
    text-decoration: none;
    color: white;
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
}

.main-nav ul > li {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0.5rem;
}

.main-nav a {
    display: block;
    padding-top: 0.5rem;
    padding-right: 1rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    color: #e5e7eb;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.main-nav a.active,
.main-nav li.active a {
    background: #2563eb;
    color: white;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #1a237e;
    color: rgba(255,255,255,0.8);
    padding-top: 1.5rem;
    padding-right: 0;
    padding-bottom: 1.5rem;
    padding-left: 0;
    margin-top: auto;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
}

.footer-content {
    text-align: center;
}

.disclaimer {
    font-size: 0.85rem;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0.5rem;
    margin-left: 0;
    color: rgba(255,255,255,0.7);
}

.copyright {
    font-size: 0.8rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding-top: 0.75rem;
    padding-right: 1.5rem;
    padding-bottom: 0.75rem;
    padding-left: 1.5rem;
    border-width: 0;
    border-style: none;
    border-color: transparent;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-secondary {
    background: #546e7a;
    color: white;
}

.btn-secondary:hover {
    background: #455a64;
}

.btn-success {
    background: #388e3c;
    color: white;
}

.btn-success:hover {
    background: #2e7d32;
}

.btn-danger {
    background: #d32f2f;
    color: white;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-warning {
    background: #f57c00;
    color: white;
}

.btn-warning:hover {
    background: #ef6c00;
}

/* --- LOT COHABITATION : barre de bascule MODE 1 / MODE 2 (limite a .es-vue-bar) --- */
.es-vue-bar .btn.es-vue-active { box-shadow: 0 0 0 2px rgba(0,0,0,0.35) inset; font-weight: 700; }
.es-vue-bar .btn.btn-outline-secondary { background:#fff; color:#555; border:1px solid #bbb; }

.btn-logout {
    background: #f97316;
    color: white;
    padding-top: 0.5rem;
    padding-right: 1rem;
    padding-bottom: 0.5rem;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: #ea580c;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding-top: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    margin-left: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 1rem;
    padding-left: 0;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e0e0e0;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a237e;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.status-badge {
    display: inline-block;
    padding-top: 0.25rem;
    padding-right: 0.75rem;
    padding-bottom: 0.25rem;
    padding-left: 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-stable,
.status-exploitable,
.status-envisageable {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-fragile {
    background: #fff3e0;
    color: #ef6c00;
}

.status-mauvais,
.status-non_envisageable {
    background: #ffebee;
    color: #c62828;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1.25rem;
    margin-left: 0;
}

.form-label {
    display: block;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0.5rem;
    margin-left: 0;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding-top: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-width: 1px;
    border-style: solid;
    border-color: #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25,118,210,0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.table th,
.table td {
    padding-top: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 0.75rem;
    padding-left: 0.75rem;
    text-align: left;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e0e0e0;
}

.table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #1a237e;
}

.table tbody tr:hover {
    background: #f5f7fa;
}

/* ============================================
   SCORE DISPLAY
   ============================================ */
.score-display {
    display: flex;
    align-items: center;
}

.score-display > * {
    margin-top: 0;
    margin-right: 1rem;
    margin-bottom: 0;
    margin-left: 0;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a237e;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
}

.score-breakdown {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1rem;
    margin-right: -0.5rem;
    margin-bottom: 0;
    margin-left: -0.5rem;
}

.score-breakdown > * {
    flex: 1 1 150px;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

.score-item {
    background: #f5f7fa;
    padding-top: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    border-radius: 6px;
    text-align: center;
}

.score-item-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1976d2;
}

.score-item-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding-top: 1rem;
    padding-right: 1.25rem;
    padding-bottom: 1rem;
    padding-left: 1.25rem;
    border-radius: 6px;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #1976d2;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #388e3c;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #f57c00;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #d32f2f;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    max-width: 400px;
    margin-top: 4rem;
    margin-right: auto;
    margin-bottom: 4rem;
    margin-left: auto;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding-top: 2rem;
    padding-right: 2rem;
    padding-bottom: 2rem;
    padding-left: 2rem;
}

.login-header {
    text-align: center;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 2rem;
    margin-left: 0;
}

.login-header h2 {
    color: #1a237e;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0.5rem;
    margin-left: 0;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    margin-top: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: -0.75rem;
    margin-left: -0.75rem;
}

.dashboard-grid > * {
    flex: 1 1 300px;
    margin-top: 0.75rem;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    margin-left: 0.75rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding-top: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.stat-card-title {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a237e;
}

.stat-card-subvalue {
    margin-top: 0.75rem;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    font-size: 0.9rem;
    color: #666;
}

.stat-card-long {
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #388e3c;
}

.stat-card-short {
    border-left-width: 4px;
    border-left-style: solid;
    border-left-color: #d32f2f;
}

/* ============================================
   DEVOIR PAGE
   ============================================ */
.devoir-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 2rem;
    margin-left: 0;
}

.devoir-header > * {
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

.devoir-info {
    display: flex;
    flex-wrap: wrap;
}

.devoir-info > * {
    margin-top: 0;
    margin-right: 2rem;
    margin-bottom: 0.5rem;
    margin-left: 0;
}

.devoir-info-item {
    display: flex;
    flex-direction: column;
}

.devoir-info-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
}

.devoir-info-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a237e;
}

.devoir-price {
    margin-top: 0.75rem;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-top: 0.75rem;
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #e0e0e0;
}

.context-summary {
    background: #f5f7fa;
    border-radius: 8px;
    padding-top: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    margin-left: 0;
}

.context-summary h3 {
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
    color: #1a237e;
}

.context-item {
    display: flex;
    justify-content: space-between;
    padding-top: 0.5rem;
    padding-right: 0;
    padding-bottom: 0.5rem;
    padding-left: 0;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e0e0e0;
}

.context-item:last-child {
    border-bottom-width: 0;
    border-bottom-style: none;
}

/* ============================================
   PLAN FORM
   ============================================ */
.plan-form {
    display: flex;
    flex-wrap: wrap;
    margin-top: -0.5rem;
    margin-right: -0.5rem;
    margin-bottom: -0.5rem;
    margin-left: -0.5rem;
}

.plan-form > * {
    flex: 1 1 200px;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}

.plan-form .form-group.full-width {
    flex-basis: 100%;
}

/* ============================================
   VERDICT PAGE
   ============================================ */
.verdict-card {
    text-align: center;
    padding-top: 3rem;
    padding-right: 3rem;
    padding-bottom: 3rem;
    padding-left: 3rem;
}

.verdict-icon {
    font-size: 4rem;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.verdict-envisageable .verdict-icon {
    color: #388e3c;
}

.verdict-fragile .verdict-icon {
    color: #f57c00;
}

.verdict-non_envisageable .verdict-icon {
    color: #d32f2f;
}

.verdict-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.verdict-explanation {
    max-width: 600px;
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    text-align: left;
}

.verdict-issues {
    list-style: none;
    margin-top: 1rem;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
}

.verdict-issues li {
    padding-top: 0.5rem;
    padding-right: 0;
    padding-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.verdict-issues li::before {
    content: "!";
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    background: #f57c00;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ============================================
   EXPORT PAGE
   ============================================ */
.export-options {
    display: flex;
    flex-wrap: wrap;
    margin-top: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: -0.75rem;
    margin-left: -0.75rem;
}

.export-options > * {
    flex: 1 1 250px;
    margin-top: 0.75rem;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
    margin-left: 0.75rem;
}

.export-option {
    background: #f5f7fa;
    border-radius: 8px;
    padding-top: 2rem;
    padding-right: 2rem;
    padding-bottom: 2rem;
    padding-left: 2rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.export-option:hover {
    transform: translateY(-2px);
}

.export-option h3 {
    color: #1a237e;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1rem;
    margin-left: 0;
}

.export-option p {
    color: #666;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    margin-left: 0;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav ul > li {
        margin: 0.25rem;
    }
    
    .devoir-header {
        flex-direction: column;
        text-align: center;
    }
    
    .devoir-info {
        justify-content: center;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { 
    text-align: center; 
}

.text-right { 
    text-align: right; 
}

.text-muted {
    color: #666;
}

.mono {
    font-family: 'Courier New', Courier, monospace;
}

.mt-1 { 
    margin-top: 0.5rem; 
}

.mt-2 { 
    margin-top: 1rem; 
}

.mt-3 { 
    margin-top: 1.5rem; 
}

.mb-1 { 
    margin-bottom: 0.5rem; 
}

.mb-2 { 
    margin-bottom: 1rem; 
}

.mb-3 { 
    margin-bottom: 1.5rem; 
}

.ml-2 {
    margin-left: 1rem;
}

.mr-2 {
    margin-right: 1rem;
}

.hidden { 
    display: none; 
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-sm th,
.table-sm td {
    padding-top: 0.5rem;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.5rem;
}