/* [nb_staff]: plain on purpose, so it takes on the theme's look. Everything sits
   inside :where() (zero specificity), so any theme rule wins without a fight. */
:where(.nb-staff) [hidden] { display: none !important; }
:where(.nb-staff .nb-tabs) { display: flex; flex-wrap: wrap; gap: .5em; margin: 0 0 1em; }
:where(.nb-staff .nb-tabs [aria-selected="true"]) { font-weight: 700; text-decoration: underline; }
:where(.nb-staff label) { display: inline-block; margin: 0 1em .5em 0; }
:where(.nb-staff label > input, .nb-staff label > select, .nb-staff label > textarea) { display: block; margin-top: .3em; }
:where(.nb-staff textarea) { width: 100%; max-width: 36em; box-sizing: border-box; }
:where(.nb-staff .nb-msg, .nb-staff .nb-notice) { padding: .6em .9em; border: 1px solid currentColor; }
/* Empty but still rendered: a live region that is display:none isn't read out when it fills. */
:where(.nb-staff .nb-msg:empty) { margin: 0; padding: 0; border: 0; }
:where(.nb-staff .nb-error, .nb-staff .nb-warn) { font-weight: 600; }
:where(.nb-staff .nb-card) { border: 1px solid rgba(128, 128, 128, .5); padding: .8em 1em; margin: 0 0 1em; }
:where(.nb-staff .nb-card h3) { margin: 0 0 .4em; font-size: 1.05em; }
:where(.nb-staff .nb-card p) { margin: .3em 0; }
/* Finished bookings: a dashed frame, not faded text (fading fails contrast). */
:where(.nb-staff .nb-card--cancelled, .nb-staff .nb-card--rejected) { border-style: dashed; }
:where(.nb-staff .nb-confirm) { margin-top: .6em; padding-top: .4em; border-top: 1px dashed currentColor; }
:where(.nb-staff .nb-badge) { display: inline-block; margin-left: .5em; padding: 0 .4em; border: 1px solid currentColor; font-size: .85em; }
:where(.nb-staff .nb-actions) { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .6em; }
:where(.nb-staff .nb-scroll) { overflow-x: auto; }
:where(.nb-staff table) { width: 100%; border-collapse: collapse; }
:where(.nb-staff th, .nb-staff td) { text-align: left; padding: .45em .6em; border-bottom: 1px solid rgba(128, 128, 128, .35); }

/* ---- Dashboard: the day as a timeline.
   Geometry is scoped to .nb-dash (not :where) so a theme's generic button and
   label rules can't move the grid; themes leave it alone. The colours below it
   are :where() defaults that any theme rule replaces. */
.nb-dash { min-width: 0; max-width: 100%; }
.nb-dash .nb-dash__toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5em; margin: 0 0 .75em; }
.nb-dash .nb-dash__toolbar label { margin: 0; }
.nb-dash .nb-dash__toolbar :is(input, select) { width: auto; }
.nb-dash .nb-dash__branch:empty, .nb-dash .nb-dash__note:empty { display: none; }
.nb-dash .nb-dash__legend { display: flex; flex-wrap: wrap; gap: .35em; margin: 0; padding: 0; list-style: none; }
.nb-dash .nb-dash__key { padding: .15em .5em; }
/* The grid scrolls sideways inside itself; the page never does. */
.nb-dash .nb-dash__grid {
  --nb-dash-label: 6.5rem; --nb-dash-col: 1.75rem; --nb-dash-row: 3rem;
  position: relative; display: grid; max-width: 100%; box-sizing: border-box;
  grid-template-columns: var(--nb-dash-label) repeat(var(--nb-dash-cols, 1), minmax(var(--nb-dash-col), 1fr));
  grid-template-rows: 1.75rem repeat(var(--nb-dash-rows, 1), var(--nb-dash-row));
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
}
.nb-dash .nb-dash__row { display: contents; }
.nb-dash :is(.nb-dash__corner, .nb-dash__label) { position: sticky; left: 0; z-index: 4; }
.nb-dash .nb-dash__label { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 .5em; overflow: hidden; line-height: 1.15; }
.nb-dash .nb-dash__hour { padding: .3em .3em 0; overflow: hidden; white-space: nowrap; }
.nb-dash .nb-dash__gap { z-index: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none; }
/* A staff-only session: its cells stay bookable under a band that names it. */
.nb-dash .nb-dash__band { z-index: 1; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; pointer-events: none; }
.nb-dash .nb-dash__item {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .1em;
  min-width: 0; min-height: 0; margin: 2px 1px; padding: .1em .35em; overflow: hidden;
  font-size: .78rem; line-height: 1.15; text-align: left; white-space: nowrap;
  cursor: grab; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.nb-dash :is(.nb-dash__who, .nb-dash__tag) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nb-dash .nb-dash__item--dragging { opacity: .45; cursor: grabbing; }
.nb-dash .nb-dash__handle { position: absolute; z-index: 1; right: 0; }
.nb-dash .nb-dash__handle--end { top: 0; bottom: 0; width: 10px; cursor: ew-resize; }
.nb-dash .nb-dash__handle--corner { bottom: 0; z-index: 2; width: 14px; height: 14px; cursor: nwse-resize; }
.nb-dash .nb-dash__ghost { z-index: 3; display: flex; align-items: flex-end; margin: 2px 1px; padding: .1em .35em; overflow: hidden; white-space: nowrap; font-size: .75rem; pointer-events: none; }
.nb-dash .nb-dash__now { position: relative; z-index: 3; width: 2px; margin-left: -1px; pointer-events: none; }
.nb-dash .nb-dash__now-label { position: absolute; top: 0; left: 2px; padding: 0 .3em; font-size: .7rem; line-height: 1.6; white-space: nowrap; }
.nb-dash .nb-dash__state--loading { display: grid; gap: 4px; }
.nb-dash .nb-dash__skel { display: block; height: 3rem; }
.nb-dash .nb-dash__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nb-dash .nb-dash__panel { box-sizing: border-box; max-width: 100%; margin-top: 1em; padding: 1em; }
.nb-dash .nb-dash__panel :is(input, select, textarea) { max-width: 100%; box-sizing: border-box; }

/* Colours: one square border system, yellow / green / red / blue states, every
   text colour at 4.5:1 or better on its fill. */
:where(.nb-dash__grid) { border: 1px solid rgba(128, 128, 128, .5); background: Canvas; color: CanvasText; }
:where(.nb-dash__row, .nb-dash__corner, .nb-dash__label) { background: inherit; } /* sticky names hide what scrolls under them */
:where(.nb-dash__label) { border-right: 2px solid rgba(128, 128, 128, .6); border-bottom: 1px solid rgba(128, 128, 128, .3); font-size: .85rem; font-weight: 600; }
:where(.nb-dash__type) { font-size: .75rem; font-weight: 400; }
:where(.nb-dash__corner, .nb-dash__hour) { border-bottom: 1px solid rgba(128, 128, 128, .6); font-size: .72rem; }
:where(.nb-dash__hour) { border-left: 1px solid rgba(128, 128, 128, .6); }
:where(.nb-dash__cell) { border-left: 1px solid rgba(128, 128, 128, .15); border-bottom: 1px solid rgba(128, 128, 128, .3); cursor: cell; }
:where(.nb-dash__cell--hour) { border-left-color: rgba(128, 128, 128, .5); }
/* Equal (zero) specificity, so order decides: the staff tint before the hover, the staff key after the key. */
:where(.nb-dash__cell--staff) { background: rgba(21, 101, 192, .07); }
:where(.nb-dash__cell:hover) { background: rgba(128, 128, 128, .14); }
:where(.nb-dash__gap) { background: repeating-linear-gradient(135deg, rgba(128, 128, 128, .3) 0 3px, transparent 3px 9px);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
:where(.nb-dash__band) { border-left: 2px dashed #1565C0; border-right: 2px dashed #1565C0; padding-top: .2em;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
:where(.nb-dash__item, .nb-dash__key) { border: 2px solid #5C4700; border-radius: 0; background: #F7D348; color: #1A1914; }
:where(.nb-dash__key--staff) { border: 2px dashed #1565C0; background: rgba(21, 101, 192, .12); color: CanvasText; }
:where(.nb-dash__item) { font-family: inherit; box-shadow: none; }
:where(.nb-dash__item:focus-visible) { outline: 3px solid #1565C0; outline-offset: 2px; }
:where(.nb-dash__item--pending) { border-style: dashed; background: #FFF1B8; color: #1A1914; }
:where(.nb-dash__item--late) { border-color: #6D1410; background: #B3261E; color: #FFFFFF; }
:where(.nb-dash__item--arrived) { border-color: #0F3D12; background: #2E7D32; color: #FFFFFF; }
:where(.nb-dash__item--change) { border-color: #0B3A75; background: #1565C0; color: #FFFFFF; }
:where(.nb-dash__item--done) { border-color: #5E8F61; background: #DCEDDC; color: #1B3D1E; }
:where(.nb-dash__item--noshow) { border-color: #A86A64; background: #F6D9D6; color: #5A1A14; }
:where(.nb-dash__tag) { font-size: .9em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
:where(.nb-dash__handle--end:hover) { background: rgba(0, 0, 0, .18); }
:where(.nb-dash__handle--corner) { background: linear-gradient(135deg, transparent 55%, currentColor 55%); }
:where(.nb-dash__ghost) { border: 2px dashed currentColor; background: rgba(21, 101, 192, .18); }
:where(.nb-dash__now, .nb-dash__now-label) { background: #B3261E; }
:where(.nb-dash__now-label) { color: #FFFFFF; font-weight: 700; }
:where(.nb-dash__skel) { background: rgba(128, 128, 128, .18); animation: nb-dash-pulse 1.2s ease-in-out infinite; }
:where(.nb-dash__panel) { border: 2px solid rgba(128, 128, 128, .6); border-radius: 0; }
/* Tactile: a press sinks a pixel. Only transform and opacity ever animate. */
:where(.nb-dash button) { transition: transform .08s ease-out, opacity .12s ease-out; }
:where(.nb-dash button:not(.nb-dash__item):active) { transform: translateY(1px); }
@keyframes nb-dash-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .nb-dash *, .nb-dash *::before, .nb-dash *::after { transition: none !important; animation: none !important; }
}
