:root {
  --bg: #f4f6f9; --surface: #ffffff; --text: #1d2433; --muted: #6b7385; --border: #dde2ea;
  --primary: #1f5fbf; --primary-text: #ffffff; --danger: #c0392b; --ok: #1e8449;
  --lvl1: #7f8c8d; --lvl2: #2980b9; --lvl3: #d68910; --lvl4: #c0392b;
  --pill-bg: #e8f0fc; --pill-text: #1f5fbf;
  color-scheme: light;
}
/* Thème : « Utiliser le thème du système » (par défaut), ou Clair / Sombre imposé (Paramètres → Apparence) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #12151c; --surface: #1b2029; --text: #e4e8ef; --muted: #8b93a5; --border: #2c3340; --primary: #4a8ae8; --pill-bg: #1f2c44; --pill-text: #9cc0f5; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #12151c; --surface: #1b2029; --text: #e4e8ef; --muted: #8b93a5; --border: #2c3340; --primary: #4a8ae8; --pill-bg: #1f2c44; --pill-text: #9cc0f5; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin-top: 0; } h2 { font-size: 1.15rem; }
code, .mono { font-family: ui-monospace, Consolas, monospace; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .7rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; font-size: 1.1rem; min-width: 0; }
/* Nom de la société (plusieurs sociétés) : tronqué sur petit écran */
.brand-company { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap;
  margin-left: .35rem; padding: 0 .5rem; border-radius: 99px; border: 1px solid var(--border); font-size: .85rem; font-weight: 600; }
@media (max-width: 480px) { .brand-company { max-width: 12ch; } }
.topbar nav { display: flex; flex-wrap: wrap; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; }
.who { display: flex; align-items: center; gap: .6rem; }

.container { max-width: 1300px; margin: 1.5rem auto; padding: 0 16px; }
.site-foot { text-align: center; font-size: .8rem; padding: 0 16px 1.5rem; }
.site-foot a { color: var(--muted, inherit); }
.policy { max-width: 60rem; margin: 0 auto; overflow-wrap: break-word; }
@media (max-width: 640px) {
  .policy-table thead { display: none; }
  .policy-table, .policy-table tbody, .policy-table tr, .policy-table td { display: block; width: auto; }
  .policy-table tr { border-bottom: 1px solid var(--border); padding: .45rem 0; }
  .policy-table td { border: 0; padding: .1rem 0; }
  .policy-table td:first-child { font-weight: 600; }
}
.policy h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.policy li { margin-bottom: .3rem; }
.policy .alert ul { margin: .4rem 0 0; }
.policy-table th, .policy-table td { vertical-align: top; text-align: left; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.4rem; margin-bottom: 1.2rem; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

.layout { display: grid; grid-template-columns: 230px 1fr; gap: 1.2rem; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }
.sidebar, .content { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; min-width: 0; }
.groups { list-style: none; padding: 0; margin: 0; }
.groups a { display: flex; justify-content: space-between; padding: .35rem .5rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.groups a.active, .groups a:hover { background: var(--bg); }
.count { color: var(--muted); font-size: .85em; }

label { display: block; margin-bottom: .9rem; font-weight: 500; }
input, select, textarea { width: 100%; padding: .55rem .65rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.otp { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.pw-input { display: flex; gap: .3rem; align-items: center; }
.qr-read { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; align-self: end; min-width: 0; }
.qr-read[hidden] { display: none; }
#login-form .check { margin: .5rem 0 1rem; align-items: flex-start; }
.qr-read .btn { margin: 0; }
.qr-read .small { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
/* Clé TOTP : le bouton « Lire le QR code » et son explication sous le champ, dans la même colonne */
.totp-cell { min-width: 0; }
.totp-cell > label { margin-bottom: .35rem; }
.totp-cell .qr-read { align-items: flex-start; margin-bottom: .9rem; }
.totp-cell .qr-read .small { flex: 1 1 100%; }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input, .search select { margin: 0; }

.btn { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .2rem .5rem; font-size: .85rem; }
.btn-block { width: 100%; }
.inline { display: inline; }
.actions { display: flex; gap: .6rem; }
.actions-cell form { margin-right: .2rem; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
td select { width: auto; margin: 0; }
.pw-cell { white-space: nowrap; }
.pw { display: inline-block; min-width: 7em; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; color: #fff; font-size: .78rem; font-weight: 600; }
.lvl1 { background: var(--lvl1); } .lvl2 { background: var(--lvl2); } .lvl3 { background: var(--lvl3); } .lvl4 { background: var(--lvl4); }
.ok { color: var(--ok); font-weight: 600; } .ko { color: var(--danger); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.alert { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; word-break: break-word; }
.alert-success { background: #e8f6ee; border-color: #a9dfbf; color: #145a32; }
.alert-error { background: #fdecea; border-color: #f5b7b1; color: #922b21; }
.alert-warning { background: #fef5e7; border-color: #f8c471; color: #7e5109; }
.alert-info { background: #eaf2fb; border-color: #aed6f1; color: #1b4f72; }

.qr { text-align: center; margin: 1rem 0; }
.qr img { background: #fff; padding: 8px; border-radius: 8px; }
.secret-key { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; background: var(--bg); padding: .7rem; border-radius: 6px; text-align: center; word-break: break-all; user-select: all; }

.log tr.act-login td code, .log tr.act-password td code { font-weight: 600; }
.log tr.act-reveal td, .log tr.act-access td, .log tr.act-account td { color: var(--danger); }

.choices { display: grid; gap: .8rem; margin-top: 1rem; }
.choice { display: block; padding: 1rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); }
.choice:hover { border-color: var(--primary); }
.choice span { display: block; margin-top: .3rem; color: var(--muted); font-size: .9rem; }
.choice.disabled { opacity: .55; }
.resend { margin: .6rem 0; }
.email-form { display: flex; gap: .3rem; align-items: center; margin-top: .3rem; }
.email-form input { margin: 0; padding: .25rem .4rem; font-size: .85rem; min-width: 12rem; }
.chip { display: inline-block; padding: .05rem .5rem; margin: .1rem .2rem .1rem 0; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); font-size: .8rem; white-space: nowrap; }
.chip-edit { border-color: var(--lvl3); }
.row-form { display: flex; gap: .4rem; align-items: center; }
.row-form input { margin: 0; }
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .2rem 1rem; margin-bottom: 1rem; }
label.check { display: flex; align-items: center; gap: .4rem; font-weight: 400; margin-bottom: .3rem; }
label.check input { width: auto; margin: 0; }
.recovery-codes { columns: 2 12rem; column-gap: 2rem; font-size: 1.05rem; letter-spacing: .04em; padding-left: 1.6rem; margin: .8rem 0 1rem; }
.recovery-codes li { break-inside: avoid; margin-bottom: .35rem; }
details.recovery-entry { margin-top: 1rem; }
details.recovery-entry > summary { cursor: pointer; color: var(--primary); font-size: .9rem; }
details.recovery-entry[open] > summary { margin-bottom: .6rem; }
@media print { .topbar, .settings-nav, .site-foot, .btn, .alert, form { display: none !important; } .recovery-codes { font-size: 14pt; } }
label.cgvu-check { align-items: flex-start; margin: .6rem 0 1rem; font-size: .9rem; line-height: 1.35; }
label.cgvu-check input { margin-top: .2rem; flex: 0 0 auto; }
label.cgvu-check span { min-width: 0; overflow-wrap: break-word; }
.perm-table td:not(:first-child), .perm-table th:not(:first-child) { text-align: center; width: 7rem; }
.perm-table input { width: auto; margin: 0; }
.perm-table th .th-short { display: none; }
.groups-edit summary { cursor: pointer; color: var(--primary); font-size: .85rem; margin-top: .2rem; }
.groups-edit form { margin-top: .4rem; }
fieldset.span2 { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 6px; margin-bottom: .9rem; }
.sidebar form input { margin-bottom: .4rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
/* Arborescence des groupes : indentation par profondeur (classes d0 à d4) */
.d1 { padding-left: 1.3rem; } .d2 { padding-left: 2.6rem; } .d3 { padding-left: 3.9rem; } .d4 { padding-left: 5.2rem; }
.groups a.d1 { padding-left: 1.6rem; } .groups a.d2 { padding-left: 2.8rem; } .groups a.d3 { padding-left: 4rem; } .groups a.d4 { padding-left: 5.2rem; }
.tree-name { display: flex; align-items: center; gap: .3rem; }
.tree-name input { margin: 0; font-weight: 600; }
.tree-desc { margin-top: .3rem; font-size: .85rem; }
input.tree-desc.d1 { margin-left: 1.3rem; width: calc(100% - 1.3rem); } input.tree-desc.d2 { margin-left: 2.6rem; width: calc(100% - 2.6rem); }
input.tree-desc.d3 { margin-left: 3.9rem; width: calc(100% - 3.9rem); } input.tree-desc.d4 { margin-left: 5.2rem; width: calc(100% - 5.2rem); }
input.tree-desc { padding-left: .65rem; }
.tree-icon { white-space: nowrap; color: var(--muted); }
.tree-table td select { width: 100%; max-width: 16rem; }
.chip-inherited { border-style: dashed; color: var(--muted); }
.perm-table .inherited { font-size: .78rem; color: var(--muted); display: block; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .7rem; margin-bottom: .6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.bulk-bar select { width: auto; max-width: 22rem; margin: 0; }
table.entries input[type="checkbox"], table.entries th input { width: auto; margin: 0; }
.dup-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dup-form select { width: auto; max-width: 22rem; margin: 0; }
/* Champ mot de passe d'une entrée : texte masqué (pas de proposition d'enregistrement par le navigateur) */
.masked { -webkit-text-security: disc; text-security: disc; }
#login-form label { margin-bottom: 0; }
#login-form input { margin-bottom: .9rem; }
/* Page d'installation */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.platform { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.platform.current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.platform h2 { margin-top: 0; }
.platform ol { padding-left: 1.2rem; margin: 0; }
.install-icon { width: 72px; height: 72px; border-radius: 16px; float: right; margin-left: 1rem; }
[hidden] { display: none !important; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2433; color: #fff; padding: .6rem 1.1rem; border-radius: 8px; z-index: 99; }

/* ---------- Navigation : menu « + Nouvelle entrée », onglet actif ---------- */
.topbar nav { align-items: center; }
.topbar nav a.current { font-weight: 700; }
details.menu { position: relative; }
details.menu summary { cursor: pointer; color: var(--primary); list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; top: 1.8rem; left: 0; z-index: 50; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .3rem; }
.menu-list a { display: flex; gap: .5rem; align-items: center; padding: .45rem .6rem; border-radius: 6px; color: var(--text); }
.menu-list a:hover { background: var(--bg); }
.type-icon { display: inline-block; width: 1.4em; text-align: center; }

/* ---------- Paramètres ---------- */
.settings { display: grid; grid-template-columns: 250px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 800px) { .settings { grid-template-columns: 1fr; } }
.settings-nav { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.settings-nav h2 { margin-top: 0; }
.settings-nav ul { list-style: none; margin: 0; padding: 0; }
.settings-nav a { display: block; padding: .4rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.settings-nav a:hover { background: var(--bg); }
.settings-nav a.active { background: var(--pill-bg); color: var(--pill-text); font-weight: 600; }
.settings-nav a.sub { padding-left: 1.4rem; }
.settings-section { margin-top: .7rem; padding: .3rem .6rem; font-size: .8rem; text-transform: uppercase; color: var(--muted); font-weight: 600; }
/* Téléphone et tablette : menu des Paramètres sur une ligne de pastilles qui défile, le contenu de la page tout de suite dessous */
@media (max-width: 800px) {
  .settings { grid-template-columns: minmax(0, 1fr); }   /* la ligne de pastilles défile sans élargir la page */
  .settings-nav, .settings-body { min-width: 0; }
  .settings-nav { padding: .5rem; }
  .settings-nav h2 { display: none; }
  .settings-nav ul { display: flex; gap: .35rem; overflow-x: auto; white-space: nowrap; padding-bottom: .2rem; scrollbar-width: thin; }
  .settings-nav li.settings-section { display: none; }
  .settings-nav a, .settings-nav a.sub { padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 999px; font-size: .9rem; }
}
.settings-body { min-width: 0; }
.settings-body .card.narrow { margin-left: 0; }
.narrow-form { max-width: 520px; margin-bottom: 1rem; }
.strength { height: 6px; background: var(--border); border-radius: 3px; margin: -.4rem 0 1rem; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s; }
.strength[data-level="3"] span { background: var(--lvl3); }
.strength[data-level="4"] span, .strength[data-level="5"] span { background: var(--ok); }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 99px; background: var(--pill-bg); color: var(--pill-text); font-size: .82rem; border: 1px solid var(--pill-text); }
.pill-ok { background: #e8f6ee; color: #145a32; border-color: #a9dfbf; }
.provider { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .7rem; }
.provider-icon { font-size: 2.2rem; width: 3.5rem; text-align: center; }
.provider-text { flex: 1; }
.provider-text span { display: block; color: var(--muted); font-size: .9rem; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.stores { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0 1rem; }
.store { display: inline-flex; flex-direction: column; padding: .35rem .9rem; border-radius: 8px; background: #000; color: #fff; text-decoration: none; font-weight: 600; line-height: 1.15; }
.store small { font-size: .65rem; font-weight: 400; }
.qr svg { max-width: 100%; height: auto; border-radius: 8px; }
.totp-key { color: #c2185b; }
.device-table td { vertical-align: top; }
.dev-icon { margin-right: .3rem; }
table.kv th { text-transform: none; font-size: .9rem; width: 40%; }
pre.code, pre.pre { background: var(--bg); padding: .6rem; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: .3rem 0; }
.logout-alt { margin-top: .6rem; }

/* ---------- Coffre : types, arborescence repliable, icônes ---------- */
.sidebar h2 { font-size: .85rem; text-transform: uppercase; color: var(--muted); margin: .4rem 0; }
.sidebar h2 + ul { margin-bottom: 1rem; }
.tree-row { display: flex; align-items: center; gap: .15rem; }
.tree-row a { flex: 1; min-width: 0; }
.tree-row.d1 { padding-left: 1rem; } .tree-row.d2 { padding-left: 2rem; } .tree-row.d3 { padding-left: 3rem; } .tree-row.d4 { padding-left: 4rem; }
.groups .tree-row a { padding-left: .3rem; }
.tree-toggle { width: 1.4rem; height: 1.4rem; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); cursor: pointer; font: 700 .9rem/1 ui-monospace, Consolas, monospace; flex: none; }
.tree-toggle:hover { border-color: var(--primary); color: var(--primary); }
.tree-spacer { width: 1.4rem; flex: none; }
.icon-cell { width: 2rem; text-align: center; }
.favicon { width: 20px; height: 20px; vertical-align: middle; border-radius: 3px; }
.row-actions { white-space: nowrap; }
.secret { display: inline-flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.secret-value { display: inline-block; min-width: 7em; word-break: break-all; }
.secret-long .secret-value { white-space: pre-wrap; }
/* Colonne Secret du coffre : 👁 et 📋 restent sur la même ligne que la valeur */
.pw-cell .secret { flex-wrap: nowrap; }
.pw-cell .secret .btn { flex-shrink: 0; }
.pw-cell .secret-value { min-width: 5.5em; white-space: normal; }
.totp-code { font-size: 1rem; letter-spacing: .08em; }
.type-switch { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.type-switch a { padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 99px; text-decoration: none; color: var(--text); font-size: .9rem; }
.type-switch a.active { border-color: var(--primary); background: var(--pill-bg); color: var(--pill-text); font-weight: 600; }
.section-title { font-size: .95rem; margin: 1.2rem 0 .5rem; color: var(--muted); }
.section { border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1rem .2rem; margin-bottom: .6rem; }
.grid2 .span2 { grid-column: 1 / -1; }
span.check { display: flex; align-items: center; gap: .35rem; font-weight: 400; margin-top: .3rem; }
span.check input { width: auto; margin: 0; }
textarea.masked { font-family: ui-monospace, Consolas, monospace; }
.log tr.act-secret td { color: var(--danger); }

/* ---------- Fenêtres (détails, mot de passe principal) ---------- */
.dlg { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); max-height: 85vh; }
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg-inner { padding: 1.2rem; }
.dlg-inner h2 { margin-top: 0; }
.dlg input { margin-bottom: .8rem; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
dl.details dt { color: var(--muted); font-size: .88rem; }
dl.details dd { margin: 0; min-width: 0; word-break: break-word; }
@media (max-width: 560px) { dl.details { grid-template-columns: 1fr; } dl.details dd { margin-bottom: .4rem; } }
/* Suppression d'un utilisateur (page Utilisateurs) */
details.delete-user { display: inline-block; vertical-align: top; }
details.delete-user summary { list-style: none; display: inline-block; }
details.delete-user summary::-webkit-details-marker { display: none; }
details.delete-user form { display: grid; gap: .35rem; max-width: 17rem; margin-top: .4rem; padding: .5rem; border: 1px solid var(--danger); border-radius: 6px; }
details.delete-user input { margin: 0; }
.tree-all { display: flex; gap: .4rem; margin: 0 0 .5rem; }
.tree-name .tree-toggle, .tree-name .tree-spacer { margin-right: .2rem; }
/* Bouton « + Nouvelle entrée » en haut de la colonne du coffre */
details.new-entry { margin-bottom: 1rem; }
details.new-entry summary { text-align: center; color: var(--primary-text); }
details.new-entry .menu-list { top: 2.6rem; width: 100%; }
/* Export : choix du format */
fieldset.formats { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; margin: 0 0 1rem; display: grid; gap: .4rem; }
label.format-choice { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 0; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; }
label.format-choice:hover { background: var(--bg); }
label.format-choice input { width: auto; margin-top: .25rem; }
label.format-choice span { display: flex; flex-direction: column; }
.chip-private { border-color: var(--primary); color: var(--pill-text); background: var(--pill-bg); }
/* Pastille « Personnel » cliquable : ouvre la fenêtre de partage */
.chip-btn { font: inherit; font-size: .8rem; line-height: inherit; cursor: pointer; }
.chip-btn:hover, .chip-btn:focus-visible { background: var(--primary); color: #fff; outline: none; }
.share-table { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.share-table th, .share-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); text-align: center; }
.share-table th:first-child, .share-table td:first-child { text-align: left; }
.share-table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
/* Boutons bleus « + Nouveau … » (Dossiers, Groupes d'accès, Utilisateurs) */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.page-head h1 { margin: 0; }
.sidebar .side-new { margin-bottom: 1rem; text-align: center; }
@keyframes flash-target { from { box-shadow: 0 0 0 3px var(--primary); } to { box-shadow: 0 0 0 0 transparent; } }
form.flash-target { animation: flash-target 1.6s ease-out; border-radius: 8px; }
.dlg-wide { width: min(760px, calc(100vw - 32px)); }
/* ---------- Onglet Dossiers : tableau compact ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.folder-table { table-layout: fixed; font-size: .92rem; }
.folder-table col.c-name { width: 45%; } .folder-table col.c-count { width: 6.5rem; } .folder-table col.c-access { width: auto; } .folder-table col.c-act { width: 6.8rem; }
.folder-table th, .folder-table td { padding: .28rem .5rem; line-height: 1.3; }
.folder-table tbody tr:hover { background: var(--bg); }
.folder-table th.num, .folder-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.folder-table td.num a { font-weight: 600; text-decoration: none; }
.fsub { color: var(--muted); font-size: .85em; }
.fname { display: flex; align-items: center; gap: .3rem; min-width: 0; white-space: nowrap; }
.fname .indent { flex: none; } .indent.i1 { width: 1.2rem; } .indent.i2 { width: 2.4rem; } .indent.i3 { width: 3.6rem; } .indent.i4 { width: 4.8rem; }
.fname .tree-toggle, .fname .tree-spacer { width: 1.2rem; height: 1.2rem; font-size: .8rem; }
.ficon { flex: none; }
.flabel { color: var(--text); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.flabel:hover { color: var(--primary); text-decoration: underline; }
.fdesc { color: var(--muted); font-size: .85em; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.fdesc::before { content: "— "; }
.folder-table td.access { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-table .chip { font-size: .75rem; padding: 0 .45rem; margin: 0 .15rem 0 0; }
.folder-table td.act, .folder-table th.act { text-align: right; white-space: nowrap; }
.icon-btn { width: 1.9rem; height: 1.7rem; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); cursor: pointer; font-size: .95rem; line-height: 1; }
.icon-btn:hover:not([disabled]) { border-color: var(--border); background: var(--surface); }
.icon-btn.danger:hover:not([disabled]) { border-color: var(--danger); }
.icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: .8rem; text-decoration: underline; }
.legend { margin-top: .4rem; }
@media (max-width: 700px) {
  .folder-table col.c-access { width: 0; } .folder-table td.access, .folder-table th:nth-child(3) { display: none; }
  .folder-table col.c-name { width: auto; } .folder-table col.c-count { width: 5rem; } .folder-table col.c-act { width: 6.8rem; }
  .fdesc { display: none; }
}
/* Liste des applications d'authentification */
.auth-apps { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .3rem; }
.auth-apps li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 8px; }
.auth-apps strong { flex: 1 1 12rem; }
.store-link { font-size: .78rem; padding: .1rem .55rem; border-radius: 99px; background: #000; color: #fff; text-decoration: none; }
/* Corbeille */
.head-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.trash-link { margin: 1rem 0 0; padding-top: .6rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; }
.trash-link a { text-decoration: none; color: var(--text); }
.trash-table col.c-name { width: 34%; } .trash-table col.c-origin { width: auto; } .trash-table col.c-when { width: 9rem; } .trash-table col.c-act-wide { width: 17rem; }
.restore-form select { width: auto; max-width: 9rem; margin: 0; padding: .2rem; font-size: .8rem; }

/* Export : clé de cryptage (toujours pour KeePass ; masquée si « fichier en clair » est coché pour les autres formats) */
.kdbx-key { border: 1px solid var(--border, #d0d7de); border-radius: 8px; padding: .6rem .9rem; margin: .8rem 0; }
.kdbx-key label { display: block; margin-bottom: .5rem; }
.narrow-form:has(.formats input[value=keepass]:checked) .plain-choice { display: none; }
.narrow-form:not(:has(.formats input[value=keepass]:checked)):has(input[name=plain]:checked) .kdbx-key { display: none; }

/* Paramètres → Sécurité → Générateur de mots de passe */
.gen-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .6rem 1rem 1rem; margin: 0 0 1rem; }
.gen-form legend { font-weight: 600; padding: 0 .3rem; }
.gen-mode { margin-top: .6rem; }
.gen-block { margin: .3rem 0 .6rem 1.6rem; }
.gen-length input { width: 6em; margin-left: .5rem; }
.gen-length { display: flex; align-items: center; flex-wrap: wrap; }
.gen-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .2rem 1rem; margin: .5rem 0; }
.gen-sets .check, .gen-form .check { margin: .15rem 0; }
.gen-form input[type=text] { width: 100%; }
.gen-help { margin-top: .5rem; }
.gen-help summary { cursor: pointer; color: var(--primary); }
.gen-form:has(input[name=mode][value=charset]:checked) input[name=pattern],
.gen-form:has(input[name=mode][value=charset]:checked) input[name=permute] { opacity: .55; }
.gen-form:has(input[name=mode][value=pattern]:checked) .gen-block:first-of-type { opacity: .55; }
.gen-reset { margin-top: -.4rem; }
.gen-examples { list-style: none; padding: 0; margin: .5rem 0; }
.gen-examples li { padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 6px; margin-bottom: .35rem; overflow-wrap: anywhere; }
.gen-examples code { font-size: 1rem; }
.chip-ok { border-color: var(--ok); color: var(--ok); }
.chip-warn { border-color: var(--lvl3); color: var(--lvl3); }
.chip-bad { border-color: var(--danger); color: var(--danger); }
/* Administrateur principal (Utilisateurs, Paramètres → Sécurité → Administrateur principal) */
.chip-main { border-color: var(--lvl3); color: var(--text); background: var(--pill-bg); white-space: normal; }
.main-admin { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; }
.main-admin-icon { font-size: 1.8rem; line-height: 1; }
/* Paramètres → Entrées en double */
.dup-criteria .formats { border: 0; padding: 0; margin: 0 0 .8rem; }
.dup-group { margin: 0 0 1.2rem; }
.dup-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-size: 1rem; margin: 0 0 .4rem; }
.dup-table td { vertical-align: top; }
.dup-table .chip { margin: 0 .2rem .2rem 0; }
.dup-check { width: 2.2rem; text-align: center; }
.dup-check input { width: auto; }

/* Valeur en attente (ex. double authentification à configurer) */
.warn { color: var(--lvl3); font-weight: 600; }

/* Onglet « ? » : aide */
.topbar nav a.help-link { font-weight: 700; min-width: 1.9rem; text-align: center; border: 1px solid currentColor; border-radius: 999px; padding-left: .55rem; padding-right: .55rem; }
.help { display: grid; grid-template-columns: 250px 1fr; gap: 1rem; align-items: start; }
.help-toc { position: sticky; top: 1rem; }
.help-toc h2 { font-size: 1rem; margin-top: 0; }
.help-toc ol { padding-left: 1.2rem; margin: 0; line-height: 1.9; }
.help-body .card { scroll-margin-top: 1rem; }
.help-body h2 { margin-top: 0; }
.help-body h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.help-body li { margin: .25rem 0; }
.help-dl dt { font-weight: 600; margin-top: .7rem; }
.help-dl dd { margin: .15rem 0 0 1rem; }
.help-note { background: var(--pill-bg); color: var(--text); border-left: 4px solid var(--primary); padding: .5rem .8rem; border-radius: 4px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.help-box { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .9rem; }
.help-box h3 { margin-top: 0; }
.help-table { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.help-table th, .help-table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.help details { border: 1px solid var(--border); border-radius: 6px; padding: .4rem .8rem; margin: .4rem 0; }
.help summary { cursor: pointer; font-weight: 600; }
.help kbd { font: inherit; font-size: .85em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--surface); white-space: nowrap; }
@media (max-width: 800px) { .help { grid-template-columns: 1fr; } .help-toc { position: static; } }

/* Recherche (onglet, coffre, dossiers, utilisateurs, groupes d'accès) */
.search-big input[type="search"] { flex: 1; font-size: 1.05rem; }
.search-big select { width: auto; }
.search-table td { vertical-align: top; }
.search-actions { white-space: nowrap; }
.search-actions .btn, .search-actions form { margin: 0 .15rem .2rem 0; }
.folder-table tr.search-hit > td { background: var(--pill-bg); }
.folder-table tr.search-hit .flabel { font-weight: 700; }
.side-search { display: flex; gap: .3rem; margin-bottom: .8rem; }
.side-search input { margin: 0; min-width: 0; flex: 1; }

/* Niveaux de sécurité S1 (le plus haut) à S5 (le plus bas) */
.lvl-chip { font-weight: 600; }
.lvl-s1 { border-color: #c0392b; color: #c0392b; }
.lvl-s2 { border-color: #d35400; color: #d35400; }
.lvl-s3 { border-color: #b7950b; color: #b7950b; }
.lvl-s4 { border-color: #2980b9; color: #2980b9; }
.lvl-s5 { border-color: var(--muted); color: var(--muted); }
.sec-form { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.sec-form select { width: auto; margin: 0; padding: .2rem .3rem; font-size: .85rem; }
.sec-form .check { margin: 0; font-size: .8rem; }
.sec-form .share-down { align-items: flex-start; max-width: 13rem; line-height: 1.25; }
.sec-form .share-down input { margin-top: .1rem; flex: 0 0 auto; }
.sec-form .share-down span { min-width: 0; }
.level-table input { margin: 0; }
/* Groupes d'accès : administrateurs et gestionnaires, membres d'office (case cochée verrouillée) */
.member-locked { opacity: .85; cursor: not-allowed; }
.member-locked input { cursor: not-allowed; }

/* Groupes d'accès → Membres : une carte par membre, le contenu passe à la ligne au lieu de déborder */
.member-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem .8rem; }
.member-list label.check { flex-wrap: wrap; align-items: center; min-width: 0; margin: 0; padding: .35rem .5rem;
  border: 1px solid var(--border); border-radius: 6px; line-height: 1.3; }
.member-list label.check .chip, .member-list label.check .badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }

/* Utilisateurs : tableau compact (ne déborde plus) */
.users-table td { vertical-align: top; }
.users-table .email-form input { min-width: 0; width: 100%; max-width: 10.5rem; }
.users-table .sec-form { flex-direction: column; align-items: flex-start; gap: .25rem; }
/* listes : rétrécissent avec la colonne (un libellé long ne doit pas élargir le tableau) */
.users-table .sec-form select { width: 100%; max-width: 11rem; min-width: 0; }
.users-table td select[name="level"] { width: 100%; max-width: 9rem; min-width: 0; }
.users-table .actions-cell { width: 1%; }
.users-table .actions-cell form.inline, .users-table .actions-cell details.delete-user { display: block; margin: 0 0 .25rem; }
.users-table .actions-cell .btn { width: 100%; white-space: nowrap; text-align: left; }
.users-table .actions-cell details.delete-user summary { display: block; }
/* Confirmation de suppression : aussi large que la colonne des boutons, jamais plus (le tableau ne s'élargit pas) */
.users-table .actions-cell details.delete-user form { width: 9.5rem; max-width: 100%; box-sizing: border-box; }
.users-table .actions-cell details.delete-user form .btn { white-space: normal; text-align: center; }
.users-table .actions-cell details.delete-user small { overflow-wrap: anywhere; }
.users-table .state-cell { font-size: .9rem; white-space: nowrap; }

.users-table .mfa-line { margin-top: .3rem; }
/* Ordinateur : les valeurs longues (empreintes de clé, adresses) passent à la ligne au lieu d'élargir le tableau */
table.entries td .mono, table.search-table td .mono { overflow-wrap: anywhere; word-break: break-word; }
table.entries td:nth-last-child(4) { max-width: 18rem; }
table.search-table td.search-actions { white-space: normal; min-width: 11rem; }
/* Écran étroit (portable, tablette, téléphone) : chaque utilisateur devient une carte (libellé à gauche, valeur à droite) */
@media (max-width: 1339px) {
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: .8rem; padding: .3rem .7rem; background: var(--surface); }
  .users-table td { position: relative; border-bottom: 1px dashed var(--border); padding: .45rem 0 .45rem 7rem; white-space: normal; min-height: 2rem; }
  .users-table td:last-child { border-bottom: none; }
  .users-table td::before { content: attr(data-label); position: absolute; left: 0; top: .55rem; width: 6.5rem;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
  .users-table .email-form input { width: 100%; flex: 1; }
  .users-table .sec-form select, .users-table td select[name="level"] { max-width: 100%; width: 100%; }
  .users-table .actions-cell { width: 100%; }
  .users-table .actions-cell .btn { width: auto; }
  .users-table .actions-cell form.inline, .users-table .actions-cell details.delete-user { display: inline-block; margin: 0 .25rem .25rem 0; }
  .users-table .actions-cell details.delete-user[open] { display: block; }
  .users-table .actions-cell details.delete-user form { width: 17rem; max-width: 100%; }
}
/* Téléphone : menu du haut sur deux lignes (nom + compte, puis les onglets sur toute la largeur) */
@media (max-width: 700px) {
  .topbar { gap: .5rem .8rem; padding: .6rem .8rem; }
  /* Base = largeur du contenu : si le nom de la société ne laisse pas la place, le compte passe à la ligne */
  .topbar .brand { flex: 1 1 auto; white-space: nowrap; display: flex; align-items: center; gap: .3rem; min-width: 0; overflow: hidden; }
  .topbar .brand-company { flex: 0 1 auto; min-width: 2.5rem; margin-left: 0; }
  .topbar .who { order: 2; gap: .4rem; font-size: .85rem; flex-wrap: wrap; justify-content: flex-end; }
  .topbar .who .btn { padding: .3rem .6rem; }
  .topbar nav { order: 3; flex: 1 1 100%; gap: .45rem .9rem; padding-top: .45rem; border-top: 1px solid var(--border); }
  .container { margin-top: 1rem; }
}
/* Téléphone, tablette, petit portable : tableaux .mtable (coffre, recherche, niveaux) affichés en cartes ;
   titre en tête, libellé devant chaque valeur */
@media (max-width: 1100px) {
  table.mtable thead { display: none; }
  table.mtable, table.mtable tbody, table.mtable tr { display: block; width: 100%; }
  table.mtable tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: .7rem; padding: .35rem .7rem; background: var(--surface); }
  table.mtable td { display: block; border: none; padding: .3rem 0; text-align: left !important; width: auto !important; white-space: normal; overflow-wrap: anywhere; }
  table.mtable td.act, table.mtable td.search-actions, table.mtable td.row-actions { white-space: normal; }
  table.mtable td.access { display: block; }
  table.mtable td.act { border-top: 1px dashed var(--border); margin-top: .2rem; padding-top: .45rem; }
  table.mtable td.act select { width: 100%; }
  table.mtable td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 700;
    text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
  table.mtable td[data-label=""]:empty, table.mtable td[data-label=""]:not([data-cell]):not(.row-actions):not(.search-actions):not(.icon-cell):not(:has(*)) { display: none; }
  /* case à cocher, icône et titre sur la même ligne */
  table.mtable td[data-cell="check"], table.mtable td.icon-cell { display: inline-block; vertical-align: middle; padding-right: .4rem; }
  table.mtable td[data-cell="title"] { display: inline-block; vertical-align: middle; max-width: calc(100% - 4rem); font-size: 1.02rem; }
  table.mtable td.row-actions, table.mtable td.search-actions { border-top: 1px dashed var(--border); margin-top: .2rem; padding-top: .45rem; }
  table.mtable td.row-actions .btn, table.mtable td.search-actions .btn { margin: 0 .25rem .25rem 0; }
  table.mtable td select { width: 100%; max-width: 100%; }
  .table-wrap:has(> table.mtable) { overflow: visible; }
}
@media (max-width: 700px) {
  /* Groupes d'accès : grille des droits plus étroite */
  .perm-table td:not(:first-child), .perm-table th:not(:first-child) { width: 2.4rem; padding-left: 0; padding-right: 0; }
  .perm-table td:first-child { padding-right: .3rem; }
  .perm-table .inherited { overflow-wrap: anywhere; }
  .perm-table th .th-full { display: none; }
  .perm-table th .th-short { display: inline; font-size: 1rem; }
  .perm-table td:first-child { word-break: break-word; }
  .perm-table .tree-name { flex-wrap: wrap; }
}
/* Petit téléphone : indentations réduites, aide et barre d'actions groupées sans débordement */
@media (max-width: 480px) {
  .bulk-bar select { max-width: 100%; min-width: 0; flex: 1 1 100%; }
  .page-head { flex-wrap: wrap; }
  .head-actions { max-width: 100%; }
  .head-actions .btn { white-space: normal; text-align: center; }
  .help > *, .help-body, .help-body .card { min-width: 0; }
  .help-body { overflow-wrap: anywhere; }
  .help-table th, .help-table td { padding: .35rem .3rem; }
  .perm-table .d1 { padding-left: .5rem; } .perm-table .d2 { padding-left: 1rem; } .perm-table .d3 { padding-left: 1.5rem; } .perm-table .d4 { padding-left: 2rem; }
  .perm-table .tree-name, .perm-table .inherited { overflow-wrap: anywhere; min-width: 0; }
  .indent.i1 { width: .6rem; } .indent.i2 { width: 1.2rem; } .indent.i3 { width: 1.8rem; } .indent.i4 { width: 2.4rem; }
  .folder-table col.c-count { width: 3.6rem; }
  .card { padding-left: .8rem; padding-right: .8rem; }
}
/* Écran étroit : les listes de filtres de la colonne de gauche (sauf l'arborescence des dossiers) deviennent des pastilles */
@media (max-width: 800px) {
  .sidebar ul.groups:not(.tree) { display: flex; flex-wrap: wrap; gap: .35rem; }
  .sidebar ul.groups:not(.tree) li { margin: 0; }
  .sidebar ul.groups:not(.tree) li a { display: inline-flex; gap: .45rem; padding: .3rem .65rem; border: 1px solid var(--border); border-radius: 99px; }
  .sidebar ul.groups:not(.tree) li a.active { border-color: var(--primary); }
  .sidebar h2 { margin: .7rem 0 .4rem; }
}
@media (max-width: 420px) {
  .users-table td { padding-left: 0; }
  .users-table td::before { position: static; display: block; width: auto; margin-bottom: .2rem; }
}

/* ---------- Site de gestion des sociétés (gestionsocietes/) ---------- */
.gs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.gs-grid > .card { min-width: 0; }
.gs-due { border-color: var(--danger, #c0392b); }
.gs-delete > summary, .gs-edit > summary { list-style: none; display: inline-block; cursor: pointer; }
.gs-delete > summary::-webkit-details-marker, .gs-edit > summary::-webkit-details-marker { display: none; }
.gs-delete[open] > summary, .gs-edit[open] > summary { margin-bottom: .6rem; }
.gs-delete form, .gs-edit form { max-width: 32rem; }
.gs-actions select { margin: 0; min-width: 0; max-width: 100%; }
.gs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .8rem 0 0; }
.gs-actions input[type="text"], .gs-actions input[type="email"], .gs-actions input[type="file"] { margin: 0; flex: 1 1 14rem; min-width: 0; width: auto; }
.gs-refuse { max-width: 36rem; }
@media (min-width: 701px) { .gs table.kv th { width: 13rem; } }   /* site de gestion : libellés étroits, valeurs près des libellés */
.gs-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; font-weight: normal; }
.gs-inline select { width: auto; max-width: 100%; margin: 0; }
/* Tickets de support (coffre et site de gestion) */
.ticket-kind { border: 1px solid var(--border); border-radius: 6px; padding: .5rem .8rem; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; }
.ticket-kind legend { padding: 0 .3rem; font-weight: 600; }
.ticket-kind label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: normal; }
.ticket-kind input { width: auto; margin: 0; }
.ticket-thread { display: grid; gap: .8rem; margin: 0 0 1rem; }
.ticket-msg { border: 1px solid var(--border); border-radius: 8px; padding: .7rem .9rem; background: var(--surface); min-width: 0; }
.ticket-platform { border-left: 4px solid var(--primary); }
.ticket-company { border-left: 4px solid var(--muted); }
.ticket-meta { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.gs-filters a { text-decoration: none; }
/* Petits téléphones : aucun bouton, encadré ou raccourci ne dépasse de l'écran */
fieldset { min-width: 0; }
@media (max-width: 480px) {
  .btn { white-space: normal; max-width: 100%; }
  .provider { flex-wrap: wrap; }
  .provider-text { min-width: 0; }
  .help kbd { white-space: normal; }
}
.gs-wrap { max-width: 100%; white-space: normal; text-align: left; }
.gs-support { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; margin: 0; }
.gs-support > .fld { flex: 1 1 100%; margin: 0; }   /* e-mail sur toute la largeur, cases et bouton dessous */
.gs-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; flex: 1 1 auto; }
.gs-accounts td[data-label^="E-mail"] { min-width: 19rem; }
@media (max-width: 860px) { .gs-accounts td[data-label^="E-mail"] { min-width: 0; } }
.gs-support input[type="email"] { flex: 1 1 13rem; min-width: 0; width: auto; margin: 0; }
.gs-support label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: normal; white-space: nowrap; }
.gs-support input[type="checkbox"] { width: auto; margin: 0; }
.gs-stats { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: 0; }
.gs-stats .chip { text-decoration: none; font-size: .85rem; padding: .15rem .65rem; }
.chip-current { background: var(--pill-bg); font-weight: 600; }
.gs-break, .gs-break code { overflow-wrap: anywhere; word-break: break-word; }
.gs-nowrap { white-space: nowrap; }
.gs-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-admins { list-style: none; padding: 0; margin: 0; }
.gs-admins li { padding: .6rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.gs-admins li:last-child { border-bottom: 0; }
.gs-admins form { display: inline-block; margin-top: .3rem; }
.gs .page-head h1 { overflow-wrap: anywhere; min-width: 0; }
.gs table.kv td { overflow-wrap: anywhere; }
.gs-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .9rem; }
.gs-plan { display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 8px; font-weight: 400; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.gs-plan input { width: auto; margin: 0 0 .2rem; align-self: flex-start; }
.gs-plan-on, .gs-plan:has(input:checked) { border-color: var(--primary); background: var(--pill-bg); }
.gs-vat { max-width: 14rem; margin-top: .9rem; }
/* Offres : tableau, exemples, simulateur */
.gs-offers tr.gs-current td { background: var(--pill-bg); }
.gs-examples { margin: .6rem 0 1rem; }
.gs-examples > summary { cursor: pointer; font-weight: 600; }
.gs-examples ul { padding-left: 1.1rem; margin: .5rem 0 0; }
.gs-examples li { margin-bottom: .45rem; overflow-wrap: anywhere; }
.gs-sim .grid2 { align-items: end; }
.gs-sim-go { padding-bottom: .9rem; }
.gs-sim-out { padding: .6rem .8rem; border-left: 3px solid var(--primary); background: var(--pill-bg); border-radius: 4px; overflow-wrap: anywhere; }
.gs-offer form { max-width: 40rem; }
.gs-offer .check { align-self: end; }
.totp-off { margin: 0; align-self: center; }
@media (max-width: 900px) { .gs-grid { grid-template-columns: 1fr; } }
/* Téléphone et tablette en portrait : chaque ligne de tableau devient une fiche (aucun défilement horizontal) */
@media (max-width: 860px) {
  .gs-table thead { display: none; }
  .gs-table, .gs-table tbody, .gs-table tr, .gs-table td { display: block; width: 100%; }
  .gs-table tr { padding: .5rem 0; border-bottom: 1px solid var(--border); }
  .gs-table td { border: 0; padding: .15rem 0; overflow-wrap: anywhere; }
  .gs-table td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: .8rem; }
}
@media (max-width: 700px) {
  .gs table.kv th, .gs table.kv td { display: block; width: auto; border: 0; padding: .1rem 0; }
  .gs table.kv tr { display: block; padding: .35rem 0; border-bottom: 1px solid var(--border); }
  .gs .topbar nav { gap: .4rem .9rem; }
}
/* Repères à droite des champs (assets/champs.js) : « ? » aide, « * » obligatoire */
.fld { display: flex; align-items: center; gap: .35rem; margin-top: .25rem; min-width: 0; }
.fld > input, .fld > select, .fld > textarea { flex: 1 1 auto; width: auto; min-width: 0; margin-top: 0; margin-bottom: 0; }
.dlg .fld { margin-bottom: .8rem; }
.users-table td[data-label="Rôle"] .fld > select { min-width: 7.6rem; }
/* Listes aux options longues : le champ rétrécit au lieu d'élargir la page (téléphone) */
.grid2 > label, .gs-inline { min-width: 0; max-width: 100%; }
.gs-inline .fld { flex: 1 1 12rem; min-width: 0; margin: 0; }
.gs-inline .fld > select { max-width: none; }
.email-form .fld, .sec-form .fld, .inline .fld { flex: 1 1 auto; margin: 0; }
.req { flex: 0 0 auto; color: var(--danger); font-weight: 700; font-size: 1.05rem; line-height: 1; cursor: help; }
.tip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; padding: 0; margin: 0 0 0 .2rem;
  border: 1px solid var(--primary); border-radius: 50%; background: var(--surface); color: var(--primary); font: 700 .8rem/1 system-ui, sans-serif; cursor: pointer; vertical-align: middle; }
.fld .tip, .pw-input .tip { margin-left: 0; }
.tip:hover, .tip[aria-expanded="true"] { background: var(--primary); color: var(--primary-text); }
.tip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
label.check .req, label.check .tip { margin-left: .1rem; }
.tip-bubble { position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); padding: .55rem .7rem; border-radius: 8px;
  background: #1d2433; color: #fff; font-size: .85rem; font-weight: 400; line-height: 1.4; text-transform: none; letter-spacing: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); overflow-wrap: break-word; white-space: normal; text-align: left; }

/* Site de gestion : onglets d'une société, paiements (25/11/2026) */
.gs-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); }
.gs-tabs a { padding: .45rem .9rem; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; text-decoration: none; margin-bottom: -1px; }
.gs-tabs a.current { background: var(--surface); border-color: var(--border); font-weight: 600; }
.gs-tabs .chip { margin: 0 0 0 .3rem; }
.pay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .4rem; }
.pay-head strong { min-width: 0; }
.pay-item.pay-late { border-left: 4px solid var(--danger); }
.pay-actions { align-items: flex-start; }
.pay-actions > details[open] { flex: 1 1 100%; }
.pay-actions > details form { max-width: 40rem; }
.pay-preview { background: var(--bg); padding: .6rem; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; max-height: 18rem; overflow-y: auto; margin: .3rem 0 .6rem; }
.gs-recipients { border: 1px solid var(--border); border-radius: 6px; padding: .3rem .6rem .5rem; margin: 0 0 .6rem; min-width: 0; }
.gs-recipients .check { display: flex; gap: .4rem; align-items: flex-start; margin: .25rem 0; }
.pay-due { overflow-wrap: anywhere; }
.kv td .chip { white-space: normal; overflow-wrap: anywhere; }
/* Utilisateurs du coffre (tableau, grand écran) : colonne Utilisateur assez large pour lire l'adresse e-mail */
@media (min-width: 1340px) {
  .users-table td[data-label="Utilisateur"] { min-width: 15rem; }
  .users-table .email-form input { max-width: none; }
}
/* Journal du coffre : longues valeurs coupées plutôt que tableau élargi */.log td small, table.log td code { overflow-wrap: anywhere; word-break: break-word; }
/* Tarifs : description de l'offre lisible en entier */
.gs-desc { min-width: 14rem; }
.gs-desc textarea { width: 100%; min-height: 3.2rem; margin: 0; resize: vertical; font-size: .9rem; }
@media (max-width: 860px) { .gs-desc { min-width: 0; } }
/* Mon abonnement : tableau des offres sans défilement */
.gs-offers td, .gs-offers th { overflow-wrap: anywhere; }
/* Journal du coffre sur téléphone : chaque ligne devient une fiche (libellé : valeur), cases vides masquées */
@media (max-width: 700px) {
  table.log thead, table.device-table thead { display: none; }
  table.log, table.log tbody, table.log tr, table.log td,
  table.device-table, table.device-table tbody, table.device-table tr, table.device-table td { display: block; width: 100%; }
  table.log tr, table.device-table tr { padding: .5rem 0; border-bottom: 1px solid var(--border); }
  table.log td, table.device-table td { border: 0; padding: .1rem 0; }
  table.log td[data-label]::before, table.device-table td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-size: .8rem; }
  table.log td:empty, table.log td[data-label="Entrée"]:empty { display: none; }
}
/* Téléphone : mot de passe d'une entrée sur toute la largeur, boutons 👁 🎲 🛡 dessous */
@media (max-width: 480px) {
  .pw-input:has(> #password) { flex-wrap: wrap; }
  .pw-input > #password { flex: 1 1 100%; }
}
