/* DigiAccess — web panels (Panneau V2), charte « Le seuil » (docs/charte-le-seuil).
   The brand colours, fonts and radius are the official tokens (brand/digiaccess-tokens.css, loaded
   first); this file only adds the support tints and the interface rules of the charter: the result
   first, a sign and a word for every state (never a colour alone), white on sea blue only for large
   titles, underlined links, a visible keyboard focus, flat surfaces and lightly rounded corners.
   Mobile first, then larger screens. Logical properties (inline-start / inline-end) only, so a
   right-to-left language needs nothing but dir="rtl" on <html>. */

@font-face { font-family: "Manrope"; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/IBMPlexSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
/* Arabic letters only: the file is fetched when a page shows some (a name, a message). */
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  /* Support tints of the palette (backgrounds and lines, never a sixth brand colour). */
  --mer-pale: #E4F1F3;
  --palmier-pale: #E6F0EA;
  --sable-fonce: #EDE5D4;
  --line: #E4DCCB;            /* separations */
  --field: #748286;           /* edges of fields and controls (a tint of the marine ink): 3.98:1 on white */
  --muted: #4D5F64;           /* secondary text: 6.7:1 on white, 5.9:1 on sand */
  --motif: #23505B;           /* the decorative motif on deep blue */
  /* The families of the tokens, written out so that Arabic letters reach IBM Plex Sans Arabic before any
     generic family (the tokens end each family with "sans-serif"). */
  --titles: "Manrope", "IBM Plex Sans Arabic", sans-serif;
  --text: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--digi-encre);
  background: var(--digi-sable);
}
[dir="rtl"] body { font-family: "IBM Plex Sans Arabic", "IBM Plex Sans", sans-serif; line-height: 1.7; }

h1, h2, h3 { font-family: var(--titles); font-weight: 600; color: var(--digi-marine); line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
/* Links are underlined (charter); navigation blocks have their own marks. */
a { color: var(--digi-marine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
/* The keyboard focus is always visible: a solid ring, white on the dark surfaces. */
:focus-visible { outline: 3px solid var(--digi-marine); outline-offset: 2px; }
.topbar :focus-visible, .login-brand :focus-visible { outline-color: var(--digi-blanc); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--digi-marine); margin: 0 0 4px; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }

/* Pictograms of the charter (24 × 24, stroke 1.7, one colour, always beside a word): the official
   files, painted in the colour of the text around them. */
.icon { display: inline-block; flex: none; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.icon-invites { --icon: url("icons/invites.svg"); }
.icon-reclamations { --icon: url("icons/reclamations.svg"); }
.icon-annonces { --icon: url("icons/annonces.svg"); }
.icon-securite { --icon: url("icons/securite.svg"); }
.icon-residence { --icon: url("icons/residence.svg"); }
.icon-documents { --icon: url("icons/documents.svg"); }
.icon-techniciens { --icon: url("icons/techniciens.svg"); }
.icon-vehicules { --icon: url("icons/vehicules.svg"); }
svg.line-icon { width: 22px; height: 22px; flex: none; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ------------------------------------------------------------------------------ layout */

.app { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--digi-marine); color: var(--digi-blanc);
}
/* The emblem alone (the signed logo needs 300 px, charter p. 5), with its clear space. */
.topbar-emblem { display: inline-flex; padding: 4px 8px; margin-inline-end: auto; }
.topbar-emblem img { display: block; width: 32px; height: auto; }
.topbar-user { display: none; text-align: end; font-size: 14px; line-height: 1.35; }
.topbar-user strong { display: block; font-weight: 600; }
.topbar form { margin: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--digi-rayon);
  background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.sidebar .icon-btn:hover { background: var(--mer-pale); }
.icon-btn svg { width: 22px; height: 22px; }

.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40;
  width: min(300px, 86vw);
  padding: 16px 12px 24px;
  background: var(--digi-blanc); border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}
[dir="rtl"] .sidebar { transform: translateX(105%); }
.sidebar.open { transform: none; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 16px; }
.sidebar-head img { display: block; width: 32px; height: auto; margin: 4px; }
.sidebar-user { padding: 0 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; font-size: 14px; }
.sidebar-user strong { display: block; color: var(--digi-marine); }
.residence-switch:empty { display: none; }
.residence-switch { display: grid; gap: 6px; padding: 0 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.residence-switch .select { width: 100%; }
.nav-group { margin: 16px 8px 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 8px 12px; margin: 2px 0;
  border-radius: var(--digi-rayon); color: var(--digi-encre); text-decoration: none; font-weight: 600;
}
.nav-link:hover { background: var(--mer-pale); }
.nav-link[aria-current="page"] { background: var(--digi-marine); color: var(--digi-blanc); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(11, 60, 73, 0.45); }

.view { max-width: 1180px; margin: 0 auto; padding: 20px 16px 96px; }
/* The main area takes the focus after each change of view (tabindex -1, never reached with Tab): no ring. */
.view:focus { outline: none; }
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.view-head p { margin: 0; }

@media (min-width: 1024px) {
  .nav-toggle, .sidebar-close, .scrim { display: none !important; }
  .topbar-user { display: block; }
  .sidebar { transform: none !important; top: 64px; width: 260px; padding-top: 12px; }
  .sidebar-head, .sidebar-user { display: none; }
  .view { margin-inline-start: 260px; padding: 32px 32px 64px; }
  .with-sidebar .view { max-width: none; }
  h1 { font-size: 36px; }
}

/* ------------------------------------------------------------------------------- cards */

.card { background: var(--digi-blanc); border: 1px solid var(--line); border-radius: var(--digi-rayon); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.card-head h2 .icon { color: var(--digi-mer); }
.card-head > a { white-space: nowrap; font-size: 15px; }
.grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .card { padding: 20px; }
}
.grid > .card { margin-bottom: 0; }
.dashboard { display: flex; flex-direction: column; gap: 16px; }
.dashboard .dash-col { display: contents; }
.dashboard .card { margin-bottom: 0; }
.dash-guests { order: 1; } .dash-checks { order: 2; } .dash-tickets { order: 3; }
.dash-declarations { order: 4; } .dash-announcements { order: 5; }
@media (min-width: 900px) {
  .dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .dashboard .dash-col { display: flex; flex-direction: column; gap: 16px; }
}
/* A phone shows the first five lines of each list ("Tout voir" opens the rest). */
@media (max-width: 559px) {
  :is(.dash-guests, .dash-checks, .dash-declarations, .dash-announcements) .list > li:nth-child(n + 6) { display: none; }
  :is(.dash-guests, .dash-checks, .dash-declarations, .dash-announcements) .list > li:nth-child(5) { border-bottom: 0; }
}
/* Phone (one column): each block of the home page is closed; a button with its short title and its number
   opens it, "see all" under it (F-prép). The computer keeps the open blocks. */
@media not all and (min-width: 900px), (pointer: coarse) and (max-height: 500px) {
  .home-head { flex-wrap: wrap; row-gap: 0; }
  .home-head h2 { flex: 1 0 100%; min-width: 0; }
  .home-head > a { display: inline-flex; align-items: center; min-height: 44px; margin-inline-start: 34px; }
}
.dash-toggle {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 10px; width: 100%; min-height: 44px; padding: 0; margin: 0;
  border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer;
}
.dash-toggle .icon { color: var(--digi-mer); }
.dash-label { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.dash-title { min-width: 0; }
.dash-count {
  display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--mer-pale);
  font-family: var(--text); font-size: 15px; font-weight: 600; color: var(--digi-marine); white-space: nowrap;
}
.dash-toggle .chevron { width: 20px; height: 20px; flex: none; transition: transform 0.15s; }
.dash-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.card.is-closed .card-head { margin-bottom: 0; }

/* « À traiter » at the top of the home page (F-prép, suite): seen first, a number and a link for each item. */
.to-handle {
  margin-bottom: 16px; padding: 14px 16px; border-radius: var(--digi-rayon);
  background: var(--digi-blanc); border: 1px solid var(--line); border-inline-start: 6px solid var(--digi-palmier);
}
.to-handle.has-items { border-color: var(--digi-marine); border-inline-start-color: var(--digi-marine); background: var(--mer-pale); }
.to-handle h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 20px; }
.to-handle p { margin: 0; }
.to-handle-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.to-handle-list a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 16px; }
.to-handle-list strong { font-family: var(--titles); font-size: 20px; }
@media (min-width: 720px) { .to-handle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; } }

/* -------------------------------------------------------------------------------- KPIs */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 719px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: var(--digi-rayon); background: var(--digi-blanc);
  border: 1px solid var(--line); border-block-start: 4px solid var(--digi-mer);
  color: inherit; text-decoration: none; text-align: start;
}
a.kpi:hover { border-color: var(--digi-marine); }
.kpi-value { font-family: var(--titles); font-size: 32px; font-weight: 600; color: var(--digi-marine); line-height: 1.1; }
.kpi-label { font-size: 15px; color: var(--digi-encre); }
a.kpi .kpi-label { text-decoration: underline; text-underline-offset: 3px; }
.kpi.tone-ok { border-block-start-color: var(--digi-palmier); }
.kpi.tone-danger, .kpi.tone-warn { border-block-start-color: var(--digi-marine); }

/* ----------------------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border: 1px solid transparent; border-radius: var(--digi-rayon);
  background: var(--mer-pale); color: var(--digi-marine);
  font-family: var(--titles); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled, [aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.btn-primary, .btn-dark, .btn-danger { background: var(--digi-marine); color: var(--digi-blanc); }
.btn-ghost { background: var(--digi-blanc); border-color: var(--field); color: var(--digi-marine); }
.btn-ghost:hover { background: var(--mer-pale); }
.btn-ok { background: var(--digi-palmier); color: var(--digi-blanc); }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.btn-block { width: 100%; }
.btn svg, .btn .icon { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Fingers need room: every control is at least 44 px high on a touch screen. */
@media (pointer: coarse) {
  .btn-sm, .segmented button, .chip, .select-sm { min-height: 44px; }
}

/* ------------------------------------------------------------------------------- forms */

.form { display: grid; gap: 12px; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 720px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
}
.field { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--digi-marine); }
.field small { font-weight: 400; color: var(--muted); }
.input, .field input, .field select, .field textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--field); border-radius: var(--digi-rayon); background: var(--digi-blanc); color: var(--digi-encre);
  font-size: 16px; font-weight: 400;
}
.field textarea { min-height: 120px; resize: vertical; }
.counter { text-align: end; font-size: 14px; color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 12px; }
.inline-form .field { flex: 1 1 200px; }
.select-sm { width: auto; min-height: 40px; padding: 6px 10px; font-size: 16px; }
.inline-value { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
@media (min-width: 720px) {
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; }
  .toolbar .search { flex: 1 1 260px; }
  .toolbar > .select { width: auto; min-width: 14rem; }
}
.search { position: relative; }
.search input { padding-inline-start: 42px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--digi-rayon); background: var(--digi-blanc); border: 1px solid var(--field); }
.segmented button {
  min-height: 38px; padding: 6px 12px; border-radius: 6px;
  border: 0; background: transparent; color: var(--digi-encre); font-weight: 600; cursor: pointer;
}
.segmented button:hover { background: var(--mer-pale); }
.segmented button[aria-pressed="true"] { background: var(--digi-marine); color: var(--digi-blanc); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: var(--digi-rayon); border: 1px solid var(--field); background: var(--digi-blanc); cursor: pointer; }
.chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--digi-marine); }
.chip:has(input:checked) { background: var(--mer-pale); border-color: var(--digi-marine); color: var(--digi-marine); font-weight: 600; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 48px; height: 28px; margin: 2px 0 0; border-radius: 999px; background: var(--field); position: relative; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--digi-blanc); transition: inset-inline-start 0.15s; }
.switch input:checked { background: var(--digi-palmier); }
.switch input:checked::after { inset-inline-start: 23px; }

/* ------------------------------------------------------------------------------ tables */

.table-wrap { width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { text-align: start; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { text-align: start; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.cell-actions { text-align: end; }
.table td.cell-actions .actions { justify-content: flex-end; }
.table-wrap > .more:not(:empty) { display: flex; justify-content: center; padding-top: 12px; }
@media (min-width: 760px) { .table td .select { min-width: 13rem; } }
@media (min-width: 1100px) { .table td.cell-actions .actions { flex-wrap: nowrap; } }
/* A tablet (or a phone held sideways) keeps the columns, scrolled inside the card when too wide. */
@media (min-width: 760px) and (max-width: 1099px) { .table-wrap { overflow-x: auto; } }

/* Phones: each row becomes a small card, each cell carries its column's name; empty cells are left out. */
@media (max-width: 759px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 4px 0; border: 0; justify-items: start; }
  .table td.cell-empty { display: none; }
  .table td > .cell { min-width: 0; max-width: 100%; }
  .table td.cell-actions .actions { justify-content: flex-start; }
  .table td::before { content: attr(data-label); font-size: 13px; font-weight: 600; color: var(--muted); }
  .table td.cell-main { grid-template-columns: 1fr; font-family: var(--titles); font-weight: 600; color: var(--digi-marine); }
  .table td.cell-main::before, .table td.cell-actions::before { content: none; }
  .table td.cell-actions { grid-template-columns: 1fr; padding-top: 8px; text-align: start; }
}

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--digi-marine); }
.list .meta { font-size: 14px; color: var(--muted); }
.list .meta .badge { margin-inline-end: 4px; }
.list .item-icon { flex: none; width: 22px; color: var(--digi-mer); }
@media (max-width: 559px) {
  .list.stack-phone > li { flex-wrap: wrap; row-gap: 2px; }
  .list.stack-phone > li > .aside { order: 3; flex-basis: 100%; }
  .list.stack-phone > li.has-icon > .aside { padding-inline-start: 34px; }
}
.recipients > div + div { margin-top: 4px; }

.empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 15px; }
.loading { padding: 18px; text-align: center; color: var(--muted); }

/* --------------------------------------------------------- states: a sign and a word, always */

.sign { font-weight: 600; }
svg.sign-check { width: 0.9em; height: 0.9em; flex: none; }
.result-title svg.sign-check { width: 0.8em; height: 0.8em; vertical-align: -0.02em; }
.notice { display: flex; gap: 8px; padding: 12px 14px; border-radius: var(--digi-rayon); background: var(--mer-pale); color: var(--digi-marine); font-size: 16px; margin-bottom: 12px; border-inline-start: 4px solid var(--digi-mer); }
.notice.tone-ok { background: var(--palmier-pale); color: var(--digi-palmier); border-inline-start-color: var(--digi-palmier); }
/* An alert: a border and an instruction, not a colour (charter p. 7). */
.notice.tone-warn, .notice.tone-danger { background: var(--digi-blanc); color: var(--digi-marine); border: 2px solid var(--digi-marine); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--digi-sable); color: var(--digi-encre); border: 1px solid var(--line); }
.badge.tone-ok { background: var(--palmier-pale); color: var(--digi-palmier); border-color: var(--digi-palmier); }
.badge.tone-info { background: var(--mer-pale); color: var(--digi-marine); border-color: var(--digi-mer); }
.badge.tone-warn { background: var(--digi-blanc); color: var(--digi-marine); border-color: var(--digi-marine); }
.badge.tone-danger { background: var(--digi-blanc); color: var(--digi-marine); border: 2px solid var(--digi-marine); padding: 1px 7px; }
/* Plates, numbers and times keep their order in any language (charter p. 9). */
.plate { display: inline-block; padding: 1px 8px; border: 2px solid var(--digi-marine); border-radius: 6px; background: var(--digi-blanc); color: var(--digi-marine); font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: bidi-override; }
.count { display: inline-flex; min-width: 24px; justify-content: center; padding: 1px 8px; border-radius: 6px; background: var(--digi-marine); color: var(--digi-blanc); font-size: 13px; font-weight: 600; }

/* Steps of a ticket, as a short bar list. */
.steps { display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; color: inherit; text-decoration: none; }
.step > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.step .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--sable-fonce); overflow: hidden; }
.step .bar span { display: block; height: 100%; border-radius: 4px; background: var(--digi-mer); }
.step strong { color: var(--digi-marine); }

/* Thread of a ticket. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 24px; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--digi-mer); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 9px; top: 19px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { content: none; }
.photo { width: 100%; max-width: 420px; border-radius: var(--digi-rayon); display: block; margin-top: 8px; }
.photo-box:empty { display: none; }
.panel-detail { border-inline-start: 4px solid var(--digi-mer); }
.panel-detail h3 { margin-top: 18px; }
.panel-detail .lead { font-size: 17px; color: var(--digi-marine); margin-bottom: 4px; }
.panel-detail > .actions { margin: 12px 0 4px; }
.sends { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.sends .badge { margin-inline-start: 4px; }
blockquote.card { margin: 0 0 12px; white-space: pre-wrap; }

/* ------------------------------------------------------------------- toasts and dialogs */

.toasts { position: fixed; inset-inline: 12px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; gap: 8px; max-width: 560px; width: 100%; padding: 12px 16px; border-radius: var(--digi-rayon); background: var(--digi-marine); color: var(--digi-blanc); font-size: 16px; pointer-events: auto; }
.toast.tone-ok { background: var(--digi-palmier); }
.toast.tone-danger { outline: 3px solid var(--digi-blanc); outline-offset: -6px; }

dialog.dialog { width: min(520px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: var(--digi-rayon); padding: 0; color: var(--digi-encre); }
dialog.dialog::backdrop { background: rgba(11, 60, 73, 0.5); }
.dialog-body { padding: 20px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

/* --------------------------------------------------------------------------- login page */

.page-login { background: var(--digi-marine); }
.login-screen {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px 72px;
  background: var(--digi-marine);
}
/* The motif derived from the passage of the emblem (charter p. 10): enlarged, one tint, past the edge. */
.login-motif { position: absolute; z-index: 0; inset-inline-end: -12vmin; bottom: -18vmin; width: 62vmin; min-width: 260px; height: auto; pointer-events: none; }
[dir="rtl"] .login-motif { transform: none; }
.login-brand { position: relative; z-index: 1; width: min(420px, 100%); color: var(--digi-blanc); margin-bottom: 20px; }
/* The signed logo: 300 px at least, its clear space around (a quarter of the emblem's width). */
.login-logo { display: block; width: 300px; height: auto; margin: 18px 18px 20px; }
.login-emblem { display: none; width: 56px; height: auto; margin: 14px 14px 18px; }
@media (max-width: 347px) { .login-logo { display: none; } .login-emblem { display: block; } }
.login-brand p { margin: 0; font-size: 17px; }
.login-card { position: relative; z-index: 1; width: min(420px, 100%); background: var(--digi-blanc); border-radius: var(--digi-rayon); padding: 24px; color: var(--digi-encre); }
.login-help { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.login-error { display: flex; gap: 8px; padding: 10px 12px; border-radius: var(--digi-rayon); border: 2px solid var(--digi-marine); color: var(--digi-marine); font-size: 15px; margin-bottom: 12px; }
.login-footer { position: absolute; bottom: 16px; inset-inline: 0; z-index: 1; text-align: center; font-size: 14px; color: var(--digi-blanc); }
@media (min-width: 900px) { .login-logo { width: 340px; } }

/* ------------------------------------------------------------------ security: the result */

.result { border-radius: var(--digi-rayon); padding: 18px; margin-top: 14px; background: var(--digi-blanc); }
.result.tone-ok { border: 3px solid var(--digi-palmier); }
.result.tone-danger, .result.tone-warn { border: 3px solid var(--digi-marine); }
.result-title { font-family: var(--titles); font-size: 28px; font-weight: 600; margin: 0 0 8px; }
.result.tone-ok .result-title { color: var(--digi-palmier); }
.result.tone-danger .result-title, .result.tone-warn .result-title { color: var(--digi-marine); }
.result-line { font-size: 17px; margin: 0 0 6px; }
.plate-input { font-family: var(--titles); font-size: 26px !important; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; direction: ltr; unicode-bidi: bidi-override; }
.gate-layout { display: grid; gap: 16px; grid-template-areas: "check" "live" "recent"; }
.gate-layout > .card { margin-bottom: 0; }
.gate-check { grid-area: check; }
.gate-live { grid-area: live; }
.gate-recent { grid-area: recent; }
@media (min-width: 1100px) {
  .gate-layout { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); grid-template-areas: "check live" "recent live"; align-items: start; }
}
.live-state { display: inline-flex; align-items: center; gap: 6px; }

/* Arabic: no letter spacing (it would break the joined letters). */
[dir="rtl"] .eyebrow, [dir="rtl"] .nav-group, [dir="rtl"] .table th, [dir="rtl"] .plate-input { letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------- WhatsApp messages (CodeBag) */

details.card > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary .chevron { width: 20px; height: 20px; flex: none; transition: transform 0.15s; }
details.card[open] > summary .chevron { transform: rotate(180deg); }
details.card[open] > summary { margin-bottom: 10px; }
.notes { margin: 0; padding-inline-start: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; overflow-wrap: anywhere; }


/* Cotisations V1: the payer confirmation, the inline payment form and the reminder preview. */
label.check { display: flex; gap: 8px; align-items: flex-start; }
label.check input { margin-top: 4px; }
.card-inset { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
