/* CTA [03/12/2026], AIT TURNOS, stylesheet.
   Own design, no external assets. Person colours follow the plant's paper board: green = weekday staff,
   blue = weekend team, grey = agency. State is never colour only: every state also carries text or an icon. */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1c2530; --muted: #5d6875; --line: #d5dae1; --line2: #e8ebef;
  --brand: #17324d; --accent: #0b6bcb;
  --w: #1f8a4c; --w-bg: #e3f4ea; --f: #0f7fb5; --f-bg: #e0f1fa; --e: #6b7280; --e-bg: #eceef1;
  --bad: #b3261e; --bad-bg: #fde8e6; --warn: #8a5a00; --warn-bg: #fff3d6; --good: #17693a; --good-bg: #e3f4ea;
  --rot-B: #cfe6fb; --rot-G: #d3efc0; --rot-Y: #fdeeb5;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.4; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .good { color: var(--good); } .right { text-align: right; }
[hidden] { display: none !important; }

/* top bar */
.top { display: flex; align-items: center; gap: 1rem; background: var(--brand); color: #fff; padding: .45rem 1rem; flex-wrap: wrap; }
.top .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.top nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.top nav a { color: #d7e2ee; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; white-space: nowrap; }
.top nav a:hover, .top nav a.on { background: rgba(255, 255, 255, .16); color: #fff; }
.top-right { display: flex; align-items: center; gap: .5rem; }
.top-right a { color: #d7e2ee; text-decoration: none; font-size: .8rem; padding: .15rem .35rem; border-radius: 4px; }
.top-right a.on { background: #fff; color: var(--brand); font-weight: 700; }
.top-right .who { font-size: .85rem; margin-left: .5rem; }
.top-right form { margin: 0; }
.linklike { background: none; border: 0; color: #d7e2ee; cursor: pointer; text-decoration: underline; font: inherit; font-size: .85rem; padding: .2rem; }
.pill { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: #e9edf2; color: var(--ink); font-size: .75rem; text-align: center; font-weight: 600; }
.pill.bad, .top .pill { background: var(--bad); color: #fff; }
main { padding: .8rem 1rem 2rem; }

/* generic controls */
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: .4rem .75rem; border-radius: 6px; cursor: pointer; font: inherit; text-decoration: none; min-height: 2.2rem; }
.btn:hover { border-color: #9aa5b3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e1b5b1; }
.btn.small { padding: .2rem .5rem; min-height: 1.8rem; font-size: .85rem; }
input, select, textarea { font: inherit; padding: .35rem .5rem; border: 1px solid #b9c1cc; border-radius: 6px; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible, .chip:focus-visible, td.sk:focus-visible { outline: 3px solid #7fb4ee; outline-offset: 1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-top: .5rem; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.flash { padding: .6rem .8rem; border-radius: 6px; margin-bottom: .8rem; border: 1px solid; white-space: pre-line; }
.flash.ok { background: var(--good-bg); border-color: #a9d9bb; color: var(--good); }
.flash.err { background: var(--bad-bg); border-color: #f0b8b3; color: var(--bad); }
.flash.warn { background: var(--warn-bg); border-color: #ecd08c; color: var(--warn); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; margin-bottom: 1rem; }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .2rem 1rem; }
.formgrid input, .formgrid select { width: 100%; }

/* login */
.login { max-width: 360px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem; }
.login input { width: 100%; }
.login .btn { width: 100%; margin-top: 1rem; }

/* tables */
table.data { border-collapse: collapse; background: var(--panel); width: 100%; }
table.data th, table.data td { border: 1px solid var(--line2); padding: .3rem .5rem; text-align: left; vertical-align: top; }
table.data thead th { background: #eef1f5; position: sticky; top: 0; z-index: 2; font-size: .85rem; }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.kdot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .35em; vertical-align: baseline; }
.kdot.W { background: var(--w); } .kdot.F { background: var(--f); } .kdot.E { background: var(--e); }
.tag { display: inline-block; font-size: .75rem; padding: 0 .4em; border-radius: 4px; border: 1px solid var(--line); background: #f3f5f8; }
.tag.bad { background: var(--bad-bg); border-color: #f0b8b3; color: var(--bad); }
.tag.warn { background: var(--warn-bg); border-color: #ecd08c; color: var(--warn); }
.tag.good { background: var(--good-bg); border-color: #a9d9bb; color: var(--good); }

/* board */
.board-top { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: .5rem; }
.datenav { display: flex; gap: .25rem; align-items: center; }
.day-title { margin: 0; font-size: 1.25rem; text-transform: capitalize; }
.badges { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; }
.badge { font-size: .8rem; padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.badge.bad { background: var(--bad-bg); border-color: #f0b8b3; color: var(--bad); font-weight: 600; }
.badge.good { background: var(--good-bg); border-color: #a9d9bb; color: var(--good); font-weight: 600; }
.badge.type-F, .badge.type-C, .badge.type-V { background: #fbe6d4; border-color: #e9bf99; }
.badge.mode-CLOSED { background: #e5e7eb; }
.badge.rot-B { background: var(--rot-B); } .badge.rot-G { background: var(--rot-G); } .badge.rot-Y { background: var(--rot-Y); }
.actions { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.weekstrip { display: flex; gap: .3rem; margin-bottom: .6rem; flex-wrap: wrap; }
.wday { flex: 1; min-width: 92px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: .25rem .4rem; cursor: pointer; text-align: left; font: inherit; border-left-width: 5px; }
.wday .wd { display: block; font-weight: 600; font-size: .85rem; }
.wday .wm { display: block; font-size: .75rem; color: var(--muted); }
.wday.short { border-left-color: var(--bad); } .wday.short .wm { color: var(--bad); font-weight: 600; }
.wday.full { border-left-color: var(--w); } .wday.closed { border-left-color: #9ca3af; background: #f0f1f3; }
.wday.on { outline: 2px solid var(--accent); }
.board-main { display: flex; gap: .8rem; align-items: flex-start; }
.grid-wrap { flex: 1; min-width: 0; overflow-x: auto; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; table-layout: fixed; min-width: 1180px; }
table.grid thead th { background: #1f2933; color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; padding: .45rem .25rem; border-right: 1px solid #3a4652; }
table.grid th.corner { width: 84px; }
table.grid th.shift { background: #111820; color: #fff; padding: .4rem .3rem; border-top: 1px solid #3a4652; vertical-align: middle; }
table.grid th.shift .sname { display: block; font-size: .9rem; }
table.grid th.shift .stime { display: block; font-size: .72rem; font-weight: 400; color: #c7d0da; }
td.cell { border-right: 1px solid var(--line2); border-top: 1px solid var(--line); padding: .25rem .25rem 1.5rem; vertical-align: top; height: 104px; position: relative; }
td.cell.short { background: var(--bad-bg); }
td.cell.over { background: #fff7e3; }
td.cell.none { background: #f3f4f6; }
td.cell.hot, .pool.hot { outline: 3px dashed var(--accent); outline-offset: -3px; background: #e7f1fd; }
td.cell.target { cursor: copy; }
.cfoot { position: absolute; left: .25rem; right: .25rem; bottom: .2rem; display: flex; justify-content: space-between; align-items: center; gap: .2rem; }
.cov { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.cell.short .cov { color: var(--bad); font-weight: 700; }
td.cell.over .cov { color: var(--warn); font-weight: 600; }
.plus { border: 1px solid var(--line); background: #fff; border-radius: 4px; width: 1.4rem; height: 1.3rem; line-height: 1; cursor: pointer; color: var(--accent); font-weight: 700; padding: 0; margin-left: auto; }
.closed-note { padding: 2rem; text-align: center; background: #eceef1; border-radius: 8px; caption-side: top; }

/* person chips */
.chip { display: flex; align-items: center; gap: .25rem; font-size: .82rem; padding: .18rem .35rem; margin-bottom: .2rem; border-radius: 5px; border: 1px solid; border-left-width: 5px; background: #fff; cursor: grab; user-select: none; overflow: hidden; }
.chip .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .hrs { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chip .hrs.over { color: var(--bad); font-weight: 700; }
.chip .flag { font-size: .8rem; }
.chip.static { display: inline-flex; cursor: default; margin: 0; }
.chip.kind-W { background: var(--w-bg); border-color: var(--w); }
.chip.kind-F { background: var(--f-bg); border-color: var(--f); }
.chip.kind-E { background: var(--e-bg); border-color: var(--e); }
.chip.lvl-err { box-shadow: inset 0 0 0 2px var(--bad); }
.chip.lvl-warn { box-shadow: inset 0 0 0 2px #d9a400; }
.chip.dragging { opacity: .45; }
.chip.picked { outline: 3px solid var(--accent); }
.chip.hot { outline: 3px solid #e2551d; }
.legend { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }

/* side panel */
.side { width: 290px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; position: sticky; top: .5rem; max-height: calc(100vh - 1rem); display: flex; flex-direction: column; }
.tabs { display: flex; gap: .2rem; margin-bottom: .5rem; }
.tab { flex: 1; border: 1px solid var(--line); background: #f3f5f8; border-radius: 6px; padding: .3rem .2rem; cursor: pointer; font: inherit; font-size: .78rem; }
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabpane { overflow-y: auto; min-height: 0; }
.tabpane input[type=search], .tabpane select { width: 100%; }
.filters { display: flex; gap: .2rem; flex-wrap: wrap; margin: .4rem 0; }
.chipbtn { border: 1px solid var(--line); background: #fff; border-radius: 999px; font: inherit; font-size: .75rem; padding: .1rem .5rem; cursor: pointer; }
.chipbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pool { min-height: 120px; margin-top: .5rem; padding: .25rem; border: 1px dashed var(--line); border-radius: 6px; }
.absrow { margin-bottom: .3rem; }
.warnrow { display: block; width: 100%; text-align: left; border: 1px solid; border-radius: 6px; padding: .3rem .45rem; margin-bottom: .3rem; font: inherit; font-size: .82rem; cursor: pointer; }
.warnrow.err { background: var(--bad-bg); border-color: #f0b8b3; color: var(--bad); }
.warnrow.warn { background: var(--warn-bg); border-color: #ecd08c; color: var(--warn); }

/* popover and toast */
.pop { position: absolute; z-index: 50; background: #fff; border: 1px solid #9aa5b3; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: .7rem; width: 300px; max-width: calc(100vw - 16px); }
.pop input { width: 100%; }
.poprow { display: flex; gap: .35rem; margin-top: .6rem; flex-wrap: wrap; }
.popwarn { background: var(--warn-bg); border: 1px solid #ecd08c; border-radius: 6px; padding: .3rem .4rem; font-size: .8rem; white-space: pre-line; margin: .4rem 0; }
.sugrow { display: block; width: 100%; text-align: left; border: 1px solid var(--line2); background: #fff; border-radius: 6px; padding: .3rem; margin-top: .3rem; cursor: pointer; font: inherit; }
.sugrow:hover { border-color: var(--accent); }
.sugrow.weak { background: #faf6ea; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 60; max-width: 90vw; }
.toast.bad { background: var(--bad); }

/* month matrix */
table.matrix { border-collapse: separate; border-spacing: 0; font-size: .78rem; background: var(--panel); }
table.matrix th, table.matrix td { border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: .15rem .2rem; text-align: center; white-space: nowrap; }
table.matrix thead th { position: sticky; top: 0; background: #eef1f5; z-index: 3; }
table.matrix th.pname, table.matrix td.pname { position: sticky; left: 0; background: #fff; text-align: left; z-index: 2; min-width: 150px; border-right: 2px solid var(--line); }
table.matrix thead th.pname { z-index: 4; background: #eef1f5; }
table.matrix td.d a { display: block; text-decoration: none; color: inherit; min-width: 30px; }
table.matrix .off { background: #f0f1f3; } table.matrix .hol { background: #fbe6d4; }
.s-T1 { background: #fff2b8; } .s-T2 { background: #ffd6a8; } .s-T3 { background: #c9d4f5; } .s-T4 { background: #d9f0c2; } .s-T5 { background: #d7c8ee; }
.s-abs { background: #f6c9c5; font-weight: 700; } .s-multi { box-shadow: inset 0 0 0 2px #d9a400; }
.keyrow { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .8rem; margin: .5rem 0; }
.keyrow span { padding: .05rem .4rem; border-radius: 4px; border: 1px solid var(--line2); }

/* capacity heatmap */
table.heat { border-collapse: separate; border-spacing: 0; font-size: .75rem; background: var(--panel); }
table.heat th, table.heat td { border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); padding: .15rem .25rem; text-align: center; white-space: nowrap; }
table.heat thead th { position: sticky; top: 0; background: #eef1f5; z-index: 3; }
table.heat th.rowh { position: sticky; left: 0; background: #fff; text-align: left; z-index: 2; border-right: 2px solid var(--line); }
table.heat thead th.rowh { z-index: 4; background: #eef1f5; }
table.heat td.c-short { background: #f6b3ad; color: #5f0f0a; font-weight: 700; }
table.heat td.c-ok { background: #d3efc0; } table.heat td.c-over { background: #ffe9a8; } table.heat td.c-off { background: #f0f1f3; color: #9aa1ab; }
table.heat td a { color: inherit; text-decoration: none; display: block; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.kpi b { display: block; font-size: 1.4rem; } .kpi.bad b { color: var(--bad); }
.bar { height: .55rem; background: #e8ebef; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--w); } .bar.over i { background: var(--bad); }

/* skill matrix */
table.skills td.sk { text-align: center; cursor: pointer; min-width: 62px; font-size: .78rem; user-select: none; }
table.skills td.sk.l2 { background: #bfe6cd; font-weight: 700; } table.skills td.sk.l1 { background: #fff0bf; }
table.skills td.sk:hover { box-shadow: inset 0 0 0 2px var(--accent); }

/* staff portal */
.mylist { max-width: 640px; }
.myday { display: flex; gap: .7rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-left-width: 6px; border-radius: 8px; padding: .5rem .7rem; margin-bottom: .35rem; }
.myday .dd { width: 96px; font-weight: 600; text-transform: capitalize; } .myday .what { flex: 1; }
.myday.work { border-left-color: var(--accent); } .myday.free { border-left-color: #c5ccd6; color: var(--muted); }
.myday.absd { border-left-color: var(--bad); } .myday.today { box-shadow: 0 0 0 2px var(--accent); }
.myweek { margin: 1rem 0 .3rem; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

@media (max-width: 900px) {
  .board-main { flex-direction: column; } .side { width: 100%; position: static; max-height: none; }
  main { padding: .6rem; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; } main { padding: 0; }
  table.grid { min-width: 0; font-size: 9pt; } td.cell { height: auto; min-height: 60px; }
  .plus { display: none; } .scroll { max-height: none; overflow: visible; border: 0; }
  @page { size: A4 landscape; margin: 10mm; }
}
/* CTA AIT TURNOS */

/* CTA [03/12/2026], AIT TURNOS, weekday checkboxes of the person card */
.wdrow { border: 1px solid #d5dbe3; border-radius: 6px; padding: .4rem .8rem; margin: .4rem 0; max-width: 640px; }
.wdrow legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.wdrow label.inline { margin-right: 1rem; }
/* CTA AIT TURNOS */
