/* PassFort — UI */
:root {
  --bg: #0f1720;
  --bg-2: #141e29;
  --panel: #18232f;
  --panel-2: #1e2b39;
  --line: #273647;
  --line-2: #314357;
  --text: #e6edf3;
  --text-2: #9fb0c0;
  --text-3: #6f8296;
  --accent: #2dd4bf;
  --accent-2: #14b8a6;
  --accent-ink: #042f2b;
  --accent-soft: rgba(45, 212, 191, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .12);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .13);
  --digit: #60a5fa;
  --sym: #f472b6;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f6f9; --bg-2: #eaf0f5; --panel: #ffffff; --panel-2: #f6f9fb; --line: #dde5ec; --line-2: #c9d5e0;
    --text: #102030; --text-2: #4a5d70; --text-3: #7a8c9e;
    --accent: #0d9488; --accent-2: #0f766e; --accent-ink: #ffffff; --accent-soft: rgba(13, 148, 136, .10);
    --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .08); --warn: #b45309; --warn-soft: rgba(217, 119, 6, .10);
    --ok: #15803d; --ok-soft: rgba(22, 163, 74, .10); --info: #2563eb; --info-soft: rgba(37, 99, 235, .09);
    --digit: #2563eb; --sym: #db2777; --shadow: 0 18px 50px rgba(16, 32, 48, .16);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0; }
small { font-size: .82rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { flex: 1; }
.clip-helper { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* icons */
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.fav, .fav-on .ic { color: var(--warn); }
.ic.fav svg, .fav-on .ic svg { fill: currentColor; }
.ic.ok { color: var(--ok); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--panel-2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .item-row:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.sm { height: 32px; padding: 0 10px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--radius-sm); border: 0;
  background: transparent; color: var(--text-2); cursor: pointer; flex: none; text-decoration: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm { width: 32px; height: 32px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 550; }
.link:hover { text-decoration: underline; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--text-2); }
input:not([type=checkbox]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; height: 42px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); font-weight: 400; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { opacity: .7; }
input.invalid { border-color: var(--danger); }
.input-group { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding-right: 4px; }
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-group input { border: 0 !important; box-shadow: none !important; background: transparent !important; flex: 1; min-width: 0; font-family: var(--mono); }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.code-input { font-family: var(--mono); font-size: 1.5rem !important; letter-spacing: .35em; text-align: center; height: 54px !important; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; font-weight: 550; }
.notice { border-radius: var(--radius-sm); padding: 11px 13px; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.notice .ic { margin-top: 2px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.good { background: var(--ok-soft); color: var(--ok); display: block; }
.notice.bad { background: var(--danger-soft); color: var(--danger); display: block; }
.notice.info { background: var(--accent-soft); color: var(--text); }
.notice.info .ic { color: var(--accent); }

.meter-wrap { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.meter { flex: 1; height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter-bar { height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; background: var(--danger); }
.meter-bar[data-s="2"] { background: var(--warn); }
.meter-bar[data-s="3"] { background: var(--accent); }
.meter-bar[data-s="4"] { background: var(--ok); }
.meter-label { min-width: 48px; text-align: right; }
.meter-text, #meter-text { margin-top: -6px; }

/* boot / auth */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 64px; height: 64px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.95); } }
.noscript { padding: 24px; text-align: center; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px; }
.auth-card.wide { max-width: 520px; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 36px; height: 36px; }
.brand-name { font-weight: 750; font-size: 1.15rem; letter-spacing: -.01em; }
.auth-foot { display: flex; flex-direction: column; gap: 8px; align-items: center; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.auth-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--text-3); font-size: .82rem; text-align: center; }
.auth-note .ic { width: 16px; height: 16px; color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--bg-2); }
.who > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.checklist .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; transform: translateY(-1px); }
.checklist .bad .dot { background: var(--danger); }
.checklist small { color: var(--text-3); width: 100%; padding-left: 19px; }

/* avatars */
.avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff; font-size: 1rem; }
.avatar.big { width: 56px; height: 56px; border-radius: 14px; font-size: 1.4rem; }
.avatar.big .ic { width: 26px; height: 26px; }
.avatar.sm { width: 32px; height: 32px; border-radius: 50%; font-size: .9rem; }
.avatar.c0 { background: #0e7490; } .avatar.c1 { background: #7c3aed; } .avatar.c2 { background: #c2410c; } .avatar.c3 { background: #0f766e; }
.avatar.c4 { background: #be185d; } .avatar.c5 { background: #4d7c0f; } .avatar.c6 { background: #1d4ed8; } .avatar.c7 { background: #a16207; }

/* shell */
.shell { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; margin-right: 8px; }
.brand img { width: 28px; height: 28px; }
.tabs { display: flex; gap: 2px; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.on { color: var(--text); background: var(--panel-2); }
.tab.on .ic { color: var(--accent); }
.search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 38px !important; height: 40px !important; background: var(--panel) !important; }
.avatar-btn { background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 50%; }
.page { flex: 1; min-height: 0; }
.page-scroll { height: calc(100vh - 60px); height: calc(100dvh - 60px); overflow: auto; }
.only-mobile { display: none !important; }

/* vault 3-pane */
.vault { display: grid; grid-template-columns: 236px minmax(280px, 380px) 1fr; height: calc(100vh - 60px); height: calc(100dvh - 60px); }
.sidebar { border-right: 1px solid var(--line); padding: 14px 10px; overflow: auto; background: var(--bg-2); }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; padding: 16px 10px 6px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer; text-align: left; font-weight: 550; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--text); }
.nav-item.on .ic { color: var(--accent); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: .78rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item.warn .count { background: var(--warn-soft); color: var(--warn); padding: 0 7px; border-radius: 99px; font-weight: 700; }
.scrim { display: none; }

.list-pane { border-right: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 18px 18px 10px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.items { list-style: none; margin: 0; padding: 0 8px 16px; }
.item-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); }
.item-row:hover { background: var(--panel); }
.item-row.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.item-text { flex: 1; min-width: 0; }
.item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: .85rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .row { justify-content: center; margin-top: 6px; }
.empty-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty-ic .ic { width: 32px; height: 32px; }

.detail-pane { overflow: auto; }
.detail { max-width: 720px; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
.detail-head { display: flex; align-items: center; gap: 16px; }
.detail-head h2 { font-size: 1.35rem; word-break: break-word; }
.chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--text-2); font-weight: 600; }
.chip .ic { width: 13px; height: 13px; }
.fields { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.f-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.f-row:last-child { border-bottom: 0; }
.f-main { flex: 1; min-width: 0; }
.f-label { font-size: .78rem; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.f-val { word-break: break-all; font-size: 1rem; }
.f-val.mono { letter-spacing: .02em; }
.f-val a { word-break: break-all; }
.f-btns { display: flex; gap: 2px; flex: none; }
.f-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.cd { color: var(--digit); } .cs { color: var(--sym); }
.notes-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.notes { white-space: pre-wrap; word-break: break-word; }
.history { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.history summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.history li { display: flex; align-items: center; gap: 12px; }
.history li .mono { flex: 1; }
.meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-btn { align-self: flex-start; }

.badge { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.badge.s1 { background: var(--danger-soft); color: var(--danger); }
.badge.s2 { background: var(--warn-soft); color: var(--warn); }
.badge.s3 { background: var(--accent-soft); color: var(--accent); }
.badge.s4, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.role-admin { background: var(--accent-soft); color: var(--accent); }

/* health */
.health { padding: 56px 32px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 620px; margin: 0 auto; }
.ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 8px solid var(--ok); margin-bottom: 8px; background: var(--panel); }
.ring[data-score="mid"] { border-color: var(--warn); }
.ring[data-score="low"] { border-color: var(--danger); }
.ring b { font-size: 2rem; line-height: 1; }
.ring small { color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; width: 100%; margin-top: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; text-align: left; color: var(--text); }
.tile b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.tile span { font-size: .83rem; color: var(--text-2); }
.tile.click { cursor: pointer; }
.tile.click:hover { border-color: var(--line-2); }
.tile.warn b { color: var(--warn); } .tile.ok b { color: var(--ok); } .tile.info b { color: var(--info); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(4, 10, 16, .62); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
  animation: fade .15s ease-out; backdrop-filter: blur(2px); }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.modal.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 8px 22px; }
.modal-body { padding: 10px 22px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 10px; }
.seg-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 0; background: transparent; border-radius: 8px;
  color: var(--text-2); cursor: pointer; font-size: .8rem; font-weight: 600; }
.seg-btn.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 0 var(--line-2); }
.seg-btn.on .ic { color: var(--accent); }

.gen-box { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 10px 14px 16px; }
.gen-out { flex: 1; font-size: 1.15rem; word-break: break-all; line-height: 1.45; min-height: 1.45em; }
.len-row { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--text-2); }
.len-row input { flex: 1; accent-color: var(--accent); }
.len-num { min-width: 28px; text-align: right; font-family: var(--mono); color: var(--text); }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
.opts .check:last-child { grid-column: 1 / -1; }

/* popmenu + toasts */
.popmenu { position: fixed; z-index: 60; min-width: 220px; max-width: 300px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; animation: pop .12s ease-out; }
.pm-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pm-head div { display: flex; flex-direction: column; min-width: 0; }
.pm-head small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.pm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; font-weight: 550; }
.pm-item:hover, .pm-item:focus { background: var(--panel-2); outline: none; }
.pm-item .ic { color: var(--text-2); }
.pm-item.danger, .pm-item.danger .ic { color: var(--danger); }
.popmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow); animation: pop .18s ease-out; transition: opacity .3s, transform .3s; }
.toast .ic { color: var(--accent-2); }
.toast.error { background: var(--danger); color: #fff; }
.toast.error .ic { color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* settings / admin */
.settings, .admin { max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-direction: column; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .ic { color: var(--accent); }
.btn-list { display: flex; flex-direction: column; gap: 8px; }
.btn-list .btn { justify-content: flex-start; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 340px; overflow: auto; }
.activity li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity li.bad > span:first-child { color: var(--danger); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; flex-direction: column; gap: 10px; font-weight: 600; counter-increment: st; }
.steps li::before { content: "Step " counter(st); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: -6px; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-weight: 400; }
.qr { width: 172px; height: 172px; image-rendering: pixelated; border-radius: 10px; background: #fff; padding: 6px; }
.secret { font-size: 1.02rem; background: var(--bg-2); padding: 8px 10px; border-radius: 8px; margin: 6px 0 8px; word-break: break-all; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.subtab { border: 0; background: transparent; padding: 10px 14px; color: var(--text-2); font-weight: 650; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab.on { color: var(--text); border-bottom-color: var(--accent); }
.admin-body { display: flex; flex-direction: column; gap: 16px; }
.tiles.stats { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.section-head { margin-top: 6px; }
.filter { max-width: 300px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.c, .table th.c { text-align: center; }
.table tr.bad td:nth-child(2) { color: var(--danger); font-weight: 600; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.user-cell > div:last-child { display: flex; flex-direction: column; }
.big-code { font-size: 1.7rem; letter-spacing: .12em; text-align: center; padding: 16px; background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 12px; color: var(--accent); font-weight: 700; }
.invite { white-space: pre-wrap; background: var(--bg-2); border-radius: 10px; padding: 12px; font-size: .85rem; margin: 0; color: var(--text-2); font-family: var(--font); }
.switch-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; color: var(--text); font-weight: 400; cursor: pointer; }
.switch { appearance: none; width: 44px !important; height: 26px !important; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: .9rem; }

/* responsive */
@media (max-width: 1100px) {
  .vault { grid-template-columns: 220px 320px 1fr; }
  .tabs .tab { padding: 0 9px; }
}
@media (max-width: 900px) {
  .tabs, .hide-mobile { display: none; }
  .only-mobile { display: inline-flex !important; }
  .brand span { display: none; }
  .brand { margin-right: 0; }
  .topbar { padding: 0 8px; gap: 6px; }
  .add-btn { padding: 0 12px; }
  .add-btn > span:not(.ic) { display: none; }
  .add-btn { width: 40px; padding: 0; }
  .vault { grid-template-columns: 1fr; position: relative; }
  .sidebar { position: absolute; inset: 0 auto 0 0; width: 270px; z-index: 20; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: var(--shadow); }
  .drawer-open .sidebar { transform: none; }
  .drawer-open .scrim { display: block; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); z-index: 15; }
  .list-pane { border-right: 0; }
  .detail-pane { display: none; }
  .show-detail .list-pane { display: none; }
  .show-detail .detail-pane { display: block; }
  .detail { padding: 16px 16px 40px; }
  .health { padding: 32px 16px; }
  .settings, .admin { padding: 20px 14px 48px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .auth-card { padding: 24px 18px; border-radius: 14px; }
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 92dvh; }
  .modal-foot .btn { flex: 1; }
  .seg-btn { font-size: .72rem; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .detail-head h2 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
