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

@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-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: 28%; }
.drinks th:nth-child(2) { width: 12%; }
.drinks th:nth-child(3) { width: 20%; }
.drinks th:nth-child(4) { width: 12%; }
.drinks th:nth-child(5) { width: 18%; }

/* 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; } }
