/* Acceso Cosmocar */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #e8efff;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --radius: 12px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --side-bg: #12357f;
  --side-bg-2: #0e2a66;
  --side-text: #e8eeff;
  --side-muted: #a9b9e6;
  --side-hover: rgba(255, 255, 255, .08);
  --side-active: rgba(255, 255, 255, .16);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --surface-2: #0f172a;
    --border: #23304a;
    --text: #e5ebf5;
    --muted: #93a1b8;
    --primary: #4f7cff;
    --primary-hover: #6b91ff;
    --primary-soft: #18264a;
    --danger: #f26b6b;
    --danger-soft: #3a1820;
    --ok: #4ade80;
    --ok-soft: #12301f;
    --warn: #fbbf24;
    --warn-soft: #33270e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
    --side-bg: #0f1d3d;
    --side-bg-2: #0b1630;
    --side-text: #e5ebf5;
    --side-muted: #8fa2c7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
a { color: var(--primary); }
p { margin: 0 0 .5rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; margin: 16px 0; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.pad { padding: 0 16px; }
.boot, .noscript { padding: 40px; text-align: center; color: var(--muted); }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-lg { width: 40px; height: 40px; stroke-width: 1.5; color: var(--muted); }

/* ───── Botones ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.92); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; }
.btn-link { background: none; border: none; color: var(--muted); font-weight: 400; }
.btn-link:hover { background: none; color: var(--text); text-decoration: underline; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border-radius: 8px; border: none; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn-sm { width: 26px; height: 26px; }
.icon-btn-sm .icon { width: 15px; height: 15px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn.spin .icon { animation: spin .8s linear infinite; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 24px 0; }

/* ───── Formularios ───── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; min-width: 0;
}
textarea { resize: vertical; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--primary); }
input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; flex: none; margin: 2px 0 0; }
.input-wrap { position: relative; display: flex; }
.input-wrap input { padding-right: 42px; }
.in-input { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.input-group { display: flex; gap: 4px; align-items: center; }
.input-group + .input-group { margin-top: 6px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check-sm { font-size: .8rem; align-items: center; white-space: nowrap; }
.checks { display: grid; gap: 8px; }
.code-input { font-family: var(--mono); font-size: 1.4rem !important; letter-spacing: .35em; text-align: center; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 9px 12px; border-radius: 9px; font-size: .9rem; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.custom-field { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }

.meter { display: flex; align-items: center; gap: 10px; margin-top: -6px; }
.meter-track { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.meter-bar { height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }
.meter-bar[data-w="1"] { width: 20%; } .meter-bar[data-w="2"] { width: 40%; } .meter-bar[data-w="3"] { width: 60%; }
.meter-bar[data-w="4"] { width: 80%; } .meter-bar[data-w="5"] { width: 100%; }
.meter-bar.s0, .meter-bar.s1 { background: var(--danger); } .meter-bar.s2 { background: var(--warn); }
.meter-bar.s3, .meter-bar.s4 { background: var(--ok); }
.meter-label { font-size: .8rem; color: var(--muted); min-width: 80px; text-align: right; }

.pill { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; }
.pill:empty { display: none; }
.pill.s0, .pill.s1 { background: var(--danger-soft); color: var(--danger); }
.pill.s2 { background: var(--warn-soft); color: var(--warn); }
.pill.s3, .pill.s4 { background: var(--ok-soft); color: var(--ok); }

.segmented { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: none; background: none; padding: 7px 10px; border-radius: 7px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

.callout { background: var(--primary-soft); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout-warn { background: var(--warn-soft); color: var(--text); }
.callout-info { margin-bottom: 14px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
.tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; }
.secret { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .06em; flex: 1; word-break: break-all; }
.link-code { font-family: var(--mono); font-size: .8rem; flex: 1; word-break: break-all; }
.fingerprint { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .05em; background: var(--surface); border-radius: 8px; padding: 8px 10px; margin: 6px 0; word-spacing: .2em; border: 1px solid var(--border); }

/* ───── Pantallas de acceso ───── */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.auth-app { font-weight: 700; font-size: 1.1rem; }
.auth-foot { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .82rem; text-align: center; }
.locked-user { display: flex; gap: 8px; align-items: center; background: var(--surface-2); padding: 10px 12px; border-radius: 9px; font-weight: 500; }

/* ───── Estructura principal ───── */
.layout { height: 100%; display: flex; }
.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search-input { padding-left: 36px !important; background: var(--surface-2) !important; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.user-menu { position: relative; }
.user-btn { border: none; background: none; padding: 2px; cursor: pointer; border-radius: 50%; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: 6px; z-index: 30; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border: none; background: none; color: var(--text); font: inherit; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--surface-2); }

.shell { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 264px; flex: none; background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2)); color: var(--side-text); display: flex; flex-direction: column; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.side-brand img { border-radius: 9px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.side-brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; }
.side-brand-sub { font-size: .75rem; color: var(--side-muted); }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: none; background: none; color: var(--side-text); font: inherit; font-size: .92rem; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--side-hover); }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #fff; }
.nav-item .icon { color: var(--side-muted); }
.nav-item.active .icon { color: #fff; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: .75rem; color: var(--side-text); background: rgba(255, 255, 255, .12); border-radius: 99px; padding: 0 7px; }
.nav-title { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--side-muted); padding: 16px 10px 4px; }
.nav-title .icon-btn { color: var(--side-muted); }
.nav-title .icon-btn:hover { color: #fff; background: var(--side-hover); }
.nav-empty { font-size: .82rem; color: var(--side-muted); padding: 4px 10px; }
.nav-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px; color: var(--side-muted); font-size: .78rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.emoji { width: 18px; text-align: center; flex: none; font-size: 1rem; line-height: 1; }
.emoji.big { font-size: 1.5rem; width: 32px; }
.ro .icon { width: 14px; height: 14px; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; overflow: hidden; display: flex; }

/* ───── Bóveda ───── */
.vault { flex: 1; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; min-width: 0; }
.list-pane { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.list-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 18px 16px 10px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.list-head h1 { font-size: 1.15rem; }
.item-list { list-style: none; margin: 0; padding: 0 8px 16px; }
.item-list li { position: relative; }
.item-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 44px 10px 10px; border: none; background: none; color: var(--text); font: inherit; text-align: left; border-radius: 10px; cursor: pointer; }
.item-row:hover { background: var(--surface-2); }
.item-row.active { background: var(--primary-soft); }
.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0; }
.item-list li:hover .row-action, .row-action:focus-visible { opacity: 1; }
@media (hover: none) { .row-action { opacity: 1; } }

.avatar { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; font-size: 1rem; }
.avatar.sm { width: 32px; height: 32px; border-radius: 50%; font-size: .9rem; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.4rem; }
.hue-0 { background: #2563eb; } .hue-1 { background: #7c3aed; } .hue-2 { background: #db2777; } .hue-3 { background: #dc2626; }
.hue-4 { background: #ea580c; } .hue-5 { background: #ca8a04; } .hue-6 { background: #16a34a; } .hue-7 { background: #0d9488; }
.hue-8 { background: #0891b2; } .hue-9 { background: #4f46e5; } .hue-10 { background: #9333ea; } .hue-11 { background: #475569; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip-sm { font-size: .72rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.chip-accent { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.detail-pane { overflow-y: auto; min-width: 0; }
.detail { max-width: 760px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.detail-title h2 { font-size: 1.3rem; word-break: break-word; }
.detail-actions { display: flex; gap: 6px; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.detail > .card:not(.rows) { padding: 14px 16px; }
.rows .row { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); }
.rows .row:last-child { border-bottom: none; }
.history .row { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-top: 1px solid var(--border); }
.row-main { flex: 1; min-width: 0; }
.row-label { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-value { word-break: break-all; }
.row-value.masked { letter-spacing: .1em; color: var(--muted); }
.totp-line { display: flex; align-items: center; gap: 10px; }
.totp { font-size: 1.3rem; font-weight: 600; letter-spacing: .08em; color: var(--primary); }
.totp-timer { font-size: .78rem; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; min-width: 38px; text-align: center; }
.totp-timer.warn { color: var(--danger); background: var(--danger-soft); }
.notes { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.history summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.meta { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.detail-empty { height: 100%; }

/* ───── Páginas ───── */
.page { flex: 1; overflow-y: auto; padding: 24px; }
.page > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.page.narrow > * { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; }
.cards { display: grid; gap: 12px; }
.user-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.user-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.user-id { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.user-facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.user-facts span { display: inline-flex; gap: 5px; align-items: center; }
.user-facts .icon { width: 15px; height: 15px; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.manage-list { display: flex; flex-direction: column; gap: 6px; }
.manage-item { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.manage-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.manage-item.danger strong { color: var(--danger); }
.manage-item.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.access-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; }
.access-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.access-row:last-child { border-bottom: none; }
.mode-select { width: auto; min-width: 140px; }
.mode-select.mode-read { border-color: var(--warn); }
.mode-select.mode-write { border-color: var(--ok); }
.table-card { overflow: hidden; }
.col-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.col-row:last-child { border-bottom: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emoji-grid button { font-size: 1.3rem; height: 42px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.emoji-grid button.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr.alert td { background: var(--danger-soft); }
.section { padding: 18px 20px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.setting-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.preview { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* ───── Generador ───── */
.gen-box { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 14px; }
.gen-output { flex: 1; font-size: 1.1rem; word-break: break-all; }
.gen-output.gen-big { font-size: 1.45rem; padding: 6px 0; }
.gen-history .row { display: flex; align-items: center; gap: 4px; padding: 6px 0; border-top: 1px solid var(--border); }

/* ───── Informes ───── */
.health { display: flex; align-items: center; gap: 18px; padding: 16px 20px; margin-bottom: 16px; }
.health-score { font-size: 2rem; font-weight: 800; min-width: 92px; text-align: center; padding: 8px 10px; border-radius: 14px; }
.health-score.ok { color: var(--ok); background: var(--ok-soft); }
.health-score.warn { color: var(--warn); background: var(--warn-soft); }
.health-score.danger { color: var(--danger); background: var(--danger-soft); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.report-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.report-card:hover { border-color: var(--primary); }
.report-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.report-icon { background: var(--side-bg); color: #fff; display: flex; align-items: center; justify-content: center; height: 76px; }
.report-icon .icon-lg { color: #fff; width: 38px; height: 38px; }
.report-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.report-body p { margin: 0; }
.report-detail { padding: 16px 18px; }
.report-detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.report-detail-head h2 { margin-right: auto; }
.report-list { padding: 0; }
.report-list .item-row { padding-right: 10px; }
.report-why { color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

/* ───── Modales y avisos ───── */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 50; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 0 20px; }
.modal-body { padding: 16px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: calc(100% - 32px); max-width: 440px; pointer-events: none; }
.toast { background: #1e293b; color: #f8fafc; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; transition: opacity .3s, transform .3s; animation: rise .2s; }
.toast-ok { background: #166534; }
.toast-error { background: #b91c1c; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ───── Móvil ───── */
.only-mobile { display: none; }
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .hide-mobile { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
  .report-why { display: none; }
  .vault { grid-template-columns: 1fr; }
  .vault.has-detail .list-pane { display: none; }
  .vault:not(.has-detail) .detail-pane { display: none; }
  .list-pane { border-right: none; }
  .detail { padding: 16px; }
  .page { padding: 16px; }
  .custom-field { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 22px 18px; }
}
