/* Macrolab website. One stylesheet, no framework, no external fonts. */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --ink: #1c1f23;
    --ink-muted: #5d6673;
    --line: #d8dde4;
    --accent: #00857d;          /* teal, distinct from the "someone else" grey */
    --accent-ink: #ffffff;
    --own: #00857d;
    --other: #8892a0;
    --danger: #a4291f;
    --warn-bg: #fff4e5;
    --ok-bg: #e8f5ee;
    --err-bg: #fdecea;
    --weekend-bg: #e9ecef;      /* day sheet cells on Saturday and Sunday */
    --weekend-alt: #dfe3e7;     /* ... every other row of them */
    --row-alt: #eaf5f3;         /* every other row of a striped table: a light green */
    --accent-hover: #006b64;
    --radius: 6px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171a;
        --surface: #1d2126;
        --ink: #e8eaed;
        --ink-muted: #9aa4b0;
        --line: #333a42;
        --accent: #35b3a8;
        --accent-ink: #06221f;
        --own: #35b3a8;
        --other: #6d7783;
        --danger: #e8776c;
        --warn-bg: #3a2f1c;
        --ok-bg: #17322a;
        --err-bg: #3a1f1d;
        --weekend-bg: #2c3138;
        --weekend-alt: #333941;
        --row-alt: #1c2a29;
        --accent-hover: #4cc4b9;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ------------------------------------------------------------- chrome ---- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; color: var(--ink); text-decoration: none; }

.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar .who { color: var(--ink-muted); }

/* The second row of tabs on the Administration pages, under the top bar. */
.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.25rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

/* The destinations as tabs; the current page's is bold, in the accent colour,
   with a bar under it (aria-current, set in layout.php). The hidden bold copy
   of the label (::after) reserves the bold width, so tabs do not shift when
   the current one changes. */
a.tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.2rem 0.1rem;
    border-bottom: 3px solid transparent;
    color: var(--ink);
    text-decoration: none;
}
a.tab::after {
    content: attr(data-label);
    height: 0;
    overflow: hidden;
    visibility: hidden;
    font-weight: 600;
}
a.tab:hover { border-bottom-color: var(--line); }
a.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.tab[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }

footer {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card.narrow { max-width: 26rem; margin-inline: auto; }

h1 { font-size: 1.4rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
h2:first-of-type { margin-top: 0.5rem; }
h3 { font-size: 0.95rem; margin: 1.25rem 0 0.25rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }

pre { overflow-x: auto; background: var(--bg); padding: 0.6rem 0.8rem; border-radius: var(--radius); }

.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

/* -------------------------------------------------------------- forms ---- */
label { display: block; margin: 0.75rem 0 0.25rem; font-weight: 500; }
label.check { display: flex; gap: 0.4rem; align-items: center; font-weight: 400; }

input[type="text"], input[type="password"], input[type="number"],
input[type="time"], input[type="datetime-local"], select, textarea {
    width: 100%;
    max-width: 24rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 1rem 0;
    padding: 0.5rem 1rem 1rem;
}

legend { padding: 0 0.4rem; font-weight: 600; }

.checkrow { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* The hidden attribute always wins. Rules that set display - buttons below,
   for one - would otherwise keep a "hidden" element on screen. */
[hidden] { display: none !important; }

button, .button {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

button.primary, .button.primary {
    margin-top: 1rem;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.button.block { display: block; text-align: center; }

button.link {
    border: 0;
    background: none;
    padding: 0.15rem 0;
    color: var(--accent);
    text-decoration: underline;
}

button.danger, button.link.danger { color: var(--danger); }

form.inline { display: inline; }
/* A filter form: each field a box with its label above it, in a grid that
   fills the width and stacks on a narrow screen; the button on its own line.
   Used by the time overview. */
.filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.9rem 1.5rem;
    align-items: end;
}
.filter-field label { margin: 0 0 0.3rem; }
.filter-field select { width: 100%; max-width: none; }
.filter-actions { margin-top: 1.1rem; }
.filter-actions button.primary { margin-top: 0; }

/* The same filter on one line, the button at its right end; it wraps on a
   narrow screen. */
.filter-line .filter-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.25rem; }
.filter-line .filter-field { flex: 0 0 auto; }
.filter-line .filter-field select { width: auto; min-width: 11rem; max-width: 18rem; }
.filter-line .filter-actions { margin-top: 0; }
/* Room between the filter and the entries it selects. */
.filter-line { margin-bottom: 1.25rem; }

/* A table that shows a few rows at a time and scrolls the rest, with its
   header kept in view. app.js sizes it to exactly data-visible-rows rows;
   the max-height here is the fallback without it. */
.table-scroll {
    max-height: 17rem;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.table-scroll table { margin: 0; min-width: 40rem; } /* narrow screens scroll sideways rather than squeeze */
/* A scrollbar that is always there. Windows 11 browsers otherwise show an
   "overlay" scrollbar only while the pointer is over the box, and then
   nothing says the list goes on. Styling it makes Chromium-based browsers
   (Edge, Chrome) draw a permanent one; Firefox gets its standard thin one. */
.table-scroll::-webkit-scrollbar { width: 12px; }
.table-scroll::-webkit-scrollbar-track { background: var(--bg); border-left: 1px solid var(--line); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--ink-muted); border-radius: 6px; border: 3px solid var(--bg); }
@supports (-moz-appearance: none) {
    .table-scroll { scrollbar-width: thin; scrollbar-color: var(--ink-muted) var(--bg); }
}
.table-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

form.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
form.row label { margin: 0 0 0.2rem; }
form.row > * { flex: 0 1 auto; }
form.row button.primary { margin-top: 0; }

.divider { text-align: center; color: var(--ink-muted); margin: 1rem 0 0.5rem; }

/* ------------------------------------------------------------ messages --- */
.flash, .alert {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    margin: 0 0 1rem;
}

.flash-success { background: var(--ok-bg); }
.flash-info { background: var(--surface); }
.alert, .flash-error { background: var(--err-bg); }
.alert-inline { color: var(--danger); font-size: 0.85rem; }

/* "Choose the equipment first" above the booking calendar: red on pale red, with
   a matching border, so it is seen at once. Both shades follow dark mode. */
.calendar-notice {
    color: var(--danger);
    background: var(--err-bg);
    border-color: var(--danger);
    font-weight: 600;
}

/* -------------------------------------------------------------- tables --- */
table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-muted); }
.row-suspended td, .row-cancelled td { opacity: 0.55; }
td.actions { white-space: nowrap; }
td.detail { font-size: 0.8rem; color: var(--ink-muted); word-break: break-word; max-width: 22rem; }

.wide { display: block; overflow-x: auto; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
dl.facts dt { color: var(--ink-muted); }
dl.facts dd { margin: 0; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

/* ------------------------------------------------------------ calendar --- */
/* Under the calendar, centred. */
.legend { display: flex; justify-content: center; gap: 1rem; list-style: none; margin: 0.75rem 0 0; padding: 0; font-size: 0.85rem; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; vertical-align: middle; }
.swatch.own { background: var(--own); }
.swatch.other { background: var(--other); }

/* In the booking dialog, under Purpose. */
.rules-summary { margin: 0.6rem 0 0; }

/* A date input beside the 24h time dropdown that goes with it. */
.when { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
/* Day-first date fields (date_field() in helpers.php): the text field, a
   calendar button, and the browser's date input kept out of sight but
   rendered, because showPicker() refuses a hidden input. */
.date-field { position: relative; display: inline-flex; align-items: center; gap: 0.3rem; }
input[type="text"].date-text { width: 8.5rem; max-width: 8.5rem; }
.date-native {
    position: absolute; left: 0; bottom: 0;
    width: 1px; height: 1px; padding: 0; border: 0;
    opacity: 0; pointer-events: none;
}
.date-pick { padding: 0.45rem 0.55rem; line-height: 0; }
.date-pick:disabled { opacity: 0.5; cursor: default; }
.when select { width: auto; }
.when-echo { margin: 0.25rem 0 0; }

#calendar { margin-top: 0.5rem; }

/* Own bookings carry the accent colour; everyone else's are neutral, so the
   calendar answers "what is mine" at a glance. */
.fc-event.booking-own { background: var(--own); border-color: var(--own); color: #fff; }
.fc-event.booking-other { background: var(--other); border-color: var(--other); color: #fff; }

/* The toolbar's middle: the equipment picker, then the dates shown. It takes
   the room between the buttons; on a narrow screen the picker wraps above
   the dates. */
.fc .fc-header-toolbar { flex-wrap: wrap; gap: 0.5rem; }
.fc .fc-toolbar-chunk:nth-child(2) {
    flex: 1 1 12rem; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.75rem;
}
.fc .fc-toolbar-title { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
#equipment { width: auto; max-width: 100%; min-width: 10rem; }

dialog {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    max-width: 28rem;
    width: calc(100% - 2rem);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog menu { display: flex; gap: 0.5rem; justify-content: flex-end; margin: 1.25rem 0 0; padding: 0; }
dialog menu button.primary { margin-top: 0; }
dialog dl.facts { margin: 0.25rem 0 0.5rem; }

/* -------------------------------------------------------------- extras --- */
.invite { border: 1px solid var(--accent); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 1rem 0; }
.invite-link { width: 100%; max-width: none; font-family: ui-monospace, monospace; font-size: 0.85rem; }


.qr { margin: 1rem 0; max-width: 240px; }
.qr svg { width: 100%; height: auto; background: #fff; padding: 0.5rem; border-radius: var(--radius); }

.secret { display: inline-block; padding: 0.2rem 0.4rem; background: var(--bg); border-radius: 3px; word-break: break-all; }

ul.codes { columns: 2; list-style: none; padding: 0; }
ul.codes li { margin: 0.2rem 0; }

.inline-edit { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.inline-edit input { max-width: 11rem; font-size: 0.85rem; padding: 0.3rem; }

.pager { display: flex; gap: 1rem; align-items: center; }

@media (max-width: 640px) {
    form.row { flex-direction: column; align-items: stretch; }
    dl.facts { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------- hub --- */

/* Narrow enough that a member's four destinations fit on one row. */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
}

.tile {
    display: block;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.tile:hover,
.tile:focus-visible { border-color: var(--accent); }

.tile h2 { margin: 0 0 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.tile-icon { flex: none; width: 1.25em; height: 1.25em; color: var(--accent); }
.tile p  { margin: 0; color: var(--ink-muted); font-size: 0.9rem; }

/* Numeric table columns line up on the decimal rather than the left edge. */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- time registration --- */

/* The time overview's table toolbar, styled after the booking calendar's:
   FullCalendar's own button colours, which stay the same in dark mode. */
.period-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.5rem; margin: 0.5rem 0 1rem;
}
.period-chunk { display: flex; align-items: center; gap: 0.75rem; }
.period-title { flex: 1 1 12rem; margin: 0; text-align: center; font-size: 1.75rem; line-height: 1.25; }

.btn-group { display: inline-flex; }
.btn-dark {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 2.4rem; padding: 0.4em 0.65em;
    border: 1px solid #2c3e50; border-radius: 0.25em;
    background: #2c3e50; color: #fff;
    font-size: 1em; line-height: 1.5; text-decoration: none;
}
.btn-dark svg { width: 1.2em; height: 1.2em; }
.btn-dark:hover, .btn-dark:focus-visible { background: #1e2b37; border-color: #1a252f; color: #fff; }
.btn-dark[aria-current] { background: #1a252f; border-color: #151e27; }
.btn-dark[aria-disabled="true"] { opacity: 0.65; pointer-events: none; }
.btn-dark:disabled { opacity: 0.65; cursor: not-allowed; }
/* The same button in the site's green, as the primary buttons. */
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover, .btn-accent:focus-visible { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
/* The chosen one of a group (Week or Day), darker, as for the dark buttons. */
.btn-accent[aria-current] { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Rows in turn white and light green. */
table.striped tbody tr:nth-child(odd) td { background: var(--surface); }
table.striped tbody tr:nth-child(even) td { background: var(--row-alt); }
.btn-group .btn-dark:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn-dark:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Activities down, people across. More people than fit scroll sideways,
   never up and down. */
.matrix-scroll { overflow-x: auto; overflow-y: hidden; }
.time-matrix { margin: 0; }
.time-matrix th.num, .time-matrix td.num { white-space: nowrap; }
/* A cell with notes: a small corner mark, as a spreadsheet marks a comment.
   Hovering or focusing it shows the notes in .cell-popup (app.js). */
.time-matrix td.has-notes { position: relative; cursor: help; }
.time-matrix td.has-notes::after {
    content: ""; position: absolute; top: 0; right: 0;
    border-style: solid; border-width: 0 0.5rem 0.5rem 0;
    border-color: transparent var(--accent) transparent transparent;
}
.time-matrix td.has-notes:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell-popup {
    position: fixed; z-index: 50;
    max-width: min(22rem, calc(100vw - 1rem));
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-size: 0.85rem; text-align: left; white-space: normal;
}
.cell-popup .cell-notes-title { margin: 0 0 0.35rem; font-weight: 600; }
.cell-popup ul { margin: 0; padding: 0; list-style: none; }
.cell-popup li + li { margin-top: 0.3rem; }
.time-matrix tfoot th, .time-matrix tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
.time-matrix tfoot th { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); }

.day-nav { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 1rem; }

.day-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: 1.1rem;
    text-decoration: none;
}

.day-step:hover,
.day-step:focus-visible { border-color: var(--accent); }

.day-pick { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; }

.day-label { min-width: 15rem; font-size: 1.05rem; font-weight: 600; text-align: center; }

/* The month under "My time registrations": not a button, but boxed like the
   day label above it, between the same arrow buttons. */
.month-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

/* Every card folds (wireFoldableCards() in app.js): an open arrowhead in the
   upper right corner - up while open, down while folded - and the heading
   both toggle it. The heading row stays; the body below it folds away. */
.card-foldable { position: relative; }
.card-foldable > .fold-toggle + * { padding-right: 2.75rem; }
.fold-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
}
.fold-toggle:hover .fold-arrow { border-color: var(--ink); }
.fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-heading { cursor: pointer; }
.card-foldable.is-folded > .card-body { display: none; }
.card-foldable.is-folded > .fold-toggle + * { margin-bottom: 0; }
.card-foldable.is-folded > .fold-toggle + * h1,
.card-foldable.is-folded > .fold-toggle + h1,
.card-foldable.is-folded > .fold-toggle + h2 { margin-bottom: 0; }
.fold-arrow {
    width: 0.7rem;
    height: 0.7rem;
    border-right: 2px solid var(--ink-muted);
    border-bottom: 2px solid var(--ink-muted);
    transform: translateY(25%) rotate(-135deg);
}
.card-foldable.is-folded .fold-arrow { transform: translateY(-25%) rotate(45deg); }


/*
 * With the script running, the printed day is the button and the date input
 * only hosts the browser's picker: out of sight, but still rendered, because
 * showPicker() refuses an input that is not. Anchored under the label so the
 * picker opens there.
 */
.day-nav.has-picker .day-label-static { display: none; }
.day-nav.has-picker #day-input {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.day-sheet-wrap { overflow-x: auto; }

.day-sheet td { vertical-align: middle; }
/* A weekend day stays grey, striped in greys. */
.day-sheet.is-weekend tbody tr:nth-child(odd) td { background: var(--weekend-bg); }
.day-sheet.is-weekend tbody tr:nth-child(even) td { background: var(--weekend-alt); }

/* Inputs take the colour of their cell, so a weekend row is grey throughout. */
.day-sheet input[type="text"] { max-width: none; padding: 0.35rem 0.5rem; background: transparent; }
.day-sheet td.num { width: 1%; }
.day-sheet .day-hours { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.day-sheet .day-note { min-width: 10rem; }
.day-sheet input:disabled { color: var(--ink-muted); cursor: not-allowed; }
.day-sheet input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* The label row: larger labels, as tall as the date button between "Hours"
   and "Remarks", which opens the browser's date picker. */
.day-sheet thead th {
    font-size: 1.05rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
    vertical-align: middle;
}
.day-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
.day-sheet .day-head-date .day-nav { margin: 0; }
.day-sheet .day-head-date .day-label { min-width: 0; min-height: 2.1rem; padding: 0.2em 0.8em; font-size: 1.05rem; }

/* The day before and the day after: a tall button beside all the activities,
   its date on its side. The cell's 1px height lets the button fill the rows. */
.day-sheet td.day-jump-cell { width: 1%; height: 1px; padding: 0.3rem; }
/* They span every row, so they do not take the first row's stripe. */
.day-sheet.striped tbody tr td.day-jump-cell { background: var(--surface); }
.day-sheet.striped.is-weekend tbody tr td.day-jump-cell { background: var(--weekend-bg); }
.day-jump {
    height: 100%;
    min-height: 6rem;
    padding: 0.6em 0.35em;
    writing-mode: vertical-rl;
    white-space: nowrap;
}

/* Minus and plus around the hours, one hour at a time. */
.hours-stepper { align-items: stretch; }
.hours-stepper .btn-dark { min-height: 0; padding: 0 0.6em; font-weight: 600; }
.day-sheet .hours-stepper .day-hours { border-radius: 0; margin-left: -1px; }

.day-status { min-height: 1.5em; margin: 0.25rem 0 0.5rem; color: var(--ink-muted); }
.day-status.is-error { color: var(--danger); }

@media (max-width: 640px) {
    .day-label { min-width: 0; font-size: 0.95rem; }
    .day-sheet th, .day-sheet td { padding: 0.4rem 0.3rem; }
    .day-sheet .day-hours { width: 4rem; }
    .hours-stepper .btn-dark { padding: 0 0.45em; }
}

/* Out of sight, still read out by screen readers. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------- technician planning --- */

/* A request's status as a small label, coloured by what it asks of the reader. */
.status {
    display: inline-block;
    padding: 0.05rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.8rem;
    white-space: nowrap;
}
.status-pending, .status-clarification { background: var(--warn-bg); }
.status-approved { background: var(--ok-bg); }
.status-rejected { background: var(--err-bg); }
.status-withdrawn { color: var(--ink-muted); }

/* A line under a hub tile that needs attention: requests waiting. */
.tile p.tile-note { margin-top: 0.4rem; color: var(--danger); font-weight: 600; }

#planning-calendar { margin-top: 0.5rem; }

/* As on the booking calendar: a project manager's own projects carry the
   accent colour, the others are neutral. Lab managers see them all in the
   accent colour. Bars in the month view, a dot in the list. */
.fc-daygrid-event.support-own { background: var(--own); border-color: var(--own); }
.fc-daygrid-event.support-other { background: var(--other); border-color: var(--other); }
.fc-daygrid-event.support-own .fc-event-main,
.fc-daygrid-event.support-other .fc-event-main { color: #fff; }
.fc-list-event.support-own .fc-list-event-dot { border-color: var(--own); }
.fc-list-event.support-other .fc-list-event-dot { border-color: var(--other); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0 1rem;
    margin-bottom: 0.5rem;
}

.request-lines th[scope="row"] { min-width: 10rem; font-weight: 500; }
.request-lines th[scope="row"] label { margin: 0; }
.request-lines th[scope="row"] .small { display: block; font-weight: 400; }
.request-lines td { vertical-align: top; }
.request-lines .hours-input { width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.request-lines textarea { min-width: 16rem; max-width: none; }

textarea { max-width: 48rem; min-height: 2.6rem; resize: vertical; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; margin: 1rem 0 0; }

ul.errors { margin: 0; padding-left: 1.2rem; }

/* The open question, above the form the project manager answers it in. */
.question {
    border-left: 3px solid var(--accent);
    background: var(--warn-bg);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    margin: 0 0 1rem;
}
.question p { margin: 0; }
.question .question-head { margin-bottom: 0.25rem; }

/* Messages keep the line breaks they were typed with. */
.thread-message { white-space: pre-line; overflow-wrap: anywhere; }

ol.thread { list-style: none; margin: 0; padding: 0; }
ol.thread li { border-left: 3px solid var(--line); padding: 0.1rem 0 0.1rem 0.75rem; margin: 0 0 0.9rem; }
ol.thread p { margin: 0; }
ol.thread .thread-message { margin-top: 0.25rem; }


/* A work schedule: a narrow field per weekday, side by side. */
.schedule-days { display: flex; flex-wrap: wrap; gap: 0 0.75rem; }
.schedule-days .hours-input { width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.schedule-table tr.is-current td { font-weight: 600; }
.schedule-table td.num { font-variant-numeric: tabular-nums; }
.row .hours-input { width: 5.5rem; }

/* Occupancy: a week above the person's maximum on pale amber, above 100% on
   pale red, as the legend under the table says. */
.occupancy th[scope="row"] { white-space: nowrap; font-weight: 500; }
.occupancy th[scope="row"] .small { display: block; font-weight: 400; }
.occupancy td.over-limit { background: var(--warn-bg); }
.occupancy td.over-full { background: var(--err-bg); color: var(--danger); font-weight: 600; }
.swatch.over-limit { background: var(--warn-bg); border: 1px solid var(--line); }
.swatch.over-full { background: var(--err-bg); border: 1px solid var(--danger); }
.occupancy-range { flex-wrap: wrap; gap: 0.4rem; }

.assignment-table td { vertical-align: middle; }
.assignment-table .hours-input { width: 4.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.assign-form select { min-width: 16rem; }
.my-assignments td { vertical-align: top; }

/* "new" next to what someone has not seen yet: a decision, an assignment. */
.badge-new {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

/* Rules: which systems each role has. */
.systems-table th, .systems-table td { white-space: nowrap; }
.systems-table label.check { margin: 0; }

/* The up and down arrows on the Activities page. */
.order-buttons .btn-dark { min-height: 0; padding: 0.15em 0.55em; }

/* Nederlands / English: on the hub, and in the footer before signing in. */
.language-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.language-switch .btn-dark { min-height: 0; padding: 0.2em 0.7em; }
footer .language-switch { justify-content: center; margin-top: 0.5rem; }
