/* Ajustements par-dessus Pico.css */
:root {
    --pico-font-size: 100%;
    --dp-blue: #2f6fb5;
    --dp-blue-dark: #1d4f8a;
    --dp-blue-light: #dbe7f6;
    --dp-blue-hover: #c3d7f0;
    --pico-primary: #2f6fb5;
    --pico-primary-hover: #1d4f8a;
    --pico-primary-background: #2f6fb5;
    --pico-primary-hover-background: #1d4f8a;
    --pico-primary-underline: rgba(47, 111, 181, 0.5);
}

/* ---- Bandeau et onglets ---- */
.topbar {
    background: #fff;
    border-bottom: 5px solid var(--dp-blue);
    margin-bottom: 1.5rem;
}

.topbar-inner {
    max-width: var(--pico-container-max-width, 1130px);
    margin: 0 auto;
    padding: 0.55rem 1rem 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.01em;
    color: var(--dp-blue-dark);
    text-decoration: none;
}

.brand span {
    color: var(--dp-blue);
}

.whoami {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

.whoami form {
    margin: 0;
}

.whoami button {
    margin: 0;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    background: transparent;
    color: var(--dp-blue-dark);
    border: 1px solid var(--dp-blue-light);
}

.whoami button:hover {
    background: var(--dp-blue-light);
}

.tabbar {
    max-width: var(--pico-container-max-width, 1130px);
    margin: 0 auto;
    padding: 0 1rem;
    overflow-x: auto;
}

.tabbar ul {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0;
    display: flex;
    align-items: flex-end;
    gap: 0;
    white-space: nowrap;
}

.tabbar li {
    margin: 0 2px 0 0;
    padding: 0;
}

/* Onglet en biseau (intercalaire) : plus large en bas, fondu dans la barre bleue quand actif. */
.tab {
    display: inline-block;
    padding: 0.5rem 1.7rem 0.45rem;
    background: var(--dp-blue-light);
    color: var(--dp-blue-dark);
    font-weight: 600;
    font-size: 0.93rem;
    text-decoration: none;
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
    transition: background 0.15s;
}

.tab:hover,
.tab:focus {
    background: var(--dp-blue-hover);
    color: var(--dp-blue-dark);
    text-decoration: none;
}

.tab.active {
    background: var(--dp-blue);
    color: #fff;
    padding-top: 0.6rem;
}

@media (max-width: 700px) {
    .tab {
        padding: 0.45rem 1.1rem 0.4rem;
        font-size: 0.85rem;
    }
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--pico-del-color);
    color: #fff;
}

.alert-success {
    background: var(--pico-ins-color);
    color: #fff;
}

.alert-info {
    background: #fff3cd;
    color: #664d03;
}

.login-card {
    max-width: 28rem;
    margin: 3rem auto;
}

footer.container {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: var(--pico-muted-color);
}

/* ---- Tableau de bord ---- */
.week-summary td,
.week-summary th {
    white-space: nowrap;
}

.week-summary .badge {
    white-space: normal;
}

/* ---- Écran Semaine ---- */
.week-header h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.week-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.week-nav a[role="button"] {
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
}

.week-scroll {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.week-grid {
    font-size: 0.82rem;
    min-width: 900px;
    border-collapse: collapse;
}

.week-grid th,
.week-grid td {
    vertical-align: top;
    padding: 0.4rem 0.45rem;
    border: 1px solid var(--pico-muted-border-color);
}

.week-grid thead th {
    text-align: center;
    white-space: nowrap;
}

.week-grid tbody th {
    white-space: nowrap;
}

.week-grid tbody th small {
    display: block;
    font-weight: 400;
    color: var(--pico-muted-color);
}

.week-grid .today {
    outline: 2px solid var(--dp-blue);
    outline-offset: -2px;
}

.week-grid thead th {
    background: var(--dp-blue-light);
    color: var(--dp-blue-dark);
}

.day-note {
    display: block;
    font-weight: 400;
    color: #b02a37;
    white-space: normal;
}

/* Pastille d'alerte de couverture sous la date : passe à la ligne dans la colonne du jour. */
.week-grid thead .coverage-badge {
    display: block;
    margin: 0.25rem auto 0;
    width: fit-content;
    font-weight: 600;
    white-space: normal;
}

.coverage-alerts ul {
    margin: 0.4rem 0 0;
    color: inherit;
}

.coverage-alerts li {
    margin-bottom: 0.15rem;
    color: inherit;
}

.cell-line {
    display: block;
    white-space: nowrap;
}

.cell-link {
    display: block;
    color: inherit;
    text-decoration: none;
    min-height: 1.4rem;
}

.cell-link:hover {
    text-decoration: underline;
}

/* Planning-type : couleur pastel de la salariée (Domain\Employee\EmployeeColor). */
.cell-template { background: #f4faf4; }
.cell-template.emp-aucune { background: #f4f4f4; }
.cell-template.emp-orange { background: #ffe0c2; }
.cell-template.emp-violet { background: #e6d6f7; }
.cell-template.emp-bleu { background: #d6e6fb; }
.cell-template.emp-jaune { background: #fff5b8; }
.cell-template.emp-gris { background: #e4e4e4; }
.cell-template.emp-vert { background: #d9f2dc; }
.cell-template.emp-rouge { background: #f9d6d6; }
.cell-template.emp-rose { background: #fde0ee; }
.cell-template.emp-turquoise { background: #d2f1ef; }

/* Pastille de couleur devant le prénom. */
.week-grid tbody th .swatch { margin: 0 0.4rem 0 0; }
.swatch.emp-aucune { background: #f4f4f4; }
.swatch.emp-orange { background: #ffe0c2; }
.swatch.emp-violet { background: #e6d6f7; }
.swatch.emp-bleu { background: #d6e6fb; }
.swatch.emp-jaune { background: #fff5b8; }
.swatch.emp-gris { background: #e4e4e4; }
.swatch.emp-vert { background: #d9f2dc; }
.swatch.emp-rouge { background: #f9d6d6; }
.swatch.emp-rose { background: #fde0ee; }
.swatch.emp-turquoise { background: #d2f1ef; }

/* Saisie du jour, férié, fermeture : même code couleur, plus marqué, avec un liseré. */
.cell-exception {
    background: #ffd166;
    box-shadow: inset 4px 0 0 #e09b00;
}

.cell-holiday {
    background: #f6a5ac;
    box-shadow: inset 4px 0 0 #c62828;
}

.cell-closure {
    background: #b4b9f2;
    box-shadow: inset 4px 0 0 #3949ab;
}

.cell-rest {
    background: #fafafa;
    color: var(--pico-muted-color);
}

.cell-out {
    background: #eee;
    color: var(--pico-muted-color);
}

.cell-total {
    white-space: nowrap;
}

.cell-total .hs {
    color: #0a6b2a;
}

.badge {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.badge-blocking {
    background: #b02a37;
    color: #fff;
}

.badge-info {
    background: #ffc107;
    color: #333;
}

.badge-ok {
    background: #d1e7dd;
    color: #0a3622;
    white-space: normal;
}

details summary .badge {
    margin-left: 0.25rem;
}

.legend {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
}

.swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    border: 1px solid var(--pico-muted-border-color);
    margin: 0 0.25rem 0 0.75rem;
}

/* ---- Clôture ---- */
.inline-form {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    margin: 0.25rem 0;
}

.inline-form input[type="text"] {
    margin: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    width: 16rem;
}

.inline-form button {
    margin: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    width: auto;
}

details > summary .badge {
    margin-left: 0.5rem;
}

/* ---- Mon espace ---- */
.my-week th[scope="row"] {
    white-space: nowrap;
    width: 6rem;
}

.my-week tr.today th {
    box-shadow: inset 3px 0 0 var(--pico-primary);
}

/* ---- Formulaire Jour ---- */
.segment-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .segment-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ---- Paramètres ---- */
.subnav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin: 0 0 1.25rem;
    list-style: none;
}

.subnav li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.subnav a {
    display: inline-block;
    margin: 0;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--dp-blue-light);
    border-radius: 1rem;
    background: #fff;
    color: var(--dp-blue-dark);
    font-size: 0.9rem;
    text-decoration: none;
}

.subnav a:hover {
    background: var(--dp-blue-light);
}

.subnav a.active {
    background: var(--dp-blue);
    border-color: var(--dp-blue);
    color: #fff;
}

.to-confirm {
    display: inline-block;
    white-space: nowrap;
    margin-left: 0.3rem;
    padding: 0 0.4rem;
    border-radius: 0.3rem;
    background: #fff3cd;
    color: #664d03;
    font-size: 0.75rem;
    font-weight: 400;
}

.settings-table {
    font-size: 0.9rem;
}

.settings-table td,
.settings-table th {
    vertical-align: top;
}

.row-muted {
    opacity: 0.6;
}

.settings-table .swatch {
    margin: 0 0.3rem 0 0;
}

.settings-table .nowrap {
    white-space: nowrap;
}

/* Une ligne = un petit formulaire (praticiens) : champs côte à côte, empilés sur téléphone. */
.settings-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.settings-row label {
    flex: 1 1 9rem;
    margin: 0;
}

.settings-row input,
.settings-row select,
.settings-row button {
    margin-bottom: 0;
}

.settings-row button {
    flex: 0 0 auto;
    width: auto;
}

.settings-row-title {
    flex: 1 1 100%;
}

.settings-row-title small {
    margin-left: 0.5rem;
    color: var(--pico-muted-color);
}

.settings-row .settings-row-check {
    flex: 0 0 auto;
    padding-bottom: 0.6rem;
}

/* Grille de saisie du planning-type : champs étroits « 8h00 ». */
.template-grid th,
.template-grid td {
    padding: 0.25rem 0.3rem;
    white-space: nowrap;
}

.template-grid input {
    width: 5rem;
    margin: 0;
    padding: 0.3rem 0.45rem;
    font-size: 0.9rem;
    height: auto;
}

.settings-table td.small {
    font-size: 0.8rem;
}

.heading-note {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--pico-muted-color);
}

.year-label {
    align-self: center;
    padding: 0 0.5rem;
    font-size: 1.2rem;
}

.balance-table input {
    margin: 0;
    padding: 0.3rem 0.45rem;
    font-size: 0.9rem;
    height: auto;
    min-width: 4.5rem;
}

.balance-table input[type="date"] {
    min-width: 9rem;
}

.balance-table button {
    margin: 0;
    padding: 0.3rem 0.7rem;
    width: auto;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.account-actions button {
    margin: 0;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    width: auto;
}

.account-edit {
    min-width: 18rem;
}

/* ---- Journal ---- */
.journal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.journal-filters label {
    flex: 1 1 9rem;
    margin: 0;
}

.journal-filters input,
.journal-filters select {
    margin-bottom: 0;
    width: 100%;
}

.journal-filters button,
.journal-filters [role="button"] {
    margin-bottom: 0;
    width: auto;
}

.journal-changes {
    font-size: 0.8rem;
    margin: 0.4rem 0 0;
}

.journal-changes td,
.journal-changes th {
    padding: 0.15rem 0.4rem;
}

.journal-changes tr.changed td {
    background: #fff3cd;
}

/* Semaine : colonne heures masquée pour un praticien (SPEC §10 v1.2 : son assistante seulement). */
.cell-hidden { color: var(--pico-muted-color); text-align: center; }

/* Explication sous un choix radio (formulaires du jour et des demandes) : ligne à part, pas de chevauchement. */
.choice-help { margin: -0.35rem 0 0.75rem 1.9rem; font-size: 0.85em; color: var(--pico-muted-color); }

/* Sélection de plusieurs jours (⌘/Ctrl + clic) et barre de saisie groupée. */
.week-grid td.selected {
    outline: 3px solid #e09b00;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 999px rgba(224, 155, 0, 0.22);
}

.selection-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    background: var(--dp-blue-light);
    border-top: 3px solid var(--dp-blue);
}

.selection-bar a[role="button"],
.selection-bar button {
    margin: 0;
    width: auto;
}

#selection-mode[aria-pressed="true"] {
    background: var(--dp-blue);
    color: #fff;
}

/* Vue Mois : cellules compactes, week-ends grisés, point rouge = férié ou fermeture. */
.month-grid {
    font-size: 0.74rem;
    min-width: 1100px;
}

.month-grid th,
.month-grid td {
    padding: 0.25rem 0.3rem;
    text-align: center;
    white-space: nowrap;
}

.month-grid tbody th {
    text-align: left;
}

.month-grid thead th.weekend,
.month-grid td.weekend.cell-rest {
    background: #e9e9e9;
}

.month-note {
    display: block;
    color: #b02a37;
    font-size: 0.7em;
    line-height: 1;
}
