/* Planning: team × day grid, phone "équipe du jour" view and the shift dialog. */
#planning-view-toolbar { margin-bottom:20px; }
#planning-view-toolbar[hidden], #planning-month[hidden] { display:none!important; }
#planning-view-toolbar [aria-pressed="true"] { outline:2px solid var(--rota-chip, #5fd0d6); outline-offset:2px; }
#rota-loaded.planning-month-active > :not(#planning-view-toolbar):not(#planning-month):not(#industry-team) { display:none!important; }
.planning-month-scroll { overflow:auto; max-height:70vh; margin-top:20px; border:1px solid var(--rota-line); border-radius:12px; }
.planning-month-table { border-collapse:separate; border-spacing:0; font-size:12px; width:max-content; min-width:100%; }
.planning-month-table th,.planning-month-table td { padding:6px; border-right:1px solid var(--rota-line); border-bottom:1px solid var(--rota-line); min-width:85px; vertical-align:top; }
.planning-month-table thead th { position:sticky; top:0; z-index:2; background:#162235; }
.planning-month-table tr>th:first-child { position:sticky; left:0; min-width:140px; max-width:180px; z-index:1; background:#111c2b; text-align:left; }
.planning-month-table thead th:first-child { z-index:3; }
.planning-month-table small { display:block; margin-top:4px; font-size:10px; color:var(--muted); }
.planning-month-entry { display:block; width:100%; border:1px solid var(--rota-chip,#5fd0d6); background:rgba(95,208,214,.12); color:var(--text); font:inherit; padding:7px 4px; margin-bottom:4px; border-radius:7px; cursor:pointer; }
.planning-month-entry.is-absence { border-color:var(--rota-warn,#f5c15c); background:rgba(245,193,92,.13); }
.planning-month-empty { color:var(--dim); }
.planning-month-conflict { color:var(--rota-bad,#ff7a86); }
.planning-month-total { white-space:nowrap; }
.planning-options { margin:16px 0; padding:16px; border:1px solid var(--rota-line, #536074); border-radius:12px; background:var(--rota-cell, transparent); color:var(--text); }
.planning-actions, .planning-fields { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.planning-options label, .planning-dialog label { display:flex; flex-direction:column; gap:6px; font-size:13px; }
.planning-options input, .planning-options select, .planning-dialog input, .planning-dialog select { font:inherit; padding:10px; border:1px solid var(--rota-line, #697386); border-radius:8px; background:var(--bg, #142033); color:var(--text, #fff); min-width:0; }
.planning-hint { font-size:12px; line-height:1.6; color:var(--muted); margin:12px 0; }
.planning-options summary { cursor:pointer; padding:10px 0; font-weight:600; }
.planning-need, .planning-absence-list>div { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--rota-line); }
.planning-need.is-missing { color:var(--rota-warn, #f5c15c); }
.rota-absence { background:color-mix(in srgb, var(--rota-warn, #f5c15c) 16%, transparent); border:1px solid var(--rota-warn, #f5c15c); color:var(--text, #eee); padding:8px; border-radius:8px; font:inherit; font-size:12px; cursor:pointer; }
.rota-absence:disabled { opacity:1; cursor:default; }
.planning-dialog { width:min(440px,calc(100vw - 32px)); box-sizing:border-box; border:1px solid #536074; border-radius:16px; padding:24px; background:var(--bg, #142033); color:var(--text, #fff); max-height:90vh; overflow:auto; }
.planning-dialog::backdrop { background:rgba(5,10,20,.7); }
.planning-dialog h2 { margin-top:0; }
.planning-dialog p { font-size:13px; line-height:1.5; }
.planning-dialog label { margin:12px 0; }
#planning-dialog-error, #planning-need-error { color:var(--rota-bad, #ff7a86); }
@media(max-width:600px) { .planning-fields>label { flex:1 1 120px; } .planning-fields>label input { width:100%; box-sizing:border-box; } .planning-need>span { flex-basis:100%; } .planning-options { padding:12px; } }
#panel-rota { --rota-line:rgba(160,180,215,.16); --rota-cell:rgba(255,255,255,.025); --rota-head:rgba(255,255,255,.05); --rota-ok:#5ed39a; --rota-warn:#f5c15c; --rota-bad:#ff7a86; --rota-chip:var(--c-aqua,#5fd0d6); }
#panel-rota .rota-toolbar-hint { color:var(--dim); font-size:12px; }

#panel-rota .rota-matrix-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
#panel-rota .rota-week-grid.rota-matrix { display:grid!important; grid-template-columns:minmax(150px,180px) repeat(var(--rota-cols,7),minmax(118px,1fr)) 96px!important; min-width:calc(280px + var(--rota-cols,7) * 118px); gap:0; padding:0; background:transparent; overflow:visible; }
#panel-rota .rota-week-grid.rota-matrix.single-day { grid-template-columns:minmax(150px,200px) minmax(220px,1fr) 110px!important; min-width:0; }
#panel-rota .rota-mh,#panel-rota .rota-mp,#panel-rota .rota-cell,#panel-rota .rota-mt,#panel-rota .rota-mf { border-bottom:1px solid var(--rota-line); padding:10px; min-width:0; }
#panel-rota .rota-mh { background:var(--rota-head); display:flex; flex-direction:column; gap:3px; color:var(--muted); font-size:12px; position:sticky; top:0; z-index:1; }
#panel-rota .rota-mh strong { color:var(--text); font-size:13px; }
#panel-rota .rota-mh strong span { color:var(--muted); font-weight:500; margin-left:3px; }
#panel-rota .rota-mh small { font-size:11.5px; font-variant-numeric:tabular-nums; }
#panel-rota .rota-mh-team,#panel-rota .rota-mh-total { justify-content:flex-end; font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
#panel-rota .rota-mp { display:flex; flex-direction:column; justify-content:center; gap:2px; border-right:1px solid var(--rota-line); }
#panel-rota .rota-mp strong { font-size:14px; color:var(--text); overflow-wrap:anywhere; }
#panel-rota .rota-mp small { color:var(--dim); font-size:11.5px; }
#panel-rota .rota-cell { position:relative; display:flex; flex-direction:column; gap:5px; min-height:68px; border-right:1px solid var(--rota-line); background:var(--rota-cell); cursor:pointer; padding:6px; transition:background .15s; }
#panel-rota .rota-cell.is-locked { cursor:default; }
#panel-rota .rota-cell:not(.is-locked):hover { background:rgba(143,175,230,.09); }
#panel-rota .rota-cell-add { margin:auto; width:30px; height:30px; border-radius:50%; border:1px dashed var(--rota-line); background:transparent; color:var(--dim); font-size:17px; line-height:1; cursor:pointer; opacity:.35; transition:opacity .15s,border-color .15s; }
#panel-rota .rota-cell:hover .rota-cell-add,#panel-rota .rota-cell-add:focus-visible { opacity:1; border-color:var(--rota-chip); color:var(--text); }
#panel-rota .rota-cell:has(.rota-cell-chip) .rota-cell-add { margin:0 auto; width:24px; height:24px; font-size:14px; }
#panel-rota .rota-mt { display:flex; flex-direction:column; justify-content:center; gap:2px; font-variant-numeric:tabular-nums; }
#panel-rota .rota-mt strong { font-size:15px; }
#panel-rota .rota-mt small { font-size:11px; color:var(--dim); }
#panel-rota .rota-mt.is-ok strong { color:var(--rota-ok); }
#panel-rota .rota-mt.is-near strong { color:var(--rota-warn); }
#panel-rota .rota-mt.is-over strong { color:var(--rota-bad); }
#panel-rota .rota-mf { background:var(--rota-head); border-bottom:0; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
#panel-rota .rota-matrix-empty { grid-column:1 / -1; }

/* Shift chip (grid and phone cards) */
html .manager-polished #panel-rota .rota-shift-chip.rota-cell-chip { position:relative; display:flex; flex-direction:row; align-items:stretch; gap:0; padding:0; border-radius:8px; border:1px solid color-mix(in srgb,var(--rota-chip) 38%,transparent)!important; border-left:3px solid var(--rota-chip)!important; background:color-mix(in srgb,var(--rota-chip) 13%,rgba(10,16,28,.72))!important; box-shadow:none; }
html .manager-polished #panel-rota .rota-shift-chip.rota-cell-chip.is-flagged { border-color:var(--rota-bad)!important; border-left-color:var(--rota-bad)!important; }
#panel-rota .rota-chip-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; text-align:left; background:none; border:0; color:inherit; padding:6px 4px 6px 8px; cursor:pointer; font:inherit; }
#panel-rota .rota-chip-main:disabled { cursor:default; }
#panel-rota .rota-cell-chip .rota-shift-name { font-size:12px; font-weight:650; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#panel-rota .rota-cell-chip .rota-shift-time { font-size:12px; color:var(--text); font-variant-numeric:tabular-nums; opacity:.9; }
#panel-rota .rota-cell-chip .rota-shift-time small { color:var(--rota-warn); font-size:10px; }
#panel-rota .rota-cell-chip .rota-shift-del { position:static; opacity:.55; width:26px; flex:none; background:none; border:0; color:var(--muted); font-size:16px; cursor:pointer; border-radius:0 8px 8px 0; }
#panel-rota .rota-cell-chip .rota-shift-del:hover { opacity:1; color:var(--rota-bad); }

/* Alerts */
#panel-rota .rota-alerts { display:grid; gap:6px; padding:14px 16px 4px; }
#panel-rota .rota-alerts:empty { display:none; }
#panel-rota .rota-alert { margin:0; font-size:13px; padding:9px 12px; border-radius:10px; border:1px solid; }
#panel-rota .rota-alert.is-bad { color:#ffd3d7; background:rgba(255,122,134,.09); border-color:rgba(255,122,134,.32); }
#panel-rota .rota-alert.is-warn { color:#ffe7b8; background:rgba(245,193,92,.08); border-color:rgba(245,193,92,.3); }
#panel-rota .rota-alert.is-good { color:#c9f3dd; background:rgba(94,211,154,.08); border-color:rgba(94,211,154,.28); }
html:not(.dark) #panel-rota .rota-alert.is-bad { color:#9f1239; }
html:not(.dark) #panel-rota .rota-alert.is-warn { color:#92400e; }
html:not(.dark) #panel-rota .rota-alert.is-good { color:#166534; }

/* Phone: one day as cards */
#panel-rota .rota-today { display:none; }
#panel-rota .rota-strip { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
#panel-rota .rota-strip button { display:flex; flex-direction:column; align-items:center; gap:1px; padding:7px 0; min-height:48px; border-radius:11px; border:1px solid var(--rota-line); background:var(--rota-cell); color:var(--muted); font:inherit; font-size:11px; cursor:pointer; }
#panel-rota .rota-strip button strong { color:var(--text); font-size:15px; }
#panel-rota .rota-strip button[aria-pressed="true"] { background:color-mix(in srgb,var(--rota-chip) 30%,transparent); border-color:var(--rota-chip); color:var(--text); }
#panel-rota .rota-today-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
#panel-rota .rota-today .rota-cell-chip .rota-chip-main { padding:12px 6px 12px 14px; }
#panel-rota .rota-today .rota-cell-chip .rota-shift-name { font-size:15px; }
#panel-rota .rota-today .rota-cell-chip .rota-shift-time { font-size:14px; }
#panel-rota .rota-today .rota-cell-chip .rota-shift-role { font-size:12px; color:var(--dim); }
#panel-rota .rota-today .rota-cell-chip .rota-shift-del { width:48px; font-size:20px; }
#panel-rota .rota-today-add { min-height:48px; }
#panel-rota .rota-today .rota-day-empty { margin:18px 0; }
@media (max-width:760px) {
  #panel-rota .rota-matrix-wrap,#panel-rota .rota-toolbar { display:none!important; }
  #panel-rota .rota-today { display:flex; flex-direction:column; gap:10px; padding:14px; }
  #panel-rota .rota-alerts { padding:0 14px 14px; }
}

/* Dialog: the global margin reset in dashboard.css removes the browser's centring. */
.rota-shift-dialog { margin:auto; inset:0; width:min(560px,calc(100vw - 24px)); max-height:90dvh; overflow:auto; padding:0; border-radius:16px; border:1px solid rgba(160,180,215,.28); background:#121826; color:var(--text,#eef1f8); box-shadow:0 24px 80px rgba(0,0,0,.55); }
.rota-shift-dialog::backdrop { background:rgba(3,6,12,.55); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
html:not(.dark) .rota-shift-dialog { background:#fff; }
#panel-rota .rota-shift-dialog .rota-add-shift-form { padding:22px; background:transparent!important; border:0!important; display:flex; flex-direction:column; gap:14px; }
.rota-dialog-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.rota-dialog-kicker { color:var(--muted); font-size:12.5px; }
.rota-shift-dialog .rota-form-title { margin:2px 0 0; font-size:20px; }
.rota-dialog-close { width:40px; height:40px; flex:none; border-radius:10px; border:1px solid rgba(160,180,215,.28); background:transparent; color:inherit; font-size:20px; cursor:pointer; }
.rota-presets { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; }
.rota-preset { display:flex; flex-direction:column; gap:2px; text-align:left; padding:11px 12px; min-height:52px; border-radius:11px; border:1px solid rgba(160,180,215,.24); background:rgba(255,255,255,.04); color:inherit; font:inherit; cursor:pointer; }
.rota-preset:hover,.rota-preset:focus-visible { border-color:var(--c-aqua,#5fd0d6); background:rgba(95,208,214,.1); }
.rota-preset strong { font-size:14px; }
.rota-preset small { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
#panel-rota .rota-shift-dialog .rota-form-hint { margin:0; }
#panel-rota .rota-shift-dialog .rota-form-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#panel-rota .rota-shift-dialog .rota-form-field--role { grid-column:1 / -1; }
.rota-dialog-msg { margin:0; min-height:1em; color:var(--rota-bad,#ff7a86); font-size:13px; }
.rota-dialog-msg:empty { display:none; }
.rota-dialog-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.rota-dialog-actions .rota-dialog-delete { margin-right:auto; color:#ff8a8a; }
@media (max-width:600px) {
  #panel-rota .rota-shift-dialog .rota-form-row { grid-template-columns:1fr 1fr; }
  .rota-dialog-actions .btn { flex:1; min-height:46px; }
  .rota-dialog-actions .rota-dialog-delete { flex-basis:100%; margin-right:0; order:3; }
}

#panel-rota .planning-month-table tr > th:first-child { position:sticky!important; left:0; width:140px; min-width:140px!important; background:#111c2b!important; z-index:5; }
#panel-rota .planning-month-table thead th:first-child { z-index:6; }
.planning-proposal-dialog { width:min(760px,calc(100vw - 24px)); margin:auto; inset:0; }
.planning-proposal-people { max-height:38vh; overflow:auto; margin:16px 0; }
.planning-proposal-people fieldset { margin:8px 0; padding:12px; border:1px solid #536074; border-radius:10px; }
.planning-dialog .planning-role-choice { flex-direction:row; align-items:center; }
.planning-role-choice input { width:18px; height:18px; }
#planning-proposal-result { max-height:30vh; overflow:auto; font-size:13px; line-height:1.8; }
#planning-proposal-result ul { padding-left:20px; }
#planning-month .planning-actions label { display:flex; gap:8px; align-items:center; }
