:root {
  --navy: #152C5C; --navy-700: #1d3a75; --navy-50: #eef2f9; --navy-100: #dbe3f1; --navy-200: #b9c8e2;
  --magenta: #DB1053; --magenta-50: #fdecf2; --magenta-100: #f9d0de;
  --blue: #0C71C3; --blue-50: #e8f2fb;
  --sage: #3f8a5c; --sage-50: #e9f5ee; --sage-100: #cfe9d9;
  --gold: #b7791f; --gold-50: #fdf5e6; --gold-100: #f8e4bd;
  --red: #c0392b; --red-50: #fdecea; --red-100: #f7cdc8;
  --ink: #1b2230; --muted: #5d6676; --soft: #8a93a3;
  --line: #e4e8ef; --bg: #f4f6fa; --card: #ffffff;
  --shadow: 0 1px 3px rgba(21,44,92,.06), 0 1px 2px rgba(21,44,92,.04);
  --lift: 0 18px 40px -16px rgba(21,44,92,.35);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Open Sans", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .display { font-family: "Montserrat", system-ui, sans-serif; letter-spacing: -.01em; margin: 0; }
a { color: var(--blue); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* Splash */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: linear-gradient(135deg, #f7f9fd, #e9eef8 55%, #dfe6f4); overflow: hidden; transition: opacity .45s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; }
.blob-a { width: 420px; height: 420px; background: #f6b9cd; top: -120px; right: -100px; }
.blob-b { width: 480px; height: 480px; background: #a9c3ec; bottom: -160px; left: -120px; }
.splash-logo { position: relative; display: flex; flex-direction: column; align-items: center; animation: scaleIn .5s ease; }
.logo-mark { font-family: Montserrat; font-weight: 800; font-size: 72px; color: var(--navy); letter-spacing: .02em; line-height: 1; }
.logo-mark::after { content: ""; display: block; height: 6px; width: 56%; margin: 8px auto 0; border-radius: 6px; background: var(--magenta); }
.logo-sub { margin-top: 12px; font-family: Montserrat; font-weight: 600; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.dots { display: flex; gap: 8px; position: relative; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--navy); animation: pulse 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; background: var(--magenta); }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1); opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Login */
.login { min-height: 100vh; display: flex; }
.login-brand { position: relative; overflow: hidden; flex: 1; display: none; background: linear-gradient(150deg, var(--navy) 0%, #20407f 60%, #2a4f96 100%); color: #fff; padding: 56px; flex-direction: column; justify-content: space-between; }
.login-brand .blob-a { background: var(--magenta); opacity: .35; }
.login-brand .blob-b { background: #4f86d8; opacity: .35; }
.login-brand .logo-mark { color: #fff; font-size: 56px; }
.login-brand h2 { font-size: 30px; line-height: 1.2; max-width: 460px; position: relative; }
.login-brand p { color: #c9d5ee; max-width: 440px; position: relative; }
.login-brand ul { position: relative; padding: 0; list-style: none; display: grid; gap: 10px; color: #dfe7f7; }
.login-brand li::before { content: "●"; color: var(--magenta); margin-right: 10px; font-size: 10px; vertical-align: 2px; }
.login-form { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 32px 16px; }
.login-box { width: 100%; max-width: 440px; animation: slideUp .4s ease; }
.login-box h1 { font-size: 26px; margin-bottom: 6px; }
.login-box .sub { color: var(--muted); margin-bottom: 22px; }
.user-pick { display: grid; gap: 8px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.user-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; transition: .15s; }
.user-opt:hover { border-color: var(--navy-200); background: var(--navy-50); }
.user-opt.sel { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-100); }
.user-opt .who { flex: 1; }
.user-opt .who b { display: block; font-weight: 600; }
.user-opt .who span { color: var(--muted); font-size: 12px; }
@media (min-width: 980px) { .login-brand { display: flex; } }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--navy); color: #cdd7ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar .brand { padding: 20px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand .logo-mark { font-size: 30px; color: #fff; }
.sidebar .brand .logo-mark::after { height: 3px; margin-top: 4px; width: 48px; margin-left: 0; }
.sidebar .brand small { display: block; color: #8fa3cc; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; font-family: Montserrat; font-weight: 600; }
.nav { padding: 14px 10px; display: grid; gap: 2px; overflow: auto; flex: 1; align-content: start; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #7d90b8; padding: 14px 12px 6px; font-family: Montserrat; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cdd7ec; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--magenta); }
.nav a .count { margin-left: auto; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.sidebar .foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #8fa3cc; }
.sidebar .foot b { color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.topbar .search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--soft); }
.topbar .spacer { flex: 1; }
.demo-pill { background: var(--gold-50); color: var(--gold); border: 1px solid var(--gold-100); border-radius: 20px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 30px; border: 1px solid var(--line); background: #fff; position: relative; }
.me .meta { line-height: 1.15; }
.me .meta b { font-size: 13px; display: block; }
.me .meta span { font-size: 11.5px; color: var(--muted); }
.menu-btn { display: none; background: none; border: 0; padding: 6px; }
.content { padding: 24px; max-width: 1480px; width: 100%; animation: fadeIn .25s ease; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12px; color: var(--soft); margin-bottom: 4px; }
.crumbs a { color: var(--soft); }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--lift); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .me .meta, .demo-pill { display: none; }
}
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 25; }

/* Components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head .hint { color: var(--soft); font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 8px 14px; border: 1px solid transparent; font-weight: 600; font-size: 13px; transition: .15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-accent { background: var(--magenta); color: #fff; }
.btn-accent:hover { filter: brightness(.94); }
.btn-success { background: var(--sage); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red-100); }
.btn-danger:hover { background: var(--red-50); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--navy-50); border-color: var(--navy-100); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--navy-50); color: var(--ink); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.input, .select, .textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; transition: .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-200); box-shadow: 0 0 0 3px var(--navy-50); }
.textarea { min-height: 84px; resize: vertical; }
.label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; font-family: Montserrat; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field .err { color: var(--red); font-size: 12px; margin-top: 4px; }
.input.bad { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.sit .r .badge { white-space: normal; text-align: right; }
.card-head { flex-wrap: wrap; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.b { font-weight: 700; }
.right { text-align: right; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; white-space: nowrap; border: 1px solid transparent; }
.b-navy { background: var(--navy-50); color: var(--navy); border-color: var(--navy-100); }
.b-blue { background: var(--blue-50); color: var(--blue); }
.b-mag { background: var(--magenta-50); color: var(--magenta); }
.b-green { background: var(--sage-50); color: var(--sage); }
.b-gold { background: var(--gold-50); color: var(--gold); }
.b-red { background: var(--red-50); color: var(--red); }
.b-gray { background: #f0f2f5; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 11.5px; font-family: Montserrat; flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; font-family: Montserrat; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td:first-child > b, .t td:first-child > a { white-space: nowrap; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: #f8faff; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t input.input, .t select.select { padding: 6px 8px; }
.t tfoot td { background: #fafbfd; font-weight: 600; }

/* KPI */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .k-val { font-family: Montserrat; font-weight: 700; font-size: 28px; margin-top: 4px; letter-spacing: -.02em; }
.kpi .k-foot { font-size: 12px; color: var(--soft); margin-top: 2px; }
.kpi .k-ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.kpi .k-ico svg { width: 18px; height: 18px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.bar-track { height: 10px; background: #eef1f6; border-radius: 10px; overflow: hidden; display: flex; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 10px; }
.bar-row .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* Expediente */
.exp-head { padding: 18px 20px; display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.exp-head h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exp-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.exp-meta div { font-size: 12px; color: var(--muted); }
.exp-meta b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 14px 20px 16px; border-top: 1px solid var(--line); scrollbar-width: thin; }
.step { flex: 1 0 86px; min-width: 86px; position: relative; text-align: center; font-size: 10.5px; color: var(--soft); padding-top: 22px; line-height: 1.2; }
.step::before { content: ""; position: absolute; top: 8px; left: -50%; right: 50%; height: 3px; background: #e5e9f0; }
.step:first-child::before { display: none; }
.step .c { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid #d6dce6; z-index: 1; }
.step.done { color: var(--muted); }
.step.done::before, .step.cur::before { background: var(--navy); }
.step.done .c { background: var(--navy); border-color: var(--navy); }
.step.cur { color: var(--ink); font-weight: 700; }
.step.cur .c { border-color: var(--magenta); background: #fff; box-shadow: 0 0 0 4px var(--magenta-50); }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 0 12px; scrollbar-width: thin; }
.tabs a { padding: 12px 12px 11px; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--navy); border-bottom-color: var(--magenta); }
.tabs a .n { background: #eef1f6; color: var(--muted); border-radius: 10px; font-size: 10.5px; padding: 0 6px; }
.tabs a .n.warn { background: var(--red-50); color: var(--red); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px; }
.kv div span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); font-weight: 700; font-family: Montserrat; }
.kv div b { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.sit { display: grid; gap: 8px; }
.sit .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sit .r:last-child { border-bottom: 0; }
.timeline { position: relative; display: grid; gap: 14px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-200); }
.tl.hl::before { border-color: var(--magenta); }
.tl .when { font-size: 11.5px; color: var(--soft); }
.tl .what { font-weight: 600; }
.tl .det { color: var(--muted); font-size: 12.5px; }
.diff { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; margin-top: 3px; }
.diff .old { text-decoration: line-through; color: var(--red); }
.diff .new { color: var(--sage); font-weight: 600; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert.info { background: var(--blue-50); border-color: #cfe3f6; color: #0b4f8a; }
.alert.warn { background: var(--gold-50); border-color: var(--gold-100); color: #7a4f0f; }
.alert.err { background: var(--red-50); border-color: var(--red-100); color: #8f2a1f; }
.alert.ok { background: var(--sage-50); border-color: var(--sage-100); color: #276242; }
.alert b { display: block; }
.empty { text-align: center; padding: 36px 16px; color: var(--soft); }
.checklist { display: grid; gap: 8px; }
.chk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.chk .ic { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-size: 12px; font-weight: 800; }
.chk.ok .ic { background: var(--sage); }
.chk.no .ic { background: var(--red); }
.chk.no { background: #fffafa; border-color: var(--red-100); }
.chk .tx { flex: 1; }
.chk .tx small { display: block; color: var(--muted); }
.totals { display: grid; gap: 6px; min-width: 300px; }
.totals .r { display: flex; justify-content: space-between; gap: 20px; font-variant-numeric: tabular-nums; }
.totals .r.big { font-family: Montserrat; font-weight: 700; font-size: 18px; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.totals .neg { color: var(--red); }
.chat { background: #efeae2; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow: auto; }
.msg { max-width: 78%; padding: 7px 10px 18px; border-radius: 10px; position: relative; font-size: 13px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg.rvl { align-self: flex-end; background: #d9fdd3; }
.msg.aseg { align-self: flex-start; background: #fff; }
.msg small { position: absolute; right: 8px; bottom: 3px; font-size: 10px; color: #667781; }
.doc-ico { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; flex-shrink: 0; font-family: Montserrat; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 6px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.prog > div { height: 100%; background: var(--sage); }
.plazo { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }

/* Modal */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; animation: fadeIn .18s ease; }
.modal { width: 100%; max-width: 560px; background: #fff; border-radius: 16px; box-shadow: var(--lift); overflow: hidden; animation: scaleIn .2s ease; }
.modal.wide { max-width: 860px; }
.modal-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head.danger { background: var(--red-50); border-bottom-color: var(--red-100); }
.modal-head.danger h3 { color: var(--red); }
.modal-head.warn { background: var(--gold-50); border-bottom-color: var(--gold-100); }
.modal-head.ok { background: var(--sage-50); border-bottom-color: var(--sage-100); }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; max-height: 68vh; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfd; flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--soft); padding: 2px 6px; border-radius: 6px; }
.x:hover { background: rgba(0,0,0,.05); }
.doc-preview { border: 1px solid var(--line); border-radius: 10px; padding: 34px 40px; background: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 13.5px; line-height: 1.6; box-shadow: inset 0 0 0 6px #f6f7fa; }
.doc-preview h2 { font-family: Georgia, serif; font-size: 17px; text-align: center; margin: 8px 0 16px; letter-spacing: .02em; }
.doc-preview .lh { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin-bottom: 10px; }
.doc-preview .lh b { font-family: Montserrat; color: var(--navy); font-size: 20px; }
.doc-preview mark { background: #fff2b3; padding: 0 2px; }
.dup-card { border: 1px solid var(--gold-100); background: var(--gold-50); border-radius: 12px; padding: 12px 14px; }

/* Toast */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--lift); font-size: 13px; display: flex; gap: 10px; align-items: center; animation: slideUp .25s ease; max-width: 380px; }
.toast.ok { background: #1f6b45; }
.toast.err { background: #9b2c21; }
.toast .spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pequeños */
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.dropdown { position: relative; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--lift); min-width: 260px; padding: 6px; z-index: 40; animation: scaleIn .15s ease; }
.dd-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; background: none; border: 0; border-radius: 8px; text-align: left; color: var(--ink); }
.dd-menu button:hover { background: var(--navy-50); }
.dd-menu button svg { width: 16px; height: 16px; color: var(--muted); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.dd-menu .dd-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--soft); padding: 6px 10px 2px; font-weight: 700; font-family: Montserrat; }
.integr { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.integr .lg { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: #fff; font-family: Montserrat; }
.integr .grow { flex: 1; }
.integr .grow small { display: block; color: var(--muted); font-size: 11.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--sage-50); }
.tour { background: linear-gradient(120deg, var(--navy), #2a4f96); color: #fff; border-radius: var(--radius); padding: 18px 22px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.tour::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: var(--magenta); opacity: .25; filter: blur(30px); }
.tour h3 { font-size: 17px; }
.tour p { margin: 4px 0 0; color: #c9d5ee; max-width: 760px; }
.tour .steps { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.tour .btn-outline { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.tour .btn-outline:hover { background: rgba(255,255,255,.2); }
