/* Portail horaire : styles propres au formulaire de non-dispos, aux calendriers et aux pages de période.
   Les couleurs de base, la barre, les cartes, boutons et tableaux viennent de app/commun/assets/base.css. */
:root{
  --perso:#F28C28; --perso-bg:#FDE8D3; --perso-line:#F7BE86;   /* orange */
  --prof:#4A54B4; --prof-bg:#E2E4F7; --prof-line:#A7ADE3;
  --prot:#2E8B57; --prot-bg:#DDF3E6; --prot-line:#8FD1A8;     /* protégé = vert */
  --dispo:#3A8F8B; --dispo-bg:#E2F4F3; --dispo-line:#9ED4D1;   /* disponible (temps partiel) = turquoise */
}
.blk:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

/* ---------- Période (admin) ---------- */
.comm-btn{background:none;border:1px solid var(--line);border-radius:6px;padding:.2rem .35rem;color:var(--accent-ink);cursor:pointer;line-height:0;vertical-align:middle}
.comm-btn:hover{background:var(--accent-soft)}
.comm-btn.on{background:var(--accent);border-color:var(--accent);color:#fff}
.tbl-quarts{width:100%;min-width:420px;table-layout:fixed}
.tbl-quarts th,.tbl-quarts td{padding:.45rem .7rem}
.tbl-quarts th:first-child,.tbl-quarts td:first-child{width:34%;text-align:left}

/* ---------- Soumission ---------- */
.sub-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}
.deadline{color:var(--muted)}
.deadline strong{color:var(--ink)}
/* Formulaire : calendrier / sélection / quarts+commentaires. Sur mobile, la sélection passe entre les deux. */
.form-grid{grid-template-areas:"top side" "bottom side"}
.fg-top{grid-area:top;min-width:0}.fg-side{grid-area:side}.fg-bottom{grid-area:bottom;min-width:0}
@media (max-width:900px){.form-grid{grid-template-areas:"top" "side" "bottom"}}

.toolbar{display:flex;flex-wrap:wrap;gap:.6rem 1.2rem;align-items:center;margin-bottom:1rem;padding:.75rem 1rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.toolbar .lbl{font-size:.85rem;color:var(--muted)}
.toolbar .toolbar-title{width:100%;margin:0 0 -.2rem}
.type-info{width:100%;font-size:.88rem;line-height:1.45;background:var(--bg);border:1px solid var(--line);border-radius:6px;padding:.6rem .8rem}
.type-info>div{display:none}.type-info>div.on{display:block}
.type-info p{margin:0 0 .45rem}.type-info p:last-child{margin-bottom:0}
.type-info .ti{font-weight:600;color:var(--ink);margin-right:.3rem}
.type-info[hidden]{display:none}
.periode-bar{display:none}
@media (max-width:900px){
  .periode-bar{display:block;position:sticky;top:var(--topbar-h,52px);z-index:40;text-align:right;background:var(--bg);margin:-1.75rem -1.25rem .75rem;padding:.4rem 1.25rem .4rem;border-bottom:1px solid var(--line)}
  h1 .pill-periode{display:none}
}
.seg{display:inline-flex;border:1px solid var(--line-strong);border-radius:6px;overflow:hidden}
.seg button{font:inherit;font-size:.9rem;border:0;background:#fff;padding:.4rem .8rem;cursor:pointer;color:var(--ink);display:flex;align-items:center;gap:.4rem}
.seg button+button{border-left:1px solid var(--line-strong)}
.seg button.on{font-weight:600}
.seg button.on[data-type=PERSO]{background:var(--perso-bg);color:var(--perso)}
.seg button.on[data-type=PROF]{background:var(--prof-bg);color:var(--prof)}
.seg button.on[data-type=PROT]{background:var(--prot-bg);color:var(--prot)}
.seg button.on[data-type=DISPO]{background:var(--dispo-bg);color:var(--dispo)}
.dot{width:10px;height:10px;border-radius:3px;display:inline-block}
.dot-PERSO{background:var(--perso)}.dot-PROF{background:var(--prof)}.dot-PROT{background:var(--prot)}.dot-DISPO{background:var(--dispo)}

.months{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1.25rem}
.month{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:.9rem 1rem 1rem}
.month h2{text-transform:capitalize;margin-bottom:.6rem}
.pill-periode{background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent-line);font-size:.9rem;vertical-align:middle;margin-left:.5rem;font-weight:500}
.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.cal .wd{font-size:.72rem;color:var(--muted);text-align:center;padding-bottom:.2rem}
.day{border:1px solid var(--line);border-radius:6px;padding:4px;min-height:74px;display:flex;flex-direction:column;gap:3px;background:#fff}
.day.we{background:#F7F9F8}
.day.empty{border-color:transparent;background:transparent}
.day .dn{font-size:.78rem;font-weight:500;color:var(--muted);text-align:center;cursor:pointer;user-select:none;border-radius:4px;line-height:1.3;touch-action:manipulation}
.day .dn:hover{background:var(--accent-soft);color:var(--accent-ink)}
.blk{flex:1;border:1px dashed var(--line);border-radius:4px;background:transparent;cursor:pointer;font:inherit;font-size:.68rem;color:var(--line-strong);padding:0;line-height:1;min-height:14px;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.blk:hover{border-color:var(--line-strong);color:var(--muted)}
.blk.on{border-style:solid;color:#fff;font-weight:600}
.blk.on.PERSO{background:var(--perso);border-color:var(--perso)}
.blk.on.PROF{background:var(--prof);border-color:var(--prof)}
.blk.on.PROT{background:var(--prot);border-color:var(--prot)}
.blk.on.DISPO{background:var(--dispo);border-color:var(--dispo)}
.blk.on.has-detail::after{content:"•";margin-left:3px}
.readonly .blk,.readonly .dn{cursor:default;pointer-events:none}

/* Vue calendrier admin (nombre de MD non disponibles par bloc) */
.ov .blk{border-style:solid;border-color:var(--line);color:var(--line-strong);font-size:.72rem;font-weight:600}
.ov .blk.l1{background:#FDEBD0;border-color:#F3CFA3;color:#7E5109}
.ov .blk.l2{background:#F6C26B;border-color:#E9AE4E;color:#5B3A00}
.ov .blk.l3{background:#E67E22;border-color:#CA6F1E;color:#fff}
.ov .blk.l4{background:#B03A2E;border-color:#922B21;color:#fff}
.ov .blk.sel{outline:2px solid var(--accent-ink);outline-offset:1px}
.ov-chk{display:inline-flex;align-items:center;gap:.3rem;font-weight:400;font-size:.88rem;margin:0}
.ov-legend{display:inline-flex;gap:.4rem;align-items:center;font-size:.8rem;color:var(--muted);flex-wrap:wrap;margin-left:auto}
.ov-legend i{display:inline-block;width:20px;height:12px;border-radius:3px;border:1px solid var(--line)}
.ov-legend i.l1{background:#FDEBD0}.ov-legend i.l2{background:#F6C26B}.ov-legend i.l3{background:#E67E22}.ov-legend i.l4{background:#B03A2E}
.ov .blk.on{color:#fff}   /* réponses individuelles : blocs de la couleur du type */
.ov-legend[hidden],.ov-side .card[hidden]{display:none}
/* Liste des médecins : réponses groupées (cases à cocher) / individuelles (un seul), total de blocs près du nom */
.seg button.on:not([data-type]){background:var(--accent-soft);color:var(--accent-ink)}
.ov-meds-card{margin-bottom:1rem}
.ov-meds-head{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;margin-bottom:.7rem}
.ov-meds-head h2{margin:0}
.ov-sel-actions{font-size:.88rem}
.ov-meds-note{font-size:.88rem;margin-left:auto}
.ov-meds{list-style:none;margin:0;padding:0;columns:230px;column-gap:1.75rem}
.ov-meds li{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;padding:.22rem 0;border-bottom:1px solid var(--line);break-inside:avoid;font-size:.9rem}
.ov-meds label{display:flex;align-items:baseline;gap:.4rem;margin:0;font-weight:400;min-width:0;flex-wrap:wrap;cursor:pointer}
.ov-meds input{margin:0;align-self:center}
.ov-meds .nb{font-variant-numeric:tabular-nums;font-weight:600;color:var(--ink)}
.ov-meds li.sans .nom{color:var(--muted)}
.ov-meds li.sans label{cursor:default}
.ov-meds li.cur .nom{font-weight:600;color:var(--accent-ink)}
.ov-meds-pied{font-size:.8rem;margin:.6rem 0 0}
/* Colonne de droite : fiche du médecin (réponses individuelles) puis détail du bloc, dans un seul bloc collant */
.ov-side .card{position:static}
.ov-side .card:last-child{margin-bottom:0}
@media (min-width:901px){.ov-side{position:sticky;top:calc(var(--topbar-h,52px) + 1rem);max-height:calc(100vh - var(--topbar-h,52px) - 2rem);overflow:auto}}
@media (max-width:900px){.ov-ind .ov-side{order:-1}}   /* mobile : la fiche du médecin avant le calendrier */
.ov-resume h2{margin-bottom:.2rem}
.ov-resume-tot{margin:0 0 .15rem}
.ov-resume-date{font-size:.82rem;margin:0}
.ov-resume-corps{font-size:.9rem}
.ov-resume-corps h3{font-size:.92rem !important;margin:1rem 0 .3rem !important}   /* le résumé vient du courriel (styles en ligne) */
.ov-resume-corps p{margin:.3rem 0}
.ov-resume-lien{margin:1rem 0 0}
.ov-list ul{list-style:none;padding:0;margin:0}
.ov-list li{display:flex;gap:.4rem;align-items:center;padding:.15rem 0;font-size:.9rem}
@media (max-width:480px){.day{min-height:62px;padding:3px}.blk{font-size:.62rem}.cal{gap:3px}}

/* Panneau latéral : plages sélectionnées, récurrence */
.plages{list-style:none;margin:0;padding:0;max-height:50vh;overflow:auto}
.plages li{display:grid;grid-template-columns:8px 1fr auto;gap:.5rem;align-items:start;padding:.45rem 0;border-bottom:1px solid var(--line)}
.plages .bar{width:8px;height:100%;min-height:28px;border-radius:3px}
.plages .lab{font-size:.9rem}
.plages .lab small{display:block;color:var(--muted)}
.plages input{font-size:.82rem;padding:.25rem .45rem;margin-top:.3rem}
.plages .rm{background:none;border:0;color:var(--muted);cursor:pointer;font-size:1rem;padding:0 .2rem;line-height:1}
.plages .rm:hover{color:var(--danger)}
.plages:empty+.empty-note{display:block}
.empty-note{display:none;color:var(--muted);font-size:.9rem}
.recur{display:grid;grid-template-columns:1fr auto;gap:.5rem;align-items:end;margin-top:.5rem}
.recur .chk{display:flex;gap:.6rem;font-size:.85rem;align-items:center}
.recur .chk label{display:inline;margin:0;font-weight:400}

/* Quarts souhaités / max par mois */
.cibles{width:100%;border-collapse:collapse;font-size:.92rem}
.cibles td,.cibles th{padding:.35rem .4rem;text-align:center}
.cibles th{font-weight:500;color:var(--muted);font-size:.8rem}
.cibles td:first-child,.cibles th:first-child{text-align:left;text-transform:capitalize}
.cibles input{width:4.2rem;text-align:center;padding:.35rem .3rem}
.cibles input::placeholder{color:var(--line-strong)}
.cibles input:required:placeholder-shown{border-color:var(--perso)}
.cibles th.chef{color:var(--warn);font-size:.75rem;background:var(--warn-bg);border-radius:4px 4px 0 0}
.cibles td.chef{background:var(--warn-bg)}
.cibles td.chef input{border-color:#E7D59B}
/* Question « nuits simples ou groupées » du formulaire de réponse */
.nuits-nb{margin:0 0 1.4rem}
.nuits-nb input{width:4.2rem;text-align:center;padding:.35rem .3rem}
.nuits-nb input::placeholder{color:var(--line-strong)}
.nuits-nb input:required:placeholder-shown{border-color:var(--perso)}
.card h2 label{display:inline;margin:0;font:inherit;color:inherit}
.nuits-pref{display:flex;flex-direction:column;gap:.45rem}
.nuits-pref label{display:flex;align-items:flex-start;gap:.5rem;margin:0;font-weight:400;font-size:.92rem;line-height:1.4;cursor:pointer}
.nuits-pref input{margin:.2rem 0 0;flex:none}
.nuits-pref em{color:var(--muted);font-style:normal;white-space:nowrap}
.chef-swatch{display:inline-block;width:12px;height:12px;background:var(--warn-bg);border:1px solid #E7D59B;border-radius:3px;vertical-align:middle}

/* Ajustements du chef : quarts souhaités de tous les médecins, colonnes max modifiables (admin/ajustements) */
.ajust-outils{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;margin-bottom:.9rem}
.ajust-outils .filtre{flex:1 1 220px;margin:0}
.tbl-ajust{width:100%}
.tbl-ajust th,.tbl-ajust td{vertical-align:middle}
.tbl-ajust td:nth-child(2){white-space:nowrap;min-width:0}
.tbl-ajust .md-nom{font-weight:500;color:var(--ink);font-size:.92rem;white-space:normal;min-width:9rem;vertical-align:top;padding-top:.75rem}
.tbl-ajust .md-nom a{color:inherit;text-decoration:none}
.tbl-ajust .md-nom a:hover{color:var(--accent-ink);text-decoration:underline}
.tbl-ajust .mois{text-transform:capitalize;color:var(--muted)}
.tbl-ajust tbody.md tr:first-child>*{border-top:2px solid var(--line)}
.tbl-ajust tbody.md tr:not(:last-child)>td{border-bottom-color:transparent}
.tbl-ajust tbody.sans .md-nom{color:var(--muted)}
.tbl-ajust th.chef{color:var(--warn);background:var(--warn-bg)}
.tbl-ajust td.chef,.tbl-ajust tr:hover td.chef{background:var(--warn-bg)}
.tbl-ajust input{width:4.2rem;text-align:center;padding:.3rem .25rem;border-color:#E7D59B}
.tbl-ajust input.modifie{border-color:var(--accent-ink);box-shadow:0 0 0 2px var(--accent-soft)}
/* Colonne blanche « Nuits » (demande du médecin pour toute la période) : une cellule fusionnée sur ses mois */
.tbl-ajust td.nuits-dem{font-variant-numeric:tabular-nums;font-weight:500}
.tbl-ajust tbody.md tr:first-child>td.nuits-dem{border-bottom-color:var(--line)}
.tbl-ajust tfoot tr:first-child>td{border-top:2px solid var(--line)}
.tbl-ajust tfoot td:first-child{white-space:normal}
.tbl-ajust tfoot tr.tbl-periode>td{border-top:2px solid var(--line-strong)}   /* total de la période entière */
.tbl-ajust tfoot tr.tbl-periode .mois{color:var(--ink)}
@media (max-width:700px){   /* le tableau défile de côté : le nom du médecin reste en vue, colonnes resserrées */
  .tbl-ajust th,.tbl-ajust td{padding:.4rem .35rem}
  .tbl-ajust .md-nom,.tbl-ajust tfoot td:first-child{position:sticky;left:0;z-index:1;background:var(--surface);width:6.5rem;min-width:6.5rem;overflow-wrap:anywhere}
  .tbl-ajust .md-nom .pill{white-space:normal;border-radius:10px;margin-top:.15rem}   /* une longue pastille (profil, préférence de nuits) n'élargit pas la colonne du nom */
  .tbl-ajust tfoot .tbl-total td:first-child{background:#F7F9F8}
  .tbl-ajust input{width:3.3rem}
}

/* Configuration du solveur (admin/solveur) : fichiers, paramètres de la période, caractéristiques des médecins */
.solv-fichiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem 1.5rem}
.solv-fichiers p{font-size:.88rem;margin:.5rem 0 0}
.solv-recap{margin:0 0 1rem;line-height:1.9}
.solv-recap .btn{margin-left:.5rem}
.solv-params{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:.9rem 1.25rem}
.solv-params .field{margin:0}
.solv-params input[type=number]{max-width:9rem}
.solv-params small{display:block;font-size:.8rem;line-height:1.35;margin-top:.25rem}
.solv-coche{display:flex;gap:.45rem;align-items:center;font-weight:500;margin:1.55rem 0 0}
.solv-outils{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;margin-bottom:.9rem}
.solv-outils .filtre{flex:1 1 220px;margin:0}
.tbl-solv{width:100%}
.tbl-solv th,.tbl-solv td{vertical-align:middle;padding:.4rem .5rem}
.tbl-solv td:nth-child(2){white-space:nowrap;min-width:0}
.tbl-solv .md-nom{font-weight:500;color:var(--ink);font-size:.92rem;white-space:normal;min-width:10rem}
.tbl-solv input[type=number]{width:4rem;text-align:center;padding:.3rem .25rem}
.tbl-solv input[type=number]::placeholder{color:var(--line-strong)}
.tbl-solv select{padding:.3rem .4rem;font-size:.9rem;width:10.5rem;min-width:10.5rem}   /* sans largeur fixe, le tableau large l'écrase */
.tbl-solv .solv-groupe{width:7rem;padding:.3rem .4rem}
.tbl-solv .solv-code{width:5.5rem;padding:.3rem .4rem;text-transform:uppercase}
.tbl-solv .solv-nom{width:9rem;padding:.3rem .4rem}
.tbl-solv tr.solv-neuf td{background:#F7F9F8}
@media (max-width:700px){.tbl-solv .md-nom{position:sticky;left:0;z-index:1;background:var(--surface);min-width:6.5rem}}

@media (prefers-reduced-motion:no-preference){.blk{transition:background .08s,border-color .08s}}
