:root {
    --apis-blue:  #007bff; 
    --apis-gray-light: #eaeaea; 
    --apis-gray-border: #ddd;
    --apis-bg-light: #fafafa;
}

/* graphique */

a {
    text-decoration: none;
}

.ruche-link {
    color: #555;         /* même ton que le texte du dashboard */
    text-decoration: none;  /* supprime le soulignement */
    font-weight: 600;
}

.ruche-link:hover {
    color: #d97706;
    font-weight: bold;
}

.filtre-link {
    text-decoration: none;
    color: #444;
    font-weight: 600;
}


.filtre-link:hover {
    color: #d97706;
}


.chart-container {
    width: 100%;
    min-height: 350px;
}

/*
canvas {
    width: 100% !important;
    height: 350px !important;
}
*/


.chart-container canvas {
    width: 100% !important;
    height: 350px !important;
}


/* Layout global */
.sidebar .menu-section {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--apis-gray-light);
    border: 1px solid var(--apis-gray-border);
}

.menu-title {
    padding: 10px 12px;
    background: #e9e9e9;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle-section { display: none; }

.menu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.menu-toggle-section:checked + .menu-title + .menu-items {
    max-height: 500px;
}

.menu-item {
    display: block;
    padding: 8px 14px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
}

.menu-item:hover { background: #f0f0f0; }

.apis-context-item {
    font-size: 1.4rem;
    font-weight: bold;
    color: #004aad;
}
.apis-context {
    display: flex;
    gap: 15px;
}

.apis-context-rucher {
    font-size: 1.4rem;
    font-weight: bold;
    color: #fff;
}

.apis-context-ruche {
    font-size: 1.4rem;
    opacity: 0.9;  
    color:  #fff; 
}

/* Header */
.apis-header {
    background-color: var(--apis-blue);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apis-header-top {
    background-color: var(--apis-blue);
    color: white;
    padding: 6px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
	
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 42px;
    z-index: 3000;
    font-size: 15px; 
}

.apis-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.apis-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Photo du rucher dans la barre bleue */
.apis-rucher-photo {
    height: 32px;
    width: 32px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid white;
}


.apis-auth-button {
    color: white !important;
    text-decoration: none;
    font-weight: 600;
}


/* Navigation */
.apis-main-nav {
    background: #007bff;
    padding: 10px;
    display: flex;
    gap: 20px;
}

.apis-nav-item {
    color: white;
    font-weight: 500;
}

.apis-nav-item.active {
    text-decoration: underline;
}

.apis-sub-nav {
...
}


.apis-sub-context {
...
}

.apis-sub-item {
...
}

.apis-sub-item:hover {
    background: #ddd;
    border-radius: 4px;
}


/* Layout */
.apis-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.apis-main {
    flex: 1;
    padding: 2rem;
}

.apis-footer {
    text-align: center;
    padding: 1rem;
    background: var(--apis-bg-light);
    border-top: 1px solid var(--apis-gray-border);
}

.menu-item.active {
    background: var(--apis-honey);
    color: #000;
    font-weight: 600;
    border-left: 4px solid var(--apis-honey-dark);
}

.dark .menu-item.active {
    background: var(--apis-hover);
    color: var(--apis-accent);
    border-left: 4px solid var(--apis-accent);
}

/* Bandeau horizontal   barre grise claire */
.apis-context-bar {
    background: var(--apis-context-bg, #f0f0f0);
    padding: 8px 16px;
    border-bottom: 1px solid #ccc;
    font-size: 14px;
    display: flex;
    gap: 20px;
    font-weight: 500;
}

.apis-topbar {
    display: flex;
    gap: 20px;
    background: #003366;
    padding: 12px 20px;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: 2000;
}

.apis-topbar a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

/* sidebar verticale */

.apis-sidebar {
    position: fixed;
    top: 50px; /* 140px sous la barre horizontale --- hauteur du header + barre bleue + barre grise */
    left: 0;
    width: 140px;  /* 240px  */
    height: calc(100vh - 50px);
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;  ;       /* IMPORTANT pour ne pas recouvrir le header */

}

.apis-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.apis-sidebar li {
    margin-bottom: 12px;
}

.apis-sidebar a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}


/* pour éviter qu'il passe sous les menus */

.apis-content {
    margin-left: 160px; /*   260 pxe space pour le menu */
    margin-top: 20px;   /*   0px  70px ← C’est ça qui descend les vues */
    padding: 20px;
}

/* --- Dashboard du rucher --- */

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #3e2723; /* brun doux */
    font-weight: 600;
}

.stats-grid {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.alertes-card {
    background: #fff8e1;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;

    width: 100%;
    display: block;

    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    border: 1px solid #f0d98c;
}

.card {
    background: #fff8e1; /* miel clair */
    padding: 20px;
    border-radius: 12px;
    min-width: 220px;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    border: 1px solid #f0d98c; /* bord miel */
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.card h3 {
    font-size: 1.4rem;
    margin: 0;
    color: #b8860b; /* miel foncé */
}

.card p {
    margin-top: 8px;
    font-weight: bold;
    color: #6d4c41; /* brun bois */

}


.photo-rucher {
    max-width: 100px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* Liste des ruches */
.ruche-list {
    list-style: none;
    padding-left: 0;
}

.ruche-list li {
    margin: 10px 0;
}

.ruche-list a {
    text-decoration: none;
    color: #3e2723;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fdf6e3;
    display: inline-block;
    transition: 0.2s;
}

.ruche-list a:hover {
    background: #fff3cd;
    color: #b8860b;
}

/* Liens du bas */
.dashboard-links a {
    color: #6d4c41;
    font-weight: bold;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
}

.dashboard-links a:hover {
    background: #fff8e1;
    color: #b8860b;
}



/* ----------------------------- */
/* RESPONSIVE — TABLETTES & MOBILES */
/* ----------------------------- */

@media (max-width: 900px) {

    /* Topbar compacte */
    .apis-topbar {
        gap: 10px;
        padding: 10px;
        height: 45px;
        font-size: 14px;
    }

    .apis-topbar a {
        font-size: 13px;
    }

    /* Sidebar devient un menu déroulant */
    .apis-sidebar {
        position: fixed;
        top: 45px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    /* Quand active */
    .apis-sidebar.open {
        max-height: 400px; /* menu déroulant */
        padding: 15px;
    }

    /* Contenu prend toute la largeur */
    .apis-content {
        margin-left: 0;
        margin-top: 60px;
    }

    /* Bouton menu mobile */
    .apis-menu-toggle {
        display: inline-block;
        background: #0055aa;
        color: white;
        padding: 6px 12px;
        border-radius: 4px;
        margin-left: auto;
        cursor: pointer;
        font-size: 14px;
    }
}


/* Optimisation smartphone */
@media (max-width: 768px) {

    table.table {
        font-size: 18px !important;
    }

    table.table th,
    table.table td {
        font-size: 18px !important;
        padding: 12px 8px !important;
    }

}

/*.table-apis {
    background-color: red !important;
}*/