:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --fg: #1b1b1f;
    --muted: #5c5c66;
    --line: #e3e3e8;
    --link: #0b57d0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16161a;
        --fg: #ececf1;
        --muted: #9a9aa5;
        --line: #2c2c33;
        --link: #8ab4f8;
    }
}

/* One colour for every link, visited or not. `:where()` keeps this at zero
   specificity, so links styled elsewhere (nav, buttons) keep their own. */
:where(a, a:visited) {
    color: var(--link);
}

/* Always keep room for the scrollbar, so a page that scrolls and one that
   does not line up the same and nothing jumps when navigating between them. */
html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    padding: 3rem 1rem;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
    max-width: 36rem;
    margin: 0 auto;
}

h1 {
    margin: 0 0 .25rem;
    font-size: 2rem;
    letter-spacing: -.02em;
}

h1 + p {
    margin: 0 0 2rem;
    color: var(--muted);
}

dl {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: .75rem 1rem;
    margin: 0;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

dl > * {
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line);
}

main.wide {
    max-width: 52rem;
}

.muted {
    color: var(--muted);
}

.empty {
    padding: 2rem 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.button {
    display: inline-block;
    padding: .5rem 1rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    border-color: var(--fg);
}

.flash {
    max-width: 52rem;
    margin: 0 auto 1.5rem;
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-left-width: .25rem;
    border-radius: .375rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: .75rem 1rem .75rem 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

thead th {
    color: var(--muted);
    font-weight: 400;
}

tbody th {
    font-weight: 600;
}

.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

form > div {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: .25rem;
    color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: var(--bg);
    color: inherit;
    font: inherit;
    box-sizing: border-box;
}

.help-text {
    margin: .375rem 0 0;
    color: var(--muted);
    font-size: .875rem;
}

form ul {
    margin: .375rem 0 0;
    padding-left: 1.25rem;
    color: #c0392b;
    font-size: .875rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.day-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .5rem;
}

.day-row input {
    flex: 1;
}

.day-collection {
    margin-bottom: 1.25rem;
}

.button-quiet {
    padding: .5rem .75rem;
    color: var(--muted);
    font-size: .875rem;
}

input[type="date"],
input[type="time"] {
    padding: .5rem .75rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: var(--bg);
    color: inherit;
    font: inherit;
}

tfoot th,
tfoot td {
    border-bottom: none;
    color: var(--muted);
}

.site-nav {
    max-width: 52rem;
    margin: -1.5rem auto 2.5rem;
    border-bottom: 1px solid var(--line);
}

.site-nav-groups,
.site-nav-items {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 1.5rem;
    row-gap: .25rem;
}

.site-nav-groups {
    padding-bottom: .75rem;
}

/* The pages of the current group, a step quieter than the groups above. */
.site-nav-items {
    padding: .625rem 0 .75rem;
    border-top: 1px solid var(--line);
    font-size: .9375rem;
}

.site-name {
    margin-right: auto;
    font-weight: 600;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--fg);
}

.logout {
    margin: 0;
}

.logout button {
    padding: 0;
    border: none;
    background: none;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.logout button:hover {
    color: var(--fg);
}

.site-nav a[aria-current] {
    color: var(--fg);
    text-decoration: underline;
    text-underline-offset: .35rem;
}

/* Reregistration: one card per norm, with a bar showing progress against it. */

:root {
    --ok: #1f7a4d;
    --warn: #b3541e;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ok: #5cc38d;
        --warn: #e0965c;
    }
}

.requirement {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.requirement h2 {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0;
    font-size: 1.125rem;
}

.requirement-description {
    margin: .25rem 0 1rem;
    color: var(--muted);
    font-size: .875rem;
}

/* The optional pregnancy leave on the edit form: three fields that belong
   together, set apart from the period they lower. */
.leave-fields {
    margin: 0 0 1.25rem;
    padding: 1rem 1rem .25rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
}

.leave-fields legend {
    padding: 0 .375rem;
    color: var(--muted);
    font-size: .875rem;
}

.leave-fields > div {
    margin-bottom: 1.25rem;
}

.pregnancy-leave {
    color: var(--muted);
}

.requirement-lowered {
    margin: -.5rem 0 .75rem;
    color: var(--muted);
    font-size: .875rem;
}

.requirement-total {
    margin: 0 0 .75rem;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.requirement-total strong {
    font-weight: 600;
}

.requirement-figures {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    gap: .25rem 1rem;
    margin-top: 1rem;
    font-size: .875rem;
}

.requirement-figures > * {
    padding-bottom: 0;
    border-bottom: 0;
}

.requirement-figures dd.ahead {
    color: var(--ok);
}

.requirement-figures dd.behind {
    color: var(--warn);
}

/* The fill is what has been done; the notch is what was expected by today. */
.meter {
    position: relative;
    height: .75rem;
    border-radius: .375rem;
    background: var(--line);
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: var(--ok);
}

.meter-fill-behind {
    background: var(--warn);
}

.meter-expected {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--fg);
}

.badge {
    padding: .125rem .5rem;
    border: 1px solid currentcolor;
    border-radius: 1rem;
    font-size: .75rem;
    font-weight: 400;
    white-space: nowrap;
}

.badge-met,
.badge-on-track {
    color: var(--ok);
}

.badge-behind {
    color: var(--warn);
}

/* The users page: switching to another user sits on that user's row.
   Development scaffolding, see templates/user/index.html.twig. */

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

/* Workdays: repeating weekly, and deleting. */

.repeat-fields {
    margin: 0 0 1.25rem;
    padding: 1rem 1rem 0;
    border: 1px solid var(--line);
    border-radius: .375rem;
}

.repeat-fields legend {
    padding: 0 .25rem;
    color: var(--muted);
}

main h2 {
    margin: 2rem 0 .75rem;
    font-size: 1.25rem;
}

.delete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.button-danger {
    color: var(--warn);
    border-color: currentColor;
}

/* Invoices. */

.invoice-parties {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.invoice-parties address {
    font-style: normal;
}

.invoice-lines {
    margin: 1.5rem 0;
}

/* Bookings not yet matched: the same left bar the flash messages use, in the
   "behind" colour, so what still needs doing stands out without shouting. */

table.bookings th:first-child,
table.bookings td:first-child,
table.work-days th:first-child,
table.work-days td:first-child {
    padding-left: .75rem;
}

/* Workdays from a weekly series: the same bar, in the text colour. */
table.work-days tr.repeating > :first-child {
    box-shadow: inset .25rem 0 var(--fg);
}

table.bookings tr.unmatched > :first-child {
    box-shadow: inset .25rem 0 var(--warn);
}

.unmatched-count {
    padding-left: .75rem;
    border-left: .25rem solid var(--warn);
}

/* Reports: a heading row per aangifte-rubriek, its accounts indented under it. */

.year-picker {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin: 0 0 1.5rem;
}

.report {
    margin-bottom: 2rem;
}

.report td:first-child {
    width: 7rem;
    font-variant-numeric: tabular-nums;
}

.report-heading th,
.report-heading td {
    padding-top: 1.25rem;
    font-weight: 600;
}

.report tr.unexplained > :first-child {
    box-shadow: inset .25rem 0 var(--warn);
    padding-left: .75rem;
}

/* A one-field form inside a description list: dropdown and button side by side. */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0;
}

.inline-form select {
    width: auto;
    flex: 1 1 14rem;
}

.inline-form .help-text {
    flex-basis: 100%;
}
