/* =====================================================================
   Sabine PRO — styles communs (repris des maquettes validées)
   ===================================================================== */
:root {
  --primary: #5b4ee6;
  --primary-soft: #eeecfd;
  --primary-dark: #4337c9;
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #22223b;
  --text-2: #5c5e78;
  --muted: #8a8ca5;
  --line: #ebecf3;
  --green: #1fbf8f;
  --green-soft: #e3f8f1;
  --orange: #ff8a3d;
  --orange-soft: #fff0e5;
  --yellow-soft: #fff6d9;
  --red: #f0475f;
  --red-soft: #fde8eb;
  --blue-soft: #e5f1fe;
  --radius: 6px;
  --shadow: 0 4px 18px rgba(34, 34, 59, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Poppins", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; height: 100vh; overflow: hidden; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 13px; color: var(--text); }
a { color: inherit; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100vh; }
.app.with-panel { grid-template-columns: 240px minmax(0, 1fr) var(--panel-w, 400px); }

/* ---------- Menu latéral ---------- */
.sidebar { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; }
.brand-logo { width: 40px; height: 40px; border-radius: 6px; background: linear-gradient(135deg, #7b6ff0, var(--primary)); display: grid; place-items: center; color: #fff; font-size: 20px; }
.brand-name { font-weight: 700; font-size: 19px; }
.brand-name span { color: var(--primary); }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 5px; color: var(--text-2); text-decoration: none; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(91, 78, 230, .3); }
.nav a.soon { opacity: .45; cursor: default; }
.nav .ico { width: 20px; text-align: center; font-size: 16px; }
.nav .badge { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 8px; white-space: nowrap; flex-shrink: 0; }
.nav .label { min-width: 0; }
.nav a.active .badge { background: #fff; color: var(--primary); }
.nav .badge.impaye, .nav a.active .badge.impaye { background: var(--red); color: #fff; margin-left: 4px; }
.nav .badge + .badge.impaye { margin-left: 4px; }
.sidebar-foot { margin-top: auto; background: var(--primary-soft); border-radius: 7px; padding: 14px; font-size: 12px; color: var(--primary-dark); }
.sidebar-foot strong { display: block; font-size: 13px; }

/* ---------- Zone centrale ---------- */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.topbar-title { flex: 1; font-weight: 600; color: var(--text-2); }
.search { flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 6px; padding: 10px 14px; }
.search input { border: none; background: none; outline: none; flex: 1; min-width: 0; }
.chip-date { white-space: nowrap; background: var(--primary-soft); color: var(--primary-dark); border-radius: 6px; padding: 9px 14px; font-weight: 500; font-size: 13px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 6px; background: var(--bg); display: grid; place-items: center; font-size: 17px; position: relative; flex-shrink: 0; }
.user-menu { position: relative; }
.user { display: flex; align-items: center; gap: 10px; background: var(--primary); color: #fff; padding: 5px 6px 5px 16px; border-radius: 6px; font-weight: 500; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 5px; background: #fff; color: var(--primary); display: grid; place-items: center; font-weight: 700; }
.user-drop { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border-radius: 7px; box-shadow: 0 12px 32px rgba(34, 34, 59, .16); min-width: 220px; overflow: hidden; }
.user-menu.open .user-drop { display: block; }
.user-drop-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.user-drop-head small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.user-drop a { display: block; padding: 11px 16px; text-decoration: none; color: var(--red); font-weight: 500; }
.user-drop a:hover { background: var(--bg); }

.content { flex: 1; overflow-y: auto; padding: 22px 26px 30px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb b { color: var(--primary); font-weight: 500; }

/* ---------- Panneau de droite ---------- */
.panel { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; height: 100vh; min-width: 0; }

/* ---------- Éléments communs ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.tabs { display: flex; gap: 4px; background: var(--card); border-radius: 6px; padding: 4px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.tabs > * { flex-shrink: 0; }
.tabs button { padding: 7px 12px; border-radius: 4px; font-weight: 500; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tabs button.active { background: var(--primary); color: #fff; }
.tabs button .n { font-size: 11px; opacity: .75; margin-left: 2px; }
.btn { border-radius: 6px; padding: 11px 8px; font-weight: 600; font-size: 13px; }
.btn-ghost { background: var(--bg); color: var(--text-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(91, 78, 230, .3); }
.btn-green { background: var(--green); color: #fff; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-link { background: var(--primary); color: #fff; border-radius: 6px; padding: 10px 16px; font-weight: 600; text-decoration: none; box-shadow: 0 6px 14px rgba(91, 78, 230, .3); white-space: nowrap; }
.pill { border-radius: 10px; padding: 3px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; height: fit-content; }
.s-0 { background: var(--yellow-soft); color: #a77600; }
.s-1 { background: var(--green-soft); color: #138a66; }
.s-2 { background: var(--red-soft); color: #c42a40; }
.t-1 { background: var(--green-soft); color: #138a66; }
.t-2 { background: var(--orange-soft); color: #c45f17; }
.t-3 { background: var(--blue-soft); color: #1d6fc7; }
.due { color: var(--red); }
.paid { color: var(--green); }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- Fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgba(34, 34, 59, .45); display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 6px; width: 100%; max-width: 440px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); }
.modal-head { background: var(--primary); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-head.danger { background: var(--red); }
.modal-head h3 { font-size: 16px; }
.modal-head small { display: block; opacity: .8; font-weight: 400; }
.modal-head button { color: #fff; font-size: 20px; }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-body p { color: var(--text-2); line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; background: #fafaff; border-top: 1px solid var(--line); }
.modal-foot .btn { padding: 10px 18px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 6px; font-weight: 500; transition: .3s; z-index: 60; max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* ---------- Connexion ---------- */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; overflow: auto; height: auto; }
.login-art { background: linear-gradient(150deg, #7b6ff0, var(--primary) 55%, var(--primary-dark)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-size: 34px; line-height: 1.2; margin: 18px 0 10px; }
.login-art p { opacity: .85; max-width: 420px; line-height: 1.6; }
.login-art .big { font-size: 110px; line-height: 1; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--card); }
.login-form form { width: 100%; max-width: 360px; }
.login-form h1 { font-size: 26px; margin-bottom: 4px; }
.login-form .sub { color: var(--muted); margin-bottom: 26px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field input, .field select { border: 1px solid var(--line); border-radius: 5px; padding: 11px 12px; background: #fff; outline: none; width: 100%; font-size: 14px; }
.field input:focus, .field select:focus { border-color: var(--primary); }
.field.error select, .field.error input { border-color: var(--red); background: var(--red-soft); }
.alert-box { background: var(--red-soft); color: #a8262f; border-radius: 5px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.login-form .btn { width: 100%; padding: 13px; font-size: 14px; }

/* Connexion « vitrine » : photos de la salle en fondu (Paramètres › Photos & logo) */
.vitrine { grid-template-columns: 1fr 1fr; }
.login-vit { position: relative; overflow: hidden; color: #fff; isolation: isolate; min-height: 100vh; background: #13245e; }
.lv-photo { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; z-index: -2; }
/* Fondu très lent (7 s) : la photo suivante apparaît par-dessus, la précédente ne s'efface qu'une fois cachée.
   Zoom continu : chaque photo se rapproche de +50 % (×1,5) en 10 minutes, puis la suivante arrive en fondu. */
.lv-photo { transform-origin: var(--zo, 50% 40%); }
.lv-photo.defile { z-index: -3; opacity: 0; transition: opacity 7s ease-in-out, transform 600s linear; }
.lv-photo.defile.on { opacity: 1; transform: scale(1.5); }
.lv-photo:not(.defile) { animation: lv-zoom 600s ease-in-out infinite alternate; }
@keyframes lv-zoom { to { transform: scale(1.5); } }
.lv-photo.defile.dessus { z-index: -2; }
.login-vit::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0d1533aa 0%, #0d153300 22%, #0d153300 46%, #13245ee0 78%, #0d1a4af5 100%); }
.lv-haut { position: absolute; top: 26px; left: 32px; right: 32px; display: flex; align-items: center; gap: 10px; font-size: 15px; }
.lv-haut .brand-logo { width: 36px; height: 36px; font-size: 16px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); }
.lv-haut b span { color: #cfc9ff; }
.lv-date { margin-left: auto; font-size: 12.5px; font-weight: 500; background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); border-radius: 6px; padding: 5px 12px; white-space: nowrap; }
.lv-bas { position: absolute; left: 36px; right: 36px; bottom: 36px; }
.lv-bas small { font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #f8d867; }
.lv-bas h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.02; letter-spacing: -1.5px; font-weight: 800; margin: 8px 0 12px; }
.lv-inf { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-inf span { background: rgba(255, 255, 255, .13); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; padding: 6px 13px; font-size: 12.5px; }
.lv-pts { display: flex; gap: 6px; margin-top: 18px; }
.lv-pts i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35); transition: background 7s ease-in-out; }
.lv-pts i.on { background: #f5c21b; }
@media (prefers-reduced-motion: reduce) { .lv-photo.defile { transition: none; transform: none !important; } .lv-photo { animation: none !important; } }
.vitrine .login-form { flex-direction: column; position: relative;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 16L-28 0M56 16l28-16' fill='none' stroke='%231d3f8a' stroke-opacity='.13' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 56px 97px; }
.vitrine .login-form::before { content: ""; position: absolute; inset: 0; background: linear-gradient(35deg, rgba(91, 78, 230, .06) 0%, rgba(255, 255, 255, .35) 30%, rgba(255, 255, 255, .85) 60%, #fff 85%); pointer-events: none; }
.vitrine .login-form > * { position: relative; }
.vitrine .login-form h1, .vitrine .login-form .sub { text-align: center; }
.lv-logo { width: 116px; height: 116px; border-radius: 50%; margin-bottom: 16px; flex-shrink: 0; background: #f4f4f4 no-repeat 50% 46% / 104% auto; box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(29, 63, 138, .2); }
@media (max-width: 900px) {
  .vitrine { grid-template-columns: 1fr; }
  .login-vit { min-height: 46vh; }
  .lv-haut { top: 18px; left: 20px; right: 20px; }
  .lv-bas { left: 22px; right: 22px; bottom: 44px; }
  .vitrine .login-form { margin-top: -28px; border-radius: 10px 10px 0 0; padding-top: 28px; z-index: 1; }
  .lv-logo { width: 84px; height: 84px; margin: -66px 0 12px; }
}
@media (max-width: 420px) { .lv-date { display: none; } }

/* ---------- Tablette / téléphone ---------- */
@media (max-width: 1280px) {
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .app.with-panel { grid-template-columns: 84px minmax(0, 1fr) var(--panel-w-s, 360px); }
  .brand-name, .nav-title, .nav .label, .nav .badge, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding: 0 0 20px; }
  .nav a { justify-content: center; }
  .topbar { padding: 14px 18px; gap: 10px; }
  .content { padding: 18px; }
  .user { padding: 5px; }
  .user-name { display: none; }
}
/* Éléments réservés aux petits écrans (cachés sur ordinateur) */
.m-brand, .panel-bar, .bottom-nav, .more-sheet, .cart-bar { display: none; }
.panel-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- Téléphone et tablette (≤ 900 px) ---------- */
@media (max-width: 900px) {
  :root { --bn-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); }
  body { overflow: auto; height: auto; padding-bottom: calc(var(--bn-h) + var(--safe-b)); }
  body.panel-open, body.more-open { overflow: hidden; }
  .app, .app.with-panel { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100vh; }
  .sidebar { display: none; }
  .main { height: auto; }

  /* Barre du haut compacte, toujours visible */
  .topbar { position: sticky; top: 0; z-index: 15; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; gap: 8px; flex-wrap: wrap; }
  .m-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 1; }
  .m-brand .brand-logo { width: 36px; height: 36px; font-size: 18px; flex-shrink: 0; }
  .m-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-title { display: none; }
  .chip-date { margin-left: 0; padding: 7px 10px; font-size: 12px; }
  .topbar .icon-btn[title="Plein écran"] { display: none; }
  .search { max-width: none; order: 3; flex-basis: 100%; padding: 9px 12px; }
  .search input { font-size: 16px; } /* évite le zoom automatique d'iOS */
  .content { padding: 16px 14px 24px; overflow: visible; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 21px; }
  .page-head .crumb { display: none; }
  .tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  input, select, textarea { font-size: 16px; }

  /* Navigation fixe en bas */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bn-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--card);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(34, 34, 59, .06); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; }
  .bottom-nav .bn-ico { font-size: 21px; line-height: 1; position: relative; filter: grayscale(1); opacity: .7; }
  .bottom-nav .active { color: var(--primary); font-weight: 600; }
  .bottom-nav .active .bn-ico { filter: none; opacity: 1; }
  .bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
  .bn-badge { position: absolute; top: -6px; right: -12px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 5px; padding: 1px 5px; min-width: 18px; text-align: center; font-style: normal; filter: none; }

  /* Feuille « Plus » : toutes les rubriques */
  .more-sheet { display: flex; position: fixed; inset: 0 0 calc(var(--bn-h) + var(--safe-b)) 0; z-index: 45; background: rgba(34, 34, 59, .45); align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.more-open .more-sheet { opacity: 1; pointer-events: auto; }
  .more-box { background: var(--card); width: 100%; border-radius: 7px 10px 0 0; padding: 18px 16px 16px;
    max-height: 88vh; overflow-y: auto; transform: translateY(30px); transition: transform .2s; }
  body.more-open .more-box { transform: none; }
  .more-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
  .more-head small { display: block; color: var(--muted); font-size: 12px; }
  .more-head button { font-size: 26px; line-height: 1; color: var(--muted); padding: 0 6px; }
  .more-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 8px; }
  .more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .more-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; font-size: 12px;
    font-weight: 500; color: var(--text); background: var(--bg); border-radius: 7px; padding: 12px 6px; line-height: 1.2; }
  .more-grid a span { font-size: 22px; }
  .more-grid a small { color: var(--muted); font-size: 10px; font-weight: 400; }
  .more-grid a.active { background: var(--primary-soft); color: var(--primary-dark); }
  .more-grid a.soon { opacity: .5; }
  .more-logout { display: block; margin-top: 16px; text-align: center; padding: 12px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-weight: 600; text-decoration: none; }

  /* Panneau de droite → écran plein, ouvert à la demande */
  .panel { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--bn-h) + var(--safe-b)); z-index: 30; height: auto;
    border: none; transform: translateY(102%); transition: transform .25s ease; box-shadow: 0 -10px 30px rgba(34, 34, 59, .15); }
  body.panel-open .panel { transform: none; }
  .panel-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); flex-shrink: 0; }
  .panel-bar b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel-close { background: var(--bg); border-radius: 5px; padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--primary); white-space: nowrap; }
  .overlay { z-index: 50; }
  .modal { max-height: 90vh; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; }
  .toast { bottom: calc(var(--bn-h) + var(--safe-b) + 14px); }

  /* Panier flottant (prise de commande) */
  .cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bn-h) + var(--safe-b) + 10px); z-index: 20; display: flex; align-items: center; gap: 10px;
    background: var(--primary); color: #fff; border-radius: 8px; padding: 12px 16px; box-shadow: 0 10px 24px rgba(91, 78, 230, .4); font-weight: 600; }
  .cart-bar[hidden] { display: none; }
  .cart-bar .cb-count { background: #fff; color: var(--primary); border-radius: 5px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 13px; padding: 0 6px; }
  .cart-bar b { margin-left: auto; white-space: nowrap; }
  body.has-cart-bar .content { padding-bottom: 90px; }

  .login-page { grid-template-columns: 1fr; padding-bottom: 0; }
  .login-art { padding: 28px; }
  .login-art .big { font-size: 60px; }
  .login-art h2 { font-size: 24px; }
}

/* Petits téléphones */
@media (max-width: 380px) {
  .chip-date { display: none; }
  .content { padding: 14px 10px 24px; }
}

/* =====================================================================
   Terminaux POS (écrans tactiles de caisse)
   ===================================================================== */
/* Pas de zoom au double-tap, pas de surlignage bleu, pas de « tirer pour rafraîchir » */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, a, select, label, .product, .order, .tcard, .mcard, .srow, .mrow, .cat { touch-action: manipulation; }
button, .product, .order, .tcard, .mcard, .srow, .mrow, .cat, .nav a, .bottom-nav a, .tabs button { -webkit-user-select: none; user-select: none; }
button:active:not(:disabled), .btn-link:active { transform: scale(.97); }

/* Écran tactile (pointeur « grossier ») : cibles d'au moins 44 px, pas d'effets au survol */
@media (pointer: coarse) {
  .btn, .btn-link, .tabs button, .segment button, .seg button, .sens button, .seg4 button { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .field input, .field select, .cfield select, .cfield input, .pay-input select, .pay-input input,
  .period input, .filters select, .cfilters select, .fgrid input, .fgrid select { min-height: 44px; }
  .pay-input button { min-width: 48px; }
  .qty button { width: 38px; height: 38px; font-size: 18px; border-radius: 5px; }
  .qty { gap: 8px; }
  .acc-btn, .del-btn, .acc-chip { padding: 7px 12px; font-size: 12px; }
  .acc-chip button { width: 24px; height: 24px; }
  .product:hover, .order:hover, .tcard:hover, .mcard:hover, .rmenu button:hover { transform: none; }
  .nav a { padding: 12px; }
  .presets button { padding: 10px 14px; }
}

/* Caisse fixe en paysage peu haute (1024×768, 1280×800, 1366×768…) : on gagne de la hauteur */
@media (min-width: 901px) and (max-height: 860px) {
  .topbar { padding-top: 10px; padding-bottom: 10px; }
  .content { padding-top: 14px; }
  .page-head { margin-bottom: 12px; }
  .page-head h1 { font-size: 21px; }
  .page-head .crumb { display: none; }
  .brand { padding-bottom: 14px; }
  .nav a { padding-top: 8px; padding-bottom: 8px; }
  .nav-title { padding-top: 8px; }
  .sidebar-foot { display: none; }
}

/* Très grands écrans (1920×1080 et plus) : texte et cibles agrandis pour la lecture à distance */
@media (min-width: 1800px) {
  html { font-size: 15px; }
  body { font-size: 15px; }
  .app { grid-template-columns: 260px minmax(0, 1fr); }
  .app.with-panel { grid-template-columns: 260px minmax(0, 1fr) var(--panel-w-l, 460px); }
}

/* Petit écran paysage (POS 7 pouces 800×480, téléphone couché) */
@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  :root { --bn-h: 52px; }
  .bottom-nav .bn-ico { font-size: 18px; }
  .bottom-nav a, .bottom-nav button { flex-direction: row; gap: 6px; font-size: 12px; }
  .topbar { position: static; }
  .search { order: 0; flex-basis: auto; }
}
.user-drop a.pwd-link { color: var(--text); }
.more-pwd { display: none; }
@media (max-width: 900px) {
  .more-pwd { display: block; margin-top: 16px; text-align: center; padding: 12px; border-radius: 6px; background: var(--bg); color: var(--text); font-weight: 600; text-decoration: none; }
  .more-pwd + .more-logout { margin-top: 8px; }
}

/* ---------- Menu latéral réduit à une colonne d'icônes (bouton ☰) ---------- */
.nav-toggle { display: none; }
@media (min-width: 1281px) {
  .nav-toggle { display: grid; }
  .app.nav-compact { grid-template-columns: 76px minmax(0, 1fr); }
  .app.nav-compact.with-panel { grid-template-columns: 76px minmax(0, 1fr) var(--panel-w, 400px); }
  .app.nav-compact .sidebar { padding: 18px 10px; }
  .app.nav-compact .brand-name, .app.nav-compact .nav-title, .app.nav-compact .nav .label, .app.nav-compact .sidebar-foot { display: none; }
  .app.nav-compact .brand { justify-content: center; padding: 0 0 18px; }
  .app.nav-compact .nav a { justify-content: center; position: relative; padding: 12px 0; }
  .app.nav-compact .nav .badge { position: absolute; top: 3px; right: 3px; margin: 0; font-size: 10px; padding: 0 5px; min-width: 18px; text-align: center; }
  .app.nav-compact .nav a + .nav-title + a, .app.nav-compact .nav a:has(+ .nav-title) { margin-bottom: 8px; }
}
@media (min-width: 1281px) and (min-width: 1800px) {
  .app.nav-compact.with-panel { grid-template-columns: 76px minmax(0, 1fr) var(--panel-w-l, 460px); }
}

/* Bulle du nom de rubrique au survol du menu réduit */
.nav-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--text); color: #fff; font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: 4px; white-space: nowrap; box-shadow: 0 8px 22px rgba(34, 34, 59, .22);
  opacity: 0; transform: translate(-4px, -50%); transition: opacity .12s, transform .12s; }
.nav-tip.show { opacity: 1; transform: translate(0, -50%); }
.nav-tip::before { content: ""; position: absolute; left: -5px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 10px; height: 10px; background: var(--text); border-radius: 2px; }
.nav-tip small { opacity: .7; font-weight: 400; margin-left: 6px; }

/* Rendu de monnaie */
.rendu-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: 6px 0; }
.rendu-box label { display: flex; align-items: center; gap: 6px; }
.rendu-box input { width: 130px; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; font: inherit; }
.rendu-val { font-weight: 800; font-size: 14px; } .rendu-val.ok { color: #138a66; } .rendu-val.manque { color: var(--red); }

/* Bandeau des commandes prises hors ligne */
.hors-ligne { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 60; background: #b54708; color: #fff; border-radius: 10px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.hors-ligne.err { background: var(--red); }

/* Texte de la boîte de confirmation : les retours à la ligne sont respectés */
#confirmText { white-space: pre-line; }

/* Boutons secondaires bien visibles (contour + texte foncé), partout dans l'application */
.btn { border: 1.5px solid transparent; transition: background .15s, border-color .15s, filter .15s; }
.btn-ghost { background: #fff; color: var(--text); border-color: #cfd2e3; }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-soft { background: #e6e2ff; color: #3d2fc4; border-color: #c4bcfb; }
.btn-soft:hover:not(:disabled) { background: #d9d3ff; }
.btn-danger { background: #fff1f1; color: #c42020; border-color: #f3aaaa; }
.btn-danger:hover:not(:disabled) { background: #ffe1e1; border-color: #e46b6b; }
.btn-green { border-color: transparent; }
.btn-primary:hover:not(:disabled), .btn-green:hover:not(:disabled) { filter: brightness(1.06); }
/* Bouton indisponible : reste lisible mais clairement grisé */
.btn:disabled { opacity: 1; background: #f1f2f6; color: #9a9db3; border-color: #e1e3ec; box-shadow: none; cursor: not-allowed; }

/* Bouton WhatsApp (envoi de ticket, relance, confirmation) */
.btn-whatsapp { background: #e7f8ee; color: #128c4b; border: 1.5px solid #25d366; font-weight: 600; }
.btn-whatsapp:hover:not(:disabled) { background: #25d366; color: #fff; }

/* Demandes des clients en ligne */
.en-ligne-btn { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 30; background: linear-gradient(135deg, #f79009, #f04438); color: #fff; font-weight: 700; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(240, 68, 56, .35); animation: elPulse 1.6s infinite; max-width: calc(100% - 32px); }
@keyframes elPulse { 50% { box-shadow: 0 8px 30px rgba(240, 68, 56, .6); } }
.en-ligne-modal { max-width: 560px; width: 100%; }
.en-ligne-modal .modal-body { max-height: 70vh; overflow: auto; display: grid; gap: 10px; }
.el-carte { border: 1.5px solid var(--line); border-radius: 7px; padding: 12px; }
.el-tete { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.el-tete span { color: var(--muted); font-size: 12.5px; }
.el-carte ul { margin: 8px 0; padding-left: 18px; font-size: 14px; }
.el-carte em { color: var(--muted); }
.el-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.el-actions > :first-child { margin-right: auto; }
.el-actions a.btn { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .en-ligne-btn { animation: none; } }

/* Connexion rapide par code PIN */
.pin-noms { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 16px; }
.pin-noms button { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: 7px; padding: 10px 6px; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--card); }
.pin-noms button span { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.pin-noms button.on { border-color: var(--primary); background: var(--primary-soft); }
.pin-points { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.pin-points i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.pin-points i.on { background: var(--primary); border-color: var(--primary); }
.pin-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pave button { height: 58px; border-radius: 8px; background: var(--bg, #f4f4fb); font-size: 22px; font-weight: 600; color: var(--text); }
.pin-pave button:active { transform: scale(.96); }
.pin-pave .ok { background: var(--primary); color: #fff; font-size: 17px; }
.pin-alt { text-align: center; margin-top: 16px; font-size: 13px; }
.pin-alt a { color: var(--primary); font-weight: 600; text-decoration: none; }
/* Écrans du code PIN (login.php) : choix en 2 saisies, déverrouillage, tablette « Qui êtes-vous ? » */
.pin-points i { border-color: #cfcde0; }
.pin-pave span { height: 58px; }
.pin-pave .eff { background: transparent; color: var(--muted); font-size: 20px; }
.pin-alt + .pin-alt { margin-top: 8px; }
.pin-alt .gris, .lg-lien.gris { color: var(--muted); }
.lg-lien { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--primary); }
.lg-souvenir { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); margin: 2px 0 16px; cursor: pointer; }
.lg-souvenir input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.lg-note { background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 10px 12px; font-size: 12.5px; margin: 14px 0 0; text-align: center; }
.lg-note.haut { margin: 0 0 14px; }
.lg-av { width: 62px; height: 62px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; margin: 0 auto 10px; box-shadow: 0 8px 20px rgba(29, 63, 138, .16); }
.login-form form[data-pin] h1, .login-form form[data-pin] .sub { text-align: center; }
.login-form form[data-pin] .sub { margin-bottom: 18px; }
.login-form form.envoi .pin-pave { opacity: .5; pointer-events: none; }
.lg-tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.lg-tu { display: block; border: 1.5px solid var(--line); border-radius: 7px; padding: 10px 6px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); background: var(--card); text-decoration: none; cursor: pointer; font-family: inherit; }
.lg-tu .a { width: 36px; height: 36px; border-radius: 6px; color: #fff; display: grid; place-items: center; margin: 0 auto 5px; font-weight: 700; font-size: 12.5px; }
.lg-tu small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.lg-tu.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
@media (min-width: 620px) { .lg-tuiles { grid-template-columns: repeat(3, 1fr); } }

/* Commande prête à servir (alerte de la caisse) */
.pretes-btn { position: fixed; right: 16px; bottom: 20px; z-index: 35; background: linear-gradient(135deg, #22c55e, #059669); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 13.5px; padding: 11px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(5, 150, 105, .35); max-width: calc(100% - 32px); }
.pretes-btn.neuf { animation: prPulse 1s 6; }
@keyframes prPulse { 50% { transform: scale(1.06); box-shadow: 0 8px 30px rgba(5, 150, 105, .6); } }
@media (max-width: 860px) { .pretes-btn { bottom: 84px; } }
@media (prefers-reduced-motion: reduce) { .pretes-btn.neuf { animation: none; } }

/* Commandes terminées non payées : badge rouge dans le menu */
.bn-badge.impaye { background: var(--red); }
.app.nav-compact .nav .badge.impaye { top: auto; bottom: 3px; }

/* ---------- Responsive : garde-fous communs à toutes les pages ---------- */
.content { min-width: 0; }
img, svg, video, iframe { max-width: 100%; }
/* Tableaux générés par les pages : ils défilent dans leur cadre au lieu d'élargir la page */
#journal, #depenses, #hArticles, #hCommandes { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filters > *, .page-head > * { min-width: 0; max-width: 100%; }
/* ---------- Barre d'onglets : fixe en haut de page, une seule ligne, défilement doux ---------- */
/* La rangée des filtres reste collée sous la barre du haut quand on fait défiler la page. */
.filters { position: sticky; top: calc(var(--colle-haut, 0px) - 1px); z-index: 12; margin-left: -6px; margin-right: -6px; padding: 6px;
  background: var(--bg); border-radius: 0 0 8px 8px; transition: box-shadow .2s; }
.filters.colle { box-shadow: 0 10px 18px -12px rgba(34, 34, 59, .28); }
.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; scroll-padding-inline: 24px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { transition: background .15s, color .15s; }
.tabs button:not(.active):hover { background: var(--bg); color: var(--text); }
/* Fondu sur le bord qui cache encore des onglets (indique qu'on peut faire défiler) */
.tabs.plus-droite { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.tabs.plus-gauche { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.tabs.plus-gauche.plus-droite { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
@media (max-width: 900px) {
  /* Téléphone : tous les groupes de filtres sur UNE ligne qui défile au doigt, pour que la barre reste basse et fixe */
  .filters { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin-left: -14px; margin-right: -14px; padding: 6px 14px 8px; border-radius: 0; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex-shrink: 0; max-width: none; }
  .filters > .tabs { overflow: visible; max-width: none; -webkit-mask-image: none !important; mask-image: none !important; }
  .filters.plus-droite { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .filters.plus-gauche { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
  .filters.plus-gauche.plus-droite { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
}
.filters.libre { position: static; box-shadow: none; }
@media print { .filters { position: static; box-shadow: none; } }
@media (max-width: 380px) { .filters { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; } }

/* Proposition d'ouvrir l'écran client quand un second écran est détecté */
.ecran-auto { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text, #1c1b2e); color: #fff; border-radius: 8px;
  padding: 12px 20px; font-size: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); text-align: center; max-width: calc(100% - 32px); }
.ecran-auto b { color: #b9b2ff; }
.ecran-auto small { display: block; opacity: .65; font-size: 12px; margin-top: 2px; }
@media (max-width: 900px) { .ecran-auto { bottom: calc(var(--bn-h, 64px) + 14px); } }

/* Pastilles du menu (en cours, non payées) empilées à droite : le libellé garde toute sa place */
.nav .badges { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.nav .badges .badge, .nav .badges .badge.impaye { margin-left: 0; }
.nav .label { flex: 1; }
.nav a:has(.badges) { gap: 9px; padding-right: 8px; }
.nav .badges .badge { font-size: 10.5px; padding: 1px 6px; line-height: 15px; }
@media (max-width: 1280px) { .nav .badges { display: none; } }
.app.nav-compact .nav .badges { position: absolute; top: 3px; right: 3px; margin: 0; gap: 2px; }
.app.nav-compact .nav .badges .badge { position: static; }

/* =====================================================================
   Navigation, style Widgets (maquette validée) : le menu tient entier à l'écran,
   icônes dans des carrés colorés par groupe, rubrique ouverte teintée (aucune barre sur le côté).
   ===================================================================== */
.brand { padding: 0 6px; height: 42px; margin-bottom: 12px; gap: 10px; }
.brand-logo { width: 38px; height: 38px; border-radius: 6px; background: var(--primary); font-size: 17px; flex-shrink: 0; }
.brand-name { font-size: 17px; white-space: nowrap; }
.nav-reduire { margin-left: auto; width: 28px; height: 28px; border-radius: 4px; background: var(--bg); color: var(--muted); font-size: 13px; flex-shrink: 0; }
.nav-reduire:hover { background: var(--primary-soft); color: var(--primary); }
.sidebar { padding: 18px 14px 14px; }
.nav-title { font-size: 10px; font-weight: 600; letter-spacing: .1em; color: #b3b2c4; padding: 10px 8px 3px; }
.nav a { min-height: 36px; padding: 4px 8px; gap: 10px; border-radius: 6px; margin-bottom: 1px; font-size: 13.5px; color: #55546c; white-space: nowrap; }
.nav .ico { width: 28px; height: 28px; flex-shrink: 0; border-radius: 4px; display: grid; place-items: center; font-size: 14px; }
.nav .g-service .ico { background: #efedfe; }
.nav .g-gestion .ico { background: #fff2e0; }
.nav .g-finances .ico { background: #e3f6ec; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; box-shadow: none; }
.nav a.active .ico { background: var(--primary); box-shadow: 0 4px 10px rgba(91, 78, 230, .35); }
.nav a.active .badge { background: var(--orange); color: #fff; }
.nav a.nav-nouv { justify-content: center; min-height: 42px; margin: 0 0 6px; background: var(--primary); color: #fff; font-weight: 600; border-radius: 7px; box-shadow: 0 8px 18px rgba(91, 78, 230, .28); }
.nav a.nav-nouv:hover, .nav a.nav-nouv.active { background: var(--primary-dark); color: #fff; }
.nav a.nav-nouv .ico { width: auto; height: auto; background: none; box-shadow: none; font-size: 18px; line-height: 1; }
.nav a.nav-nouv .label { flex: 0 0 auto; }
/* pied du menu : la personne connectée et la journée de service (ouvre le menu du compte) */
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; width: 100%; background: var(--bg); color: var(--text); border-radius: 8px; padding: 10px 12px; text-align: left; font-size: 12px; flex-shrink: 0; }
.sidebar-foot:hover { background: var(--primary-soft); }
.foot-av { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.foot-nom { flex: 1; min-width: 0; }
.foot-nom b, .foot-nom small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-nom b { font-size: 12.5px; }
.foot-nom small { color: var(--muted); font-size: 11px; }
.foot-jour { font-size: 10.5px; font-weight: 700; color: #0b7d47; background: #e3f6ec; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }

/* barre du haut : rubrique + titre de la page */
.topbar { padding: 12px 24px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); }
.topbar-crumb { flex: 0 1 auto; min-width: 0; line-height: 1.25; }
.topbar-crumb small { display: block; font-size: 11.5px; color: var(--muted); }
.topbar-crumb b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumb + .search { margin-left: 12px; }
.app:not(.nav-compact) .nav-toggle { display: none; }

@media (min-width: 901px) {
  .topbar .user { display: none; }          /* le compte s'ouvre depuis le pied du menu */
  .topbar .user-menu { align-self: flex-end; }
}
/* menu réduit : colonne d'icônes, le pied ne garde que l'initiale */
@media (min-width: 1281px) {
  .app.nav-compact .nav-reduire { display: none; }
  .app.nav-compact .nav-title { display: block; height: 1px; padding: 0; margin: 8px 10px; background: var(--line); font-size: 0; }
  .app.nav-compact .nav a { padding: 4px 0; }
  .app.nav-compact .nav a.nav-nouv { width: 46px; margin: 0 auto 6px; }
  .app.nav-compact .sidebar-foot { display: flex; justify-content: center; padding: 6px; background: none; }
  .app.nav-compact .foot-nom, .app.nav-compact .foot-jour { display: none; }
}
@media (max-width: 1280px) and (min-width: 901px) {
  .nav-reduire { display: none; }
  .nav-title { display: block; height: 1px; padding: 0; margin: 8px 10px; background: var(--line); font-size: 0; }
  .nav a { padding: 4px 0; }
  .nav a.nav-nouv { width: 46px; margin: 0 auto 6px; }
  .sidebar-foot { display: flex; justify-content: center; padding: 6px; background: none; }
  .foot-nom, .foot-jour { display: none; }
}
/* écrans peu hauts : tout reste visible sans défiler */
@media (min-width: 901px) and (max-height: 860px) {
  .brand { margin-bottom: 8px; }
  .nav a { min-height: 32px; padding-top: 2px; padding-bottom: 2px; }
  .nav .ico { width: 26px; height: 26px; }
  .nav a.nav-nouv { min-height: 38px; }
  .nav-title { padding-top: 7px; }
  .sidebar-foot { display: flex; padding: 7px 10px; }
  .foot-av { width: 30px; height: 30px; }
}

/* téléphone et tablette : barre flottante en bas, « + » au centre, feuille « Tout » */
@media (max-width: 900px) {
  :root { --bn-h: 78px; }
  .topbar .user { background: none; padding: 0; }
  .topbar .user-name { display: none; }
  .topbar .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; }
  .topbar-crumb { display: none; }
  .bottom-nav { display: flex; align-items: center; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: 64px; padding: 0 6px;
    border-radius: 7px; border: none; box-shadow: 0 12px 30px rgba(34, 34, 59, .18); }
  .bottom-nav > a, .bottom-nav > button { flex: 1; min-width: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); }
  .bottom-nav .bn-ico { width: 38px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 18px; filter: grayscale(1); opacity: .75; }
  .bottom-nav .active { color: var(--primary); }
  .bottom-nav .active .bn-ico { background: var(--primary-soft); filter: none; opacity: 1; }
  .bottom-nav .active::before { display: none; }
  .bottom-nav .bn-plus { flex: 0 0 66px; }
  .bottom-nav .bn-plus span { width: 56px; height: 56px; margin-top: -30px; border-radius: 6px; background: var(--primary); color: #fff; display: grid; place-items: center;
    font-size: 28px; font-weight: 400; border: 4px solid var(--bg); box-shadow: 0 10px 22px rgba(91, 78, 230, .4); }
  .bottom-nav .bn-plus.active span { background: var(--primary-dark); }
  .bn-badge { top: -5px; right: -6px; border: 2px solid var(--card); }
  .more-box { border-radius: 8px 10px 0 0; padding: 10px 16px 16px; }
  .more-poignee { width: 40px; height: 5px; border-radius: 4px; background: #dddce6; margin: 0 auto 12px; }
  .more-head { align-items: center; gap: 10px; background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 4px; }
  .more-head > div { flex: 1; min-width: 0; }
  .more-head b { font-size: 13px; }
  .more-title { font-size: 10px; font-weight: 600; letter-spacing: .1em; color: #b3b2c4; margin: 12px 2px 6px; }
  .more-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
  .more-grid a { background: none; padding: 2px; gap: 5px; font-size: 10.5px; font-weight: 600; color: #55546c; }
  .more-grid a span { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; font-size: 20px; }
  .more-grid.g-service a span { background: #efedfe; }
  .more-grid.g-gestion a span { background: #fff2e0; }
  .more-grid.g-finances a span { background: #e3f6ec; }
  .more-grid a.active { background: none; color: var(--primary); }
  .more-grid a.active span { background: var(--primary); }
  .more-bas { display: flex; gap: 8px; margin-top: 14px; }
  .more-bas .more-pwd, .more-bas .more-logout { flex: 1; margin: 0; padding: 11px 8px; border-radius: 7px; font-size: 12.5px; }
  .more-bas .more-pwd + .more-logout { margin-top: 0; }
}
@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  :root { --bn-h: 62px; }
  .bottom-nav { height: 50px; bottom: calc(6px + var(--safe-b)); }
  .bottom-nav .bn-plus span { width: 44px; height: 44px; margin-top: -14px; font-size: 22px; }
}
.nav .badges { flex-direction: row; align-items: center; gap: 4px; }
@media (min-width: 1281px) {
  .app.nav-compact .nav .badges { position: absolute; top: -3px; right: 0; margin: 0; flex-direction: row; gap: 2px; }
  .app.nav-compact .nav .badges .badge { position: static; font-size: 10px; padding: 0 5px; min-width: 0; line-height: 15px; }
}
.app.nav-compact .nav .badges .badge:not(.impaye):has(+ .impaye) { display: none; }
.nav a.active .ico { color: #fff; }

/* Téléphone et tablette : aucun élément ne peut élargir la page (sinon le navigateur mobile dézoome tout l’écran).
   overflow-x: clip ne crée pas de zone de défilement : la barre du haut reste collée. */
@media (max-width: 900px) {
  .app { overflow-x: clip; max-width: 100vw; }
  .nav-tip { display: none; }
  .topbar > * { min-width: 0; }
  .search { box-sizing: border-box; width: 100%; }
}

/* Petits écrans : boutons d'en-tête en grille 2 × 2, périodes « Du … au … » lisibles en entier */
@media (max-width: 640px) {
  .content .head-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .content .head-btns > * { width: 100%; justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
  .content .head-btns > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .content .period { display: flex; flex-wrap: wrap; width: 100%; row-gap: 8px; }
  .content .period input[type="date"] { flex: 1 1 118px; min-width: 0; font-size: 14px; padding-left: 8px; padding-right: 6px; }
  .content .period .go, .content .period button { flex: 1 0 100%; }
}

/* ---------- Identité du restaurant (Paramètres › Photos & logo) ---------- */
/* Fond : photo principale légèrement floutée (on reconnaît la salle), sous le gris clair de l'application */
body.avec-fond::before { content: ""; position: fixed; inset: -12px; z-index: -1; pointer-events: none;
  background: var(--fond-img) var(--fond-pos, 50% 40%) / cover no-repeat; filter: blur(2px) saturate(.9); opacity: var(--fond-op, .25); }
/* Carte du restaurant en haut du menu : photo, logo rond, nom */
.brand.resto { position: relative; height: 112px; margin: -4px -2px 34px; padding: 0; border-radius: 7px; overflow: visible; align-items: flex-end; }
.resto-photo { position: absolute; inset: 0; border-radius: 7px; background-size: cover; background-repeat: no-repeat; overflow: hidden; }
.resto-photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(13, 21, 51, 0) 30%, rgba(19, 36, 94, .85)); }
.brand-logo[style*="background-image"] { background-color: #f4f4f4; background-repeat: no-repeat; background-position: 50% 46%; background-size: 104% auto; }
.brand.resto .brand-logo { position: absolute; left: 12px; bottom: -24px; width: 52px; height: 52px; border-radius: 50%; z-index: 1; box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(29, 63, 138, .25); }
.brand.resto .brand-name { position: absolute; left: 72px; right: 10px; bottom: 8px; z-index: 1; color: #fff; font-size: 12.5px; line-height: 1.2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.brand.resto .brand-name small { display: block; font-size: 10px; font-weight: 600; color: #f8d867; letter-spacing: .06em; }
.brand.resto .nav-reduire { position: absolute; top: 8px; right: 8px; z-index: 1; background: rgba(255, 255, 255, .85); }
.m-brand .brand-logo[style*="background-image"] { border-radius: 50%; }
/* Menu réduit (ordinateur) ou étroit (tablette) : seul le logo rond reste */
.app.nav-compact .brand.resto { height: auto; margin: 0 0 18px; flex-direction: column; align-items: center; gap: 8px; }
.app.nav-compact .resto-photo, .app.nav-compact .brand.resto .brand-name { display: none; }
.app.nav-compact .brand.resto .brand-logo, .app.nav-compact .brand.resto .nav-reduire { position: static; }
@media (max-width: 1280px) and (min-width: 901px) {
  .brand.resto { height: auto; margin: 0 0 18px; flex-direction: column; align-items: center; gap: 8px; }
  .resto-photo, .brand.resto .brand-name { display: none; }
  .brand.resto .brand-logo, .brand.resto .nav-reduire { position: static; }
}

/* Icônes : toujours en émoji couleur (certains symboles comme ⏱ ou ⚙ s'affichent sinon en une seule couleur,
   celle du texte, et disparaissent sur le carré violet de l'élément actif) ; blanc en secours sur fond violet */
.nav .ico, .more-grid a span, .snav i, .brand-logo { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Poppins", sans-serif; font-variant-emoji: emoji; }
.more-grid a.active span, .nav a.active .ico, .snav button.active i { color: #fff; }

/* ---------- Centre de notifications (T13) : cloche de la barre du haut, panneau, bandeau qui reste ----------
   Sélection et non-lu marqués par un fond teinté et un point, jamais par un liseré à gauche. */
.cloche { border: 0; cursor: pointer; font-size: 18px; }
.cloche.on { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
.cloche em { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; background: #d92d43; color: #fff;
  font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; line-height: 1; }
.cloche em:empty { display: none; }
.cloche.sonne { animation: alSonne .9s ease 2; }
@keyframes alSonne { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .cloche.sonne { animation: none; } }
.mon-ecran { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.mon-ecran:hover { background: var(--primary); color: #fff; }

.al-pan { position: fixed; top: 72px; right: 16px; width: 390px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 96px)); background: #fff; border-radius: 8px;
  box-shadow: 0 24px 60px rgba(28, 27, 46, .2); border: 1px solid var(--line); display: none; flex-direction: column; overflow: hidden; z-index: 55; }
.al-pan.open { display: flex; }
.al-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.al-h b { font-size: 15px; }
.al-retour { display: none; }
.al-lien { margin-left: auto; background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 6px 4px; border-radius: 4px; }
.al-lien:hover { background: var(--primary-soft); }
.al-filt { display: flex; gap: 6px; padding: 0 16px 10px; }
.al-filt button { border: 0; border-radius: 6px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; background: var(--bg); color: #55546c; cursor: pointer; }
.al-filt button.on { background: var(--text); color: #fff; }
.al-liste { overflow: auto; padding: 0 8px 8px; flex: 1; }
.al-grp { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #a3a2b6; padding: 8px 8px 4px; }
.al-n { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 6px; }
.al-n + .al-n { border-top: 1px solid #f3f2f8; }
.al-n.nl { background: #f8f7ff; }
.al-ic { width: 38px; height: 38px; border-radius: 5px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Poppins", sans-serif; }
.al-tx { min-width: 0; }
.al-tx b { display: block; font-size: 13px; line-height: 1.35; }
.al-tx small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.al-pt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }
.al-ac { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.al-ac time { font-size: 11px; color: var(--muted); }
.al-bt { border: 0; border-radius: 4px; padding: 7px 12px; min-height: 34px; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; color: #fff; white-space: nowrap; }
.al-ic.al-vert { background: #e3f6ec; } .al-bt.al-vert { background: #0e9f5a; }
.al-ic.al-violet { background: #efedfe; } .al-bt.al-violet { background: var(--primary); }
.al-ic.al-bleu { background: #e4eefe; } .al-bt.al-bleu { background: #1d6fd1; }
.al-ic.al-orange { background: #fff0dc; } .al-bt.al-orange { background: #e07b00; }
.al-ic.al-rouge { background: #ffe4e6; } .al-bt.al-rouge { background: #d92d43; }
.al-bt.al-gris { background: var(--bg); color: var(--text); }
.al-vide { text-align: center; color: var(--muted); padding: 30px 10px; margin: 0; }
.al-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); background: #fafafd; font-size: 12px; color: #55546c; }
.al-sw { display: flex; align-items: center; gap: 8px; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 4px 0; min-height: 36px; }
.al-sw i { width: 34px; height: 20px; border-radius: 4px; background: #d7d6e3; position: relative; flex-shrink: 0; transition: background .15s; }
.al-sw i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.al-sw[aria-checked="true"] i { background: var(--primary); }
.al-sw[aria-checked="true"] i::after { left: 16px; }

.al-ban { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(680px, calc(100vw - 32px)); background: #1c1b2e; color: #fff; border-radius: 7px;
  padding: 12px 14px; display: none; align-items: center; gap: 12px; box-shadow: 0 16px 40px rgba(28, 27, 46, .35); z-index: 45; }
.al-ban.open { display: flex; }
.al-ban-tx { min-width: 0; flex: 1; }
.al-ban-tx b { display: block; font-size: 14px; }
.al-ban-tx small { display: block; opacity: .78; font-size: 12px; overflow-wrap: anywhere; }
.al-ban-bt { display: flex; gap: 6px; flex-shrink: 0; }
.al-ban .al-bt { min-height: 40px; }
.al-plus-tard { border: 0; border-radius: 4px; padding: 7px 12px; min-height: 40px; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; background: rgba(255, 255, 255, .14); color: #fff; }

.more-alertes { display: none; }
@media (max-width: 900px) {
  /* Téléphone : la liste s'ouvre en plein écran, au-dessus de la barre du bas */
  .al-pan { inset: 0; top: 0; right: 0; width: auto; max-width: none; max-height: none; border-radius: 0; border: 0; z-index: 70;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  body.al-ouvert { overflow: hidden; }
  .al-h { padding: 10px 12px 8px; }
  .al-h b { font-size: 17px; }
  .al-long { display: none; }
  .al-retour { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 6px; background: var(--bg); font-size: 18px; cursor: pointer; }
  .al-lien, .al-filt button, .al-sw { min-height: 44px; }
  .al-bt { min-height: 44px; padding: 8px 14px; font-size: 13px; }
  .al-ban { bottom: calc(var(--bn-h, 64px) + var(--safe-b, 0px) + 22px); flex-wrap: wrap; }
  .al-ban-bt { width: 100%; }
  .al-ban-bt button { flex: 1; min-height: 44px; }
  .cloche { width: 44px; height: 44px; }
  .mon-ecran { min-height: 44px; padding: 0 12px; }
  .more-alertes { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 12px; min-height: 48px; border: 0; border-radius: 6px;
    background: var(--primary-soft); color: var(--primary-dark); font: inherit; font-weight: 600; cursor: pointer; }
  .more-alertes em { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 4px; background: #d92d43; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
  .more-alertes em:empty { display: none; }
}
@media print { .cloche, .al-pan, .al-ban, .mon-ecran { display: none !important; } }

/* ---------- Plusieurs établissements : sélecteur du menu, feuille sur téléphone, bandeaux de licence (absents en mode un établissement) ----------
   Élément choisi : fond teinté, jamais de liseré à gauche. */
.ty-r { background: var(--orange-soft); }
.ty-s { background: var(--green-soft); }
.ty-p { background: var(--blue-soft); }
.etab-sel { margin: 0 0 12px; flex-shrink: 0; }
.etab-sel-btn { width: 100%; display: flex; align-items: center; gap: 9px; background: var(--text); color: #fff; border-radius: 6px; padding: 9px 11px; text-align: left; }
.etab-sel-btn > i { font-style: normal; width: 30px; height: 30px; border-radius: 4px; background: #ffffff24; display: grid; place-items: center; font-size: 15px; flex: none; }
.etab-sel-txt { min-width: 0; flex: 1; }
.etab-sel-txt b { display: block; font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etab-sel-txt small { display: block; opacity: .7; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etab-sel-btn > em { font-style: normal; opacity: .7; flex: none; }
.etab-menu { display: none; position: fixed; z-index: 46; width: 280px; max-height: 70vh; overflow-y: auto; background: var(--card); border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(34, 34, 59, .2); padding: 6px; }
.etab-menu.open { display: block; }
.etab-liste a { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 4px; text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--text); min-width: 0; }
.etab-liste a:hover { background: var(--bg); }
.etab-liste a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.etab-liste a > i { font-style: normal; width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; font-size: 14px; flex: none; background: var(--bg); }
.etab-liste a > i.ty-r { background: var(--orange-soft); }
.etab-liste a > i.ty-s { background: var(--green-soft); }
.etab-liste a > i.ty-p { background: var(--blue-soft); }
.etab-liste a > span { min-width: 0; overflow-wrap: anywhere; }
.etab-liste small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.etab-liste hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.brand.etab .brand-name { font-size: 14px; line-height: 1.2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; flex: 1; }
.etab-m, .more-etab, .etab-feuille { display: none; }
.app.nav-compact .etab-sel-txt, .app.nav-compact .etab-sel-btn > em { display: none; }
.app.nav-compact .etab-sel-btn { justify-content: center; padding: 7px; }
.app.nav-compact .etab-sel { margin: 0 0 12px; }

/* Bandeau de licence : dans la barre haute, ou en tête d'un écran */
.topbar:has(.lic-ban) { flex-wrap: wrap; }
.lic-ban { background: var(--orange-soft); color: #8a5200; border-radius: 6px; padding: 9px 14px; font-weight: 600; font-size: 12.5px; line-height: 1.4; }
.lic-ban.lic-r { background: var(--red-soft); color: #a8262f; }
.topbar .lic-ban { flex: 1 0 100%; order: 9; }
.lic-page { margin-bottom: 12px; }

@media (max-width: 1280px) and (min-width: 901px) {
  .etab-sel-txt, .etab-sel-btn > em { display: none; }
  .etab-sel-btn { justify-content: center; padding: 7px; }
  .etab-sel { margin: 0 0 12px; }
  .brand.etab .brand-name { display: none; }
}
/* Téléphone et tablette : bouton dans la barre du haut, feuille comme « Tout » */
@media (max-width: 900px) {
  .etab-m { display: inline-flex; align-items: center; gap: 7px; background: var(--text); color: #fff; border-radius: 6px; padding: 7px 10px; font-size: 12px; font-weight: 600; min-width: 0; max-width: 58vw; }
  .topbar:has(.etab-m) .m-title, .topbar:has(.etab-m) .chip-date { display: none; }
  .topbar:has(.etab-m) .etab-m { margin-right: auto; }
  body.more-open:not(.etab-open) .etab-feuille { opacity: 0; pointer-events: none; }
  .etab-m > i { font-style: normal; flex: none; }
  .etab-m > b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .etab-m > em { font-style: normal; opacity: .7; flex: none; }
  .etab-feuille { display: flex; }
  body.etab-open { overflow: hidden; }
  body.etab-open .etab-feuille { opacity: 1; pointer-events: auto; }
  body.etab-open .etab-feuille .more-box { transform: none; }
  .etab-feuille .etab-liste a { padding: 11px 8px; font-size: 13.5px; }
  .etab-feuille .etab-liste a > i { width: 36px; height: 36px; border-radius: 6px; font-size: 18px; }
  .more-etab { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--text); color: #fff; font-size: 13px; font-weight: 600; text-align: left; }
  .more-etab > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .lic-ban { font-size: 12px; padding: 8px 12px; }
}

/* Connexion aux couleurs de Sabine PRO */
.lv-marque { width: 38px; height: 38px; border-radius: 50%; flex: none; box-shadow: 0 2px 8px rgba(13, 21, 51, .35); }
.login-vit::before { background: linear-gradient(180deg, #0d1533b0 0%, #0d153300 20%, #17125a00 38%, #2a2170e6 66%, #1b1554fa 100%); }
.lv-bas h2 em { font-style: normal; font-weight: 600; background: linear-gradient(135deg, #fff0b8, #f3cd6a 55%, #c9962f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lv-sous { font-size: 15px; line-height: 1.55; max-width: 560px; margin: 0 0 16px; color: rgba(255, 255, 255, .92); }
.lv-logo { background-color: transparent; background-size: 100% auto; background-position: center; }
@media (max-width: 900px) { .lv-sous { font-size: 13px; line-height: 1.45; margin-bottom: 10px; } .lv-bas { bottom: 40px; } .login-vit { min-height: 62vh; } }
@media (max-width: 420px) { .lv-inf span { font-size: 11.5px; padding: 4px 10px; } }
@media (max-width: 640px) { .login-vit { min-height: 46vh; } .lv-inf { display: none; } .lv-bas h2 { margin: 4px 0 8px; } }

/* Menu du profil ouvert depuis le bas du menu : juste au-dessus du profil */
.user-menu.pf-bas { position: fixed; z-index: 200; }
.user-menu.pf-bas .user-drop { position: static; display: block; }
/* Logo de l'entreprise en haut de la connexion : rond, image recadrée sans déformation */
.lv-marque { object-fit: cover; background: #fff; }

/* Champs numériques : sans flèches haut/bas (saisie au clavier ou au pavé, comme partout dans Sabine PRO) */
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* En-tête à bandeau des impressions A4 d'écran (assets/js/app.js) : le même que les rapports et les PDF */
.imp-bande { display: none; }
@media print {
  .imp-bande { display: block; margin: 0 0 12px; color: #111; visibility: visible; }
  .imp-bande * { visibility: visible; }
  .imp-bande-h { display: flex; align-items: stretch; background: #f4f5fa; border-radius: 10px; padding: 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .imp-bande-m { position: relative; z-index: 1; flex: 0 1 52%; display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 8px; padding: 9px 14px; min-width: 0; }
  .imp-bande-m img { max-height: 17mm; max-width: 28mm; width: auto; object-fit: contain; flex: none; }
  .imp-bande-m b { display: block; font-size: 15px; color: #22223b; }
  .imp-bande-m span { display: block; font-size: 10px; color: #8a8ca5; }
  .imp-bande-d { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: right; margin: 4px 4px 4px -44px; padding: 8px 16px 8px 58px; background: #5b4ee6; color: #fff; border-radius: 16px; }
  .imp-bande-d b { font-size: 16px; } .imp-bande-d span { font-size: 11px; font-weight: 700; margin-top: 2px; }
  .imp-bande-meta { font-size: 10px; color: #444; margin-top: 7px; }
  .content .page-head { display: none !important; }   /* le bandeau remplace le titre de l'écran */
}

/* Barres d'onglets : sur ordinateur, tous les onglets restent visibles (retour à la ligne au lieu d'un défilement caché) */
@media (min-width: 901px) {
  .tabs, .rp-seg { flex-wrap: wrap !important; overflow-x: visible; }
  .tabs.plus-droite { -webkit-mask-image: none; mask-image: none; }
}
/* Pastille « à examiner » de l'en-tête (administrateur général) */
.hl-alerte { display: inline-flex; align-items: center; gap: 5px; background: #fde2e2; color: #a11c1c; border: 1px solid #f2b8b8; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hl-alerte:hover { background: #fbd0d0; }
.hl-alerte[hidden] { display: none; }
