/* ── Variables ─────────────────────────────────────────── */
:root {
    --honey:       #F5A623;
    --honey-dark:  #C47C0A;
    --honey-light: #FDE68A;
    --honey-pale:  #FEF7E6;
    --wood:        #5C3A00;
    --wood-mid:    #92400E;
    --cream:       #FFFBF2;
    --sidebar-bg:  #2A1500;
    --sidebar-w:   220px;
    --border:      rgba(196, 124, 10, 0.18);
    --border-dark: rgba(245, 166, 35, 0.12);
    --text-main:   #2C1A00;
    --text-muted:  #9A7340;
    --text-soft:   #C4A882;
    --radius:      14px;
    --radius-sm:   9px;
    --tr:          0.18s cubic-bezier(.4,0,.2,1);
}
 
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
 
body {
    font-family: 'DM Sans', sans-serif;
    background: #EDE5D8;
    color: var(--text-main);
    overflow: hidden;
}
 
/* ── Dashboard shell ───────────────────────────────────── */
.dashboard {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
    overflow: hidden;
}
 
/* ════════════════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════════════════ */
.sidebar {
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 1.4rem 1rem 1rem;
    overflow-y: auto;
    border-right: 1px solid var(--border-dark);
}
 
/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-dark);
}
 
.logo-icon {
    width: 38px; height: 38px;
    background: rgba(245, 166, 35, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(245, 166, 35, 0.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
 
.logo-icon svg { width: 26px; height: 26px; }
 
.logo-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--honey-light);
    line-height: 1.1;
}
 
.logo-sub {
    font-size: 0.7rem;
    color: rgba(253, 230, 138, 0.45);
    margin-top: 1px;
}
 
/* Section label */
.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 500;
    color: rgba(245, 166, 35, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}
 
/* Type toggle */
.type-toggle {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
 
.type-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
 
.type-item span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: rgba(253, 230, 138, 0.45);
    cursor: pointer;
    transition: all var(--tr);
}
 
.type-item span svg {
    width: 14px; height: 14px;
    flex-shrink: 0;
}
 
.type-item input:checked + span {
    background: rgba(245, 166, 35, 0.13);
    color: var(--honey);
    font-weight: 500;
}
 
.type-item:hover span { color: rgba(253, 230, 138, 0.7); }
 
/* Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
 
.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: rgba(253, 230, 138, 0.5);
    cursor: pointer;
    text-align: left;
    transition: all var(--tr);
}
 
.nav-item:hover {
    background: rgba(245, 166, 35, 0.08);
    color: rgba(253, 230, 138, 0.8);
}
 
.nav-item.active {
    background: var(--honey);
    color: var(--wood);
    font-weight: 500;
}
 
.nav-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(245, 166, 35, 0.3);
}
 
.nav-item.active .nav-dot { background: var(--wood); opacity: 0.5; }
.nav-dot[data-status="Active"]    { background: #4ADE80; }
.nav-dot[data-status="Surveiller"]{ background: #FACC15; }
.nav-dot[data-status="Récente"]   { background: #60A5FA; }
.nav-item.active .nav-dot[data-status] { opacity: 1; }
 
/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
 
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: rgba(253, 230, 138, 0.45);
}
 
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ADE80;
    animation: pulse 2s infinite;
}
 
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
 
.footer-date {
    font-size: 0.68rem;
    color: rgba(245, 166, 35, 0.25);
    line-height: 1.4;
}
 
/* ════════════════════════════════════════════════════════
   CONTENT AREA
════════════════════════════════════════════════════════ */
.content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: #EDE5D8;
}
 
/* Topbar */
.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.25rem 1.75rem 0.9rem;
    background: #EDE5D8;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(196,124,10,0.12);
    gap: 1rem;
}
 
.topbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
 
h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}
 
.topbar-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--honey-pale);
    border: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
 
.topbar .actions-row {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
 
.topbar-coords {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    min-width: 200px;
    max-width: 200px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    justify-self: end;
}
 
.topbar-coords svg {
    width: 13px; height: 13px;
    color: var(--honey-dark);
    flex-shrink: 0;
}
 
/* Metric cards row */
.metrics-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 1.75rem 0;
}
 
.metric-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    animation: fadeUp 0.2s ease both;
}
 
.metric-card--hero {
    background: var(--honey);
    border-color: var(--honey-dark);
}
 
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
 
.mc-label {
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    margin-bottom: 0.4rem;
}
 
.metric-card--hero .mc-label { color: var(--wood); opacity: 0.65; }
 
.mc-value-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
 
.mc-input {
    border: none;
    background: transparent;
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--wood);
    width: 130px;
    outline: none;
    line-height: 1;
}
 
.mc-input::-webkit-inner-spin-button,
.mc-input::-webkit-outer-spin-button { -webkit-appearance: none; }
 
.mc-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--wood);
    opacity: 0.55;
}
 
.mc-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}
 
.mc-value.positive { color: #15803D; }
.mc-value.negative { color: #B91C1C; }
 
/* Actions row */
.actions-row {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1.75rem 0;
}
 
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--tr);
    border: none;
}
 
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
 
.btn-primary {
    background: var(--wood);
    color: var(--honey-light);
}
 
.btn-primary:hover  { background: #3A1F00; }
.btn-primary:active { transform: scale(0.97); }
 
.btn-ghost {
    background: white;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
 
.btn-ghost:hover  { background: var(--honey-pale); color: var(--text-main); }
.btn-ghost:active { transform: scale(0.97); }
 
/* Lower grid */
.lower-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.75rem 1.75rem 0;
    flex: 1;
}
 
/* Panels */
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeUp 0.22s ease both;
    min-height: 180px;
}
 
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid var(--border);
}
 
.panel-title {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}
 
.panel-count {
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--honey-pale);
    color: var(--text-muted);
    border-radius: 20px;
    padding: 1px 8px;
    border: 1px solid var(--border);
}
 
/* History */
.history-list {
    list-style: none;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
 
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    background: var(--honey-pale);
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.83rem;
    animation: fadeUp 0.15s ease both;
}
 
.hi-time  { color: var(--text-soft); font-size: 0.76rem; }
.hi-value { font-weight: 500; }
.hi-delta { font-size: 0.78rem; }
.hi-delta.pos { color: #15803D; }
.hi-delta.neg { color: #B91C1C; }
.hi-delta.neu { color: var(--text-muted); }
 
/* Map panel */
.map-panel { padding: 0; }
 
.map-panel .panel-header { padding: 0.85rem 1rem 0.65rem; }
 
#ruche-map {
    flex: 1;
    min-height: 180px;
    border-radius: 0 0 var(--radius) var(--radius);
}
 
.leaflet-popup-content-wrapper {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    border-radius: 10px !important;
    box-shadow: 0 4px 18px rgba(92,58,0,0.12) !important;
    color: var(--text-main);
}
 
/* ── Countdown bar ──────────────────────────────────────── */
.countdown-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 1.75rem;
    margin: 0.75rem 1.75rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
 
.cd-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
 
.cd-bar-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}
 
.cd-units {
    display: flex;
    gap: 4px;
    align-items: baseline;
}
 
.cd-unit {
    display: flex;
    align-items: baseline;
    gap: 2px;
    padding: 3px 8px;
    background: var(--honey-pale);
    border: 1px solid var(--border);
    border-radius: 6px;
}
 
.cd-unit--accent {
    background: var(--honey);
    border-color: var(--honey-dark);
}
 
.cd-unit span {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}
 
.cd-unit--accent span { color: var(--wood); }
 
.cd-unit em {
    font-style: normal;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
 
.cd-unit--accent em { color: var(--wood); opacity: 0.6; }
 
.cd-center { flex: 1; display: flex; flex-direction: column; gap: 5px; }
 
.cd-bar-bg {
    background: rgba(196,124,10,0.12);
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
}
 
.cd-bar-fill {
    background: var(--honey);
    height: 5px;
    border-radius: 4px;
    width: 0%;
    transition: width 1s linear;
}
 
.cd-bar-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-soft);
}
 
.cd-cycles {
    font-size: 0.68rem;
    color: var(--text-soft);
}
 
/* ── Toast ─────────────────────────────────────────────── */
.toast {
    position: fixed;

    bottom: 1.5rem;
    left: 50%;

    transform: translateX(-50%) translateY(70px);

    background: var(--wood);
    color: var(--honey-light);

    padding: 0.55rem 1.25rem;

    border-radius: 40px;

    font-size: 0.84rem;
    font-weight: 500;

    z-index: 1000;

    pointer-events: none;
    opacity: 0;

    white-space: nowrap;

    max-width: calc(100vw - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;

    transition:
        transform 0.28s cubic-bezier(.34,1.56,.64,1),
        opacity 0.28s;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Bouton ajout ruche ────────────────────────────────── */
.btn-add-ruche {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed rgba(245, 166, 35, 0.3);
    border-radius: var(--radius-sm);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem;
    font-weight: 500;
    color: rgba(245, 166, 35, 0.45);
    cursor: pointer;
    transition: all var(--tr);
}
 
.btn-add-ruche svg {
    width: 13px; height: 13px;
    flex-shrink: 0;
}
 
.btn-add-ruche:hover {
    background: rgba(245, 166, 35, 0.08);
    border-color: rgba(245, 166, 35, 0.6);
    color: var(--honey);
}
 
/* ── Modale ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
 
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
 
.modal {
    background: #FFFBF2;
    border: 1px solid rgba(196, 124, 10, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(92, 58, 0, 0.25);
    animation: slideUp 0.2s cubic-bezier(.34,1.56,.64,1);
}
 
@keyframes slideUp {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
 
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem 0.85rem;
    border-bottom: 1px solid rgba(196, 124, 10, 0.12);
}
 
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}
 
.modal-close {
    border: none;
    background: none;
    font-size: 1.3rem;
    color: var(--text-soft);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 5px;
    transition: all var(--tr);
}
.modal-close:hover { background: rgba(196, 124, 10, 0.1); color: var(--text-main); }
 
.modal-body {
    padding: 1rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
 
.modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
 
.modal-field label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-soft);
}
 
.modal-field input[type="text"],
.modal-field input[type="number"] {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid rgba(196, 124, 10, 0.2);
    border-radius: var(--radius-sm);
    background: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
}
 
.modal-field input:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}
 
.modal-field input::placeholder { color: var(--text-soft); }
 
/* Statut radios */
.modal-statut-group {
    display: flex;
    gap: 6px;
}
 
.modal-statut-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
 
.modal-statut-item span {
    display: block;
    padding: 5px 12px;
    border: 1.5px solid rgba(196, 124, 10, 0.18);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    background: white;
    transition: all var(--tr);
}
 
.modal-statut-item input:checked + span {
    font-weight: 500;
}
 
.modal-statut-item input[value="Active"]:checked + span {
    background: #dcfce7; border-color: #4ADE80; color: #15803D;
}
.modal-statut-item input[value="Surveiller"]:checked + span {
    background: #fef9c3; border-color: #FACC15; color: #854d0e;
}
.modal-statut-item input[value="Récente"]:checked + span {
    background: #dbeafe; border-color: #60A5FA; color: #1e40af;
}
 
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.3rem 1.1rem;
    border-top: 1px solid rgba(196, 124, 10, 0.12);
}
 
 
/* ── Modale ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
 
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
 
.modal {
    background: #FFFBF2;
    border: 1px solid rgba(196, 124, 10, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(92, 58, 0, 0.25);
    animation: modalSlideUp 0.2s cubic-bezier(.34,1.56,.64,1);
}
 
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
 
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.3rem 0.85rem;
    border-bottom: 1px solid rgba(196, 124, 10, 0.12);
}
 
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}
 
.modal-close {
    border: none;
    background: none;
    font-size: 1.3rem;
    color: var(--text-soft);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 5px;
    transition: all var(--tr);
}
.modal-close:hover { background: rgba(196, 124, 10, 0.1); color: var(--text-main); }
 
.modal-body {
    padding: 1rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
 
.modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
 
.modal-field label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-soft);
}
 
.modal-field input[type="text"],
.modal-field input[type="number"] {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid rgba(196, 124, 10, 0.2);
    border-radius: var(--radius-sm);
    background: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
}
 
.modal-field input[type="number"]::-webkit-inner-spin-button,
.modal-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
 
.modal-field input:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}
 
.modal-field input::placeholder { color: var(--text-soft); }
 
/* Statut radios */
.modal-statut-group {
    display: flex;
    gap: 6px;
}
 
.modal-statut-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
 
.modal-statut-item span {
    display: block;
    padding: 5px 12px;
    border: 1.5px solid rgba(196, 124, 10, 0.18);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    background: white;
    transition: all var(--tr);
    user-select: none;
}
 
.modal-statut-item input[value="Active"]:checked + span {
    background: #dcfce7; border-color: #4ADE80; color: #15803D; font-weight: 500;
}
.modal-statut-item input[value="Surveiller"]:checked + span {
    background: #fef9c3; border-color: #FACC15; color: #854d0e; font-weight: 500;
}
.modal-statut-item input[value="Récente"]:checked + span {
    background: #dbeafe; border-color: #60A5FA; color: #1e40af; font-weight: 500;
}
 
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1.3rem 1.1rem;
    border-top: 1px solid rgba(196, 124, 10, 0.12);
}
 
/* ── Responsive fallback ───────────────────────────────── */
@media (max-width: 700px) {

    body {
        overflow: hidden;
    }

    .dashboard {
        grid-template-columns: 1fr;
        height: 100vh;
    }

    .content {
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;

        width: var(--sidebar-w);
        height: 100vh;

        z-index: 300;

        transform: translateX(-100%);
        transition: transform var(--tr);

        flex-direction: column;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;

        background: rgba(20, 10, 0, 0.45);

        z-index: 250;

        opacity: 0;
        pointer-events: none;

        transition: opacity var(--tr);
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-btn {
        position: fixed;
        top: 0.9rem;
        left: 0.9rem;

        z-index: 260;

        width: 42px;
        height: 42px;

        border: 1px solid var(--border);
        border-radius: 10px;

        background: white;
        color: var(--wood);

        font-size: 1.4rem;
        cursor: pointer;

        box-shadow: 0 4px 16px rgba(92,58,0,.12);
    }

    .topbar {
        grid-template-columns: 1fr;
        padding-left: 4.2rem;
        align-items: flex-start;
    }

    .topbar .actions-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .topbar-coords {
        justify-self: start;
        min-width: auto;
        max-width: 100%;
    }

    .metrics-row {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .lower-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .countdown-bar {
        flex-direction: column;
        align-items: stretch;
        margin: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

.mobile-menu-btn,
.sidebar-overlay {
    display: none;
}

@media (max-width: 700px) {

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;

        width: var(--sidebar-w);
        height: 100dvh;

        overflow-y: auto;

        display: flex;
        flex-direction: column;

        padding-bottom: 1rem;

        -webkit-overflow-scrolling: touch;
    }

    .sidebar-footer {
        margin-top: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    #btn-logout {
        width: 100%;
    }
}
 
table {
  border-collapse: collapse;
  border: 2px solid rgb(140 140 140);
  font-family: sans-serif;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
 
caption {
  caption-side: bottom;
  padding: 10px;
  font-weight: bold;
}
 
thead,
tfoot {
  background-color: rgb(228 240 245);
}
 
th,
td {
  border: 1px solid rgb(160 160 160);
  padding: 8px 10px;
}
 
td:last-of-type {
  text-align: center;
}
 
tbody > tr:nth-of-type(even) {
  background-color: rgb(237 238 242);
}
 
tfoot th {
  text-align: right;
}
 
tfoot td {
  font-weight: bold;
}
 
/* ── Bouton danger (supprimer ruche) ────────────────────── */
.btn-danger {
    background: white;
    color: #B91C1C;
    border: 1px solid rgba(185, 28, 28, 0.25);
}
 
.btn-danger:hover {
    background: #FEF2F2;
    color: #991B1B;
    border-color: rgba(185, 28, 28, 0.5);
}
 
.btn-danger:active { transform: scale(0.97); }

/* ════════════════════════════════════════════════
   GESTION ADMIN
════════════════════════════════════════════════ */

.gestion-layout{
    padding:1rem 1.75rem;
}

.users-list{
    display:flex;
    flex-direction:column;
    gap:.75rem;
    padding:1rem;
}

.user-card{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:1rem;

    background:var(--honey-pale);
    border:1px solid var(--border);
    border-radius:var(--radius-sm);

    transition:all var(--tr);
}

.user-card:hover{
    transform:translateY(-1px);
    box-shadow:0 4px 14px rgba(92,58,0,.06);
}

.user-left{
    display:flex;
    align-items:center;
    gap:.9rem;
}

.user-avatar{
    width:42px;
    height:42px;

    border-radius:50%;

    background:var(--honey);
    color:var(--wood);

    font-weight:700;
    font-size:1rem;

    display:flex;
    align-items:center;
    justify-content:center;

    flex-shrink:0;
}

.user-name{
    font-weight:600;
    color:var(--text-main);
    margin-bottom:4px;
}

.user-role{
    display:inline-flex;
    align-items:center;
    gap:5px;

    padding:3px 10px;

    border-radius:999px;

    font-size:.75rem;
    font-weight:500;
}

.role-user{
    background:#DCFCE7;
    color:#15803D;
}

.role-admin{
    background:#FEF3C7;
    color:#92400E;
}

.role-dev{
    background:#DBEAFE;
    color:#1E40AF;
}

.user-actions{
    display:flex;
    gap:.5rem;
}

.btn-history{
    border:none;
    background:transparent;

    color:var(--text-muted);

    font-size:.75rem;
    font-weight:500;

    cursor:pointer;

    padding:4px 8px;
    border-radius:6px;

    transition:all var(--tr);
}

.btn-history:hover{
    background:var(--honey-pale);
    color:var(--wood);
}

.history-modal{
    max-width:700px;
    max-height:80vh;

    display:flex;
    flex-direction:column;
}

.history-full-body{
    padding:1rem;

    overflow-y:auto;

    display:flex;
    flex-direction:column;
    gap:6px;
}

.history-full-item{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:.65rem .8rem;

    background:var(--honey-pale);

    border:1px solid var(--border);

    border-radius:8px;

    font-size:.85rem;
}

/* ════════════════════════════════════════════════════════
   MOBILE APP V2 : burger, actions ⋮, cartes compactes, bottom nav
════════════════════════════════════════════════════════ */
.mobile-actions-btn,
.bottom-nav {
    display: none;
}

@media (max-width: 700px) {
    body { overflow: hidden; }

    .dashboard {
        grid-template-columns: 1fr;
        min-height: 100dvh;
    }

    .content {
        height: 100dvh;
        padding-bottom: 82px;
    }

    .mobile-menu-btn,
    .sidebar-overlay,
    .mobile-actions-btn,
    .bottom-nav {
        display: flex;
    }

    .mobile-menu-btn {
        top: 0.75rem;
        left: 0.75rem;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        z-index: 800;
    }

    .sidebar {
        width: min(82vw, 290px);
        z-index: 1000;
        transform: translateX(-105%);
        box-shadow: 20px 0 60px rgba(20, 10, 0, .35);
    }

    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay { z-index: 900; }

    .topbar {
        position: sticky;
        top: 0;
        grid-template-columns: 44px 1fr 44px;
        gap: .65rem;
        align-items: center;
        padding: .75rem .85rem .7rem;
        min-height: 64px;
    }

    .topbar-title {
        grid-column: 2;
        min-width: 0;
        justify-content: center;
    }

    .topbar-title h1 {
        font-size: 1.28rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-badge {
        font-size: .7rem;
        padding: 3px 9px;
    }

    #main-view .topbar .actions-row {
        position: absolute;
        top: calc(100% + .35rem);
        right: .85rem;
        width: min(270px, calc(100vw - 1.7rem));
        padding: .45rem;
        display: none;
        flex-direction: column;
        gap: .35rem;
        background: white;
        border: 1px solid var(--border);
        border-radius: 16px;
        box-shadow: 0 18px 45px rgba(92, 58, 0, .18);
        z-index: 700;
    }

    #main-view .topbar .actions-row.open { display: flex; }

    #main-view .topbar .actions-row .btn {
        width: 100%;
        justify-content: flex-start;
        border: none;
        background: transparent;
        padding: .8rem .9rem;
    }

    .mobile-actions-btn {
        grid-column: 3;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: white;
        color: var(--wood);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
    }

    .topbar-coords {
        grid-column: 1 / -1;
        justify-self: center;
        min-width: 0;
        max-width: calc(100vw - 2rem);
        font-size: .75rem;
        padding: 4px 10px;
    }

    .metrics-row {
        grid-template-columns: 1fr 1fr;
        gap: .65rem;
        padding: .85rem;
    }

    .metric-card {
        padding: .85rem;
        border-radius: 18px;
    }

    .metric-card--hero {
        grid-column: 1 / -1;
        min-height: 108px;
    }

    .metric-card:not(.metric-card--hero) .mc-label {
        font-size: .62rem;
        letter-spacing: .08em;
    }

    .mc-input {
        width: 150px;
        font-size: 2.6rem;
    }

    .metric-card:not(.metric-card--hero) .mc-value {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    .metric-card:not(.metric-card--hero) .mc-value div {
        font-size: .68rem !important;
    }

    .lower-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
        padding: 0 .85rem .85rem;
    }

    #history-section .history-list {
        max-height: 245px;
    }

    .map-panel #ruche-map {
        display: none;
        min-height: 230px;
    }

    .map-panel.map-open #ruche-map {
        display: block;
    }

    .map-toggle {
        cursor: pointer;
    }

    .map-toggle-icon {
        color: var(--text-muted);
        transition: transform .2s ease;
    }

    .map-panel.map-open .map-toggle-icon {
        transform: rotate(180deg);
    }

    .countdown-bar {
        margin: .75rem .85rem 1rem;
        padding: .85rem;
        border-radius: 18px;
        gap: .9rem;
    }

    .cd-cycles { display: none; }

    #graph-view .topbar,
    #history-view .topbar,
    #gestion-view .topbar {
        grid-template-columns: 1fr auto;
        padding: .85rem;
    }

    #graph-view .topbar-title,
    #history-view .topbar-title,
    #gestion-view .topbar-title {
        grid-column: 1;
        justify-content: flex-start;
    }

    #graph-view .btn,
    #history-view .btn,
    #gestion-view .btn {
        width: auto;
    }

    #graph-view > div,
    #history-view > div {
        padding: 1rem !important;
    }

    .gestion-layout {
        padding: 1rem !important;
    }

    .bottom-nav {
        position: fixed;
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        z-index: 850;
        align-items: center;
        justify-content: space-around;
        gap: .25rem;
        padding: .45rem;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: rgba(255, 251, 242, .96);
        box-shadow: 0 14px 45px rgba(92, 58, 0, .22);
        backdrop-filter: blur(10px);
    }

    .bottom-nav-item {
        flex: 1;
        border: none;
        background: transparent;
        color: var(--text-muted);
        border-radius: 16px;
        padding: .5rem .25rem;
        font-family: 'DM Sans', sans-serif;
        font-size: 1.15rem;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .15rem;
    }

    .bottom-nav-item span {
        font-size: .62rem;
        font-weight: 600;
    }

    .bottom-nav-item.active {
        background: var(--honey);
        color: var(--wood);
    }

    .toast {
        bottom: 5.8rem;
    }
}

.nav-item {
    justify-content: space-between;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .15s;
}

.nav-item:hover .nav-actions,
.nav-item.active .nav-actions {
    opacity: 1;
}

.nav-action {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-action:hover {
    background: rgba(92, 58, 0, 0.15);
}

.map-actions{
    display:flex;
    align-items:center;
    gap:10px;
}

.btn-locate{
    border:none;
    border-radius:8px;
    padding:6px 10px;
    cursor:pointer;
    background:rgba(245,166,35,.15);
    color:#5C3A00;
    font-size:.8rem;
    font-weight:600;
}

.distance-info {
    padding: 0.65rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--honey-pale);
}