:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --ink: #1c2430;
    --ink-2: #5a6675;
    --ink-3: #8a94a3;
    --line: #e7e9ee;
    --line-2: #eef0f4;
    --accent: #0e9e8e;
    --accent-ink: #0a7064;
    --accent-soft: #e3f5f1;
    --amber: #b5730a;
    --amber-soft: #fdf3e3;
    --red: #c0392b;
    --red-soft: #fbecea;
    --blue: #2f7df6;
    --accent-hover: #0a7064;
    --info-bg: #eef4ff;
    --info-ink: #2a5bb0;
    --purple-bg: #f0ecfb;
    --purple-ink: #543db0;
    --purple-ink-2: #6a4fd0;
    --amber-ink: #7a4e06;
    --red-ink: #a3271b;
    --switch-off: #cfd5dd;
    --border-hover: #d3d8e0;
    --toast-bg: #1c2430;
    --side: #121821;
    --side-2: #0d131b;
    --side-ink: #aab3c0;
    --side-ink-2: #6f7c8d;
    --side-line: #232c38;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(20,30,45,.05), 0 8px 24px rgba(20,30,45,.06);
    --shadow-lg: 0 20px 50px rgba(15,23,35,.22);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
a { color: inherit; text-decoration: none; }
.ti { font-size: 18px; line-height: 1; }

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
    background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
    color: var(--side-ink);
    display: flex; flex-direction: column;
    padding: 18px 14px;
    position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    display: grid; place-items: center; color: #fff; flex: 0 0 auto;
    box-shadow: 0 6px 16px rgba(14,158,142,.35);
}
.brand-mark .ti { font-size: 21px; }
.brand-text { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--side-ink-2); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--side-ink-2); padding: 14px 10px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm);
    color: var(--side-ink); font-size: 13.5px; font-weight: 500;
    cursor: pointer; position: relative; transition: background .12s, color .12s;
}
.nav-link:hover { background: rgba(255,255,255,.05); color: #e8edf3; }
.nav-link.active { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active::before {
    content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
    background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-badge {
    margin-left: auto; background: var(--amber); color: #fff;
    font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--side-line); }
.vault-status { display: flex; align-items: center; gap: 9px; padding: 8px 10px; font-size: 12.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 3px rgba(46,204,113,.18); }
.foot-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.foot-user .avatar { width: 30px; height: 30px; font-size: 11px; }
.foot-meta { line-height: 1.2; min-width: 0; }
.foot-name { color: #e8edf3; font-size: 12.5px; font-weight: 500; }
.foot-mail { color: var(--side-ink-2); font-size: 11px; }
.lock-btn {
    margin-left: auto; background: transparent; border: 1px solid var(--side-line);
    color: var(--side-ink); width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    display: grid; place-items: center;
}
.lock-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px; padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.search { flex: 1; max-width: 460px; position: relative; }
.search > .ti { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 17px; }
.search input {
    width: 100%; height: 40px; padding: 0 14px 0 40px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
    font-family: var(--font); font-size: 13.5px; color: var(--ink); outline: none;
}
.search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 26px; max-width: 1180px; width: 100%; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); font-family: var(--font);
    font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .12s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn .ti { font-size: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--surface); border-color: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2); cursor: pointer;
    display: grid; place-items: center; transition: all .12s; flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-hover); }

/* ---------- Page head ---------- */
.page-head { margin-bottom: 18px; }
.page-title { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.page-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }

/* ---------- Toolbar / chips ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
    color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--border-hover); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .ti { font-size: 15px; }
.chip-count { font-size: 11px; opacity: .65; }

/* ---------- Vault list ---------- */
.vault-list { display: flex; flex-direction: column; gap: 8px; }
.vault-row {
    display: flex; align-items: center; gap: 14px; padding: 13px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .04s;
}
.vault-row:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.vault-row:active { transform: translateY(1px); }
.row-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.row-icon .ti { font-size: 20px; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--ink-3); font-size: 12px; flex-wrap: wrap; }
.row-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.row-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.pill {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
    border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--line-2); color: var(--ink-2);
}
.pill .ti { font-size: 13px; }
.tag { color: var(--ink-3); font-size: 11.5px; }

.exp { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; }
.exp .ti { font-size: 14px; }
.exp.soon { background: var(--amber-soft); color: var(--amber); }
.exp.expired { background: var(--red-soft); color: var(--red); }
.exp.ok { background: var(--accent-soft); color: var(--accent-ink); }

.third-pill { background: var(--purple-bg); color: var(--purple-ink-2); }

/* ---------- Drawer (detail) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(18,24,33,.42); z-index: 40; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw;
    background: var(--surface); z-index: 50; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; animation: slidein .2s cubic-bezier(.2,.7,.3,1);
}
@keyframes slidein { from { transform: translateX(30px); opacity: .4; } }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.drawer-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; }
.drawer-icon .ti { font-size: 23px; }
.drawer-title { font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.drawer-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.drawer-close { margin-left: auto; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }

.field-view { padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.fv-label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 500; }
.fv-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.fv-value { font-size: 13.5px; color: var(--ink); word-break: break-word; flex: 1; font-variant-numeric: tabular-nums; }
.fv-value.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.fv-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.mini-btn { width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.mini-btn:hover { background: var(--line-2); color: var(--ink); }
.mini-btn .ti { font-size: 16px; }

.section-label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 20px 0 8px; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.meta-k { font-size: 11.5px; color: var(--ink-3); }
.meta-v { font-size: 13px; color: var(--ink); margin-top: 2px; font-weight: 500; }

.attach-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.attach-item .ti { font-size: 20px; color: var(--ink-2); }
.attach-name { font-size: 13px; font-weight: 500; }
.attach-size { font-size: 11.5px; color: var(--ink-3); }

/* TOTP */
.totp { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.totp-ring { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.totp-ring span { font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.totp-code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 600; letter-spacing: 3px; color: var(--ink); }

.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.banner .ti { font-size: 18px; flex: 0 0 auto; margin-top: 1px; }
.banner.warn { background: var(--amber-soft); color: var(--amber-ink); }
.banner.third { background: var(--purple-bg); color: var(--purple-ink); }
.banner.info { background: var(--info-bg); color: var(--info-ink); }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
    background: rgba(18,24,33,.42); animation: fade .15s ease; overflow-y: auto;
}
.modal-box {
    background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px;
    box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.7,.3,1); margin: auto;
}
@keyframes pop { from { transform: scale(.97); opacity: .5; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* type grid (add item) */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-card {
    display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line);
    border-radius: 11px; cursor: pointer; transition: all .12s; background: var(--surface);
}
.type-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.type-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.type-ic .ti { font-size: 20px; }
.type-name { font-weight: 600; font-size: 13.5px; }
.type-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Form ---------- */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.input {
    width: 100%; height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px;
    font-family: var(--font); font-size: 13.5px; color: var(--ink); background: var(--surface); outline: none;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); }
.check-text { font-size: 13px; }
.check-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .12s; }
.radio-card:hover { border-color: var(--border-hover); }
.radio-card.active { border-color: var(--accent); background: var(--accent-soft); }
.radio-card .ti { font-size: 19px; color: var(--ink-2); margin-top: 1px; }
.radio-card.active .ti { color: var(--accent-ink); }
.rc-name { font-weight: 600; font-size: 13px; }
.rc-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.seg { display: flex; gap: 7px; }
.seg button { flex: 1; height: 38px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Generator ---------- */
.gen-wrap { max-width: 620px; }
.gen-display { display: flex; align-items: center; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 18px; }
.gen-pass { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 21px; font-weight: 500; word-break: break-all; color: var(--ink); }
.slider { width: 100%; accent-color: var(--accent); height: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.toggle-row label { font-size: 13.5px; }
.switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--switch-off); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(17px); }
.strength { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.strength-bar { height: 100%; border-radius: 4px; transition: width .2s, background .2s; }

/* ---------- Members ---------- */
.avatar { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: 0 0 auto; width: 40px; height: 40px; }
.member-row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.role-pill { height: 24px; padding: 0 10px; border-radius: 7px; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.role-owner { background: var(--accent-soft); color: var(--accent-ink); }
.role-admin { background: var(--info-bg); color: var(--info-ink); }
.role-member { background: var(--line-2); color: var(--ink-2); }

/* ---------- Timeline / audit ---------- */
.timeline { position: relative; padding-left: 8px; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: -4px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: 0 0 auto; z-index: 1; }
.tl-dot .ti { font-size: 16px; }
.tl-body { padding-top: 5px; }
.tl-text { font-size: 13.5px; }
.tl-text b { font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Status pills (shares) ---------- */
.status-pill { height: 23px; padding: 0 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.st-pending { background: var(--amber-soft); color: var(--amber); }
.st-opened { background: var(--accent-soft); color: var(--accent-ink); }
.st-expired { background: var(--line-2); color: var(--ink-2); }
.st-revoked { background: var(--red-soft); color: var(--red); }

/* ---------- Table ---------- */
.tbl { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .ti { font-size: 40px; opacity: .4; }
.empty p { margin: 12px 0 0; font-size: 13.5px; }

/* ---------- Generated passphrase box ---------- */
.passbox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; }
.passbox code { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 500; color: var(--accent-ink); word-break: break-all; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    background: var(--toast-bg); color: #fff; padding: 11px 18px; border-radius: 11px; z-index: 80;
    font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
    animation: toastin .2s ease;
}
.toast .ti { color: #5fe6cf; font-size: 18px; }
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- Unlock ---------- */
.lock-screen { min-height: 100vh; display: grid; place-items: center; position: relative; background: radial-gradient(1200px 600px at 50% -10%, #1b2530 0%, #0d131b 60%); padding: 20px; }
.lock-card { width: 100%; max-width: 380px; text-align: center; }
.lock-mark { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), #14b8a6); display: grid; place-items: center; margin: 0 auto 22px; box-shadow: 0 14px 40px rgba(14,158,142,.4); }
.lock-mark .ti { font-size: 34px; color: #fff; }
.lock-title { color: #fff; font-size: 22px; font-weight: 600; }
.lock-sub { color: #8290a0; font-size: 13.5px; margin-top: 7px; margin-bottom: 28px; }
.lock-input-wrap { position: relative; }
.lock-input {
    width: 100%; height: 50px; padding: 0 16px 0 46px; border-radius: 12px;
    border: 1px solid #2a3543; background: #161e28; color: #fff; font-family: var(--font);
    font-size: 15px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.lock-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(14,158,142,.18); }
.lock-input::placeholder { color: #586677; }
.lock-input-wrap > .ti { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #586677; font-size: 19px; }
.lock-btn-main { width: 100%; height: 50px; margin-top: 14px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .12s; }
.lock-btn-main:hover { background: var(--accent-hover); }
.lock-btn-main:disabled { opacity: .45; cursor: not-allowed; }
.lock-hint { margin-top: 22px; color: #5a6a7c; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.zk-note { margin-top: 26px; padding: 13px 15px; border-radius: 12px; background: rgba(14,158,142,.1); border: 1px solid rgba(14,158,142,.22); color: #9fdccf; font-size: 11.5px; line-height: 1.55; display: flex; gap: 9px; text-align: left; }
.zk-note .ti { color: var(--accent); font-size: 17px; flex: 0 0 auto; margin-top: 1px; }

/* ---------- Blazor boot / error ---------- */
.loading-progress { position: relative; display: block; width: 7rem; height: 7rem; margin: 28vh auto 1rem; }
.loading-progress circle { fill: none; stroke: var(--line); stroke-width: .5rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: var(--accent); stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * .8), 500%; transition: stroke-dasharray .05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: 500; color: var(--ink-2); inset: calc(28vh + 2.9rem) 0 auto; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, "Cargando"); }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--amber-soft); color: var(--amber-ink); padding: 11px 18px; font-size: 13px;
    box-shadow: 0 -2px 12px rgba(20,30,45,.08);
}
#blazor-error-ui .reload { font-weight: 600; text-decoration: underline; margin-left: 6px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; font-weight: 600; }

/* ---------- Empresas ---------- */
.empresa-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.empresa-mini { display: inline-flex; align-items: center; gap: 5px; }

.empresa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.empresa-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .04s;
    display: flex; flex-direction: column; gap: 12px;
}
.empresa-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.empresa-card:active { transform: translateY(1px); }
.empresa-notas { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.empresa-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.empresa-foot .avatar-stack { margin-left: auto; }

.avatar-stack { display: flex; }
.avatar-xs { width: 24px; height: 24px; font-size: 9.5px; border: 2px solid var(--surface); }
.avatar-stack .avatar-xs:not(:first-child) { margin-left: -7px; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2);
    font-size: 13px; font-weight: 500; margin-bottom: 14px;
}
.back-link:hover { color: var(--ink); }
.back-link .ti { font-size: 16px; }

.empresa-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    font-size: 12.5px; color: var(--ink-2);
}
.stat-chip b { color: var(--ink); }
.stat-chip .ti { font-size: 16px; }

.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }

.acceso-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }

@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .field-row, .meta-grid, .type-grid { grid-template-columns: 1fr; }
    .empresa-grid { grid-template-columns: 1fr; }
}

/* ---------- Seguridad ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.sec-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.sec-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.sec-head .ti { font-size: 18px; color: var(--accent-ink); }
.sec-text { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.lock-secondary { background: none; border: none; color: var(--side-ink-2, #93a0ad); font-size: 12.5px; cursor: pointer; margin-top: 10px; width: 100%; }
.lock-secondary:hover { color: var(--side-ink, #e8edf2); }


/* ---------- Powered by Asysa ---------- */
.pie-asysa { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 6px 2px; border-top: 1px solid var(--side-line); margin-top: 12px; }
.pie-asysa-texto { font-size: 9px; font-weight: 500; letter-spacing: 1.4px; color: var(--side-ink-2); text-transform: uppercase; }
.pie-asysa-logo { height: 14px; object-fit: contain; opacity: .72; }
.pie-asysa:hover .pie-asysa-logo { opacity: .95; }

.lock-powered { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: .6; }
.lock-powered span { font-size: 9.5px; font-weight: 500; letter-spacing: 1.4px; color: #5a6a7c; text-transform: uppercase; }
.lock-powered img { height: 14px; }

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
    --bg: #0b1118;
    --surface: #131a24;
    --surface-2: #19212d;
    --ink: #e6ecf3;
    --ink-2: #9aa6b4;
    --ink-3: #6a7686;
    --line: #242e3b;
    --line-2: #1b232f;
    --accent: #15b9a6;
    --accent-ink: #5fe0cf;
    --accent-hover: #0e9e8e;
    --accent-soft: rgba(21,185,166,.15);
    --amber: #e0a44a;
    --amber-ink: #e8be7c;
    --amber-soft: rgba(224,164,74,.15);
    --red: #e9776a;
    --red-ink: #f1a59b;
    --red-soft: rgba(233,119,106,.15);
    --blue: #5b9bf7;
    --info-bg: rgba(91,155,247,.15);
    --info-ink: #93bcfb;
    --purple-bg: rgba(150,120,255,.16);
    --purple-ink: #c2b1ff;
    --purple-ink-2: #c2b1ff;
    --switch-off: #38424f;
    --border-hover: #313c4a;
    --toast-bg: #27313f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
    color-scheme: dark;
}
[data-theme="dark"] .chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Selección múltiple ---------- */
.row-check {
    width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line);
    display: grid; place-items: center; flex: 0 0 auto; color: #fff;
    transition: background .12s, border-color .12s;
}
.row-check.on { background: var(--accent); border-color: var(--accent); }
.row-check .ti { font-size: 15px; }
.vault-row.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.select-bar {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70;
    display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px;
    background: var(--toast-bg); color: #fff; border-radius: 13px; box-shadow: var(--shadow-lg);
    animation: toastin .2s ease;
}
.select-count { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.select-count .ti { font-size: 18px; color: #5fe6cf; }
.select-bar .btn { height: 34px; }

/* badge "sin clave" (pendiente de cargar/rotar) */
.nokey-pill { background: var(--amber-soft); color: var(--amber-ink); }

/* ---------- Importador ---------- */
.import-area { width: 100%; min-height: 200px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.5; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); resize: vertical; outline: none; }
.import-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.import-prog { height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 10px 0; }
.import-prog > div { height: 100%; background: var(--accent); transition: width .15s; }

/* ---------- Login con Google ---------- */
.google-btn-wrap { display: flex; justify-content: center; margin: 6px 0 4px; min-height: 44px; }
.lock-divider { display: flex; align-items: center; gap: 12px; color: #5a6a7c; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 18px; }
.lock-divider::before, .lock-divider::after { content: ""; flex: 1; height: 1px; background: #2a3543; }

/* editor de plantillas de correo */
.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }
.tpl-preview { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.lock-error { color: var(--red); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }

/* tabla de previsualización del importador */
.scroll-x { overflow-x: auto; max-width: 100%; }
.scroll-x .tbl { min-width: 760px; }
