/* Case schedule (GDEV-576). Prefix cs-. One global sheet, not a scoped one: the page, its tabs, the
   case drawer, My work and the floor monitor are separate components that share these marks (kit
   pips, assignee avatars, stage bars, badges). Colors and sizes follow the mock-up tokens and the
   house panel from Sales Orders. */

.cs-page { padding-inline: 1.5rem; color: #1C2B3A; }
.cs-title { display: flex; flex-direction: column; gap: 2px; }
.cs-title__overline { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; color: #5B6878; }
.cs-title__sub { font-size: 0.875rem; color: #5B6878; max-width: 80ch; }

.cs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 0.875rem; margin-top: 0.875rem; }
.cs-head__field { width: 17rem; max-width: 100%; }
/* Two short lines, so Refresh and Attention rules stay on the row with it. */
.cs-sync { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.3; font-size: 0.8125rem; color: #5B6878; }
.cs-sync__how { font-size: 0.75rem; }
.cs-spacer { flex: 1; }

/* The page's name on the left; on the right only what acts on the data (the WebOps pull, the rules). */
.cs-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; }
.cs-top__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 0.75rem; margin-left: auto; }

/* The one bar under every tab, in three groups that wrap as groups: where (branch, saved view), when (the
   tab's dates), then find and filter, pushed to the right edge. */
.cs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 1.5rem; margin: 0.875rem 0; }
.cs-bar__group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.625rem; min-width: 0; }
.cs-bar__group--end { margin-left: auto; }
.cs-filter { width: 13rem; max-width: 100%; }
.cs-filter .rz-dropdown { border: 0; box-shadow: none; background: transparent; min-height: 0; }
.cs-filter--dates { width: 15rem; }
.cs-filter--branch { width: 15rem; }
.cs-filter--view { width: 11rem; }
.cs-filter--case { width: 9.5rem; }
.cs-filter--kit { width: 12rem; }
/* Every other filter, behind the Filters button: a panel of fields in order of use. */
.cs-filters { margin: -0.25rem 0 0.875rem; padding: 1rem 1.25rem 0.625rem; background: #fff; border: 1px solid #E4E9F2; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05); }
.cs-filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem 0.875rem; align-items: center; }
.cs-filters__grid .cs-filter { width: auto; }
.cs-filters__foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.cs-active { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; margin: -0.25rem 0 0.875rem; }
.cs-active__label { font-size: 0.8125rem; font-weight: 600; color: #5B6878; margin-right: 0.25rem; }
.cs-active__dim { color: #5B6878; font-weight: 400; margin-right: 0.25rem; }
.cs-nav { display: inline-flex; align-items: center; gap: 0.25rem; }
.cs-range { font-size: 0.9375rem; font-weight: 600; padding: 0 0.5rem; font-variant-numeric: tabular-nums; }
.cs-hint { font-size: 0.8125rem; color: #5B6878; }

/* ---- panel (the house look) ---- */
.cs-panel { background: #fff; border: 1px solid #E4E9F2; border-radius: 12px; overflow: clip;
    box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05); }
.cs-panel__header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem;
    padding: 1rem 1.25rem 0.875rem; border-bottom: 1px solid #E4E9F2; }
.cs-panel__title { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
.cs-panel__subtitle { margin: 0.125rem 0 0; font-size: 0.8125rem; color: #5B6878; }
.cs-panel__body { padding: 1.25rem; }
.cs-panel__footer { background: #F6F8FC; border-top: 1px solid #E4E9F2; padding: 0.75rem 1.25rem; font-size: 0.8125rem; color: #5B6878; }
.cs-stats { display: flex; gap: 1.75rem; }
.cs-stat__label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: #5B6878; }
.cs-stat__value { font-size: 1.25rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cs-red { color: #B42318; }
.cs-amber { color: #8A520A; }

.cs-layout { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.cs-layout__main { flex: 999 1 40rem; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.cs-layout__rail { flex: 1 1 19rem; max-width: 22rem; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }

/* ---- small marks ---- */
.cs-mono { font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-size: 0.86em; font-variant-numeric: tabular-nums; }
.cs-sub { color: #5B6878; font-size: 0.8125rem; margin-top: 2px; }
/* "Non-loaner" beside a Board row's city, and the loaner count on the Month: the page's blue, so it reads apart from the grey around it. */
.cs-loaner { color: #0548CB; font-weight: 500; }
/* On a Week card, at the end of the kit line: only the cases that are not loaners are marked. */
.cs-loaner-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 0.6875rem; font-weight: 600;
    color: #0548CB; background: #EBF0FD; }
.cs-card__line .cs-loaner-tag { margin-left: auto; }
.cs-legend .cs-loaner-tag { margin-right: 6px; }
/* The Board's Surgery cell: the surgery in bold ink, and under it, lighter and smaller, when the case was created. */
.cs-surgery { font-weight: 600; color: #16202E; }
.cs-surgery--time { font-weight: 500; }
.cs-created { color: #7A8597; font-size: 0.75rem; margin-top: 3px; white-space: nowrap; }
.cs-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cs-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
/* A case's status: a solid tag in the status color (--cs-stage), square-cornered, dark ink. The At risk and
   Attention badges are outlined pills on a pale tint, so a red-orange New never reads as a red At risk. */
.cs-status { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600;
    white-space: nowrap; color: #1C2B3A; background: var(--cs-stage, #EEF1F6); }
.cs-chip--blue { background: #EBF0FD; color: #0548CB; }
.cs-chip--green { background: #E8F8F3; color: #0E6B4F; }
.cs-chip--grey { background: #EEF1F6; color: #5B6878; }
.cs-chip--amber { background: #FEF4E6; color: #8A520A; }
.cs-task { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; background: #EEF1F6; color: #1C2B3A; }

.cs-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cs-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
    border: 1px solid; white-space: nowrap; box-sizing: border-box; }
.cs-badge--amber { color: #8A520A; border-color: #F0C58A; background: #FEF4E6; }
.cs-badge--red { color: #B42318; border-color: #F4B4B0; background: #FDECEC; }
.cs-badge--plain { color: #5B6878; border-color: #E4E9F2; background: #fff; }

/* A Board row's kits by type: the count in ink, the type beside it. */
.cs-mix { display: flex; flex-wrap: wrap; gap: 0 0.625rem; font-variant-numeric: tabular-nums; }
.cs-mix span { white-space: nowrap; }
.cs-mix b { font-weight: 600; color: #16202E; }

.cs-pips { display: inline-flex; gap: 2px; align-items: center; vertical-align: middle; }
.cs-pips i { display: block; width: 7px; height: 12px; border-radius: 2px; border: 1.5px solid #8C98A9; box-sizing: border-box; background: #fff; }
.cs-pips i.is-done { background: #1D9E75; border-color: #1D9E75; }
.cs-pips__more { font-size: 0.6875rem; color: #5B6878; margin-left: 2px; }

.cs-ticks { display: flex; gap: 2px; margin-top: 6px; }
.cs-ticks i { display: block; width: 9px; height: 4px; border-radius: 2px; background: #DCE2EC; }
/* Steps reached so far in the case's status color (--cs-stage); the darker edge keeps the pale ones visible on white. */
.cs-ticks i.is-done, .cs-ticks i.is-current { background: var(--cs-stage, #8C98A9); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cs-stage, #8C98A9) 62%, #1C2B3A); }

.cs-av { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 600; box-sizing: border-box; }
.cs-av--on { background: #0548CB; color: #fff; }
.cs-av--as { background: #fff; color: #1C2B3A; border: 1.5px solid #8C98A9; }
.cs-av--un { background: #FEF4E6; color: #8A520A; border: 1.5px dashed #C47A18; }
.cs-av--lg { width: 32px; height: 32px; font-size: 0.75rem; }
.cs-who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cs-who__name { font-weight: 500; }
.cs-who__state { font-size: 0.75rem; color: #5B6878; }
.cs-who__state.is-on { color: #0548CB; font-weight: 600; }
.cs-assign { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px dashed #C47A18; border-radius: 4px;
    background: #FEF4E6; color: #8A520A; font-size: 0.8125rem; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
.cs-assign:hover { background: #FDE9CC; }
.cs-assign:focus-visible, .cs-link:focus-visible, .cs-fchip:focus-visible { outline: 2px solid #0548CB; outline-offset: 2px; }
.cs-link { border: 0; background: none; color: #0548CB; font-size: 0.8125rem; font-weight: 500; padding: 4px 0; cursor: pointer; font-family: inherit; }
.cs-link:hover { text-decoration: underline; }

.cs-sbar { display: flex; gap: 2px; height: 10px; border-radius: 3px; overflow: hidden; background: #fff; }
.cs-sbar i { display: block; height: 100%; }
.cs-sbar.is-empty { background: #EEF1F6; }
.cs-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 0.75rem; color: #5B6878; }
.cs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cs-legend--bar { padding: 0.625rem 1.25rem; border-bottom: 1px solid #E4E9F2; background: #F6F8FC; }
.cs-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; box-shadow: inset 0 0 0 1px rgba(28, 43, 58, 0.18); }

/* ---- board ---- */
.cs-fchips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0.625rem 1.25rem; border-bottom: 1px solid #E4E9F2; }
.cs-fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid #0548CB; border-radius: 999px;
    background: #fff; color: #0548CB; font-size: 0.8125rem; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; font-family: inherit; }
.cs-fchip.is-on { background: #0548CB; color: #fff; }
.cs-fchip--risk { border-color: #C9302C; color: #B42318; }
.cs-fchip--risk.is-on { background: #B42318; border-color: #B42318; color: #fff; }

.cs-group__head { display: flex; align-items: center; gap: 10px; padding: 0.75rem 1.25rem 0.5rem; font-size: 0.9375rem; font-weight: 600;
    border-bottom: 1px solid #E4E9F2; }
.cs-group__head.is-shut { padding: 0.625rem 1.25rem; border-bottom-color: #EEF1F6; }
.cs-group__count { color: #5B6878; font-weight: 500; font-size: 0.8125rem; }
.cs-group__actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 0 1.25rem; }
.cs-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; padding: 0.5rem 1.25rem 0.625rem; border-bottom: 1px solid #E4E9F2;
    font-size: 0.8125rem; color: #5B6878; }
.cs-legend--key { flex: 1 1 24rem; justify-content: flex-end; align-self: center; }
.cs-board-table .mud-table-row { cursor: pointer; }
.cs-board-table .mud-table-cell { vertical-align: top; }
/* The row's stage as a bar down its left edge (--cs-stage is set per row). On the first cell, since a table row takes no border. */
.cs-board-table .mud-table-body .mud-table-row > .mud-table-cell:first-child { box-shadow: inset 5px 0 0 var(--cs-stage, transparent); }
@media (max-width: 960px) {
    /* MudTable stacks its rows into cards at 960px and below: the bar runs down the whole card. */
    .cs-board-table .mud-table-body .mud-table-row { box-shadow: inset 5px 0 0 var(--cs-stage, transparent); }
    .cs-board-table .mud-table-body .mud-table-row > .mud-table-cell:first-child { box-shadow: none; }
    /* A stacked row is still a table row, so one long hospital name on a single line widens the whole table and the
       card scrolls sideways. Lay the table out as blocks the width of the screen, with each cell a label beside its
       value: the value's lines stack under one another, right aligned, and wrap where they must. */
    .cs-board-table .mud-table-root, .cs-board-table .mud-table-body, .cs-board-table .mud-table-body .mud-table-row { display: block; width: 100%; }
    .cs-board-table colgroup { display: none; }
    .cs-board-table .mud-table-body .mud-table-cell { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 12px;
        align-items: start; justify-items: end; text-align: right !important; }
    .cs-board-table .mud-table-body .mud-table-cell::before { grid-column: 1; grid-row: 1 / span 6; justify-self: start; text-align: left; padding: 0; }
    .cs-board-table .mud-table-body .mud-table-cell > * { grid-column: 2; min-width: 0; max-width: 100%; }
    .cs-board-table .cs-clip { white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 961px) {
    .cs-board-table table { table-layout: fixed; }
    /* The table is fixed layout, so this width is what holds "Thu, Nov 12" in bold on one line beside the case number. */
    .cs-board-table .cs-col-time { width: 7.5rem; }
    .cs-board-table .cs-col-case { width: 7rem; }
    .cs-board-table .cs-col-kits { width: 11.5rem; }
    .cs-board-table .cs-col-status { width: 13rem; }
    .cs-board-table .cs-col-who { width: 12rem; }
    .cs-group:not(.is-first) .cs-board-table .mud-table-head { display: none; }
}
.cs-empty { padding: 1.25rem; font-size: 0.875rem; color: #5B6878; }

/* ---- Kit view ---- */
.cs-kit-table .mud-table-body .mud-table-row { cursor: pointer; }
.cs-kit-table .mud-table-body .mud-table-row.cs-kit-detail { cursor: default; }
.cs-kit-table .cs-r { text-align: right; }
.cs-kit-name { display: flex; align-items: flex-start; gap: 0.25rem; min-width: 0; }
.cs-kit-name__text { font-weight: 600; color: #16202E; overflow-wrap: anywhere; }
.cs-kit-detail > td { padding: 0.75rem 1.25rem 1rem 3.25rem; background: #F6F8FC; border-bottom: 1px solid #E4E9F2; }
.cs-kit-detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem 2.5rem; }
.cs-kit-detail__head { margin: 0 0 0.375rem; font-size: 0.8125rem; font-weight: 600; color: #1C2B3A; }
.cs-kit-detail__head span { margin-left: 0.375rem; color: #5B6878; font-weight: 500; font-variant-numeric: tabular-nums; }
.cs-kit-list { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; }
.cs-kit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; padding: 0.25rem 0; border-bottom: 1px solid #E4E9F2; }
.cs-kit-list li:last-child { border-bottom: 0; }
.cs-kit-list__main { flex: 1 1 12rem; min-width: 0; color: #1C2B3A; }
.cs-kit-list .cs-sub { margin-top: 0; }
.cs-kit-free { color: #0E6B4F; font-weight: 500; }
@media (max-width: 960px) {
    .cs-kit-table .cs-r { text-align: left; }
    .cs-kit-detail > td { display: block; padding: 0.75rem 1rem 1rem; }
}

.cs-att__head { display: flex; align-items: center; gap: 8px; padding: 0.625rem 1.25rem 0.25rem; font-size: 0.8125rem; font-weight: 600; }
.cs-att { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 10px; width: 100%; padding: 0.4375rem 1.25rem 0.5rem; border: 0;
    border-bottom: 1px solid #EEF1F6; background: none; text-align: left; color: #1C2B3A; cursor: pointer; font-family: inherit; }
.cs-att:hover { background: #EBF0FD; }
.cs-att__why { font-size: 0.875rem; font-weight: 600; }
.cs-att__meta { grid-column: 2; font-size: 0.8125rem; color: #5B6878; }
.cs-att__more { padding: 0.25rem 1.25rem 0.5rem; }

/* ---- week ---- */
.cs-scroll { overflow-x: auto; }
.cs-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; }
.cs-day { border-right: 1px solid #E4E9F2; display: flex; flex-direction: column; min-width: 0; }
.cs-day:last-child { border-right: 0; }
.cs-day__head { display: block; width: 100%; padding: 0.75rem 0.75rem 0.625rem; border: 0; border-bottom: 1px solid #E4E9F2; background: none; text-align: left; cursor: pointer;
    font-family: inherit; color: inherit; }
.cs-day__head:hover { background: #F6F8FC; }
.cs-day__head.is-today { background: #EBF0FD; }
.cs-day__name { display: flex; align-items: baseline; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.cs-day__name b { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.is-today .cs-day__name { color: #0548CB; }
.cs-today-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: #0548CB; color: #fff;
    font-size: 0.6875rem; font-weight: 600; margin-left: auto; }
.cs-day__counts { font-size: 0.8125rem; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.cs-day__counts span { color: #5B6878; }
.cs-day__note { font-size: 0.75rem; font-weight: 600; margin-top: 8px; }
.cs-day__note.is-ok { color: #5B6878; font-weight: 500; }
.cs-day__assign { font-size: 0.75rem; color: #8A520A; font-weight: 500; margin-top: 4px; }
.cs-cards { list-style: none; margin: 0; padding: 4px 0; flex: 1; }
.cs-card { display: block; width: 100%; padding: 8px 12px 8px 16px; box-shadow: inset 5px 0 0 var(--cs-stage, transparent); border: 0; border-bottom: 1px solid #EEF1F6; background: none; text-align: left;
    color: #1C2B3A; cursor: pointer; font-family: inherit; }
.cs-cards li:nth-child(odd) .cs-card { background: #F7F9FC; }
.cs-card:hover, .cs-cards li:nth-child(odd) .cs-card:hover { background: #EBF0FD; }
.cs-card__top { display: flex; gap: 6px; font-size: 0.8125rem; min-width: 0; align-items: center; }
.cs-card__time { font-variant-numeric: tabular-nums; color: #5B6878; flex: none; width: 3.5rem; }
.cs-card__hosp { font-weight: 500; flex: 1; min-width: 0; }
.cs-card__line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 5px 0 0 3.875rem; font-size: 0.75rem; color: #5B6878; }
.cs-card__line b { color: #1C2B3A; font-weight: 600; }
.cs-day__more { padding: 8px 12px 12px; }

/* ---- month ---- */
.cs-month { display: grid; grid-template-columns: repeat(7, minmax(108px, 1fr)); min-width: 760px; }
.cs-month__wd { padding: 8px 10px; font-size: 0.8125rem; font-weight: 600; background: #F6F8FC; border-bottom: 1px solid #E4E9F2; }
.cs-cell { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 112px; padding: 8px 10px 10px; border: 0; border-right: 1px solid #EEF1F6; border-bottom: 1px solid #EEF1F6;
    background: #fff; text-align: left; color: #1C2B3A; box-sizing: border-box; cursor: pointer; font-family: inherit; }
.cs-cell:nth-child(7n) { border-right: 0; }
.cs-cell:hover { background: #EBF0FD; }
.cs-cell.is-out { background: #FAFBFD; color: #B4BCC8; cursor: default; }
.cs-cell.is-today { box-shadow: inset 0 0 0 2px #0548CB; }
.cs-cell__day { font-size: 0.8125rem; font-weight: 600; color: #5B6878; font-variant-numeric: tabular-nums; }
.is-today .cs-cell__day { color: #0548CB; }
.is-out .cs-cell__day { color: #B4BCC8; }
.cs-cell__cases { margin-top: 6px; font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-cell__cases span { font-size: 0.75rem; font-weight: 500; color: #5B6878; }
.cs-cell__kits { font-size: 0.75rem; color: #5B6878; margin-bottom: 7px; font-variant-numeric: tabular-nums; }
.cs-cell .cs-sbar { height: 8px; }
.cs-cell__note { margin-top: 7px; font-size: 0.6875rem; font-weight: 600; }
.cs-cell__quiet { margin-top: 6px; font-size: 0.75rem; color: #667385; }
.cs-sum { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.875rem; }
.cs-sum__value { font-size: 0.9375rem; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cs-sum__value.is-big { font-size: 1.25rem; font-weight: 700; }

/* ---- assign work ---- */
.cs-assign-layout { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.cs-assign-layout__left { flex: 1 1 32rem; min-width: 0; }
.cs-assign-layout__right { flex: 1.4 1 35rem; min-width: 0; }
.cs-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 0.75rem; padding: 0.625rem 1.25rem; background: #EBF0FD;
    border-bottom: 1px solid #C3D2F9; font-size: 0.875rem; }
.cs-bulk__who { width: 14rem; max-width: 100%; }
.cs-todo__group { padding: 0.875rem 1.25rem 0.375rem; font-size: 0.8125rem; font-weight: 600; color: #5B6878; border-bottom: 1px solid #E4E9F2; }
.cs-todo { display: grid; grid-template-columns: 28px minmax(5.5rem, auto) minmax(0, 1fr) auto auto 20px; gap: 0.625rem; align-items: center;
    padding: 0.5625rem 1.25rem; border-bottom: 1px solid #EEF1F6; font-size: 0.875rem; background: #fff; cursor: grab; }
.cs-todo.is-odd { background: #F7F9FC; }
.cs-todo.is-selected { background: #EBF0FD; }
.cs-todo__grip { color: #8C98A9; }
.cs-dragging { opacity: 0.45; }
.cs-lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.cs-lane { background: #fff; border: 1px solid #E4E9F2; border-radius: 12px; overflow: clip; display: flex; flex-direction: column;
    box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05); }
.cs-lane__head { display: flex; align-items: center; gap: 10px; padding: 0.75rem 0.875rem 0.625rem; border-bottom: 1px solid #E4E9F2; }
.cs-lane__name { font-size: 0.9375rem; font-weight: 600; }
.cs-lane__load { margin-left: auto; text-align: right; font-size: 0.75rem; color: #5B6878; font-variant-numeric: tabular-nums; }
.cs-lane__load b { display: block; font-size: 0.9375rem; color: #1C2B3A; font-weight: 700; }
.cs-lane__bar { height: 6px; background: #EEF1F6; margin: 0.625rem 0.875rem 0; border-radius: 3px; overflow: hidden; }
.cs-lane__bar i { display: block; height: 100%; background: #0548CB; border-radius: 3px; }
.cs-lane__zone { min-height: 3.25rem; margin: 0.5rem 0 0; }
.cs-lane__zone.mud-drop-zone-drag-block, .cs-lane__zone.cs-can-drop { background: #EBF0FD; }
.cs-lrow { display: grid; grid-template-columns: 20px minmax(4.25rem, auto) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 0.5rem 0.875rem;
    border-top: 1px solid #EEF1F6; font-size: 0.8125rem; background: #fff; cursor: grab; }
.cs-lrow__ord { color: #5B6878; font-variant-numeric: tabular-nums; font-size: 0.75rem; }
.cs-state { font-size: 0.6875rem; font-weight: 600; padding: 0 8px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; }
.cs-state--on { background: #0548CB; color: #fff; }
.cs-state--next { background: #EEF1F6; color: #5B6878; }
.cs-drop { margin: 0.625rem 0.875rem 0.875rem; border: 1px dashed #C9D1DE; border-radius: 8px; padding: 0.625rem; text-align: center;
    font-size: 0.8125rem; color: #5B6878; }
.cs-addperson { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem; margin-bottom: 1rem; }
.cs-addperson__field { width: 16rem; max-width: 100%; }

/* ---- team ---- */
.cs-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.875rem; margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 8px;
    background: #FEF4E6; border: 1px solid #F0C58A; color: #8A520A; font-size: 0.875rem; }
.cs-idle { color: #8A520A; font-weight: 600; }
.cs-muted { color: #5B6878; }

/* ---- case drawer ---- */
/* 700px: room for the kits table's four columns (kit, number, type, status). */
.mud-dialog.cs-drawer { height: 100vh; max-height: 100vh; width: min(700px, 100vw); max-width: 100vw; margin: 0; border-radius: 0; }
.mud-dialog.cs-drawer .mud-dialog-content { padding: 0; }
.cs-drawer__body { padding: 1.125rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.cs-drawer__title { margin: 0; font-size: 1.25rem; font-weight: 600; line-height: 1.35; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-drawer h3 { margin: 0 0 0.625rem; font-size: 0.9375rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.cs-drawer h3 span { font-size: 0.8125rem; font-weight: 500; color: #5B6878; }
/* A section heading that opens and shuts its table (Still needed, Usage). */
.cs-drawer h3.is-shut { margin-bottom: 0; }
.cs-fold { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; padding: 2px 6px 2px 0; border: 0; border-radius: 6px; background: none;
    font: inherit; color: inherit; cursor: pointer; }
.cs-fold:hover { background: #EBF0FD; }
.cs-fold:focus-visible { outline: 2px solid #0548CB; outline-offset: 2px; }
.cs-alert { padding: 0.75rem 0.875rem; border-radius: 8px; background: #FDECEC; border: 1px solid #F4B4B0; }
.cs-alert.is-amber { background: #FEF4E6; border-color: #F0C58A; }
.cs-alert__title { font-weight: 600; color: #B42318; font-size: 0.875rem; }
.is-amber .cs-alert__title { color: #8A520A; }
.cs-alert__text { color: #5B2420; font-size: 0.8125rem; }
.is-amber .cs-alert__text { color: #8A520A; }
.cs-alert.is-quiet { background: #F6F8FC; border-color: #D9E0EA; }
.cs-alert--head { margin-top: 0.75rem; font-weight: 400; line-height: 1.45; }
.is-quiet .cs-alert__title { color: #1F2A37; }
.is-quiet .cs-alert__text { color: #5B6878; }
.cs-asg { display: flex; align-items: center; gap: 12px; padding: 0.75rem 0.875rem; border: 1px solid #E4E9F2; border-radius: 10px; }
.cs-asg__name { font-size: 0.9375rem; font-weight: 600; }
.cs-asg__state { font-size: 0.8125rem; color: #0548CB; font-weight: 600; }
.cs-asg__by { font-size: 0.75rem; color: #5B6878; }
.cs-ident { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.875rem 1.25rem; }
.cs-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: #5B6878; }
.cs-ident__value { font-size: 1.25rem; font-weight: 600; line-height: 1.35; margin-top: 2px; }
/* The route from the branch to the hospital, opened from the case panel. */
.cs-route__toggle { margin: 0.25rem 0 0 -0.375rem; text-transform: none; }
.cs-route { display: flex; flex-direction: column; gap: 0.5rem; }
.cs-route iframe { width: 100%; height: 22rem; border: 1px solid #E4E9F2; border-radius: 8px; }
.cs-route__legs { display: grid; gap: 0.125rem; font-size: 0.8125rem; color: #5B6878; }
.cs-route__legs .cs-label { display: inline-block; min-width: 2.75rem; }
.cs-route__link { font-size: 0.8125rem; font-weight: 600; color: var(--mud-palette-primary); }
.cs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.875rem 1rem; padding: 0.875rem 1rem; background: #F6F8FC;
    border: 1px solid #E4E9F2; border-radius: 10px; margin: 0; }
.cs-facts dt { font-size: 0.75rem; font-weight: 600; color: #5B6878; }
.cs-facts dd { margin: 2px 0 0; font-size: 0.875rem; }
.cs-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cs-track li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; position: relative; font-size: 0.75rem; color: #667385; }
.cs-track li::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: #DCE2EC; }
.cs-track li:first-child::before { display: none; }
.cs-track li.is-done::before, .cs-track li.is-current::before { background: color-mix(in srgb, var(--cs-stage, #8C98A9) 62%, #1C2B3A); }
.cs-track__dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #DCE2EC; background: #fff; box-sizing: border-box; position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center; color: #1C2B3A; font-size: 0.75rem; }
.is-done .cs-track__dot { background: var(--cs-stage, #8C98A9); border-color: color-mix(in srgb, var(--cs-stage, #8C98A9) 62%, #1C2B3A); }
.is-current .cs-track__dot { border-color: color-mix(in srgb, var(--cs-stage, #8C98A9) 62%, #1C2B3A); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cs-stage, #8C98A9) 40%, #fff); }
.is-current .cs-track__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--cs-stage, #8C98A9) 62%, #1C2B3A); }
.cs-track li.is-done, .cs-track li.is-current { color: #1C2B3A; }
.cs-track li.is-current { font-weight: 600; }
.cs-track__when { font-size: 0.6875rem; color: #5B6878; font-weight: 400; }
/* Seven labels do not fit a phone: name the current step only. The others keep their dots, and their names stay for screen readers. */
@media (max-width: 600px) {
    .cs-track li:not(.is-current) { font-size: 0; }
    .cs-track li:not(.is-current) .cs-track__when { display: none; }
    .cs-track li.is-current { white-space: nowrap; }
}
.cs-notes { background: #F6F8FC; border: 1px solid #E4E9F2; border-radius: 8px; padding: 0.75rem 0.875rem; font-size: 0.875rem; line-height: 1.55;
    white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-hist { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; }
.cs-hist li { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid #EEF1F6; }
.cs-hist__when { width: 8rem; flex: none; color: #5B6878; font-variant-numeric: tabular-nums; }
.cs-gx { font-size: 0.6875rem; font-weight: 600; color: #5B6878; border: 1px solid #E4E9F2; border-radius: 999px; padding: 0 6px; margin-left: 6px; }
.cs-drawer__foot { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 0.8125rem; color: #5B6878; }
/* On a phone the note takes its own line above the buttons. */
@media (max-width: 600px) {
    .cs-drawer__foot { flex-wrap: wrap; }
    .cs-drawer__foot > span:first-child { flex: 0 0 100%; }
}

/* ---- rules and views dialogs ---- */
.cs-rule { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem 6rem; gap: 0.75rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #EEF1F6;
    font-size: 0.875rem; }
.cs-rule__when { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: #5B6878; }
.cs-rule__when .mud-input-control { width: 4.5rem; }
.cs-view { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 0.625rem 0; border-bottom: 1px solid #EEF1F6; }
.cs-view__name { font-size: 0.875rem; font-weight: 600; }
.cs-view__toggle { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; padding: 2px 6px 2px 0; border: 0; background: none; color: var(--mud-palette-primary); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.cs-view__toggle:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; border-radius: 4px; }
.cs-view__filters { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0 0; padding: 8px 10px; background: #F6F8FC; border-radius: 8px; font-size: 0.8125rem; }
.cs-view__filters dt { color: #5B6B7C; }
.cs-view__filters dd { margin: 0; overflow-wrap: anywhere; }

/* ---- my work (phone first) ---- */
.cs-mywork { max-width: 34rem; margin-inline: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; color: #1C2B3A; }
.cs-now .cs-panel__header { background: #EBF0FD; border-bottom-color: #C3D2F9; align-items: center; justify-content: flex-start; }
.cs-live { width: 10px; height: 10px; border-radius: 50%; background: #0548CB; box-shadow: 0 0 0 4px #C3D2F9; }
.cs-big { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.cs-kitlist { list-style: none; margin: 0; padding: 0; border: 1px solid #E4E9F2; border-radius: 8px; overflow: hidden; }
.cs-kitlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0.625rem 0.75rem; border-bottom: 1px solid #EEF1F6;
    font-size: 0.875rem; min-height: 44px; box-sizing: border-box; }
.cs-kitlist li:last-child { border-bottom: 0; }
.cs-kitlist li:nth-child(odd) { background: #F7F9FC; }
.cs-item { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: 0.375rem 0.75rem; align-items: start; padding: 0.875rem 1rem; border-bottom: 1px solid #EEF1F6; }
.cs-item__ord { font-size: 0.8125rem; color: #5B6878; font-variant-numeric: tabular-nums; padding-top: 0.125rem; }
.cs-item:nth-child(even) { background: #F7F9FC; }
.cs-item__meta { grid-column: 2 / 4; font-size: 0.8125rem; color: #5B6878; display: flex; align-items: center; gap: 0.25rem 0.5rem; flex-wrap: wrap; }
.cs-item__meta .cs-badges { gap: 0.25rem; }
.cs-open { display: block; width: 100%; border: 0; background: none; padding: 0; margin: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 40px; }
.cs-open__time { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.cs-open__name { display: block; font-size: 0.9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.cs-mywork .cs-panel__header { align-items: baseline; gap: 0.125rem 1rem; }
.cs-mywork .cs-panel__header .cs-sub { flex: 1 1 12rem; text-align: right; }
.cs-mywork .cs-now .cs-panel__header { align-items: center; }
@media (max-width: 480px) { .cs-mywork { padding: 0.75rem 0.5rem; } .cs-mywork .cs-panel__header .cs-sub { flex-basis: 100%; text-align: left; } }
.cs-open:hover { color: #0548CB; text-decoration: underline; text-underline-offset: 3px; }
.cs-open:focus-visible { outline: 2px solid #0548CB; outline-offset: 2px; }
.cs-done { display: flex; align-items: center; gap: 10px; padding: 0.625rem 1rem; border: 0; border-bottom: 1px solid #EEF1F6; font-size: 0.8125rem;
    width: 100%; min-height: 44px; margin: 0; background: none; font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
.cs-done:hover { background: #F2F6FE; }
.cs-done:focus-visible { outline: 2px solid #0548CB; outline-offset: -2px; }
.cs-done:disabled { cursor: default; background: none; }

/* ---- floor monitor: sized in --u, 1% of the width or of a 16:9 height, whichever is smaller, so any screen is filled and nothing scrolls ---- */
.cs-tv { --u: min(1vw, 1.7778vh); height: 100vh; height: 100dvh; overflow: hidden; box-sizing: border-box; padding: calc(var(--u) * 1.5) calc(var(--u) * 1.9); display: flex; flex-direction: column; gap: calc(var(--u) * 1.15); background: #F4F5FA; color: #1C2B3A; }
.cs-tv__top { display: flex; align-items: center; gap: calc(var(--u) * 2.5); flex-wrap: wrap; }
.cs-tv__title { font-size: calc(var(--u) * 2.1); font-weight: 600; line-height: 1.1; }
.cs-tv__date { font-size: calc(var(--u) * 1.25); color: #5B6878; margin-top: calc(var(--u) * 0.3); }
.cs-tv__kpis { display: flex; gap: calc(var(--u) * 2.3); margin-left: auto; }
.cs-tv__kpi-label { font-size: calc(var(--u) * 1.05); font-weight: 600; color: #5B6878; }
.cs-tv__kpi-value { font-size: calc(var(--u) * 2.7); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cs-tv__clock { text-align: right; min-width: calc(var(--u) * 12); }
.cs-tv__clock-time { font-size: calc(var(--u) * 2.7); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.05; }
.cs-tv__clock-sub { font-size: calc(var(--u) * 0.95); color: #5B6878; margin-top: calc(var(--u) * 0.2); }
.cs-tv__body { flex: 1; display: grid; grid-template-columns: 1fr 1fr 1fr 0.8fr calc(var(--u) * 24); gap: calc(var(--u) * 0.95); min-height: 0; }
.cs-tv__lane { background: #fff; border: 1px solid #E4E9F2; border-radius: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05); }
.cs-tv__lane-head { display: flex; align-items: center; gap: calc(var(--u) * 0.75); padding: calc(var(--u) * 0.95) calc(var(--u) * 1.15) calc(var(--u) * 0.75); border-bottom: 1px solid #E4E9F2; font-size: calc(var(--u) * 1.35); font-weight: 600; }
.cs-tv__lane-head .cs-sw { width: calc(var(--u) * 1.05); height: calc(var(--u) * 1.05); border-radius: calc(var(--u) * 0.26); }
.cs-tv__lane-count { margin-left: auto; font-size: calc(var(--u) * 2.3); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.cs-tv__rows { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: hidden; }
.cs-tv__rows li { padding: calc(var(--u) * 0.75) calc(var(--u) * 1.15); border-bottom: 1px solid #EEF1F6; }
.cs-tv__rows li:nth-child(odd) { background: #F7F9FC; }
.cs-tv__r1 { display: flex; gap: calc(var(--u) * 0.75); align-items: center; font-size: calc(var(--u) * 1.25); }
.cs-tv__time { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; width: calc(var(--u) * 6); }
.cs-tv__hosp { font-weight: 500; flex: 1; min-width: 0; }
.cs-tv__r2 { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.4); align-items: center; margin: calc(var(--u) * 0.4) 0 0 calc(var(--u) * 6.75); font-size: calc(var(--u) * 1); color: #5B6878; }
.cs-tv .cs-av { width: calc(var(--u) * 2.1); height: calc(var(--u) * 2.1); font-size: calc(var(--u) * 0.9); font-weight: 700; }
.cs-tv .cs-badge { height: calc(var(--u) * 1.7); padding: 0 calc(var(--u) * 0.6); font-size: calc(var(--u) * 0.95); }
.cs-tv__foot { padding: calc(var(--u) * 0.6) calc(var(--u) * 1.15); background: #F6F8FC; border-top: 1px solid #E4E9F2; font-size: calc(var(--u) * 1); color: #5B6878; }
.cs-tv__att { padding: calc(var(--u) * 0.75) calc(var(--u) * 1.15); border-bottom: 1px solid #EEF1F6; }
.cs-tv__att-why { font-size: calc(var(--u) * 1.2); font-weight: 600; }
.cs-tv__att-meta { font-size: calc(var(--u) * 1); color: #5B6878; }
.cs-tv__tom { display: flex; align-items: center; gap: calc(var(--u) * 1.15); background: #fff; border: 1px solid #E4E9F2; border-radius: 12px; padding: calc(var(--u) * 0.95) calc(var(--u) * 1.35); font-size: calc(var(--u) * 1.15);
    box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04), 0 4px 16px rgba(16, 32, 64, 0.05); flex-wrap: wrap; }
.cs-tv__tom-title { font-size: calc(var(--u) * 1.35); font-weight: 600; }
.cs-tv__tom .cs-sbar { flex: 1; height: calc(var(--u) * 1.15); min-width: calc(var(--u) * 15); }
.cs-tv__key { display: flex; align-items: center; gap: calc(var(--u) * 0.4); font-size: calc(var(--u) * 0.95); color: #5B6878; white-space: nowrap; }
/* Inside the signed-in shell: the header, the body padding and the page's branch row take about 11 rem of the height. */
.cs-tv--shell { --u: min(0.94vw, calc((100dvh - 11rem) * 0.017778)); height: calc(100dvh - 11rem); min-height: 22rem; padding: 0; background: none; }

@media (max-width: 768px) {
    .cs-page { padding-inline: 0.75rem; }
    .cs-head__field, .cs-filter { width: 100%; }
    .cs-bar__group, .cs-bar__group--end { width: 100%; margin-left: 0; }
    .cs-top__actions { justify-content: flex-start; margin-left: 0; }
    .cs-top__actions .cs-sync { align-items: flex-start; text-align: left; }
    .cs-fchips { flex-wrap: nowrap; overflow-x: auto; }
    .cs-fchip { flex: none; height: 36px; }
    .cs-assign { height: 44px; }
    .cs-todo { grid-template-columns: 28px minmax(0, 1fr) auto; }
    .cs-todo__time, .cs-todo__grip { display: none; }
    .cs-rule { grid-template-columns: 1fr; gap: 0.25rem; }
    .cs-tv__body { grid-template-columns: 1fr; }
}
