/* Theme: a calm, Stripe-like look on top of Bootstrap. Colours are set once here as Bootstrap
   variables so every page picks them up without page-level classes. No web fonts: the
   Content-Security-Policy only allows this site, so we use the system UI font. */

:root {
  --mtl-primary: #11385b;
  --mtl-accent: #eb642e;
  --mtl-accent-soft: #fdeee7;
  --mtl-link: #1d5c91;
  --mtl-primary-hover: #0d2c48;
  --mtl-primary-soft: #e8eef5;
  --mtl-text: #1a1f36;
  --mtl-text-muted: #687385;
  --mtl-border: #e3e8ee;
  --mtl-page: #f6f8fa;
  --mtl-surface: #ffffff;
  --mtl-shadow-sm: 0 1px 1px rgba(0, 0, 0, .03), 0 2px 5px rgba(60, 66, 87, .06);
  --mtl-shadow-btn: 0 1px 1px rgba(0, 0, 0, .08), 0 0 0 1px rgba(60, 66, 87, .14), 0 2px 5px rgba(60, 66, 87, .08);
  --mtl-focus: 0 0 0 4px rgba(17, 56, 91, .2);
  --mtl-sidebar-width: 248px;

  --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--mtl-text);
  --bs-secondary-color: var(--mtl-text-muted);
  --bs-border-color: var(--mtl-border);
  --bs-primary: var(--mtl-primary);
  --bs-primary-rgb: 17, 56, 91;
  --bs-link-color: var(--mtl-link);
  --bs-link-color-rgb: 29, 92, 145;
  --bs-link-hover-color: var(--mtl-primary-hover);
  --bs-link-hover-color-rgb: 13, 44, 72;
  --bs-border-radius: 6px;
  --bs-border-radius-lg: 8px;
  --bs-border-radius-sm: 4px;
}

html {
  font-size: 14px;
}

body {
  background: var(--mtl-page);
  color: var(--mtl-text);
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.icon {
  flex-shrink: 0;
  vertical-align: -3px;
}

/* ---- App shell: sidebar + content ---- */

.app {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 2.25rem 4rem;
}

.sidebar {
  --bs-offcanvas-width: 280px;
  display: flex;
  flex-direction: column;
}

.sidebar.offcanvas-lg {
  background-color: var(--mtl-surface) !important;
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: var(--mtl-sidebar-width);
    height: 100vh;
    flex-shrink: 0;
    border-right: 1px solid var(--mtl-border);
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1.25rem 1.25rem 1rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f28455, var(--mtl-accent) 55%, #d4541f);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 2px 6px rgba(235, 100, 46, .35);
}

.brand-name {
  display: block;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: .75rem;
  color: var(--mtl-text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .25rem .75rem 1rem;
}

.side-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .4rem .625rem;
  margin: 1px 0;
  border-radius: 6px;
  color: #414552;
  font-weight: 500;
}

.side-nav a .icon {
  color: #87909f;
}

.side-nav a:hover {
  background: #f2f4f7;
  text-decoration: none;
  color: var(--mtl-text);
}

.side-nav a.active {
  background: var(--mtl-primary-soft);
  color: var(--mtl-primary);
  font-weight: 600;
}

.side-nav a.active .icon {
  color: var(--mtl-accent);
}

.side-nav-heading {
  margin: 1.25rem .625rem .375rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8792a2;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid var(--mtl-border);
}

.sidebar-user form {
  margin: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex: 1;
  min-width: 0;
  padding: .375rem;
  border-radius: 6px;
  color: var(--mtl-text);
  font-weight: 500;
}

.user-chip:hover {
  background: #f2f4f7;
  text-decoration: none;
  color: var(--mtl-text);
}

.user-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--mtl-accent-soft);
  color: #b8461a;
  font-size: .72rem;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .625rem 1rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--mtl-border);
}

@media (max-width: 991.98px) {
  .app-content {
    padding: 1.25rem 1rem 3rem;
  }
}

/* ---- Signed-out pages ---- */

body.auth {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(17, 56, 91, .14), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(235, 100, 46, .12), transparent 60%),
    var(--mtl-page);
}

.auth-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
}

.auth .card {
  border: 0;
  box-shadow: 0 15px 35px rgba(60, 66, 87, .08), 0 5px 15px rgba(0, 0, 0, .06) !important;
}

/* ---- Page header ---- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
  color: var(--mtl-text);
  font-weight: 650;
}

/* ---- Cards ---- */

.card {
  --bs-card-border-color: var(--mtl-border);
  --bs-card-border-radius: 8px;
  --bs-card-inner-border-radius: 7px;
  --bs-card-cap-bg: var(--mtl-surface);
  --bs-card-cap-padding-y: .875rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-spacer-y: 1.125rem;
  box-shadow: var(--mtl-shadow-sm);
}

.card + .card {
  margin-top: 1.25rem;
}

.card-header {
  font-weight: 600;
  font-size: 1rem;
}

a.card {
  color: var(--mtl-text);
  transition: box-shadow .15s ease, transform .15s ease;
}

a.card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(60, 66, 87, .12), 0 1px 3px rgba(0, 0, 0, .06);
}

/* Dashboard tiles: label above a large number, as on Stripe. */
.card-body:has(> .stat) {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.stat {
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  order: -1;
  color: var(--mtl-text-muted);
  font-size: .85rem;
  font-weight: 500;
}

.card.border-warning {
  border-color: var(--mtl-border) !important;
  box-shadow: inset 3px 0 0 var(--mtl-accent), var(--mtl-shadow-sm);
}

.card.border-danger {
  border-color: var(--mtl-border) !important;
  box-shadow: inset 3px 0 0 #df1b41, var(--mtl-shadow-sm);
}

/* ---- Tables ---- */

.table {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: #f7f9fc;
  --bs-table-border-color: #ebeef1;
  margin-bottom: 0;
}

.table td, .table th {
  vertical-align: middle;
  padding: .75rem 1rem;
}

.table > thead th {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--mtl-text-muted);
  background: #fafbfc;
  border-bottom-color: var(--mtl-border);
  white-space: nowrap;
}

.table > tbody > tr:last-child > * {
  border-bottom: 0;
}

.card > .table-responsive:first-child .table > thead th:first-child {
  border-top-left-radius: 7px;
}

.card > .table-responsive:first-child .table > thead th:last-child {
  border-top-right-radius: 7px;
}

/* ---- Buttons ---- */

.btn {
  --bs-btn-font-weight: 500;
  --bs-btn-padding-y: .375rem;
  --bs-btn-padding-x: .875rem;
  --bs-btn-focus-box-shadow: var(--mtl-focus);
  transition: background-color .12s ease, box-shadow .12s ease, color .12s ease;
}

.btn-sm {
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .625rem;
  --bs-btn-font-size: .85rem;
}

.btn-primary {
  --bs-btn-bg: var(--mtl-primary);
  --bs-btn-border-color: var(--mtl-primary);
  --bs-btn-hover-bg: var(--mtl-primary-hover);
  --bs-btn-hover-border-color: var(--mtl-primary-hover);
  --bs-btn-active-bg: #0a2238;
  --bs-btn-active-border-color: #0a2238;
  --bs-btn-disabled-bg: var(--mtl-primary);
  --bs-btn-disabled-border-color: var(--mtl-primary);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 2px 5px rgba(17, 56, 91, .25);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  --bs-btn-bg: var(--mtl-surface);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-border-color: transparent;
  box-shadow: var(--mtl-shadow-btn);
}

.btn-outline-secondary {
  --bs-btn-color: #30313d;
  --bs-btn-hover-color: var(--mtl-text);
  --bs-btn-hover-bg: #f6f8fa;
  --bs-btn-active-color: var(--mtl-text);
  --bs-btn-active-bg: #ebeef1;
}

.btn-outline-primary {
  --bs-btn-color: var(--mtl-primary);
  --bs-btn-hover-color: var(--mtl-primary-hover);
  --bs-btn-hover-bg: var(--mtl-primary-soft);
  --bs-btn-active-color: var(--mtl-primary-hover);
  --bs-btn-active-bg: #dbe5ef;
}

.btn-outline-danger {
  --bs-btn-color: #c0123c;
  --bs-btn-hover-color: #a50e33;
  --bs-btn-hover-bg: #fff0f3;
  --bs-btn-active-color: #a50e33;
  --bs-btn-active-bg: #ffe2e9;
}

.btn-success {
  --bs-btn-bg: #1a8f4c;
  --bs-btn-border-color: #1a8f4c;
  --bs-btn-hover-bg: #157a40;
  --bs-btn-hover-border-color: #157a40;
}

.btn-link {
  text-decoration: none;
  --bs-btn-color: var(--mtl-link);
  --bs-btn-hover-color: var(--mtl-primary-hover);
}

/* ---- Forms ---- */

.form-control, .form-select {
  min-height: 2.5rem;
  border: 1px solid #d5dbe1;
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
  transition: border-color .12s ease, box-shadow .12s ease;
}

.form-control:hover, .form-select:hover {
  border-color: #c1c9d2;
}

.form-control:focus, .form-select:focus,
.btn:focus-visible, .form-check-input:focus {
  border-color: var(--mtl-primary);
  box-shadow: var(--mtl-focus);
  outline: 0;
}

.form-control.is-invalid, .form-select.is-invalid,
.input-validation-error {
  border-color: #df1b41;
}

.form-control::placeholder {
  color: #a3acb9;
}

.form-label {
  font-size: .875rem;
  font-weight: 600;
  color: #30313d;
  margin-bottom: .375rem;
}

/* Added by OptionalLabelTagHelper to fields the form does not require. */
.label-optional {
  margin-left: .3rem;
  font-weight: 400;
  color: var(--mtl-text-muted);
}

/* A section where every field is optional says so once in its explanation, not on each label. */
.all-optional .label-optional {
  display: none;
}

.form-text {
  margin-top: .375rem;
  font-size: .8125rem;
  color: var(--mtl-text-muted);
}

.form-check-input {
  border-color: #b4bcc6;
}

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

.form-check-label {
  font-weight: 500;
}

.form-check .form-text {
  margin-top: .125rem;
}

/* Form layout: one card, sections with a title and explanation on the left and their fields on
   the right, a readable width, and the actions together at the bottom right. */
.form-page {
  max-width: 960px;
}

.form-card > .card-body {
  padding: .5rem 2rem;
}

.form-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem 2.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--mtl-border);
}

.form-section:first-child {
  border-top: 0;
}

.form-section-intro h2 {
  margin: 0 0 .3rem;
  font-size: 1rem;
  font-weight: 650;
}

.form-section-intro p {
  margin: 0;
  font-size: .875rem;
  color: var(--mtl-text-muted);
}

.form-section-body {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.form-section-body > .row {
  --bs-gutter-y: 1.125rem;
}

/* Stacked sections (title above fields) for forms in a narrow column or mostly used on phones. */
.form-stacked .form-section {
  grid-template-columns: 1fr;
  gap: .875rem;
  padding: 1.5rem 0;
}

.form-stacked > .card-body {
  padding: .25rem 1.5rem;
}

/* Short values get short boxes, so a form reads like what it asks for. */
.field-short {
  max-width: 11rem;
}

.field-medium {
  max-width: 20rem;
}

.field-wide {
  max-width: 32rem;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
  padding: .875rem 0;
  background: linear-gradient(to top, var(--mtl-page) 75%, rgba(246, 248, 250, 0));
}

@media (max-width: 767.98px) {
  .form-card > .card-body {
    padding: .25rem 1.25rem;
  }

  .form-section {
    grid-template-columns: 1fr;
    gap: .75rem;
    padding: 1.25rem 0;
  }

  .form-actions .btn {
    flex: 1;
  }
}

/* ---- Badges: soft pills instead of solid blocks ---- */

.badge {
  border-radius: 999px;
  padding: .3em .65em;
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .01em;
}

.badge.text-bg-success { background-color: #d7f7c2 !important; color: #05690d !important; }
.badge.text-bg-warning { background-color: #fcedb9 !important; color: #a82c00 !important; }
.badge.text-bg-danger { background-color: #ffe7f2 !important; color: #b3093c !important; }
.badge.text-bg-info { background-color: #cff5f6 !important; color: #0055bc !important; }
.badge.text-bg-primary { background-color: #e2ebf3 !important; color: #11385b !important; }
.badge.text-bg-secondary,
.badge.text-bg-light { background-color: #ebeef1 !important; color: #545969 !important; }

/* ---- Alerts, dropdowns, lists, pagination ---- */

.alert {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--mtl-shadow-sm);
}

/* Validation summaries are rendered on every form; hide them until there are errors. */
.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.alert-success { background: #ecfbe3; color: #05690d; }
.alert-danger { background: #fff0f5; color: #b3093c; }
.alert-warning { background: #fef6dc; color: #8a2a00; }
.alert-info { background: #e8fafb; color: #0055bc; }

.dropdown-menu {
  --bs-dropdown-border-color: var(--mtl-border);
  --bs-dropdown-link-active-bg: var(--mtl-primary);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(60, 66, 87, .14);
}

.list-group {
  --bs-list-group-border-color: #ebeef1;
  --bs-list-group-active-bg: var(--mtl-primary);
  --bs-list-group-active-border-color: var(--mtl-primary);
}

.list-group-flush > .list-group-item {
  padding: .75rem 1.25rem;
}

.pagination {
  --bs-pagination-active-bg: var(--mtl-primary);
  --bs-pagination-active-border-color: var(--mtl-primary);
  --bs-pagination-color: var(--mtl-primary);
  --bs-pagination-focus-box-shadow: var(--mtl-focus);
}

.nav-tabs {
  --bs-nav-tabs-border-color: var(--mtl-border);
  --bs-nav-link-color: var(--mtl-text-muted);
  --bs-nav-link-hover-color: var(--mtl-text);
}

.nav-tabs .nav-link.active {
  color: var(--mtl-primary);
  font-weight: 600;
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--mtl-primary);
}

.text-primary { color: var(--mtl-primary) !important; }
.bg-primary { background-color: var(--mtl-primary) !important; }
.border-primary { border-color: var(--mtl-primary) !important; }

/* ---- Help ---- */

.side-nav-help {
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px solid var(--mtl-border);
}

.help-card {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.help-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.help-card-summary {
  color: var(--mtl-text-muted);
}

.help-topics .list-group-item a {
  color: var(--mtl-text);
}

.help-topics .list-group-item a.active {
  color: var(--mtl-primary);
  font-weight: 600;
}

.help-content {
  --bs-card-spacer-x: 2rem;
  --bs-card-spacer-y: 1.75rem;
  line-height: 1.65;
  max-width: 52rem;
}

.help-content > :first-child {
  margin-top: 0;
}

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

.help-content h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 .5rem;
}

.help-content p,
.help-content ul,
.help-content ol {
  margin-bottom: .9rem;
}

.help-content li + li {
  margin-top: .25rem;
}

.help-content table {
  width: 100%;
  margin-bottom: 1.25rem;
  border-collapse: collapse;
  font-size: .95rem;
}

.help-content th,
.help-content td {
  padding: .5rem .75rem;
  border-bottom: 1px solid #ebeef1;
  text-align: left;
  vertical-align: top;
}

.help-content th {
  background: #fafbfc;
  color: var(--mtl-text-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* "> Tip: ..." in a help file renders as a callout. */
.help-content blockquote {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-left: 3px solid var(--mtl-accent);
  border-radius: 4px;
  background: var(--mtl-accent-soft);
}

.help-content blockquote p:last-child {
  margin-bottom: 0;
}

.help-content code {
  color: var(--mtl-primary);
  background: var(--mtl-primary-soft);
  padding: .1em .35em;
  border-radius: 4px;
}

@media (max-width: 576px) {
  .help-content {
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
  }
}

/* ---- On the day: check-in and client sign-off ---- */

.signature-pad {
  display: block;
  width: 100%;
  height: 12rem;
  border: 1px dashed #c1c9d2;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.signature-image {
  display: block;
  max-width: 100%;
  max-height: 7rem;
  margin-top: .5rem;
  border: 1px solid var(--mtl-border);
  border-radius: 6px;
  background: #fff;
}

.on-the-day .d-flex + .d-flex {
  margin-top: .25rem;
}

/* ---- Reports ---- */

/* Chart colours: validated as a pair (lightness, chroma, colour-blind separation, contrast on white). */
:root {
  --chart-revenue: #2d6fa6;
  --chart-margin: #eb642e;
}

.report-range .form-control {
  width: auto;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  font-weight: 400;
  color: var(--mtl-text-muted);
}

.chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: .375rem;
  border-radius: 2px;
}

.swatch-revenue { background: var(--chart-revenue); }
.swatch-margin { background: var(--chart-margin); }

.month-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
}

.month-chart .grid { stroke: #ebeef1; stroke-width: 1; }
.month-chart .baseline { stroke: #c1c9d2; stroke-width: 1; }
.month-chart .axis { fill: var(--mtl-text-muted); font-size: 11px; }
.month-chart .bar-revenue { fill: var(--chart-revenue); }
.month-chart .bar-margin { fill: var(--chart-margin); }
.month-chart .hit { fill: transparent; }
.month-chart .month:hover .hit { fill: #f2f4f7; }

/* ---- Interpreter application form ---- */

/* Honeypot: off screen for people, still filled in by naive bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .25rem 1rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: .25rem;
}

.choice-grid .form-check {
  margin: 0;
}

/* ---- Feedback stars ---- */

.stars {
  color: #f5a623;
  font-size: 1.25rem;
  letter-spacing: .1em;
}

.stars-off {
  color: #d8dee4;
}

/* Five radios drawn as stars, highest first in the markup so "this and all before it" lights up. */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: .25rem;
  border: 0;
  padding: 0;
}

.star-rating input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.star-rating label {
  font-size: 2rem;
  line-height: 1;
  color: #d8dee4;
  cursor: pointer;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #f5a623;
}

.star-rating input:focus-visible + label {
  outline: 2px solid var(--mtl-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Page bits ---- */

dl.details dt {
  color: var(--mtl-text-muted);
  font-weight: 500;
}

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

.calendar td {
  height: 7rem;
  width: 14.28%;
  vertical-align: top;
  font-size: .8rem;
}

.calendar .booking-chip {
  display: block;
  border-left: 3px solid var(--mtl-primary);
  border-radius: 3px;
  background: var(--mtl-primary-soft);
  padding: 2px 6px;
  margin-bottom: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 576px) {
  .calendar td {
    height: 4rem;
  }
}

/* Service tag: a dot in the service's colour beside its name. */
.service-tag { display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; }
.service-tag::before { content: ""; flex: none; width: .625em; height: .625em; border-radius: 50%; background: var(--service-colour, var(--bs-secondary-color)); box-shadow: 0 0 0 2px var(--bs-body-bg); }

/* Icon button: for repeated row actions. Always has an aria-label (read aloud) and a title (tooltip). */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--mtl-border);
  border-radius: 6px;
  background: var(--mtl-page);
  color: var(--mtl-text-muted);
  vertical-align: middle;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn-icon:hover { background: var(--mtl-primary-soft); border-color: #c5d3e2; color: var(--mtl-primary); }
.btn-icon:focus-visible { outline: 0; box-shadow: var(--mtl-focus); border-color: var(--mtl-primary); color: var(--mtl-primary); }
.btn-icon .icon { vertical-align: 0; }
.btn-icon-danger:hover, .btn-icon-danger:focus-visible { background: #fdecec; border-color: #f4c7c3; color: #b42318; }
td .btn-icon + .btn-icon, td .btn-icon + form, td form + form { margin-left: .25rem; }
.btn > .icon { margin-right: .1rem; }

/* Email template editor */
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  padding: .375rem;
  border: 1px solid var(--mtl-border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--mtl-page);
}
.rich-toolbar .btn-icon:disabled { opacity: .4; pointer-events: none; }
.rich-numbered { font-size: .8rem; font-weight: 600; }
.rich-placeholders { width: auto; max-width: 14rem; }
.rich-surface, .rich-source { border-radius: 0 0 8px 8px; }
.rich-surface { min-height: 18rem; overflow-y: auto; max-height: 36rem; line-height: 1.5; }
.rich-surface:focus { box-shadow: var(--mtl-focus); }
.rich-surface p { margin: 0 0 .75rem; }
.rich-surface h2 { font-size: 1.15rem; margin: 0 0 .5rem; }

/* Word count beside a document to translate */
.word-count-input { width: 6.5rem; }

/* A translation booking's documents: to translate | completed */
.doc-column-title {
  margin: 0;
  padding: .5rem 1rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mtl-text-muted);
  background: var(--mtl-page);
  border-bottom: 1px solid var(--mtl-border);
}
@media (min-width: 768px) {
  .doc-columns .doc-column + .doc-column { border-left: 1px solid var(--mtl-border); }
}
@media (max-width: 767.98px) {
  .doc-columns .doc-column + .doc-column .doc-column-title { border-top: 1px solid var(--mtl-border); }
}

/* Interpreter photo */
.profile-photo { width: 88px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--mtl-border); flex: none; }
.profile-photo-empty { display: grid; place-items: center; background: var(--mtl-page); color: var(--mtl-text-muted); }

/* Digital ID card */
.id-card {
  max-width: 400px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: var(--mtl-surface);
  border: 1px solid var(--mtl-border);
  box-shadow: 0 8px 24px rgba(17, 56, 91, .12);
}
.id-card-header { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; background: var(--mtl-primary); color: #fff; }
.id-card-header .brand-mark { background: var(--mtl-accent); }
.id-card-agency { font-weight: 600; }
.id-card-kind { margin-left: auto; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.id-card-body { display: flex; gap: 1rem; padding: 1rem; border-bottom: 4px solid var(--mtl-accent); }
.id-card-photo { width: 110px; height: 138px; object-fit: cover; border-radius: 8px; border: 1px solid var(--mtl-border); flex: none; }
.id-card-name { font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin-bottom: .5rem; }
.id-card-details dl { margin: 0; font-size: .85rem; }
.id-card-details dt { color: var(--mtl-text-muted); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.id-card-details dd { margin: 0 0 .35rem; }
.id-card-check { display: flex; gap: .75rem; align-items: center; padding: .75rem 1rem; }
.id-card-qr { width: 104px; flex: none; }
.id-card-qr svg { display: block; width: 100%; height: auto; }
.id-card-clock { font-variant-numeric: tabular-nums; color: var(--mtl-primary); font-weight: 600; margin-top: .25rem; }
.id-card-footer { padding: .5rem 1rem; font-size: .75rem; color: var(--mtl-text-muted); background: var(--mtl-page); text-align: center; }

/* The public card check */
.id-check { max-width: 480px; padding-top: 2rem; }
.id-check-result { padding: 1.25rem; border-radius: 12px; border: 1px solid; }
.id-check-good { background: #ecfdf3; border-color: #abefc6; color: #054f31; }
.id-check-bad { background: #fef3f2; border-color: #fecdca; color: #7a271a; }

/* ---- Logo and portal identity ---- */

.brand-logo { display: block; width: 145px; height: auto; }
.brand-logo-sm { width: 82px; }
.brand-logo-lg { width: 194px; }
.brand-logo-link { display: block; line-height: 0; }

.sidebar-brand { flex-direction: column; align-items: flex-start; position: relative; }
.sidebar-brand .btn-close { position: absolute; top: 1.25rem; right: 1.25rem; }

/* Each portal has its own colour, so staff, clients and interpreters can tell at a glance where they are. */
body.portal-staff { --portal: var(--mtl-primary); --portal-soft: var(--mtl-primary-soft); }
body.portal-client { --portal: #1d5c91; --portal-soft: #e6f0f9; }
body.portal-interpreter { --portal: #c24e1c; --portal-soft: var(--mtl-accent-soft); }

.portal-pill {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--portal-soft, var(--mtl-primary-soft));
  color: var(--portal, var(--mtl-primary));
  font-size: .75rem;
  font-weight: 600;
}

@media (min-width: 992px) {
  body[class*="portal-"] .sidebar { box-shadow: inset 0 4px 0 var(--portal); }
}

/* ---- Sign-in: chooser and audience pages ---- */

body.auth-client { --portal: #1d5c91; --portal-dark: #11385b; }
body.auth-interpreter { --portal: #c24e1c; --portal-dark: #8f3510; }
body.auth-staff { --portal: #1a1f36; --portal-dark: #0b2740; }

body.auth.auth-client { background: radial-gradient(1200px 520px at 0% -10%, rgba(29, 92, 145, .2), transparent 60%), var(--mtl-page); }
body.auth.auth-interpreter { background: radial-gradient(1200px 520px at 100% -10%, rgba(235, 100, 46, .2), transparent 60%), var(--mtl-page); }
body.auth.auth-staff { background: linear-gradient(180deg, #e9edf2, var(--mtl-page) 420px); }

.login-chooser { max-width: 720px; margin: 0 auto; }
.login-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.login-choice {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.5rem; border-radius: 12px; background: var(--mtl-surface);
  border: 1px solid var(--mtl-border); border-top: 4px solid var(--choice);
  box-shadow: 0 15px 35px rgba(60, 66, 87, .08), 0 5px 15px rgba(0, 0, 0, .04);
  color: var(--mtl-text); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.login-choice:hover, .login-choice:focus-visible { transform: translateY(-2px); color: var(--mtl-text); box-shadow: 0 20px 40px rgba(60, 66, 87, .14), 0 5px 15px rgba(0, 0, 0, .06); }
.login-choice-client { --choice: #1d5c91; }
.login-choice-interpreter { --choice: #eb642e; }
.login-choice .login-icon { background: color-mix(in srgb, var(--choice) 12%, #fff); color: var(--choice); }
.login-choice-title { font-size: 1.15rem; font-weight: 700; }
.login-choice-text { color: var(--mtl-text-muted); font-size: .9rem; }
.login-choice-go { margin-top: auto; font-weight: 600; color: var(--choice); }
.login-choice-interpreter .login-choice-go { color: #c24e1c; }

.login-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.login-icon svg { width: 22px; height: 22px; }

.login-card { display: grid; grid-template-columns: 1fr; max-width: 860px; margin: 0 auto; overflow: hidden; }
@media (min-width: 768px) { .login-card { grid-template-columns: 5fr 6fr; } }
.login-panel { padding: 2rem; color: #fff; background: linear-gradient(150deg, var(--portal), var(--portal-dark)); }
.login-panel .login-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.login-panel-kind { margin: 1rem 0 .25rem; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.login-panel-lede { font-size: 1.15rem; font-weight: 600; line-height: 1.35; margin-bottom: 1.25rem; }
.login-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; font-size: .92rem; }
.login-points li { display: flex; gap: .55rem; align-items: flex-start; }
.login-points li::before { content: "✓"; flex: none; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: rgba(255, 255, 255, .2); display: inline-grid; place-items: center; font-size: .7rem; margin-top: .1rem; }
.login-form { padding: 2rem; }
.login-staff .login-form .btn-primary { background: #1a1f36; border-color: #1a1f36; }
@media (prefers-reduced-motion: reduce) { .login-choice { transition: none; } .login-choice:hover { transform: none; } }

/* ---- ID card header: white, so the agency logo shows as designed ---- */

.id-card-header { background: #fff; color: var(--mtl-text); border-bottom: 1px solid var(--mtl-border); }
.id-card-logo { height: 40px; width: auto; }
.id-card-header .id-card-kind { color: #fff; background: var(--mtl-primary); padding: .2rem .6rem; border-radius: 999px; opacity: 1; }
