html, body {
    font-family: Nunito, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* The colours come from the theme (AppTheme.cs), on the static pages of /Account too. These load Bootstrap after MudBlazor:
   its rules on the body are taken back here, and its own variables take the colours of the theme. */
body {
    color: var(--mud-palette-text-primary);
    background-color: var(--mud-palette-background);
}

:root {
    --bs-link-color: var(--mud-palette-primary-darken);
    --bs-link-hover-color: var(--mud-palette-primary);
    --bs-border-radius: var(--mud-default-borderradius);
    --bs-border-radius-lg: var(--mud-default-borderradius);
}

.account-navbar {
    --bs-navbar-brand-color: var(--mud-palette-appbar-text);
    --bs-navbar-brand-hover-color: var(--mud-palette-appbar-text);
    background-color: var(--mud-palette-appbar-background);
    box-shadow: 0 1px 0 var(--mud-palette-lines-default);
}

.account-navbar .navbar-brand {
    font-weight: 700;
}

h1, .h3 {
    font-weight: 800;
    letter-spacing: -.02em;
}

a, .btn-link {
    color: var(--mud-palette-primary-darken);
}

.btn-primary {
    --bs-btn-color: var(--mud-palette-primary-text);
    --bs-btn-bg: var(--mud-palette-primary);
    --bs-btn-border-color: var(--mud-palette-primary);
    --bs-btn-hover-color: var(--mud-palette-primary-text);
    --bs-btn-hover-bg: var(--mud-palette-primary-darken);
    --bs-btn-hover-border-color: var(--mud-palette-primary-darken);
    --bs-btn-active-color: var(--mud-palette-primary-text);
    --bs-btn-active-bg: var(--mud-palette-primary-darken);
    --bs-btn-active-border-color: var(--mud-palette-primary-darken);
    --bs-btn-disabled-color: var(--mud-palette-primary-text);
    --bs-btn-disabled-bg: var(--mud-palette-primary);
    --bs-btn-disabled-border-color: var(--mud-palette-primary);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--mud-palette-primary);
    --bs-nav-pills-link-active-color: var(--mud-palette-primary-text);
}

.form-check-input:checked {
    background-color: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--mud-palette-primary-lighten);
}

.form-control:focus, .form-check-input:focus {
    border-color: var(--mud-palette-primary);
}

/* The top bar and the menu rest on the cream: a line rather than a shadow. */
.mud-appbar {
    box-shadow: 0 1px 0 var(--mud-palette-lines-default);
}

/* The logo of the bar laitier, in front of its name. It takes room from the name, as do the help and account menus: the name
   goes on two lines at most, logo or not, since the top bar cannot hold more. */
.appbar-logo {
    flex: none;
    margin-right: 8px;
}

.appbar-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

/* On a phone or a tablet, where the e-mail of the account can also be in the bar, the logo shrinks and so does the name. */
@media (max-width: 959.98px) {
    .appbar-logo {
        width: auto;
        height: 32px;
        max-width: 64px;
        object-fit: contain;
        object-position: left center;
    }

    .appbar-name {
        font-size: 1rem;
    }
}

.mud-drawer {
    box-shadow: 1px 0 0 var(--mud-palette-lines-default);
}

/* The space between the rounded rows of the menu comes out of their padding: it fits as many lines as before. */
.mud-nav-link {
    padding-top: 6px;
    padding-bottom: 6px;
}

.mud-nav-link.active .mud-nav-link-text {
    font-weight: 700;
}

/* The tabs follow the buttons, which the theme takes out of capitals, but they do not read its typography. */
.mud-tab {
    letter-spacing: 0;
    text-transform: none;
}

.mud-tabs-tabbar {
    background-color: transparent;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.count-line-unsent .count-line-tick {
    visibility: hidden;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJo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MxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Une erreur est survenue."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* On a phone, the search and the filters of a table go one per line rather than shrinking to nothing. */
@media (max-width: 599.98px) {
    .mud-toolbar.mud-table-toolbar {
        flex-wrap: wrap;
        height: auto;
        row-gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .mud-table-toolbar > :not(.flex-grow-1) {
        flex: 1 1 100%;
    }

    .mud-table-toolbar .ml-4 {
        margin-left: 0 !important;
    }
}

/* A list sorted by dragging its rows (categories, locations): a line between two rows, and the row being dragged faded. */
.catalog-list > .mud-drop-item:not(.mud-drop-item-preview-start) + .mud-drop-item {
    border-top: 1px solid var(--mud-palette-divider);
}

.catalog-list > .dragging {
    opacity: .4;
}

/* The invisible target for dropping a row first goes just above the list, rather than over the first row's buttons. */
.catalog-list > .mud-drop-item-preview-start {
    top: -20px;
}

/* A choice with a title and a description under it: its radio button lines up with the title. */
.radio-with-description .mud-radio {
    align-items: flex-start;
}

/* The schedule of the week: a line per person, a column per day, as it is posted. A shift takes the colour of its post
   (--shift-color) on a pale background, which keeps its text dark. */
.schedule-scroll {
    overflow-x: auto;
}

.schedule-grid {
    width: 100%;
    min-width: 860px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--mud-palette-surface);
    font-size: .8125rem;
    line-height: 1.3;
}

.schedule-grid th, .schedule-grid td {
    padding: 4px;
    vertical-align: top;
    text-align: left;
    font-weight: 400;
    border-right: 1px solid var(--mud-palette-divider);
    border-bottom: 1px solid var(--mud-palette-divider);
}

.schedule-grid thead th {
    background: var(--mud-palette-background-gray);
    font-weight: 500;
}

.schedule-grid .weekday {
    display: block;
    text-transform: capitalize;
}

.schedule-grid .person {
    width: 170px;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--mud-palette-surface);
}

.schedule-grid thead .person {
    background: var(--mud-palette-background-gray);
}

.schedule-grid.editable tbody td {
    cursor: pointer;
}

.schedule-grid.editable tbody td:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.schedule-grid .name {
    display: block;
    font-weight: 500;
}

.schedule-grid .detail, .schedule-list-day .detail, .my-shift .detail {
    display: block;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.schedule-grid .holiday {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    color: var(--mud-palette-primary);
}

.schedule-grid .today .weekday {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

/* A closed day is hatched, as in the registers: it does not look like a day forgotten. */
.schedule-grid .closed, .schedule-list-day.closed {
    background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0, 0, 0, .05) 6px 8px);
}

/* A day the person cannot work: another hatching than a closed day, which concerns everybody. */
.schedule-grid td.unavailable {
    background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0, 0, 0, .07) 5px 7px);
}

.schedule-cell-note {
    display: block;
    margin-bottom: 2px;
    font-size: .6875rem;
    line-height: 1.2;
    color: var(--mud-palette-text-secondary);
}

.schedule-member-hint {
    margin-left: 8px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

/* Hours that differ from those of the shift. */
.hours-changed {
    font-weight: 500;
    color: var(--mud-palette-warning-darken);
}

.schedule-zone {
    min-height: 48px;
    height: 100%;
}

.schedule-zone.can-drop {
    outline: 1px dashed var(--mud-palette-primary);
    outline-offset: -2px;
}

.shift {
    display: block;
    margin-bottom: 3px;
    padding: 2px 5px;
    border-left: 3px solid var(--shift-color);
    border-radius: 3px;
    background: color-mix(in srgb, var(--shift-color) 13%, white);
    color: var(--mud-palette-text-primary);
    font-size: .75rem;
    line-height: 1.25;
}

.shift.editable {
    cursor: pointer;
}

.shift .hours {
    display: block;
    font-weight: 500;
    white-space: nowrap;
}

.shift .position {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shift .tag {
    display: inline-block;
    margin-right: 3px;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--mud-palette-primary-darken);
}

.shift .tag.refusable {
    color: var(--mud-palette-warning-darken);
}

/* Taken off the schedule, until the person is told. */
.shift.removed {
    background: none;
    border-left-style: dashed;
    color: var(--mud-palette-text-secondary);
}

.shift.removed .hours, .shift.removed .position {
    text-decoration: line-through;
}

.shift.changed {
    box-shadow: inset 0 0 0 1px var(--shift-color);
}

.shift.flagged {
    outline: 1px solid var(--mud-palette-warning);
    outline-offset: 1px;
}

.schedule-scroll .dragging {
    opacity: .4;
}

.schedule-warning {
    display: block;
    margin-top: 2px;
    font-size: .75rem;
    font-weight: 500;
    color: var(--mud-palette-warning-darken);
}

.schedule-warning.young {
    color: var(--mud-palette-error);
}

.schedule-warnings {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
}

.schedule-warnings li {
    display: flex;
    gap: 6px;
    padding: 2px 0;
}

/* On a phone: the list of the days. */
.schedule-list-day {
    margin-bottom: 8px;
    padding: 8px 12px;
    border: 1px solid var(--mud-palette-divider);
    border-radius: 4px;
    background-color: var(--mud-palette-surface);
    font-size: .875rem;
}

.schedule-list-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.schedule-list-shift {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: start;
    margin-top: 6px;
}

/* A day hour by hour: a line per person over the hours of the day. */
.schedule-day {
    min-width: 720px;
    background: var(--mud-palette-surface);
    font-size: .8125rem;
}

.schedule-day-row {
    display: grid;
    grid-template-columns: 170px 1fr;
    align-items: center;
    min-height: 34px;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.schedule-day-row.head, .schedule-day-row.foot {
    min-height: 26px;
    background: var(--mud-palette-background-gray);
}

.schedule-day-row .name {
    padding: 0 8px;
    font-weight: 500;
}

.schedule-day-row .detail {
    font-weight: 400;
    color: var(--mud-palette-text-secondary);
}

.schedule-day-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--schedule-hours), 1fr);
    align-self: stretch;
    min-height: 30px;
    background-image: linear-gradient(to right, var(--mud-palette-divider) 1px, transparent 1px);
    background-size: calc(100% / var(--schedule-hours)) 100%;
}

.schedule-day-track .hour {
    align-self: center;
    padding-left: 4px;
    font-size: .75rem;
    color: var(--mud-palette-text-secondary);
}

.schedule-day-open, .schedule-day-shift {
    position: absolute;
    top: 3px;
    bottom: 3px;
    overflow: hidden;
    padding: 0 6px;
    border-radius: 3px;
    font-size: .75rem;
    line-height: 24px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-day-open {
    background: color-mix(in srgb, var(--mud-palette-primary) 10%, white);
    color: var(--mud-palette-primary-darken);
}

.schedule-day-shift {
    border-left: 3px solid var(--shift-color);
    background: color-mix(in srgb, var(--shift-color) 16%, white);
}

.schedule-day-shift.editable {
    cursor: pointer;
}

.schedule-day-shift.removed {
    background: none;
    border-left-style: dashed;
    color: var(--mud-palette-text-secondary);
    text-decoration: line-through;
}

.my-shifts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.my-shift {
    padding: 8px 12px;
    border-left: 4px solid var(--shift-color);
    border-radius: 4px;
    background: color-mix(in srgb, var(--shift-color) 10%, white);
    font-size: .875rem;
}

.my-shift .detail {
    display: inline;
    margin-left: 4px;
}

.schedule-swatch {
    display: inline-block;
    flex: none;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    padding: 0;
}

.schedule-swatch.large {
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.schedule-swatch.selected {
    outline: 2px solid var(--mud-palette-text-primary);
    outline-offset: 2px;
}

/* The profitability, a column a month: on a phone the months scroll under the names of the lines. */
.profit-months {
    overflow-x: auto;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-surface);
}

.profit-months table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.profit-months th, .profit-months td {
    padding: 6px 12px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

.profit-months tr > th:first-child {
    position: sticky;
    left: 0;
    text-align: left;
    background: var(--mud-palette-surface);
}

.profit-months tbody th {
    font-weight: 400;
}

.profit-months tbody tr:last-child > * {
    border-bottom: none;
}

.profit-months tbody tr.profit-total > *, .mud-simple-table table tbody tr.profit-total > td {
    font-weight: 700;
}

/* The year, in four columns that fit a phone. */
@media (max-width: 600px) {
    .profit-year.mud-simple-table table tr > * {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* A chart gives way to its legend, in the height of its box. */
.chart-box svg {
    min-height: 0;
}

.chart-box .mud-chart-legend {
    padding: 0;
    margin-top: 4px;
}

/* The grid and the axes of a chart take the quiet colours of the theme, rather than the grey MudChart writes itself. */
.chart-box .mud-charts-gridlines-yaxis path {
    stroke: var(--mud-palette-lines-default);
    stroke-width: 1;
}

.chart-box .mud-charts-xaxis, .chart-box .mud-charts-yaxis {
    fill: var(--mud-palette-text-secondary);
}

/* The dots of the curve are hollow, and full for an approximate point. MudChart gives a dot no fill of its own, which comes out black;
   the circle that follows the mouse is the one with an opacity. */
.chart-box .mud-chart-point:not([opacity]) {
    fill: var(--mud-palette-surface);
}

.chart-box .mud-chart-point[stroke="var(--mud-palette-warning)"]:not([opacity]) {
    fill: var(--mud-palette-warning);
}

.chart-box .svg-tooltip text {
    stroke: none;
    filter: none;
}

/* A page printed without the menu and its buttons: the count sheet, for example. */
@media print {
    body {
        background: none;
    }

    .mud-appbar, .mud-drawer, .no-print {
        display: none !important;
    }

    .mud-main-content, .mud-main-content > .mud-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }
}