/* =========================================
   VARIABLES & CONFIGURATION
========================================= */
:root {
    --primary-color: #a3ce10;
    --primary-dark: #8bb10d;
    --bg-color: #f4f7f6;
    --text-main: #333;
    --text-light: #555;
    --header-bg: #4a4a4a;
    --border-color: #ddd;
    --white: #ffffff;
    --font-stack: 'Segoe UI', Arial, sans-serif;
}

/* =========================================
   BASE & LAYOUT
========================================= */
body { 
    font-family: var(--font-stack); 
    background-color: var(--bg-color); 
    margin: 0; 
}

/* Layout pour les pages avec barre latérale */
body.layout-dashboard { 
    display: flex; 
    height: 100vh; 
}

/* Layout pour les pages simples */
body.layout-simple { 
    padding: 20px; 
    color: var(--text-main); 
}

/* Layout pour login */
body.layout-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

/* =========================================
   BARRE LATÉRALE GAUCHE
========================================= */
.sidebar { width: 250px; background: var(--white); padding: 20px; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; }
.logo-container { width: 100%; border: 1px solid #ccc; border-radius: 10px; padding: 20px; text-align: center; margin-bottom: 20px; box-sizing: border-box; }
.logo-container img { max-width: 100%; height: auto; }

.essai-box { text-align: center; margin-bottom: 20px; font-size: 14px; color: var(--text-main); }
.badge-essai { background-color: var(--primary-color); color: var(--white); padding: 5px 10px; border-radius: 5px; font-weight: bold; display: inline-block; margin-top: 5px; }

.btn-abonnement { border: 1px solid #555; background: var(--white); padding: 8px 15px; border-radius: 4px; cursor: pointer; font-size: 11px; margin-bottom: 20px; color: #555; text-transform: uppercase; }
.info-formulaire { background-color: #dcedc8; padding: 15px; border-radius: 5px; font-size: 13px; text-align: center; color: #33691e; font-weight: 500; }

/* =========================================
   CONTENU PRINCIPAL & NAVBAR
========================================= */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.navbar { background-color: var(--header-bg); color: var(--white); padding: 0 20px; display: flex; align-items: center; height: 60px; }
.nav-item { color: var(--white); text-decoration: none; padding: 0 15px; display: flex; align-items: center; height: 100%; font-size: 14px; position: relative; }
.nav-item i { margin-right: 8px; font-size: 18px; }
.nav-item:hover, .nav-item.active { color: var(--primary-color); }
.nav-item.active::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background-color: var(--primary-color); }

.search-container { background: var(--white); padding: 10px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; }
.search-bar { flex: 1; position: relative; display: flex; align-items: center; }
.search-bar-icon { background: var(--header-bg); color: var(--white); padding: 8px 15px; border-radius: 20px 0 0 20px; height: 35px; display: flex; align-items: center; box-sizing: border-box; }
.search-bar input { flex: 1; padding: 8px 15px; border-radius: 0 20px 20px 0; border: 1px solid #ccc; outline: none; height: 35px; box-sizing: border-box; }
.power-btn { color: var(--header-bg); font-size: 22px; text-decoration: none; margin-left: 20px; }

.page-header { padding: 20px 30px; }
.page-header h2 { font-weight: 300; color: var(--text-light); text-transform: uppercase; margin: 0 0 5px 0; }
.welcome-text { color: var(--primary-color); font-weight: bold; margin: 0; font-size: 16px; }

/* =========================================
   DASHBOARD CARDS
========================================= */
.dashboard-container { display: flex; gap: 20px; padding: 0 30px 30px 30px; flex-wrap: wrap; }
.card { background: var(--white); padding: 30px 20px; border-radius: 8px; border: 1px solid #eee; text-align: center; flex: 1; min-width: 22%; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.card-dark { background-color: var(--header-bg); color: var(--white); border: none; }
.card i { font-size: 30px; margin-bottom: 15px; }
.card h3 { font-size: 12px; text-transform: uppercase; font-weight: normal; margin: 0 0 15px 0; letter-spacing: 0.5px; }
.card-dark h3 { color: var(--white); }
.card .number { font-size: 48px; font-weight: 300; line-height: 1; }

.text-green { color: var(--primary-color); }
.text-red { color: #e74c3c; }
.text-gray { color: #7f8c8d; }
.text-orange { color: #e67e22; }
.text-yellow { color: #f1c40f; }

/* =========================================
   TABLEAUX & GRILLES
========================================= */
.header-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.header-title h2 { margin: 0; font-weight: normal; color: var(--text-light); text-transform: uppercase; }
.badge { background: #8cc63f; color: var(--white); padding: 5px 12px; border-radius: 20px; font-weight: bold; font-size: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--white); font-size: 13px; }
th { background-color: var(--white); font-weight: normal; color: var(--text-light); border-bottom: 2px solid var(--border-color); }
.row-gris { background-color: #b5bcc2; }
.row-rouge { background-color: #e2e2e2; }
.img-container { width: 60px; height: 80px; background: var(--white); border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-container img { max-width: 100%; max-height: 100%; }
.btn { padding: 6px 12px; border: 1px solid #555; background: var(--white); cursor: pointer; border-radius: 4px; font-size: 12px; color: #555; }
.btn:hover { background: #eee; }
.statut-hs { color: #e74c3c; font-weight: bold; }

.table-container { background: var(--white); border-radius: 8px; border: 1px solid #eee; margin: 0 30px 30px 30px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); overflow: hidden; position: relative; z-index: 1; }
.table-header-actions { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; background-color: #fafafa; }
.table-header-actions h3 { margin: 0; font-size: 14px; color: var(--text-light); text-transform: uppercase; }
.btn-action { background-color: var(--primary-color); color: var(--white); text-decoration: none; padding: 8px 15px; border-radius: 4px; font-size: 12px; font-weight: bold; display: inline-block; }
.btn-action:hover { background-color: var(--primary-dark); }

/* =========================================
   FICHE EQUIPEMENT
========================================= */
h2.fiche-title { font-weight: normal; color: var(--text-light); text-transform: uppercase; border-bottom: 2px solid #ccc; padding-bottom: 10px; margin-top: 0;}
.container-fiche { display: flex; gap: 30px; margin-top: 20px; align-items: flex-start; }
.col-left { width: 30%; display: flex; flex-direction: column; align-items: center; }
.image-box { background: var(--white); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; width: 100%; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.image-box img { max-width: 100%; height: auto; }
.statut-box { margin-top: 20px; text-align: center; }
.statut-icon { font-size: 40px; color: var(--text-light); }
.statut-text { font-size: 24px; font-weight: normal; color: var(--text-main); text-transform: uppercase; margin-top: 10px; }
.col-right { width: 70%; display: flex; gap: 40px; }
.details-col { flex: 1; }
.info-group { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.info-group.no-border { border: none; margin-top: 30px; }
.info-label { font-size: 11px; color: #777; text-transform: uppercase; margin-bottom: 5px; display: block; }
.info-value { font-size: 14px; font-weight: bold; color: var(--text-main); }
.comments-col { flex: 1; }
.control-card { border: 1px solid #555; border-radius: 4px; padding: 15px; background: var(--white); margin-bottom: 15px; }
.control-card p { margin: 0 0 10px 0; font-size: 13px; line-height: 1.4; }
.btn-download { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid #555; padding: 8px 12px; cursor: pointer; font-size: 12px; color: #555; text-transform: uppercase; text-decoration: none; }
.btn-download:hover { background: #f0f0f0; }
.notice-list { list-style: none; padding: 0; margin: 0; }
.notice-list li { margin-bottom: 8px; font-size: 13px; }
.notice-list a { color: var(--text-main); text-decoration: none; }
.notice-list a:hover { text-decoration: underline; }

/* =========================================
   FORMULAIRES
========================================= */
.form-container { background: var(--white); padding: 30px; border-radius: 8px; border: 1px solid #eee; margin: 0 30px 30px 30px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; color: var(--text-light); text-transform: uppercase; margin-bottom: 8px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; outline: none; box-sizing: border-box; background-color: var(--white); }
.form-group input:focus, .form-group select:focus { border-color: var(--primary-color); }
.btn-submit { background-color: var(--primary-color); color: var(--white); border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; text-transform: uppercase; font-weight: bold; }
.btn-submit:hover { background-color: var(--primary-dark); }

.alert-success { background-color: #d4edda; color: #155724; padding: 15px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #c3e6cb; }
.alert-error { background-color: #f8d7da; color: #721c24; padding: 15px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #f5c6cb; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group-full { grid-column: span 2; }
.form-section-title { grid-column: span 2; font-size: 14px; color: var(--primary-color); text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 15px; margin-bottom: 10px; }

/* =========================================
   PAGE DE CONNEXION (Login)
========================================= */
.login-container { background: var(--white); padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); width: 100%; max-width: 350px; text-align: center; border-top: 4px solid var(--primary-color); }
.login-container img { max-width: 180px; margin-bottom: 30px; }
.login-container .form-group { text-align: left; }
.btn-login { width: 100%; background-color: var(--primary-color); color: var(--white); border: none; padding: 12px; border-radius: 4px; font-size: 14px; font-weight: bold; text-transform: uppercase; cursor: pointer; margin-top: 10px; }
.btn-login:hover { background-color: var(--primary-dark); }
.error-msg { color: #e74c3c; font-size: 13px; margin-bottom: 15px; background: #fdf0ef; padding: 10px; border-radius: 4px; border: 1px solid #f5c6cb; }

/* =========================================
   PENSE-BÊTE (Sidebar)
========================================= */
.pense-bete-container { width: 100%; background-color: #fffac2; border: 1px solid #e8e3a1; border-radius: 8px; padding: 15px; margin-top: 20px; box-sizing: border-box; box-shadow: 2px 2px 5px rgba(0,0,0,0.05); }
.pense-bete-container h4 { margin: 0 0 10px 0; font-size: 13px; color: #7a7536; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.pense-bete-container textarea { width: 100%; height: 180px; border: none; background: transparent; resize: none; font-family: var(--font-stack); font-size: 13px; color: var(--text-main); outline: none; line-height: 1.5; }
.pense-bete-container textarea:focus { border-bottom: 1px dashed #d1cc8c; }

/* =========================================
   MEDIA QUERIES (Impression)
========================================= */
@media print {
    body * { visibility: hidden; }
    #fiche-imprimable, #fiche-imprimable * { visibility: visible; }
    #fiche-imprimable { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; font-family: Arial, sans-serif; }
    .print-only-logo { display: block !important; width: 150px; }
    
    .navbar, .page-header, .btn, .no-print { display: none !important; }
    body { background: var(--white); color: black; padding: 0; }
    .page-break { page-break-after: always; }
    
    table td a.btn, table td button.btn { position: relative; z-index: 100; pointer-events: auto; display: inline-block; cursor: pointer; }
}