html {
  font-size: 14px;
}

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

.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 #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.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;
}

/* Development-only 2FA bypass (DevAuth:SkipTwoFactor) */
.dev-auth-banner {
  padding: 0.4rem 1rem;
  background: #b91c1c;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

/* Lot 13d: title of the page and « À quoi sert cette page ? » (rendered by the layout) */
@media (min-width: 768px) {
  .page-heading-narrow {
    max-width: 50%;
    margin: 0 auto;
  }
}

.page-help {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid #0d6efd;
  background: #f1f5fb;
  border-radius: 0.25rem;
}

.page-help summary {
  font-weight: 600;
  cursor: pointer;
}

.page-help p {
  margin: 0.25rem 0 0;
}

/* Lot 13d: help of a field (« En savoir plus », no JavaScript) */
.field-help {
  margin-top: 0.15rem;
  font-size: 0.875em;
  color: #495057;
}

.field-help summary {
  cursor: pointer;
  color: #0d6efd;
}

.field-help p,
.field-help ul {
  margin: 0.25rem 0 0;
}

/* Lot 13d: Help page */
.help-guide {
  scroll-margin-top: 1rem;
}

/* Lot 13d: manual key of the two-factor setup, easy to copy by hand */
.authenticator-key {
  font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #212529;
}

/* Menu (admin-ui): row 1 the name, Aide and Déconnexion; row 2 the pages in groups; folded under 768 px */
.admin-nav .nav-link {
  color: #212529;
  white-space: nowrap;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link:focus-visible {
  color: #0d6efd;
}

.admin-nav .nav-link[aria-current="page"] {
  color: #0d6efd;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 #0d6efd;
}

.nav-separator {
  border-left: 1px solid #ced4da;
  margin: 0.5rem 0.5rem;
}

@media (min-width: 768px) {
  .admin-nav > .container {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  /* The folding wrapper disappears: the two lists take their own place in the grid */
  .admin-nav .navbar-collapse {
    display: contents !important;
  }

  .admin-nav .admin-nav-end {
    grid-column: 2;
    grid-row: 1;
  }

  /* Narrower than Bootstrap's 0.5rem: the twelve entries of an Owner fit on one row from 1024 px */
  .admin-nav .admin-menu .nav-link {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
  }

  .admin-nav .admin-menu .nav-separator {
    margin: 0.5rem 0.25rem;
  }

  .admin-nav .admin-menu {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    margin-top: 0.25rem;
    border-top: 1px solid #e5e5e5;
  }
}

/* Lot 23: « Personnel » added, an Owner has thirteen entries: a slightly smaller text keeps them on one row at 1024 px */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .admin-nav .admin-menu .nav-link {
    font-size: 0.9rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }
}

@media (max-width: 767.98px) {
  .admin-nav .navbar-brand {
    white-space: normal;
  }

  .admin-nav .nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .nav-separator,
  .admin-nav .admin-nav-end {
    border-left: 0;
    border-top: 1px solid #ced4da;
    margin: 0.25rem 0;
  }
}

/* admin-ui: confirmation window of a form[data-confirm] (js/site.js) */
.confirm-dialog {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem 1.5rem;
  border: 0;
  border-top: 4px solid #dc3545;
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.25);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.confirm-dialog-message {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Lot 13d: « Mise en route » of the dashboard */
.setup-step.done {
  color: #198754;
}

.setup-advice {
  color: #495057;
}

/* Lot 14: end of service (calendar, printable closures) */
.service-calendar td {
  width: 14.28%;
  vertical-align: top;
  height: 4.5rem;
}

.service-calendar .service-out {
  background: #f8f9fa;
}

.service-calendar .service-today {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

.service-month::first-letter {
  text-transform: uppercase;
}

@media print {
  header,
  footer,
  .page-help,
  .breadcrumb,
  .no-print {
    display: none !important;
  }

  .closure-sheet table {
    font-size: 11pt;
  }
}

/* Lot 15: temperatures (summary, day, sheet) */
.temp-out {
  color: #b91c1c;
  font-weight: 600;
}

.temp-missed,
.temp-late {
  color: #b45309;
  font-weight: 600;
}

.temp-open {
  color: #64748b;
}

.temperature-grid td {
  min-width: 6.5rem;
  vertical-align: top;
  font-size: 0.9rem;
}

.temperature-replaced {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Lot 16a: preview of the customer ticket (Restaurants → Tickets) */
.ticket-preview {
  max-width: 72mm;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-family: Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.8rem;
}

.ticket-preview--58 {
  max-width: 48mm;
  font-size: 0.7rem;
}

.ticket-preview p {
  margin: 0;
}

.ticket-preview hr {
  margin: 0.35rem 0;
  border-top: 1px dashed #000;
  opacity: 1;
}

.ticket-preview-title {
  font-weight: 700;
  font-size: 1.1em;
  text-align: center;
}

.ticket-preview-number {
  font-weight: 700;
  font-size: 1.8em;
  text-align: center;
}

.ticket-preview-center {
  text-align: center;
  overflow-wrap: anywhere;
}

.ticket-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.ticket-preview-notice {
  font-size: 0.9em;
}

/* Lot 18c: staff price of a size (Prix d'un produit) */
.staff-price-input {
    width: 100px;
}

/* Lot 19e: widths of the fields (no style attribute, strict CSP) */
.w-80px { width: 80px; }
.w-100px { width: 100px; }
.w-150px { width: 150px; }
.w-180px { width: 180px; }
.w-200px { width: 200px; }
.w-280px { width: 280px; max-width: 100%; }
.w-5rem { width: 5rem; }

/* Lot 19e: ✓ / ✗ of the forms saved at once (js/site.js) */
.inline-save-hidden { display: none !important; }
.inline-actions { display: inline-flex; gap: 0.25rem; vertical-align: middle; }
.inline-actions[hidden] { display: none; }
.inline-actions .btn { min-width: 2.5rem; font-weight: 700; }
.inline-actions--bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1030;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}
.inline-actions--bar .btn { min-width: 4rem; font-size: 1.1rem; }
.inline-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
  margin: 0;
  transition: opacity 0.5s;
}
.inline-toast--gone { opacity: 0; pointer-events: none; }

/* Lot 19e: prices and family of a supplement on one aligned line */
.supplement-prices { align-items: flex-end; }
.supplement-price { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; }
.supplement-family .form-select { min-width: 9rem; }
.ticket-positions img { max-width: 100%; height: auto; border: 1px solid var(--bs-border-color); border-radius: 0.375rem; }
/* a fixed width inside an input group (the group stretches its fields otherwise) */
.input-group > .form-control.w-80px { flex: 0 0 80px; }
/* Lot 19f: the same columns in every section of the drinks */
.drinks { table-layout: fixed; }
.drinks th:nth-child(1) { width: 40%; }
.drinks th:nth-child(2) { width: 20%; }
.drinks th:nth-child(3) { width: 25%; }

/* Lot 20: Paramètres → Livraison → Restaurant: label, field and help on one aligned line */
.delivery-lines { display: grid; gap: 0; margin-bottom: 1rem; }
.delivery-line {
  display: grid;
  grid-template-columns: 13rem auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}
.delivery-line-label { padding-top: 0.4rem; font-weight: 600; }
.delivery-line-field { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.delivery-line-help .form-text { margin-top: 0.4rem; }
@media (max-width: 768px) { .delivery-line { grid-template-columns: 1fr; } }

/* Lot 21: drag and drop of the rows of a list (js/site.js) */
.sort-handle {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0 0.15rem;
  color: var(--bs-secondary-color);
  cursor: grab;
  user-select: none;
}
.sort-dragging { opacity: 0.5; }
/* Lot 28: the handle on the same line as the name (it pushed the field to a second line: rows twice as tall) */
td:has(> .sort-handle) { white-space: nowrap; }
td > .sort-handle + input.form-control { display: inline-block; vertical-align: middle; }
td > .sort-handle + form { display: inline-flex; vertical-align: middle; white-space: normal; }

/* Lot 21: − / + of the amounts (js/site.js) */
.amount-stepper { display: inline-flex; align-items: center; gap: 0.2rem; }
.amount-stepper .amount-step { min-width: 1.9rem; padding-inline: 0.35rem; line-height: 1.2; }

/* Lot 23: staff (week, calendar); lot 26: through --bs-table-color, otherwise the colour of the table cells wins */
.staff-over {
  --bs-table-color: #b45309;
  color: #b45309;
  font-weight: 600;
}

.staff-under {
  --bs-table-color: #64748b;
  color: #64748b;
}

.staff-cell input {
  min-width: 4.5rem;
}

/* Lot 25: on a phone, the footer follows the page (see _Layout.cshtml.css): no space kept for it */
@media (max-width: 575.98px) {
  body {
    margin-bottom: 0;
  }
}

/* Lot 25: on a phone, the fingerprint first on the sign-in page */
.login-forms {
  display: flex;
  flex-direction: column;
}

@media (max-width: 575.98px) {
  .login-forms .passkey-login {
    order: -1;
    margin-top: 0 !important;
    margin-bottom: 1rem;
  }
}

/* Lot 28: the amounts of the end of service read as figures (20 blue underlined links drowned them); the link stays,
   underlined on hover and focus; « n commandes » keeps the look of a link */
.service-amount-link:not(.service-count-link) {
  color: inherit;
  text-decoration: none;
}

.service-amount-link:not(.service-count-link):hover,
.service-amount-link:not(.service-count-link):focus-visible {
  text-decoration: underline dotted;
}

/* Lot 28: the « ⋯ » menu of a row (rare actions: family, order, deactivate, delete), a native details */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-body {
  position: absolute;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 13rem;
  margin-top: 0.25rem;
  padding: 0.6rem;
  text-align: left;
  white-space: normal;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
}
.row-menu-body .delete-link { width: 100%; }

/* Lot 28: families of the supplements as intertitles */
.supplements .supplement-group th {
  padding-top: 1rem;
  font-size: 0.95rem;
  background: var(--bs-tertiary-bg);
}

/* Lot 28: the − / + of an amount appear on hover and while typing (always on a touch screen) */
@media (hover: hover) {
  .amount-step { visibility: hidden; }
  .amount-stepper:hover .amount-step,
  .amount-stepper:focus-within .amount-step,
  .input-group:hover > .amount-step,
  .input-group:focus-within > .amount-step { visibility: visible; }
}

/* Lot 33: staff calendar (js/staff-calendar.js), one quarter of an hour = 12 px, 06:00 → 03:00 */
.staff-calendar:not(.cal-ready) .cal-layout { display: none; }
.cal-ready .cal-fallback { display: none; }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: .75rem; }
.cal-layout { display: flex; gap: 1rem; align-items: flex-start; }
.cal-scroll { flex: 1; min-width: 0; max-height: 72vh; overflow: auto; border: 1px solid #dee2e6; border-radius: .375rem; touch-action: pan-y; }
.cal-head, .cal-body { display: grid; grid-template-columns: 3.5rem repeat(7, minmax(6.5rem, 1fr)); }
.cal-head { position: sticky; top: 0; z-index: 4; background: #fff; border-bottom: 1px solid #dee2e6; }
.cal-head-day { border: 0; background: none; padding: .45rem .25rem; font-weight: 600; text-transform: capitalize; color: inherit; }
.cal-hour { height: 48px; font-size: .75rem; color: #6c757d; text-align: right; padding-right: .35rem; transform: translateY(-.55em); }
.cal-hour:first-child { transform: none; }
.cal-day { position: relative; border-left: 1px solid #e9ecef; cursor: crosshair; user-select: none;
  background-image: repeating-linear-gradient(to bottom, #e9ecef 0, #e9ecef 1px, transparent 1px, transparent 48px); }
.cal-slot { position: absolute; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden; border: 0;
  border-left: 4px solid; border-radius: 5px; padding: 1px 5px; text-align: left; font-size: .75rem; line-height: 1.25; cursor: grab; }
.cal-slot:focus-visible { outline: 2px solid #212529; outline-offset: 1px; z-index: 3; }
.cal-slot-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-ghost { opacity: .75; pointer-events: none; }
.cal-dim { opacity: .3; }
.cal-former { position: relative; z-index: 2; margin: 2px; padding: 0 4px; font-size: .7rem; background: #f8f9fa;
  border: 1px dashed #adb5bd; border-radius: 4px; }
.cal-legend { width: 16rem; margin: 0; }
.cal-person { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .2rem 0; }
.cal-person-btn { display: flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.cal-selected .cal-person-name { font-weight: 700; text-decoration: underline; }
.cal-swatch { display: inline-block; flex: none; width: .95rem; height: .95rem; border-left: 4px solid; border-radius: 3px; }
.slot-dialog { max-width: 26rem; width: calc(100% - 2rem); border: 1px solid #dee2e6; border-radius: .5rem; padding: 1.25rem; }
.slot-dialog::backdrop { background: rgb(0 0 0 / .3); }
/* One colour per person: light background, dark text (contrast ≥ 7), border of the colour */
.cal-c0 { background-color: #dbeafe; color: #1e3a8a; border-color: #2563eb; }
.cal-c1 { background-color: #dcfce7; color: #14532d; border-color: #16a34a; }
.cal-c2 { background-color: #fef3c7; color: #78350f; border-color: #d97706; }
.cal-c3 { background-color: #ffe4e6; color: #881337; border-color: #e11d48; }
.cal-c4 { background-color: #ede9fe; color: #4c1d95; border-color: #7c3aed; }
.cal-c5 { background-color: #ccfbf1; color: #134e4a; border-color: #0d9488; }
.cal-c6 { background-color: #ffedd5; color: #7c2d12; border-color: #ea580c; }
.cal-c7 { background-color: #cffafe; color: #164e63; border-color: #0891b2; }
.cal-c8 { background-color: #ecfccb; color: #365314; border-color: #65a30d; }
.cal-c9 { background-color: #fce7f3; color: #831843; border-color: #db2777; }
.cal-c10 { background-color: #e0e7ff; color: #312e81; border-color: #4f46e5; }
.cal-c11 { background-color: #e2e8f0; color: #1e293b; border-color: #475569; }
/* A phone: the days as tabs, one day at a time */
@media (max-width: 767.98px) {
  .cal-layout { flex-direction: column; }
  .cal-legend { width: 100%; }
  .cal-head { display: flex; gap: .2rem; padding: .25rem; }
  .cal-corner { display: none; }
  .cal-head-day { flex: 1 1 0; min-width: 0; min-height: 44px; padding: .25rem .1rem; border-radius: .375rem; font-size: .72rem; }
  .cal-head-day.cal-show { background: #0d6efd; color: #fff; }
  .cal-body { grid-template-columns: 3rem 1fr; }
  .cal-day:not(.cal-show) { display: none; }
}
/* Lot 33: the portal shows its table on a phone, the calendar from 576 px */
@media (min-width: 768px) { .portal-calendar .cal-head, .portal-calendar .cal-body { grid-template-columns: 3rem repeat(7, minmax(4.5rem, 1fr)); } }
@media (max-width: 575.98px) { .portal-calendar { display: none; } }

/* Lot 35: problems reported from the POS */
.bug-report-comment { white-space: pre-wrap; }
.bug-report-log { max-height: 50vh; overflow: auto; white-space: pre-wrap; }

/* Lot 36: smaller page titles (Bootstrap's 2.5rem pushed the content down on every page) */
.page-heading h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 992px) {
  .page-heading h1 {
    font-size: 2rem;
  }
}
