/* Téléphonie La Shop — thème sombre, accent orange (comme Gestion d'atelier). */
:root {
  --fond: #121417;
  --nav: #181b1f;
  --surface: #1b1e23;
  --surface2: #22262c;
  --bordure: #2c3138;
  --bordure-forte: #3a4048;
  --texte: #ece9e4;
  --texte2: #d5d9de;
  --texte3: #c9ced4;
  --discret: #a3a9b1;
  --accent: #e07b1a;
  --accent-texte: #f3a45a;
  --accent-fond: #2a2118;
  --vert: #7ee0a8; --vert-fond: #1d2f26; --vert-point: #4cc38a;
  --rouge: #ff9c8f; --rouge-fond: #3a2020;
  --bleu: #8fbcff; --bleu-fond: #1c2738;
  --violet: #cdb6ff; --violet-fond: #2a2340;
  --rayon: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; font-size: 15px; line-height: 1.45; }
a { color: var(--accent-texte); }
a:hover { color: #ffc58f; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 0; font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-texte); outline-offset: 2px; }
.chargement { padding: 40px; color: var(--discret); }

/* Mise en page */
.cadre { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 220px; max-width: 100%; padding: 24px 16px; background: var(--nav); border-right: 1px solid var(--bordure); display: flex; flex-direction: column; gap: 4px; }
.marque { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
.marque b { font-size: 15px; display: block; }
.marque span { font-size: 12px; color: var(--discret); }
.pastille-etat { margin: 0 8px 16px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.nav a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--texte2); }
.nav a[aria-current="page"] { color: var(--accent-texte); background: var(--accent-fond); font-weight: 600; }
.nav a:hover { background: var(--surface2); color: var(--texte); }
.compte { min-width: 20px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: #14161a; font-size: 12px; font-weight: 700; text-align: center; }
.nav .bas { margin-top: auto; padding: 16px 8px 0; font-size: 12px; color: var(--discret); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.contenu { flex: 999 1 560px; min-width: 0; padding: 32px 24px; }
.page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.entete { display: flex; flex-direction: column; gap: 4px; }
.sous { color: var(--discret); font-size: 14px; }

/* Blocs */
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.carte.serree { padding: 20px; gap: 10px; }
.bloc { background: var(--surface2); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.rangee { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rangee > * { min-width: 0; }
.ligne-titre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { flex: 1 1 190px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat .etiquette { font-size: 13px; color: var(--discret); }
.stat .nombre { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .note { font-size: 12px; color: var(--discret); }
.discret { color: var(--discret); font-size: 13px; }
.petit { font-size: 12px; color: var(--discret); }
.vide { color: var(--discret); font-size: 14px; padding: 16px 0; }

/* Boutons et champs */
.bouton { min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--bordure-forte); background: transparent; color: var(--texte); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.bouton:hover { background: var(--surface2); color: var(--texte); }
.bouton.principal { border-color: var(--accent); background: var(--accent); color: #14161a; font-weight: 700; }
.bouton.principal:hover { background: #ef8d31; }
.bouton.petit { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.bouton[disabled] { opacity: .5; cursor: not-allowed; }
.boutons { display: flex; flex-wrap: wrap; gap: 10px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ > label, .etiquette-champ { font-size: 13px; font-weight: 600; color: var(--texte2); }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="time"], input[type="date"], input[type="email"], select, textarea {
  min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--bordure-forte); background: var(--surface2); color: var(--texte); font-size: 14px; max-width: 100%; color-scheme: dark;
}
textarea { width: 100%; line-height: 1.5; resize: vertical; }
input[type="number"] { width: 90px; }
.case { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.case input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.en-ligne { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: var(--texte3); }
.segment { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; border: 1px solid var(--bordure); background: var(--surface); align-self: flex-start; }
.segment button { min-height: 40px; padding: 6px 14px; border-radius: 8px; border: none; background: transparent; color: var(--texte2); font-size: 14px; font-weight: 700; cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--accent); color: #14161a; }

/* Pastilles */
.pastille { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-vert { background: var(--vert-fond); color: var(--vert); }
.p-rouge { background: var(--rouge-fond); color: var(--rouge); }
.p-bleu { background: var(--bleu-fond); color: var(--bleu); }
.p-violet { background: var(--violet-fond); color: var(--violet); }
.p-orange { background: var(--accent-fond); color: var(--accent-texte); }
.p-gris { background: var(--surface2); color: var(--texte2); }

/* Filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.filtres button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--bordure-forte); background: transparent; color: var(--texte2); font-size: 14px; font-weight: 600; cursor: pointer; }
.filtres button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fond); color: var(--accent-texte); }

/* Listes */
.defile { overflow-x: auto; }
.liste { display: flex; flex-direction: column; gap: 6px; min-width: 520px; }
.rang { display: flex; width: 100%; text-align: left; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px; border-radius: 8px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); cursor: pointer; }
.rang:hover { border-color: var(--bordure-forte); }
.rang[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fond); }
.rang .heure { width: 92px; flex: none; font-size: 13px; color: var(--discret); font-variant-numeric: tabular-nums; }
.rang .qui { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rang .qui b { font-size: 14px; }
.rang .qui span { font-size: 12px; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rang .duree { width: 48px; flex: none; text-align: right; font-size: 13px; color: var(--discret); font-variant-numeric: tabular-nums; }
.simple { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--bordure); }
.parcours { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--texte3); }
audio { width: 100%; height: 44px; }

/* Textos */
.conv { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; min-height: 64px; border-radius: 8px; border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); cursor: pointer; }
.conv[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fond); }
.conv .haut { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.fil { display: flex; flex-direction: column; gap: 14px; padding: 20px; min-height: 320px; max-height: 60vh; overflow-y: auto; }
.bulle { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.bulle.sortant { align-self: flex-end; text-align: right; }
.bulle.entrant { align-self: flex-start; }
.bulle .texte { padding: 12px 14px; border-radius: 12px; font-size: 14px; text-align: left; overflow-wrap: anywhere; white-space: pre-wrap; }
.bulle.sortant .texte { background: var(--accent-fond); border: 1px solid #4a3420; }
.bulle.entrant .texte { background: var(--surface2); border: 1px solid var(--bordure); }
.bulle.echec .texte { border-color: var(--rouge); }
.bulle .meta { font-size: 12px; color: var(--discret); }
.bulle.echec .meta { color: var(--rouge); }

/* Tableaux */
.grille { display: flex; flex-direction: column; min-width: 680px; }
.grille .ligne { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bordure); min-height: 60px; }
.grille .tete { font-size: 12px; font-weight: 600; color: var(--discret); border-top: none; min-height: 0; padding-bottom: 8px; }

/* Connexion */
.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.connexion form { width: 100%; max-width: 380px; }

/* Avis flottant */
#avis { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 480px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--bordure-forte); font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.erreur { border-color: var(--rouge); color: var(--rouge); }
.toast.ok { border-color: var(--vert-point); color: var(--vert); }

.menu-touche { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; border-radius: 10px; background: var(--surface2); }
.menu-touche .num { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--accent-fond); color: var(--accent-texte); font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.menu-touche .corps { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.citation { font-style: italic; color: var(--discret); }
.mono { font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", monospace; }
.point { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.liens { display: flex; flex-direction: column; gap: 4px; }
.grille-horaires .heures { display: flex; gap: 12px; align-items: center; flex: 1 1 auto; }
.grille-horaires input[type="time"] { width: 130px; }
.heure-champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.heure-champ .mini { display: none; font-size: 11px; color: var(--discret); }
.ferme-jour { flex: 1 1 200px; }

/* Cellulaire : navigation compacte en haut, listes qui passent à la ligne au lieu de défiler. */
@media (max-width: 620px) {
  .contenu { padding: 20px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--bordure); }
  .marque { padding: 0; flex: 1 1 auto; }
  .pastille-etat { margin: 0; }
  .liens { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .liens a { flex: none; white-space: nowrap; gap: 8px; }
  .nav .bas { order: 4; flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; margin: 0; padding: 0; }
  .liste { min-width: 0; }
  .rang { flex-wrap: wrap; row-gap: 6px; }
  .rang .heure { width: auto; flex: 1 1 100%; }
  .rang .qui { flex: 1 1 140px; }
  .bulle { max-width: 92%; }
  .grille-horaires { min-width: 0; }
  .grille-horaires .tete { display: none; }
  .grille-horaires .ligne { flex-wrap: wrap; padding: 12px 0; }
  .grille-horaires .heures { flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grille-horaires input[type="time"] { width: 100%; padding: 8px 6px; }
  .grille-horaires input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  .heure-champ .mini { display: block; }
  .ferme-jour { flex-basis: 100%; }
  h1 { font-size: 24px; }
}
input[aria-invalid] { border-color: var(--rouge); }
.fichiers { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.vignette { display: block; max-width: 240px; max-height: 240px; border-radius: 8px; border: 1px solid var(--bordure); background: var(--surface2); }
