/* Les couleurs viennent exclusivement de theme.css. */
:root { font-family: var(--font); color: var(--text); background: var(--bg); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--text); }
h1 { font-size: 1.65rem; margin: 0 0 1.25rem; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; letter-spacing: -.01em; }
h3 { margin-top: 0; }
a { color: var(--brand-text); }
.muted { color: var(--muted); }
.center { text-align: center; margin-top: 4rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--ring); }

/* Connexion */
#auth-view { margin: 7vh auto 0; border-top: 4px solid transparent; border-image: var(--grad) 1; }
#auth-view h1 { color: var(--text); }
.back { margin: 0 0 1rem; font-size: .85rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--brand-text); }

/* Coque */
#shell { display: grid; grid-template-columns: clamp(13.5rem, 17vw, 15.5rem) minmax(0, 1fr); min-height: 100vh; }
#sidebar { background: var(--sidebar-bg); color: var(--sidebar-strong); border-top: 3px solid var(--accent); padding: 1rem .75rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; min-height: 0; box-sizing: border-box; }
.brand { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; color: var(--sidebar-strong); text-decoration: none; padding: 0 .5rem; }
.brand::before { content: 'K'; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--grad); color: #fff; font-weight: 800; }
#nav { display: grid; gap: .1rem; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; align-content: start; scrollbar-width: thin; }
#nav a { padding: .45rem .7rem; font-size: .92rem; border-radius: var(--radius-sm); color: var(--sidebar-ink); text-decoration: none; border-left: 3px solid transparent; transition: background .15s, color .15s; white-space: nowrap; }
#nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
#nav a[aria-current='page'] { background: var(--sidebar-active); color: var(--sidebar-strong); font-weight: 600; border-left-color: var(--accent); }
.account { margin-top: auto; display: grid; gap: .2rem; padding: .7rem; border-radius: var(--radius); background: var(--sidebar-hover); flex: none; }
.account .muted { color: var(--sidebar-muted); font-size: .85rem; }
.account button { margin-top: .5rem; background: transparent; border-color: var(--sidebar-line); color: var(--sidebar-strong); }
.account button:hover { background: var(--sidebar-hover); }
.account .theme-toggle { margin-top: .4rem; }
.account button { padding: .35rem .6rem; font-size: .85rem; }

#page { padding: 2rem 2.5rem; max-width: 76rem; width: 100%; min-width: 0; }
@media (max-width: 760px) {
  #shell, #shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  #sidebar { position: static; height: auto; gap: 1rem; min-width: 0; }
  #sidebar-toggle { display: none; }
  #nav { grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; flex: none; scrollbar-width: thin; }
  #nav a { white-space: nowrap; }
  .account { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
  .account button { margin-top: 0; }
  #page { padding: 1.25rem 1rem; }
  h1 { font-size: 1.4rem; }
}

/* Tableau de bord */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: grid; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.1rem 1.4rem; color: inherit; text-decoration: none; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s, border-color .15s; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.stat strong { font-size: 2rem; line-height: 1.1; color: var(--text); }
.stat span { color: var(--muted); font-size: .9rem; }
.stat:hover { transform: translateY(-2px); border-color: var(--brand); }
.alerts { display: grid; gap: .4rem; margin-bottom: 1.25rem; }
.alert-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: .55rem 1rem; }
.alert-row a { font-weight: 600; white-space: nowrap; color: inherit; }
.alert-row .alert-text { flex: 1; }
.alert-row.sev-high { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger-ink); }
.alert-row.sev-low, .alert-row.sev-info { background: var(--brand-soft); color: inherit; border-color: transparent; }
.alert-counts { display: flex; gap: .4rem; }
.badge.sev-high { background: var(--danger-ink); color: #fff; }
.badge.sev-medium { background: var(--warn-ink); color: #fff; }
.badge.sev-low, .badge.sev-info { background: var(--brand-soft); color: inherit; }
.alert-ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-ink); border-radius: var(--radius); padding: .55rem 1rem; margin-bottom: 1.25rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 .2rem; font-size: 1rem; }
.bars { display: grid; gap: .35rem; margin-top: .6rem; }
.bar-row { display: grid; grid-template-columns: 3rem 1fr 2rem; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-size: .85rem; }
a.bar-row:hover .bar-label { color: var(--brand-text); text-decoration: underline; }
.bar-label { color: var(--muted); }
.bar-label.wide { grid-column: 1; width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row:has(.wide) { grid-template-columns: 7rem 1fr 2rem; }
.bar-count { text-align: right; font-weight: 600; color: var(--text); }
progress { width: 100%; height: .6rem; appearance: none; border: 0; border-radius: 999px; background: var(--track); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--track); }
progress::-webkit-progress-value { background: var(--grad); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); }

/* Tableaux et listes */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
.empty { padding: 1.25rem 0; color: var(--muted); }
.notice { background: var(--brand-soft); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.link-button { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: inherit; text-decoration: none; background: var(--surface); transition: background .15s, border-color .15s; }
.link-button:hover { background: var(--surface-2); border-color: var(--brand); }
.checklist label[hidden] { display: none; }
.agent-search { max-width: 12rem; }
.sort-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; white-space: nowrap; }
.sort-btn:hover { text-decoration: underline; background: none; }
.item-actions.nowrap { flex-wrap: nowrap; justify-content: flex-end; }
.switch { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; padding: .1rem; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; color: var(--danger-ink); }
.switch:hover { background: none; }
.switch .knob { position: relative; width: 2.2rem; height: 1.2rem; border-radius: 999px; background: var(--switch-off); transition: background .15s; }
.switch .knob::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { color: var(--ok-ink); }
.switch.on .knob { background: var(--accent); }
.switch.on .knob::after { transform: translateX(1rem); }
.switch:disabled { opacity: .55; cursor: not-allowed; }
.manage-grid { display: grid; gap: .4rem; margin: .5rem 0 1rem; min-width: min(22rem, 80vw); }
.manage-grid h3 { margin: .6rem 0 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.manage-grid button, .manage-grid a { text-align: left; justify-content: flex-start; }
.agents-table td, .agents-table th { white-space: nowrap; padding-left: .6rem; padding-right: .6rem; }
.agents-table td:nth-child(6) { white-space: normal; }
.advanced input[type=search], .advanced input[type=number], .advanced select { flex: 1 1 11rem; min-width: 9rem; max-width: 16rem; }
.advanced > p { flex: 1 1 100%; margin: 0; font-size: .85rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.stat-card { display: grid; gap: .1rem; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .85rem; cursor: pointer; font: inherit; color: var(--text); box-shadow: none; }
.stat-card strong { font-size: 1.4rem; line-height: 1.1; }
.stat-card span { font-size: .78rem; color: var(--muted); }
.stat-card:hover { border-color: var(--brand); background: var(--surface); }
.stat-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--accent); }
.person { display: flex; align-items: center; gap: .6rem; }
.person .avatar { width: 2rem; height: 2rem; border-radius: 50%; font-size: .75rem; background: var(--brand-soft); color: var(--brand-text); }
.person .avatar.admin { background: var(--accent); color: var(--accent-ink); }
.mail { color: inherit; text-decoration: none; }
.mail:hover { text-decoration: underline; }
.count-btn { border: 0; cursor: pointer; font: inherit; font-size: .8rem; }
.count-btn:hover { filter: brightness(.95); background: var(--ok-bg); }
.assigned-list ul { list-style: none; margin: .25rem 0 .5rem; padding: 0; display: grid; gap: .2rem; }
.assign-fieldset h3 { margin: .5rem 0 .25rem; font-size: .9rem; }
.assign-fieldset .checklist { margin-bottom: .5rem; max-height: 9rem; }
.checklist { display: grid; gap: .25rem; max-height: 14rem; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .75rem; margin-bottom: 1rem; background: var(--surface); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-all; }
.pre { white-space: pre-wrap; }
.secret { font-size: 1.05rem; font-family: var(--mono); }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); margin-right: .25rem; }
.badge.shared, .badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.off { background: var(--danger-soft); color: var(--danger-ink); }
.badge.tag { background: var(--tag-bg); color: var(--tag-ink); }

.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2rem; }
.narrow { max-width: 26rem; width: calc(100% - 2rem); }

/* Formulaires */
form { display: grid; gap: 1rem; }
label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--text); }
label small { font-weight: 400; }
label.inline { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
input, select, textarea { padding: .6rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-weight: 400; color: var(--text); background: var(--surface); min-width: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--brand); }
.row { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; }
.row > input, .row > select, .grow { flex: 1; }
.row.end { justify-content: flex-end; align-items: center; }

button { padding: .55rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
button:hover { background: var(--surface-2); }
button:active { transform: translateY(1px); }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; box-shadow: 0 2px 6px var(--ring); }
button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.danger-fill { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
button.danger-fill:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
button:disabled { opacity: .6; cursor: wait; }
.error { color: var(--danger); margin: 0; font-size: .9rem; }

.tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.tabs button { flex: 1; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); box-shadow: none; }
.tabs button:hover { background: none; color: var(--brand-text); }
.tabs button[aria-selected='true'] { border-bottom-color: var(--brand); color: var(--brand-text); font-weight: 600; }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input { flex: 1; min-width: 12rem; }

.list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.list > li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1.1rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); transition: border-color .15s; }
.list > li:hover { border-color: var(--border-strong); }
.list.compact > li { padding: .55rem .85rem; box-shadow: none; }
.item-main { flex: 1; min-width: 12rem; display: grid; gap: .15rem; }
.item-title { font-weight: 600; }
.item-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Coffre à trois volets : dossiers, liste, détail */
#page:has(.vault) { max-width: none; }
.vault { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.vault-list .toolbar { margin-bottom: .6rem; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#sidebar-toggle { padding: .2rem .55rem; color: var(--sidebar-ink); background: var(--sidebar-hover); border: 0; box-shadow: none; }
#nav .nav-icon { display: inline-block; width: 1.5rem; }
#shell { transition: grid-template-columns .2s; }
@media (min-width: 761px) { #shell.collapsed { grid-template-columns: 4.5rem minmax(0, 1fr); } }
#shell.collapsed .brand-name, #shell.collapsed .nav-label, #shell.collapsed .account { display: none; }
#shell.collapsed .brand-row { flex-direction: column; }
#shell.collapsed #nav a { text-align: center; padding: .6rem 0; }
#shell.collapsed .nav-icon { width: auto; }
.vault-folders { display: grid; gap: .15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow); position: sticky; top: 1rem; }
.folder-title { margin: .75rem .6rem .25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.folder { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .6rem; border-radius: var(--radius-sm); box-shadow: none; }
.folder:hover { background: var(--surface-2); }
.folder.active { background: var(--brand); color: var(--brand-ink); }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { background: var(--track); color: var(--muted); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; }
.folder.active .count { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.vault-list .list { gap: .35rem; margin: 0; }
.list > li.cred { padding: .3rem .6rem; cursor: pointer; gap: .55rem; flex-wrap: nowrap; box-shadow: none; align-items: center; }
.cred .avatar { width: 1.8rem; height: 1.8rem; font-size: .85rem; }
.cred-open { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; box-shadow: none; padding: 0; color: inherit; }
.cred-open:hover { background: none; }
.cred-pass { display: flex; align-items: center; gap: .4rem; color: var(--muted); letter-spacing: .1em; }
.cred-pass .mini { padding: .1rem .5rem; font-size: .75rem; }
.folder-picks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
.folder-picks .mini { padding: .15rem .6rem; font-size: .8rem; border-radius: 999px; }
.folder-head { display: flex; align-items: center; justify-content: space-between; }
.folder-head .mini { padding: .05rem .55rem; font-weight: 700; }
.folder-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: .5rem 1rem; margin-bottom: .6rem; }
.folder-bar-name { word-break: break-all; }
.list > li.cred.current { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cred .item-main { min-width: 0; }
.cred .badge { margin: 0; white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.toolbar.filters { margin-bottom: .6rem; align-items: center; }
.toolbar.filters select { flex: 0 1 auto; }
.seg { display: inline-flex; margin-left: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; box-shadow: none; background: var(--surface); padding: .35rem .75rem; font-size: .85rem; }
.seg button.on { background: var(--brand); color: var(--brand-ink); }
.star { background: none; border: 0; box-shadow: none; padding: 0 .2rem; font-size: 1.15rem; line-height: 1; color: var(--star); cursor: pointer; }
.star:hover { color: var(--star-on); background: none; }
.star.on { color: var(--star-on); }
.list > li.group-head, tr.group-head td { background: none; border: 0; box-shadow: none; padding: .55rem .2rem .1rem; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: default; }
tr.group-head td { background: var(--surface-2); padding: .4rem .75rem; }
.group-toggle { display: flex; align-items: center; gap: .45rem; width: 100%; background: none; border: 0; box-shadow: none; padding: 0; font: inherit; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; cursor: pointer; }
.group-toggle:hover { color: var(--brand-text); background: none; }
.group-toggle .chev { width: 1rem; display: inline-block; }
.more { text-align: center; margin: .75rem 0; }
.cred-table table { min-width: 56rem; }
.cred-table td { padding: .35rem .6rem; white-space: nowrap; vertical-align: middle; }
.cred-table .c-pick, .cred-table .c-star { width: 1%; padding-right: 0; }
.cred-table .c-name .cred-open { display: block; font-weight: 600; flex: none; }
.cred-table .c-name .cred-name-with-icon { display: inline-flex; align-items: center; gap: .5rem; }
.cred-table .c-name .credential-icon { width: 1.6rem; height: 1.6rem; font-size: .75rem; }
.cred-table .c-date { color: var(--muted); font-size: .85rem; }
.cred-table .ellipsis { max-width: 12rem; }
tr.cred-row { cursor: pointer; }
tr.cred-row:hover { background: var(--surface-hover); }
tr.cred-row.current { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cred[draggable="true"], tr.cred-row[draggable="true"] { cursor: grab; }
.folder.drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.vault-detail { background: var(--surface); border: 1px solid var(--border); padding: 1.5rem; box-shadow: -8px 0 30px var(--overlay); position: fixed; top: 0; right: 0; bottom: 0; width: min(26rem, 100vw); overflow-y: auto; z-index: 40; display: grid; align-content: start; gap: 1rem; border-radius: 0; border-top: 3px solid var(--accent); transform: translateX(105%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
.vault-detail.open { transform: none; visibility: visible; }
.drawer-close { justify-self: end; padding: .2rem .6rem; }
.detail-head { display: flex; gap: 1rem; align-items: center; }
.detail-head h2 { margin: 0; }
.detail-head p { margin: 0; }
.detail-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.field { border-top: 1px solid var(--border); padding-top: .75rem; }
.field-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin-bottom: .25rem; }
.field-value { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; word-break: break-all; }
.field-value > span:first-child, .field-value > .links { flex: 1; min-width: 0; }
.field-value button { padding: .25rem .65rem; font-size: .85rem; }
.links { display: grid; gap: .25rem; }
.detail-foot { margin: 0; font-size: .8rem; }
.avatar.big { width: 3.4rem; height: 3.4rem; font-size: 1.4rem; border-radius: 14px; }
.extra-urls { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .85rem .85rem; margin: 0; display: grid; gap: .5rem; }
.extra-urls legend { font-size: .85rem; font-weight: 600; color: var(--text); padding: 0 .35rem; }
.url-rows { display: grid; gap: .4rem; }
.url-row { align-items: center; flex-wrap: nowrap; }
.bulk { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--brand-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: .55rem 1rem; margin-bottom: .75rem; }
.bulk label { font-weight: 600; }
.pick { width: 1.1rem; height: 1.1rem; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.on:hover { background: var(--brand-hover); }
.mine-toolbar { margin-top: 1rem; }
.cred-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: .9rem; }
.cred-card { display: grid; gap: .75rem; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.cred-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.cred-card-head { display: flex; align-items: center; gap: .75rem; }
.cred-card-head .item-main { min-width: 0; }
.cred-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pass-mask { letter-spacing: .15em; }
.cred-card .link-button { text-align: center; }
.cred-cards .empty { grid-column: 1 / -1; }
.avatar { width: 2.4rem; height: 2.4rem; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem; flex: none; }
.credential-icon.has-favicon { background: var(--surface) !important; border: 1px solid var(--border); overflow: hidden; padding: .22rem; }
.credential-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }

dialog { border: 0; border-radius: var(--radius-lg); padding: 1.75rem; width: min(34rem, 94vw); max-height: 92vh; overflow-y: auto; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); border-top: 4px solid var(--brand); animation: dlg .18s ease; }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog h2 { margin-top: 0; }
details { font-size: .9rem; }
details label { margin-top: .5rem; }

#toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--toast-bg); color: var(--toast-ink); padding: .7rem 1.2rem; border-radius: var(--radius); z-index: 60; border-left: 4px solid var(--accent); box-shadow: var(--shadow-lg); animation: pop .18s ease; max-width: calc(100vw - 2rem); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes dlg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Adaptation aux écrans */
@media (max-width: 1100px) { .vault { grid-template-columns: 12rem 1fr; } }
@media (max-width: 760px) {
  .vault { grid-template-columns: minmax(0, 1fr); }
  .vault-folders { position: static; grid-auto-flow: column; overflow-x: auto; }
  .folder { width: auto; white-space: nowrap; }
  .list > li.cred { flex-wrap: wrap; }
  .list > li.cred .cred-open { flex-basis: 8rem; }
  .folder-title { display: none; }
  .toolbar.filters select, .toolbar.filters input { flex: 1 1 100%; }
  .seg { margin-left: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat strong { font-size: 1.6rem; }
  .alert-row { flex-direction: column; align-items: flex-start; gap: .25rem; }
}
@media (max-width: 560px) {
  dialog { padding: 1.25rem; width: 96vw; }
  .card { padding: 1.25rem; }
  .row.end { flex-direction: column-reverse; align-items: stretch; }
  .url-row { flex-wrap: wrap; }
  dl { grid-template-columns: 1fr; gap: .15rem; }
  dt { margin-top: .5rem; }
}

  /* Fil d'activité */
.toolbar.filters label.inline { display: inline-flex; align-items: center; gap: .4rem; flex: 0 0 auto; width: auto; margin: 0; }
.toolbar.filters label.inline input[type=checkbox] { width: auto; min-width: 0; flex: none; margin: 0; }
  .panel-head { margin-bottom: .4rem; align-items: center; }
  .panel-head h2 { margin: 0; }
  .feed { list-style: none; margin: 0; padding: 0; display: grid; }
  .feed-item { display: flex; gap: .8rem; align-items: flex-start; padding: .65rem .2rem; border-bottom: 1px solid var(--border); }
  .feed-item:last-child { border-bottom: 0; }
  .feed-icon { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-soft); font-size: 1rem; }
  .cat-credential .feed-icon { background: var(--tag-bg); }
  .cat-auth .feed-icon, .cat-folder .feed-icon { background: var(--ok-bg); }
  .cat-user .feed-icon, .cat-backup .feed-icon { background: var(--warn-bg); }
  .feed-body { flex: 1; min-width: 0; }
  .feed-title { display: flex; flex-wrap: wrap; gap: .1rem .25rem; align-items: center; }
  .feed-target { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
  .feed-ip { font-size: .78rem; }
  .feed-time { flex: none; display: grid; justify-items: end; font-size: .82rem; white-space: nowrap; }
.feed-abs { color: var(--text); font-variant-numeric: tabular-nums; }
.feed-rel { font-size: .74rem; }
  .feed-groups { display: grid; gap: 1rem; }
  .feed-day { margin: 0 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .feed-groups section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem 1rem; box-shadow: var(--shadow); }
  @media (max-width: 600px) { .feed-item { flex-wrap: wrap; } .feed-time { width: 100%; padding-left: 2.9rem; justify-items: start; } }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; max-width: 40rem; }
.extension-section { margin: 0 0 1.5rem; }
.extension-section > h2 { margin-bottom: .65rem; }
.extension-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: .75rem; }
.extension-grid .panel { margin: 0; }
.extension-grid .panel p { margin: .45rem 0 0; }
.form-grid h2 { margin: .75rem 0 0; font-size: 1.05rem; }
.stat.sev-high::before, .stat.health-high::before { background: var(--danger-ink); }
.stat.sev-medium::before, .stat.health-medium::before { background: var(--warn-ink); }
.stat.sev-low::before, .stat.sev-info::before, .stat.health-ok::before { background: var(--ok-ink); }
.alert-row.is-ignored { opacity: .55; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: .5rem; }
details summary { cursor: pointer; font-weight: 600; }
.state { border-left: 5px solid var(--ok-ink); }
.state-medium { border-left-color: var(--warn-ink); }
.state-high { border-left-color: var(--danger-ink); }
.state-line { font-size: 1.1rem; margin: .2rem 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.nav-badge { margin-left: auto; min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--danger-ink); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.25rem; }
#nav a { display: flex; align-items: center; }
#shell.collapsed .nav-badge { position: absolute; top: .1rem; right: .35rem; margin: 0; }
#shell.collapsed #nav a { position: relative; justify-content: center; }
.faq-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .6rem; }
.chip { padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.chip.active { background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.faq-group h2 { margin: 1.2rem 0 .5rem; font-size: 1.05rem; }
.faq-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.faq-help { margin-top: 1.5rem; }
.faq-empty { text-align: center; }
.download-btn { display: inline-block; padding: .65rem 1.2rem; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); font-weight: 600; text-decoration: none; box-shadow: 0 2px 6px var(--ring); }
.download-btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.download-btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: none; }
pre.code { overflow-x: auto; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2, var(--surface)); font-size: .85rem; user-select: all; }
@media print { .no-print, nav, aside, header button { display: none !important; } body { background: #fff; } }
