/* Work schedule — a roster that reads like the team's Excel sheet: every member fits on screen, one colour per kind of shift. */
#view-schedule{--sc-head:#3b69a8;--sc-week:#1f2a5a;--sc-line:var(--line-soft);}
#view-schedule .schedule-table-scroll{max-height:calc(100vh - 230px);min-height:0;border:1px solid var(--line);border-radius:12px;background:var(--paper-raised);overflow:auto;margin:6px 0 0;}
#view-schedule .schedule-grid-table{table-layout:fixed;width:100%;min-width:0;border-collapse:separate;border-spacing:0;}
#view-schedule .schedule-grid-table th,#view-schedule .schedule-grid-table td{height:46px;padding:3px 4px;border-right:1px solid var(--sc-line);border-bottom:1px solid var(--sc-line);vertical-align:middle;}
#view-schedule .schedule-grid-table td:last-child,#view-schedule .schedule-grid-table th:last-child{border-right:0;}

/* header */
#view-schedule .schedule-grid-table thead th{position:sticky;top:0;z-index:4;height:44px;padding:6px 4px;background:var(--sc-head);color:#fff;border-right:1px solid rgba(255,255,255,.22);border-bottom:0;text-align:center;font:700 12px/1.2 var(--font-body,inherit);letter-spacing:.02em;}
#view-schedule .schedule-grid-table thead th>span:last-child{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 12px/1.2 var(--font-body,inherit);color:#fff;text-transform:none;}
#view-schedule .schedule-person-initial{display:none;}
#view-schedule .schedule-date-head{width:152px;text-align:left!important;padding-left:14px!important;}

/* week banner */
#view-schedule .schedule-week-row th{position:sticky;top:44px;z-index:3;height:34px;padding:0 14px;background:var(--sc-week);color:#fff;text-align:left;font:700 12.5px var(--font-body,inherit);letter-spacing:.02em;border:0;}
#view-schedule .schedule-week-row th span{margin-right:10px;color:rgba(255,255,255,.55);font:700 10px var(--font-mono,monospace);letter-spacing:.16em;}

/* date column */
#view-schedule .schedule-date-cell{min-width:0!important;width:152px;position:sticky;left:0;z-index:2;display:table-cell;padding:3px 10px 3px 14px!important;background:var(--paper-raised);text-align:left;white-space:nowrap;}
#view-schedule .schedule-date-cell span{display:inline-block;width:34px;color:var(--ink-soft);font:700 11px var(--font-mono,monospace);letter-spacing:.06em;text-transform:uppercase;}
#view-schedule .schedule-date-cell b{display:inline-block;min-width:24px;margin-right:4px;color:var(--ink);font:700 17px var(--font-body,inherit);}
#view-schedule .schedule-date-cell small{color:var(--ink-soft);font:600 11px var(--font-body,inherit);text-transform:uppercase;}
#view-schedule .schedule-date-cell em{display:inline-block;margin-left:4px;padding:1px 7px;border-radius:999px;background:var(--sc-head);color:#fff;font:700 9px var(--font-body,inherit);font-style:normal;letter-spacing:.08em;text-transform:uppercase;vertical-align:middle;}
#view-schedule .schedule-day-row.is-weekend .schedule-date-cell{background:color-mix(in srgb,var(--sc-head) 9%,var(--paper-raised));}
#view-schedule .schedule-day-row.is-weekend td{background-image:linear-gradient(rgba(120,130,150,.05),rgba(120,130,150,.05));}
#view-schedule .schedule-day-row.is-today .schedule-date-cell{box-shadow:inset 4px 0 0 var(--sc-head);background:color-mix(in srgb,var(--sc-head) 12%,var(--paper-raised));}
#view-schedule .schedule-day-row.is-today td{box-shadow:inset 0 1px 0 var(--sc-head),inset 0 -1px 0 var(--sc-head);}

/* shifts: the whole cell is the colour, like the sheet */
#view-schedule .schedule-shift{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;width:100%;min-height:38px;padding:4px 3px;border:0;border-radius:6px;box-sizing:border-box;font:600 11.5px/1.25 var(--font-body,inherit);letter-spacing:-.01em;text-align:center;white-space:nowrap;}
#view-schedule .schedule-shift i{display:none;}
#view-schedule .schedule-shift b{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;font-weight:700;}
#view-schedule .schedule-shift small{display:block;margin-top:1px;font:700 9.5px var(--font-body,inherit);letter-spacing:.08em;text-transform:uppercase;opacity:.85;}
#view-schedule .schedule-shift.is-on{background:rgba(59,105,168,.13);color:var(--ink);}
#view-schedule .schedule-shift.is-on.shift-morning,#view-schedule .schedule-shift.is-on.shift-day{background:rgba(59,105,168,.14);}
#view-schedule .schedule-shift.is-on.shift-late{background:rgba(34,160,90,.22);color:#14683a;}
#view-schedule .schedule-shift.is-on.shift-custom{background:rgba(124,58,237,.14);color:#5b2bb5;}
#view-schedule .schedule-shift.is-home{box-shadow:inset 0 0 0 1.5px rgba(214,126,16,.55);}
#view-schedule .schedule-shift.is-home small{color:#b86a0a;}
#view-schedule .schedule-shift.is-off{background:rgba(120,128,140,.16);color:var(--ink-soft);}
#view-schedule .schedule-shift.is-off.is-leave{background:rgba(245,158,66,.30);color:#9a4d06;}
#view-schedule .schedule-shift.is-off.is-holiday{background:rgba(250,204,21,.45);color:#b42318;}
#view-schedule .schedule-shift.is-off.is-offsite{background:rgba(100,116,139,.28);color:var(--ink);}
#view-schedule .schedule-shift.is-empty{background:transparent;color:var(--ink-faint,#9aa3a0);font-weight:400;}
#view-schedule .schedule-edit-cell select{width:100%;min-width:0;padding:5px 4px;font-size:11.5px;}

/* key */
#view-schedule .schedule-legend.schedule-legend-keys{flex-wrap:wrap;gap:8px;padding:10px 4px 6px;font-size:11px;}
#view-schedule .schedule-legend-keys .key{display:inline-flex;align-items:center;padding:3px 11px;border-radius:6px;font:700 11px var(--font-body,inherit);color:var(--ink);}
#view-schedule .key-day{background:rgba(59,105,168,.16);}
#view-schedule .key-late{background:rgba(34,160,90,.24);color:#14683a;}
#view-schedule .key-wfh{background:rgba(124,58,237,.14);color:#5b2bb5;}
#view-schedule .key-home{background:transparent;box-shadow:inset 0 0 0 1.5px rgba(214,126,16,.6);color:#b86a0a;}
#view-schedule .key-off{background:rgba(120,128,140,.18);color:var(--ink-soft);}
#view-schedule .key-leave{background:rgba(245,158,66,.32);color:#9a4d06;}
#view-schedule .key-holiday{background:rgba(250,204,21,.5);color:#b42318;}
#view-schedule .key-empty{background:transparent;box-shadow:inset 0 0 0 1px var(--line);color:var(--ink-soft);font-weight:500;}
#view-schedule .schedule-legend-keys small{margin-left:auto;}

@media(max-width:900px){#view-schedule .schedule-table-scroll{max-height:none;}#view-schedule .schedule-date-head,#view-schedule .schedule-date-cell{width:104px;}}

/* refinement: a touch larger, softer colour edges, hover, nicer header */
#view-schedule .schedule-table-scroll{border-radius:14px;box-shadow:0 6px 22px rgba(20,30,55,.07);}
#view-schedule .schedule-grid-table th,#view-schedule .schedule-grid-table td{height:58px;padding:5px 4px;}
#view-schedule .schedule-grid-table thead th{height:52px;padding:8px 6px;font-size:13px;background:linear-gradient(180deg,#437bc2,#355f9c);}
#view-schedule .schedule-grid-table thead th>span:last-child{display:block;max-width:100%;font-size:13px;}
#view-schedule .schedule-person-initial{display:none;}
#view-schedule .schedule-week-row th{top:52px;height:40px;font-size:13.5px;background:linear-gradient(90deg,#1c2656,#27346f);}
#view-schedule .schedule-date-head,#view-schedule .schedule-date-cell{width:158px;}
#view-schedule .schedule-date-cell b{min-width:28px;font-size:20px;}
#view-schedule .schedule-date-cell span{width:38px;font-size:11.5px;}
#view-schedule .schedule-date-cell small{font-size:11.5px;}
#view-schedule .schedule-day-row:hover td{background-image:linear-gradient(rgba(59,105,168,.06),rgba(59,105,168,.06));}
#view-schedule .schedule-shift{--acc:#3b69a8;min-height:46px;padding:6px 3px 6px 8px;border-radius:10px;font:650 12px/1.25 var(--font-body,inherit);letter-spacing:-.02em;box-shadow:inset 3px 0 0 var(--acc);transition:transform .12s,box-shadow .12s;}
#view-schedule .schedule-shift:hover{transform:translateY(-1px);box-shadow:inset 3px 0 0 var(--acc),0 3px 10px rgba(20,30,55,.12);}
#view-schedule .schedule-shift small{font-size:10px;margin-top:2px;}
#view-schedule .schedule-shift.is-on.shift-late{--acc:#22a05a;}
#view-schedule .schedule-shift.is-on.shift-custom{--acc:#7c3aed;}
#view-schedule .schedule-shift.is-off{--acc:#8a93a3;}
#view-schedule .schedule-shift.is-off.is-leave{--acc:#f59e42;}
#view-schedule .schedule-shift.is-off.is-holiday{--acc:#eab308;}
#view-schedule .schedule-shift.is-off.is-offsite{--acc:#64748b;background:rgba(100,116,139,.22);color:var(--ink);}
#view-schedule .schedule-shift.is-home{box-shadow:inset 3px 0 0 var(--acc),0 0 0 1.5px rgba(214,126,16,.55);}
#view-schedule .schedule-shift.is-home:hover{box-shadow:inset 3px 0 0 var(--acc),0 0 0 1.5px rgba(214,126,16,.7),0 3px 10px rgba(20,30,55,.12);}
#view-schedule .schedule-shift.is-empty{box-shadow:none;}
#view-schedule .schedule-shift.is-empty:hover{transform:none;box-shadow:none;}
#view-schedule .schedule-legend.schedule-legend-keys{padding:12px 4px 8px;}
#view-schedule .schedule-legend-keys .key{padding:4px 13px;border-radius:8px;font-size:11.5px;}

/* medium screens: tighter so all members still fit */
@media(max-width:1340px){#view-schedule .schedule-date-head,#view-schedule .schedule-date-cell{width:138px;}#view-schedule .schedule-date-cell span{width:32px;}#view-schedule .schedule-date-cell em{display:none;}#view-schedule .schedule-shift{padding:6px 3px 6px 6px;font-size:11.5px;}#view-schedule .schedule-grid-table thead th{font-size:12px;}#view-schedule .schedule-person-initial{display:none;}}

/* dark theme: lighter text so every shift stays readable */
:root[data-theme="dark"] #view-schedule .schedule-shift.is-on.shift-late,:root[data-theme="dark"] #view-schedule .key-late{color:#7ee7a8;background:rgba(34,160,90,.30);}
:root[data-theme="dark"] #view-schedule .schedule-shift.is-on.shift-custom{color:#c9b8ff;}
:root[data-theme="dark"] #view-schedule .key-wfh{color:#c9b8ff;}
:root[data-theme="dark"] #view-schedule .schedule-shift.is-home small,:root[data-theme="dark"] #view-schedule .key-home{color:#fbbf4d;}
:root[data-theme="dark"] #view-schedule .schedule-shift.is-off.is-leave,:root[data-theme="dark"] #view-schedule .key-leave{color:#fdc388;background:rgba(245,158,66,.30);}
:root[data-theme="dark"] #view-schedule .schedule-shift.is-off.is-holiday,:root[data-theme="dark"] #view-schedule .key-holiday{color:#fde047;background:rgba(250,204,21,.24);}
:root[data-theme="dark"] #view-schedule .schedule-shift.is-on{background:rgba(96,140,210,.22);}
@media(prefers-color-scheme:dark){
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-on.shift-late,:root:not([data-theme="light"]) #view-schedule .key-late{color:#7ee7a8;background:rgba(34,160,90,.30);}
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-on.shift-custom{color:#c9b8ff;}
:root:not([data-theme="light"]) #view-schedule .key-wfh{color:#c9b8ff;}
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-home small,:root:not([data-theme="light"]) #view-schedule .key-home{color:#fbbf4d;}
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-off.is-leave,:root:not([data-theme="light"]) #view-schedule .key-leave{color:#fdc388;background:rgba(245,158,66,.30);}
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-off.is-holiday,:root:not([data-theme="light"]) #view-schedule .key-holiday{color:#fde047;background:rgba(250,204,21,.24);}
:root:not([data-theme="light"]) #view-schedule .schedule-shift.is-on{background:rgba(96,140,210,.22);}
}

#view-schedule .schedule-date-cell em{padding:1px 6px;font-size:8.5px;}
