html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background: #f1f5f9;
  color: #1e293b;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  line-height: 60px;
}

.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 #0f766e;
}

/* ---------------------------------------------------------------- On-call rota */
:root {
  --rota-teal: #0f766e;
  --rota-amber: #b45309;
  --rota-rose: #e11d48;
  --rota-violet: #6d28d9;
}

.rota-navbar { background: var(--rota-teal); }
.rota-toasts {
  position: fixed; left: 0; right: 0; bottom: 1rem; z-index: 1080;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 0 1rem; pointer-events: none;
}
.rota-toast {
  pointer-events: auto; max-width: 28rem; background: #0f172a; color: #fff;
  border-radius: .5rem; padding: .5rem .75rem; font-size: .875rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.rota-toast-error { background: var(--rota-rose); }

/* Dialog partials wrap header, body and footer in a <form>. Let the form pass the scrollable dialog's height
   limit through, so the header and footer stay put and only the body scrolls instead of being cut off. */
.modal-dialog-scrollable .modal-content > form {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; overflow: hidden;
}

.rota-grid { overflow-x: auto; }
.rota-grid table { min-width: 46rem; width: 100%; border-collapse: collapse; font-size: .875rem; }
.rota-grid th, .rota-grid td { border-bottom: 1px solid #f1f5f9; vertical-align: top; padding: .375rem; }
.rota-grid td + td, .rota-grid th + th, .rota-grid th + td { border-left: 1px solid #f1f5f9; }
.rota-grid thead th { background: #f8fafc; border-bottom: 1px solid #e2e8f0; min-width: 7.5rem; font-weight: 600; }
.rota-grid .rota-date { position: sticky; left: 0; z-index: 1; background: #fff; width: 8rem; min-width: 8rem; }
.rota-row-weekend, .rota-row-weekend .rota-date { background: #f8fafc; }
.rota-row-holiday, .rota-row-holiday .rota-date { background: #fffbeb; }
.rota-row-today, .rota-row-today .rota-date { background: #f0fdfa; }

.rota-dot { display: inline-block; width: .625rem; height: .625rem; border-radius: 50%; flex-shrink: 0; }
/* A doctor on a shift: tinted with the shift's colour (set as --shift), led by the same dot as the column header. */
.rota-chip {
  --shift: #94a3b8;
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--shift) 35%, #fff); border-radius: .375rem;
  padding: .125rem .4rem .125rem .35rem; font-size: .75rem; font-weight: 500; line-height: 1.2;
  background: color-mix(in srgb, var(--shift) 10%, #fff); color: #1e293b; text-align: left;
}
.rota-chip::before {
  content: ""; width: .45rem; height: .45rem; border-radius: 50%; flex-shrink: 0; background: var(--shift);
}
button.rota-chip:hover { box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
button.rota-chip:focus-visible { outline: 2px solid var(--rota-teal); outline-offset: 1px; }
.rota-chip-draft { font-style: italic; }
.rota-chip-dimmed { opacity: .25; }
.rota-chip-soft { outline: 1px solid #fbbf24; }
.rota-chip-urgent { outline: 1px solid #fb7185; }
.rota-chip .bi { font-size: .75rem; }
.rota-mark-leave, .rota-mark-weekend-approved { color: var(--rota-rose); }
.rota-mark-weekend-requested, .rota-mark-cannot { color: var(--rota-amber); }
.rota-mark-postcall { color: var(--rota-violet); }
.rota-mark-wanted { color: var(--rota-teal); }
.rota-mark-swap { color: #64748b; }
.rota-team {
  align-self: flex-start; background: #ccfbf1; color: #115e59; border-radius: .25rem;
  padding: 0 .25rem; font-size: .625rem; font-weight: 600;
}
.rota-fill {
  display: inline-flex; align-items: center; gap: .25rem; border: 1px dashed #fcd34d; border-radius: .375rem;
  padding: .125rem .375rem; font-size: .6875rem; font-weight: 600; color: var(--rota-amber); background: none;
}
button.rota-fill:hover { background: #fffbeb; }
.rota-add { border: 0; background: none; padding: 0 .25rem; font-size: .6875rem; font-weight: 600; color: #cbd5e1; align-self: flex-start; }
.rota-add:hover { color: var(--rota-teal); }
.rota-muted { color: #cbd5e1; font-size: .75rem; }
.rota-small { font-size: .6875rem; }
.rota-tiny { font-size: .625rem; }
.rota-bar { height: .5rem; background: #f1f5f9; border-radius: 999px; overflow: hidden; flex: 1; }
.rota-bar > span { display: block; height: 100%; background: var(--rota-teal); }
.rota-stat { border: 1px solid #e2e8f0; border-radius: .5rem; padding: .5rem .75rem; height: 100%; }
.rota-stat-label { font-size: .6875rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; font-weight: 600; }
.rota-stat-value { font-size: 1.125rem; font-weight: 600; }
.rota-tone-teal { color: var(--rota-teal); }
.rota-tone-amber { color: var(--rota-amber); }
.rota-tone-rose { color: var(--rota-rose); }
.rota-issue-dot { width: .5rem; height: .5rem; border-radius: 50%; flex-shrink: 0; margin-top: .3rem; }
.rota-issue-error { background: #f43f5e; }
.rota-issue-warn { background: #f59e0b; }
.rota-issue-info { background: #94a3b8; }
.rota-issue { width: 100%; text-align: left; background: #fff; }
button.rota-issue:hover { border-color: #5eead4 !important; background: #f0fdfa; }
.rota-legend { font-size: .6875rem; color: #64748b; }

/* Request / leave status: approved (teal), requested (amber), declined (grey). */
.rota-status {
  display: inline-flex; align-items: center; gap: .25rem; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: .1rem .5rem; font-size: .75rem; font-weight: 600; background: #fff; color: #475569; line-height: 1.4;
}
.rota-status-approved { background: #f0fdfa; color: #115e59; border-color: #5eead4; }
.rota-status-requested { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.rota-status-declined { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
button.rota-status:hover { border-color: var(--rota-teal); }
.rota-row-past { color: #94a3b8; }

.rota-strike { text-decoration: line-through; }
.rota-kind-want { background: #f0fdfa; color: #115e59; border-color: transparent; }
.rota-kind-cannot { background: #fff1f2; color: #be123c; border-color: transparent; }
.rota-clickable { cursor: pointer; }
.rota-clickable:hover { background: #f0fdfa; }
.rota-clash-dot { display: inline-block; width: .375rem; height: .375rem; border-radius: 50%; background: #f43f5e; }
.rota-ask-add {
  border: 1px dashed #cbd5e1; background: #fff; color: #94a3b8; border-radius: .375rem;
  padding: 0 .375rem; font-size: .6875rem; font-weight: 600;
}
.rota-ask-add:hover { border-color: #2dd4bf; color: var(--rota-teal); }
.rota-grid-cell { font-size: .6875rem; padding: 0 .375rem; border-radius: .375rem; }
.rota-weekend-option { border: 1px solid #e2e8f0; border-radius: .5rem; padding: .5rem .75rem; background: #fff; }
.rota-weekend-option:has(input:checked) { border-color: #2dd4bf; background: #f0fdfa; }

.rota-pill { display: inline-block; border-radius: 999px; padding: .05rem .45rem; font-size: .6875rem; font-weight: 600; }
.rota-pill-teal { background: #f0fdfa; color: #115e59; }
.rota-pill-amber { background: #fffbeb; color: #92400e; }
.rota-pill-rose { background: #fff1f2; color: #be123c; }

/* ---------------------------------------------------------------- Help guide */
.rota-help { max-width: 72rem; }
.rota-help-search { max-width: 40rem; }
.rota-help-search .form-control { font-size: 1rem; }
.rota-help-toc { position: sticky; top: 1rem; }
.rota-help-toc a {
  padding: .375rem .5rem; border-radius: .375rem; color: #334155; text-decoration: none; font-size: .875rem;
}
.rota-help-toc a:hover, .rota-help-toc a:focus-visible { background: #f0fdfa; color: var(--rota-teal); }
.rota-help-badge {
  display: inline-block; border-radius: 999px; padding: 0 .45rem; font-size: .6875rem; font-weight: 600;
  background: #f1f5f9; color: #475569; vertical-align: middle;
}
.rota-help-topic { margin-bottom: 1rem; scroll-margin-top: 1rem; transition: box-shadow .3s ease; }
.rota-help-topic h2 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rota-help-topic h2 .bi { color: var(--rota-teal); }
.rota-help-lead { color: #64748b; font-size: .9375rem; }
.rota-help-item { padding-top: .75rem; margin-top: .75rem; border-top: 1px solid #f1f5f9; }
.rota-help-item h3 { font-size: .9375rem; font-weight: 600; margin-bottom: .375rem; }
.rota-help-item p, .rota-help-item li { font-size: .875rem; color: #334155; }
.rota-help-item p:last-child, .rota-help-item ul:last-child, .rota-help-item ol:last-child { margin-bottom: 0; }
.rota-help-legend { list-style: none; padding-left: 0; }
.rota-help-legend li { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
mark.rota-help-hit { background: #fef08a; color: inherit; padding: 0 .0625rem; border-radius: .125rem; }
.rota-help-flash { box-shadow: 0 0 0 .2rem #5eead4; }
@media (prefers-reduced-motion: reduce) { .rota-help-topic { transition: none; } }

@media print {
  .no-print, .no-print * { display: none !important; }
  body { background: #fff; }
  @page { size: A4 landscape; margin: 10mm; }
}

/* Shared page pieces (Plan 3) */
.rota-badge-senior { background: #ccfbf1; color: #115e59; }
.rota-page-intro { max-width: 48rem; }

/* Share & print: a compact bordered grid that fits an A4 landscape page. */
.rota-print-grid { font-size: .75rem; min-width: 44rem; }
.rota-print-grid th, .rota-print-grid td { vertical-align: top; padding: .25rem .375rem; }
.rota-print-meta { font-size: .625rem; font-weight: 400; color: #94a3b8; }
.rota-print-date { width: 5rem; }
.rota-team-letter { font-size: .5625rem; font-weight: 600; color: var(--rota-teal); margin-right: .25rem; }

@media print {
  .rota-print-card { border: 0 !important; box-shadow: none !important; }
  .rota-print-card .card-body { padding: 0 !important; }
  .rota-print-grid { font-size: 7.5pt; min-width: 0; }
  .rota-print-grid tr { break-inside: avoid; }
  .table-responsive { overflow: visible !important; }
}
