:root {
    --navy:         #163354;
    --navy-mid:     #1e4a7a;
    --navy-light:   #2d6192;
    --orange:       #e85d04;
    --orange-light: #f97316;
    --foam:         #f0f5fb;
    --sand:         #dbe4ee;
    --text:         #1e293b;
    --muted:        #64748b;
    --white:        #ffffff;

    --font-display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
    --font-body:    'Open Sans', system-ui, -apple-system, sans-serif;
}

/* ── Base ── */
body {
    background-color: var(--foam);
    font-family: var(--font-body);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-light); text-underline-offset: 3px; }
a:hover { color: var(--orange); }
a.btn, a.nav-link, a.nav-card { text-decoration: none; }

h1, h2, .page-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--navy);
}
h3, h4, h5, h6 { font-weight: 700; color: var(--navy); }

/* ── Header ── */
.site-header-top {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.site-logo { height: 44px; width: auto; }

.urgence-strip {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    text-align: center;
    padding: 0.3rem 1rem 0.45rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.urgence-badge {
    display: inline-flex;
    align-items: center;
    background: var(--orange);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.site-header-top .btn-outline-light {
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
}
.site-header-top .btn-outline-light:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.site-header-top .btn-outline-danger {
    border-color: rgba(220,53,69,0.6);
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
}
.site-header-top .btn-outline-danger:hover {
    background: rgba(220,53,69,0.7);
    color: #fff;
}

/* ── Navigation cards ── */
.nav-card {
    display: block;
    background: var(--white);
    border-radius: 12px;
    padding: 1.4rem 1.25rem;
    text-decoration: none !important;
    color: var(--text);
    border: 1px solid var(--sand);
    border-left: 4px solid var(--navy-light);
    transition: all 0.18s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    height: 100%;
}
.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.11);
    border-left-color: var(--orange);
    color: var(--navy);
}
.nav-card.card-primary {
    background: var(--navy);
    color: white !important;
    border-left-color: var(--orange);
}
.nav-card.card-primary:hover {
    background: var(--navy-mid);
    color: white !important;
}
.nav-card.card-action {
    background: var(--orange);
    color: white !important;
    border-left-color: var(--orange-light);
}
.nav-card.card-action:hover {
    background: var(--orange-light);
    color: white !important;
}
.nav-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.6rem;
    display: block;
    opacity: 0.9;
}
.nav-card .card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}
.nav-card .card-desc {
    font-size: 0.82rem;
    opacity: 0.72;
    line-height: 1.4;
}

/* ── Alerte sortie en cours ── */
.alert-en-cours {
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
    color: white;
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 3px 12px rgba(232,93,4,0.3);
}
.alert-en-cours i { font-size: 1.8rem; flex-shrink: 0; }
.alert-en-cours .btn-light {
    background: white;
    color: var(--orange);
    font-weight: 700;
    border: none;
    white-space: nowrap;
}
.alert-en-cours .btn-light:hover { background: #ffe8d9; }

/* ── Tables ── */
.trip-table thead th {
    background: var(--navy);
    color: white;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-color: var(--navy-mid);
}
.trip-table tbody tr:hover { background: #f8fafc; }

.badge-en-cours  { background: var(--orange);  color: white; font-weight: 600; }
.badge-terminee  { background: #d1fae5; color: #065f46; font-weight: 600; }

/* ── Section cards (fiches) ── */
.section-card {
    background: var(--white);
    border-radius: 10px;
    border-left: 4px solid var(--navy-light);
    padding: 1.1rem 1.4rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.section-card.important {
    border-left-color: var(--orange);
    background: #fff8f3;
}
.section-card .section-icon { color: var(--orange); font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.section-card .section-title { font-weight: 700; color: var(--navy); font-size: 1rem; margin-bottom: 0.35rem; }
.section-card .section-text { color: var(--text); line-height: 1.65; font-size: 0.93rem; }

/* ── Login ── */
.login-card { border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px rgba(10,22,40,0.18); }
.login-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

/* ── Boutons personnalisés ── */
.btn-navy   { background: var(--navy);   border-color: var(--navy);   color: white; }
.btn-navy:hover { background: var(--navy-mid); border-color: var(--navy-mid); color: white; }
.btn-orange { background: var(--orange); border-color: var(--orange); color: white; }
.btn-orange:hover { background: var(--orange-light); border-color: var(--orange-light); color: white; }

/* ── Admin ── */
.admin-tabs .nav-link { color: var(--muted); }
.admin-tabs .nav-link:hover { color: var(--navy); }
.admin-tabs .nav-link.active { color: var(--navy); border-bottom: 3px solid var(--orange); font-weight: 600; }

.admin-section-block {
    border: 1px solid var(--sand);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.85rem;
}
.admin-section-title {
    background: #f8fafc;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--sand);
    font-weight: 600;
    color: var(--navy);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-section-title:hover { background: var(--sand); }
.admin-section-body { padding: 1rem; }
.admin-section-block.asb-collapsed .admin-section-body { display: none; }
.admin-section-block.asb-collapsed .asb-chevron { transform: rotate(-90deg); }
.asb-chevron { transition: transform 0.18s; }

.admin-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
    display: block;
}

/* ── Drag-and-drop ── */
.drag-handle { cursor: grab; color: var(--muted); padding: 0 4px; }
.drag-handle:active { cursor: grabbing; }
.sortable-ghost { opacity: 0.45; background: var(--sand); }
.sortable-chosen { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* ── Icon picker ── */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 5px;
    max-height: 340px;
    overflow-y: auto;
}
.icon-picker-btn {
    display: flex; flex-direction: column; align-items: center;
    padding: 7px 3px;
    border: 1px solid var(--sand); border-radius: 6px;
    background: white; font-size: 0.68rem; color: var(--text);
    cursor: pointer; transition: all 0.13s;
}
.icon-picker-btn:hover { border-color: var(--orange); background: #fff3ed; }
.icon-picker-btn i { font-size: 1.35rem; margin-bottom: 3px; color: var(--navy); }

/* ── Page header fiche ── */
.fiche-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.fiche-header h1 { color: white; margin-bottom: 0; font-size: 1.6rem; }

/* ── Formulaire ── */
.form-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid var(--sand);
}
.form-section-title {
    font-weight: 700;
    color: var(--navy-mid);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--sand);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

/* ── Calendrier ── */
.cal-wrapper {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--sand);
    overflow: hidden;
}
.cal-table { border-collapse: collapse; table-layout: fixed; }
.cal-table thead th {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.25rem;
}
.cal-table thead th.cal-weekend { color: rgba(255,255,255,0.5); }
.cal-cell {
    vertical-align: top;
    padding: 0.35rem;
    border: 1px solid var(--sand);
    min-height: 72px;
    width: 14.28%;
}
.cal-cell.cal-empty   { background: #f8f9fb; }
.cal-cell.cal-weekend { background: #fafbfd; }
.cal-cell.cal-today   { background: #fffbf5; }
.cal-cell.cal-today .cal-day-num {
    background: var(--orange);
    color: #fff;
    border-radius: 50%;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
}
.cal-cell.cal-selected { background: #f0f5fb; outline: 2px solid var(--navy-light); }
.cal-day-num { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.cal-ev {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.cal-ev:hover { opacity: 0.85; }
/* Couleurs par couple / type */
/* Rodolphe / Laurence — rose/corail */
.cal-ev-rl    { background: #fce4ec; color: #880e4f; border-left: 3px solid #e91e63; }
/* Michel / Marie-Paule — bleu */
.cal-ev-mm    { background: #e3f2fd; color: #0d47a1; border-left: 3px solid #1976d2; }
/* Autre — ambre/vert sauge */
.cal-ev-autre { background: #f1f8e9; color: #33691e; border-left: 3px solid #7cb342; }
/* Sorties en mer — violet */
.cal-ev-trip  { background: #f3e5f5; color: #4a148c; border-left: 3px solid #8e24aa; }
/* En cours (sortie active) — animation */
.cal-ev-trip.cal-ev-encours { animation: pulse-purple 2s infinite; }
@keyframes pulse-purple {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}
/* Légende */
.cal-legend {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── Événements multi-jours (spanning) ── */
/* La cellule a padding:0.35rem et border:1px solid.
   Les marges négatives font déborder l'événement jusqu'au bord de la cellule voisine. */
.cal-ev-span-start {
    border-radius: 3px 0 0 3px !important;
    margin-right: calc(-0.35rem - 1px);
    position: relative;
    z-index: 2;
}
.cal-ev-span-mid {
    border-radius: 0 !important;
    margin-left:  calc(-0.35rem - 1px);
    margin-right: calc(-0.35rem - 1px);
    border-left: none !important;
    padding-left: 3px;
    position: relative;
    z-index: 2;
    /* font-size hérité de .cal-ev → même hauteur de ligne-box que la cellule de départ */
}
.cal-ev-span-end {
    border-radius: 0 3px 3px 0 !important;
    margin-left: calc(-0.35rem - 1px);
    border-left: none !important;
    padding-left: 3px;
    position: relative;
    z-index: 2;
}
@media (max-width: 576px) {
    .cal-ev-span-start { margin-right: calc(-0.2rem - 1px); }
    .cal-ev-span-mid   { margin-left: calc(-0.2rem - 1px); margin-right: calc(-0.2rem - 1px); }
    .cal-ev-span-end   { margin-left: calc(-0.2rem - 1px); }
}

/* ── Météo marine ── */
.weather-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--sand);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.weather-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: white;
}
.weather-icon-wrap { flex-shrink: 0; }
.weather-main-icon { font-size: 2.8rem; opacity: 0.9; }
.weather-temps { flex-shrink: 0; }
.weather-temp-big  { font-size: 2rem; font-weight: 700; line-height: 1; }
.weather-temp-feel { font-size: 0.75rem; opacity: 0.7; margin-top: 2px; }
.weather-condition { font-size: 0.78rem; opacity: 0.85; margin-top: 3px; }
.weather-wind-block { flex: 1; min-width: 120px; }
.weather-bf {
    font-size: 1.25rem; font-weight: 800;
    line-height: 1; letter-spacing: -0.01em;
}
.weather-bf-label {
    font-size: 0.72rem; font-weight: 500;
    display: block; opacity: 0.85; margin-top: 1px;
}
.weather-wind-detail {
    font-size: 0.78rem; margin-top: 4px; opacity: 0.85;
    display: flex; flex-wrap: wrap; gap: 0 8px;
}
.weather-wind-kn  { font-weight: 600; }
.weather-wind-dir { opacity: 0.8; }
.weather-wind-gust { color: #fbbf24; font-size: 0.72rem; }
.weather-humid { font-size: 0.72rem; opacity: 0.65; margin-top: 3px; }
.weather-meta {
    margin-left: auto; text-align: right; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.weather-city    { font-size: 0.78rem; font-weight: 600; opacity: 0.9; }
.weather-updated { font-size: 0.68rem; opacity: 0.55; }
.weather-link {
    font-size: 0.7rem; color: rgba(255,255,255,0.6);
    text-decoration: none; margin-top: 4px;
    transition: color .15s;
}
.weather-link:hover { color: rgba(255,255,255,0.95); }

/* Prévisions */
.weather-forecast {
    display: flex;
    border-top: 1px solid var(--sand);
}
.weather-day {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center;
    padding: 0.55rem 0.25rem;
    gap: 3px;
    border-right: 1px solid var(--sand);
}
.weather-day:last-child { border-right: none; }
.weather-day-name  { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.weather-day-icon  { font-size: 1.25rem; color: var(--navy-mid); }
.weather-day-temps { font-size: 0.72rem; display: flex; gap: 4px; }
.weather-day-max   { font-weight: 700; color: var(--text); }
.weather-day-min   { color: var(--muted); }
.weather-day-bf    { font-size: 0.7rem; font-weight: 700; }

@media (max-width: 576px) {
    .weather-main  { gap: 0.7rem; padding: 0.85rem 1rem; }
    .weather-main-icon { font-size: 2.2rem; }
    .weather-temp-big  { font-size: 1.6rem; }
    .weather-meta { display: none; }
    .weather-day   { padding: 0.4rem 0.1rem; }
    .weather-day-icon { font-size: 1rem; }
}

/* ── Marées ── */
.tides-block {
    border-top: 1px solid var(--sand);
    padding: 0.85rem 1.1rem 0.9rem;
    background: #f8fafc;
}
.tides-top {
    display: flex; align-items: center; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 0.65rem;
}
.tides-coeff {
    display: flex; flex-direction: column;
    align-items: center; flex-shrink: 0;
}
.tides-coeff-num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.tides-coeff-lbl { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.tides-state {
    display: flex; align-items: center; gap: 3px;
    font-size: 0.82rem; font-weight: 600; border-radius: 20px;
    padding: 3px 10px;
}
.tides-rising  { background: #dbeafe; color: #1d4ed8; }
.tides-falling { background: #fce7f3; color: #9d174d; }
.tides-state i { font-size: 1rem; }
.tides-cur-h {
    font-size: 1.1rem; font-weight: 700; color: var(--navy);
    margin-left: auto;
}

/* Barre de niveau */
.tides-bar-wrap {
    position: relative; height: 8px;
    background: var(--sand); border-radius: 4px;
    margin-bottom: 0.85rem; overflow: visible;
}
.tides-bar-fill {
    height: 100%; border-radius: 4px;
    transition: width .4s ease;
}
.tides-bar-rising  { background: linear-gradient(90deg, #93c5fd, #2563eb); }
.tides-bar-falling { background: linear-gradient(90deg, #2563eb, #93c5fd); }
.tides-bar-cursor {
    position: absolute; top: 50%; transform: translate(-50%, -50%);
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--navy); border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

/* Extremes */
.tides-extremes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}
.tides-ex {
    border-radius: 8px; padding: 0.45rem 0.5rem;
    text-align: center; border: 1px solid transparent;
}
.tides-ex-hm { background: #eff6ff; border-color: #bfdbfe; }
.tides-ex-bm { background: #fdf4ff; border-color: #e9d5ff; }
.tides-ex-type {
    font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; opacity: 0.65; margin-bottom: 2px;
}
.tides-ex-hm .tides-ex-type { color: #1d4ed8; }
.tides-ex-bm .tides-ex-type { color: #7e22ce; }
.tides-ex-time  { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.tides-ex-h     { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.tides-ex-delta { font-size: 0.65rem; color: var(--muted); margin-top: 1px; }

@media (max-width: 576px) {
    .tides-block { padding: 0.7rem 0.85rem; }
    .tides-extremes { grid-template-columns: repeat(2, 1fr); }
    .tides-cur-h { margin-left: 0; }
}

/* ── Slides fiche (procédures / sécurité) ── */

/* Desktop : toutes les cartes visibles, nav cachée */
@media (min-width: 768px) {
    .fiche-sections-wrap .section-card { display: block !important; }
    .fiche-slide-nav                    { display: none !important; }
}

/* Mobile : une carte à la fois + nav sticky */
@media (max-width: 767px) {

    .fiche-sections-wrap .section-card {
        display: none;
    }
    .fiche-sections-wrap .section-card.slide-active {
        display: block;
        /* Animation d'entrée définie par les classes slide-in-* */
    }

    /* Entrées directionnelles */
    .slide-in-right {
        animation: slideFromRight .25s cubic-bezier(.25,.46,.45,.94) both;
    }
    .slide-in-left {
        animation: slideFromLeft .25s cubic-bezier(.25,.46,.45,.94) both;
    }
    @keyframes slideFromRight {
        from { opacity: 0; transform: translateX(28px); }
        to   { opacity: 1; transform: translateX(0); }
    }
    @keyframes slideFromLeft {
        from { opacity: 0; transform: translateX(-28px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    /* Badge "Important" en haut de slide */
    .slide-badge-important {
        display: inline-flex;
        align-items: center;
        background: var(--orange);
        color: white;
        font-size: 0.68rem;
        font-weight: 700;
        padding: 2px 9px;
        border-radius: 12px;
        margin-bottom: 0.55rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* Navigation en haut des sections */
    .fiche-slide-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        padding: 0.4rem 0;
        margin-bottom: 0.75rem;
    }

    /* Boutons flèche */
    .fiche-nav-btn {
        background: var(--foam);
        border: 1px solid var(--sand);
        border-radius: 50%;
        width: 48px; height: 48px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.25rem;
        color: var(--navy);
        cursor: pointer;
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
        transition: background .13s, border-color .13s;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    .fiche-nav-btn:active { background: var(--sand); border-color: var(--navy-light); }

    /* Zone centrale : compteur + points */
    .fiche-nav-mid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        flex: 1;
    }
    .fiche-slide-counter {
        font-weight: 700;
        font-size: 0.82rem;
        color: var(--navy);
        letter-spacing: 0.04em;
    }
    .fiche-slide-dots {
        display: flex;
        gap: 6px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 160px;
    }
    .fiche-dot {
        width: 7px; height: 7px;
        border-radius: 50%;
        background: var(--sand);
        border: none;
        padding: 0;
        cursor: pointer;
        transition: background .15s, transform .15s;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    .fiche-dot.active {
        background: var(--navy);
        transform: scale(1.4);
    }

}

/* Badge important aussi visible sur desktop */
@media (min-width: 768px) {
    .slide-badge-important { display: none; } /* déjà indiqué par la couleur orange */
}

/* ── Stat cards (historique) ── */
.stat-card {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--sand);
    border-left: 4px solid var(--navy-light);
    padding: 1rem 1.25rem;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card-action { border-left-color: var(--orange); }
.stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
}
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 600;
}

/* ── Galerie photos ── */
.gallery-group {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--sand);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.gallery-group-header {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--sand);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--navy);
    gap: 0;
}
.gallery-group-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    padding-left: 0.75rem;
}
.gallery-group-link {
    font-size: 0.72rem;
    color: var(--muted);
    opacity: 0.6;
    text-decoration: none;
    transition: opacity .15s;
}
.gallery-group-link:hover { opacity: 1; color: var(--navy-light); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 3px;
    padding: 3px;
}
.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    background: var(--sand);
}
.gallery-thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s, filter .25s;
}
.gallery-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(22, 51, 84, 0);
    color: white;
    font-size: 1.4rem;
    opacity: 0;
    transition: background .2s, opacity .2s;
}
.gallery-item:hover .gallery-thumb  { transform: scale(1.06); filter: brightness(.85); }
.gallery-item:hover .gallery-overlay { background: rgba(22, 51, 84, 0.42); opacity: 1; }

/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center; justify-content: center;
}
.gallery-lightbox.active { display: flex; }
.gallery-lb-inner {
    display: flex; flex-direction: column; align-items: center;
    max-width: 92vw; max-height: 92vh;
    padding: 0 3.5rem;
}
.gallery-lb-inner img {
    max-width: 100%; max-height: 78vh;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.55);
}
.gallery-lb-caption {
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    margin-top: 0.8rem;
    text-align: center;
    max-width: 60ch;
}
.gallery-lb-counter {
    color: rgba(255,255,255,0.38);
    font-size: 0.68rem;
    margin-top: 3px;
}
.gallery-lb-close,
.gallery-lb-prev,
.gallery-lb-next {
    position: fixed;
    background: rgba(255,255,255,0.12);
    border: none; outline: none;
    color: white; border-radius: 50%;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background .15s;
    -webkit-tap-highlight-color: transparent;
}
.gallery-lb-close:hover,
.gallery-lb-prev:hover,
.gallery-lb-next:hover { background: rgba(255,255,255,0.24); }
.gallery-lb-close { top: 1rem; right: 1rem; }
.gallery-lb-prev  { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.gallery-lb-next  { right: 0.75rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 576px) {
    .gallery-grid  { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .gallery-lb-inner { padding: 0 0.25rem; }
    .gallery-lb-prev  { left: 0.25rem; }
    .gallery-lb-next  { right: 0.25rem; }
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .page-title { font-size: 1.35rem; }
    .nav-card { padding: 1rem; }
    .nav-card .card-icon { font-size: 1.5rem; }
    .form-card { padding: 1.25rem; }
    .cal-cell { min-height: 50px; padding: 0.2rem; }
    .cal-day-num { font-size: 0.7rem; }
    .cal-ev { font-size: 0.62rem; padding: 1px 3px; }
}
