/* Comunet Clientes: mismo lenguaje visual que Comunet Tareas (navy, azul y verde agua sobre gris claro). */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --card-soft: #f9fbfd;
  --text: #142033;
  --muted: #6f7d93;
  --primary: #1769e8;
  --primary-dark: #0d4fd4;
  --primary-soft: #eaf2ff;
  --teal: #00a9a5;
  --teal-soft: #e3f6f5;
  --border: #dfe6f1;
  --border-strong: #ccd6e5;
  --success: #16875b;
  --success-soft: #e5f6ee;
  --warning: #b97408;
  --warning-soft: #fff3d8;
  --danger: #c83c43;
  --danger-soft: #ffe8ea;
  --purple: #6f4cc7;
  --purple-soft: #f1eaff;
  --side: #10243d;
  --side-2: #0c1d32;
  --side-active: #1f6ff0;
  --shadow: 0 8px 30px #152a4b12;
  --shadow-lg: 0 24px 60px #0c1d3229;
  --radius: 11px;
  --radius-lg: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- acceso ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at 20% 15%, #1b4f8f 0%, #10243e 55%, #0b1a2e 100%); }
.auth-card { width: min(100%, 420px); background: var(--card); border-radius: 22px; padding: 36px 32px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 22px; }
.auth-card h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-brand { display: flex; justify-content: center; padding-bottom: 6px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--teal)); color: #fff; font-size: 20px; font-weight: 800; box-shadow: 0 6px 16px #1769e840; }
.brand-name { font-size: 22px; }
.brand-name em { font-style: italic; font-weight: 800; color: var(--primary); }
.brand-sub { display: block; font-size: 10px; letter-spacing: .22em; font-weight: 600; color: var(--muted); text-transform: uppercase; }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 22px 14px; background: linear-gradient(180deg, var(--side), var(--side-2)); color: #c9d6e8; }
.side .brand { color: #fff; padding: 0 8px; }
.side .brand-name em { color: #6fb0ff; }
.side .brand-sub { color: #8ea3bf; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #7f93b0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); color: #c9d6e8; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: #ffffff10; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: 0 6px 18px #1f6ff04d; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #ffffff1f; font-size: 12px; text-align: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius); background: #ffffff0d; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; font-weight: 700; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who strong { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { font-size: 12px; color: #8ea3bf; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: #ffffff14; }
.icon-btn svg { width: 18px; height: 18px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: #f4f7fbe6; backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.menu-btn { display: none; color: var(--text); }
.menu-btn:hover { background: var(--primary-soft); }
.search { position: relative; flex: 1; max-width: 460px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 10px 14px 10px 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.topbar .today { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.content { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1440px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius); background: var(--card); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px #1769e83d; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-dark { background: #10243e; color: #fff; }
.btn-dark:hover { background: #0b1a2e; }
.btn-ghost { border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--card-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #ffd9dc; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); transition: border-color .15s, box-shadow .15s; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-error { padding: 10px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.select-sm { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }

/* ---------- tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.grid-2-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 28px 30px; border-radius: 20px; color: #fff; background: radial-gradient(circle at 12% 10%, #1b5bb0 0%, #10243e 60%); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, var(--teal), #14b8d4 40%, transparent 80%); }
.hero h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 6px 0 0; color: #b9c8da; }
.hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #5fd6d3; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 12px; color: var(--muted); }
.tone-blue { background: var(--primary-soft); color: var(--primary); }
.tone-teal { background: var(--teal-soft); color: var(--teal); }
.tone-green { background: var(--success-soft); color: var(--success); }
.tone-amber { background: var(--warning-soft); color: var(--warning); }
.tone-red { background: var(--danger-soft); color: var(--danger); }
.tone-purple { background: var(--purple-soft); color: var(--purple); }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--warning-soft); border: 1px solid #f3dca6; color: #7a4f06; }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--primary); }
.chart .bar.last { fill: var(--teal); }
.chart .grid { stroke: var(--border); }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar-text { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.hbar-text span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; border-radius: 999px; background: #edf1f7; margin-top: 6px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--teal)); }

/* ---------- tablas ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.toolbar .input { max-width: 300px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--card-soft); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #f6f9ff; }
.table .num { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.empty { padding: 48px 22px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.table-foot { padding: 12px 22px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.money-debt { color: var(--danger); font-weight: 600; }
.money-ok { color: var(--success); font-weight: 600; }

/* ---------- ficha ---------- */
.profile { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 24px; }
.profile .avatar { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; background: linear-gradient(135deg, var(--primary), var(--teal)); }
.profile h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.profile .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; color: var(--muted); }
.profile .balance { margin-left: auto; text-align: right; }
.profile .balance span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.profile .balance strong { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { padding: 14px 14px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 24px; padding: 22px; }
.details dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.details dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- importar ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--card-soft); text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.drop strong { color: var(--text); font-size: 16px; }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 22px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; padding: 22px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--card-soft); border: 1px solid var(--border); }
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13px; }
.step b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #edf1f7; font-size: 11px; }
.step.on { color: var(--primary); border-color: #bcd3ff; }
.step.on b { background: var(--primary); color: #fff; }

/* ---------- modal y avisos ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #0c1d3266; backdrop-filter: blur(3px); animation: fade .15s ease-out; }
.modal { width: min(100%, 640px); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-sm { width: min(100%, 440px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-head .icon-btn:hover { background: var(--card-soft); }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--card-soft); border-radius: 0 0 20px 20px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 12px 16px; border-radius: var(--radius); background: #10243e; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.toast.error { background: var(--danger); }
.loading { padding: 60px; text-align: center; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- pantallas chicas ---------- */
@media (max-width: 1100px) {
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-grid; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .topbar .today { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .profile .balance { margin-left: 0; text-align: left; }
}

/* ---------- ficha premium ---------- */
.card-profile { overflow: hidden; }
.card-profile .profile { position: relative; color: #fff; background: radial-gradient(circle at 12% 0%, #1b5bb0 0%, #10243e 62%); padding: 28px; }
.card-profile .profile::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, var(--teal), #14b8d4 40%, transparent 80%); }
.card-profile .profile .avatar { background: linear-gradient(135deg, #3d8bff, var(--teal)); box-shadow: 0 10px 24px #0008; }
.card-profile .profile .meta { color: #b9c8da; }
.card-profile .profile .code { color: #b9c8da; }
.card-profile .profile .balance span { color: #8ea3bf; }
.card-profile .profile .balance strong, .card-profile .profile .balance .money-debt, .card-profile .profile .balance .money-ok { color: #fff; }
.card-profile .profile .chip.tone-teal { background: #00a9a533; color: #7fe3e0; }
.card-profile .profile .chip.tone-green { background: #16875b40; color: #8ff0c4; }
.card-profile .profile .chip.tone-amber { background: #b9740840; color: #ffd486; }
.card-profile .profile .chip.tone-red { background: #c83c4340; color: #ffb3b7; }
.card-profile .tabs { background: var(--card); }
.card-profile .tabs button { font-size: 15px; padding: 16px 16px 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; padding: 22px 22px 6px; }
.tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, var(--card), var(--card-soft)); min-width: 0; }
.tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.tile-value { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.tile-value:has(.code-lg) { overflow-x: auto; }
.code-lg { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; font-weight: 600; white-space: nowrap; }
.link-btn { all: unset; display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 12px; font-weight: 600; cursor: pointer; }
.link-btn svg { width: 14px; height: 14px; }
.link-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 22px; }
.hint-line { margin: 0; padding: 0 22px 16px; color: var(--muted); font-size: 13px; }
.diag { margin: 0 22px 18px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-soft); display: flex; flex-direction: column; gap: 12px; }
.diag-head { display: flex; justify-content: space-between; align-items: center; }
.diag-row, .timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.dot.ok { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.timeline { display: grid; gap: 12px; margin-top: 8px; }
.card-profile .details { border-top: 1px solid var(--border); }
@media (max-width: 860px) { .tiles { padding: 16px 16px 4px; } .action-bar, .hint-line { padding-left: 16px; padding-right: 16px; } .diag { margin: 0 16px 16px; } }

/* ---------- perfil con tarjetas y menú de acciones ---------- */
.quick-bar { border-bottom: 0; border-top: 1px solid var(--border); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; padding: 22px; background: var(--bg); }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 2px 10px #152a4b0a; display: flex; flex-direction: column; min-width: 0; }
.info-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.info-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.info-card-head .info-edit { color: var(--muted); border: 1px solid var(--border); }
.info-card-head .info-edit:hover { background: var(--primary-soft); color: var(--primary); }
.info-card-body { display: flex; flex-direction: column; padding: 6px 18px 16px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); flex: none; }
.kv strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.kv-big strong { font-size: 20px; font-weight: 800; }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.action-list { gap: 8px; }
.action-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.action-item svg { width: 18px; height: 18px; flex: none; }
.action-item span { flex: 1; text-align: left; white-space: nowrap; }
.action-item > span:first-child { flex: none; }
.action-item small { color: var(--muted); font-weight: 500; font-size: 12px; text-align: right; max-width: 45%; }
.action-item:hover { transform: translateX(2px); border-color: var(--border-strong); background: var(--card-soft); }
.action-item.good { color: var(--success); }
.action-item.good:hover { background: var(--success-soft); }
.action-item.warn { color: var(--warning); }
.action-item.warn:hover { background: var(--warning-soft); }
.action-item.bad { color: var(--danger); }
.action-item.bad:hover { background: var(--danger-soft); }
.action-item[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
@media (max-width: 860px) { .info-grid { padding: 16px; grid-template-columns: 1fr; } }

/* ---------- inicio ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stat-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 26px 28px; border-radius: 20px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s; }
.stat-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: currentColor; }
.stat-card.tone-blue::before { background: var(--primary); }
.stat-card.tone-green::before { background: var(--success); }
.stat-card.tone-amber::before { background: var(--warning); }
.stat-card { background: var(--card); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stat-card-top .kpi-icon { width: 44px; height: 44px; border-radius: 14px; }
.stat-card-top .kpi-icon svg { width: 22px; height: 22px; }
.stat-card-value { font-size: 56px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-card.tone-green .stat-card-value { color: var(--success); }
.stat-card.tone-amber .stat-card-value { color: var(--warning); }
.stat-card-note { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.stat-card-note span:last-child { color: var(--primary); font-weight: 600; }
@media (max-width: 900px) { .stat-cards { grid-template-columns: 1fr; } .stat-card-value { font-size: 44px; } }

.stat-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card.tone-red::before { background: var(--danger); }
.stat-card.tone-red .stat-card-value { color: var(--danger); }
.stat-cards-2 .stat-card-value { font-size: 44px; }
@media (max-width: 900px) { .stat-cards-2 { grid-template-columns: 1fr; } .stat-cards-2 .stat-card-value { font-size: 36px; } }

/* ---------- tabla de conexiones ---------- */
.conn-block { margin: 22px 22px 6px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.conn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--card-soft); }
.conn-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.conn-block .table tbody tr.clickable td { border-bottom: 0; }
.conn-block .table tbody tr.clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
@media (max-width: 860px) { .conn-block { margin: 16px 16px 4px; } }

/* ---------- menú desplegable y caja ---------- */
.nav-group { display: flex; flex-direction: column; }
.nav-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius); background: transparent; color: #c9d6e8; font-weight: 500; cursor: pointer; text-align: left; }
.nav-toggle:hover { background: #ffffff10; color: #fff; }
.nav-toggle svg { width: 18px; height: 18px; flex: none; }
.nav-toggle .chev { margin-left: auto; font-size: 12px; transition: transform .15s; }
.nav-group.open .chev { transform: rotate(180deg); }
.nav-group.has-active > .nav-toggle { color: #fff; }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid #ffffff1f; }
.nav-group.open .nav-sub { display: flex; }
.nav .nav-sub a { padding: 8px 12px; font-size: 13.5px; }
.pick-list { display: flex; flex-direction: column; gap: 4px; }
.pick-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.pick-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.pick-name { flex: 1; min-width: 0; font-weight: 600; display: flex; flex-direction: column; }
.pick-name small { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-card { overflow: hidden; }
.pay-client { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--card-soft); }
.pay-client strong { font-size: 16px; }
.pay-saldo { margin-left: auto; text-align: right; }
.pay-saldo span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pay-saldo strong { font-size: 20px; }

/* ---------- cargar pago ---------- */
.btn-lg { padding: 13px 22px; font-size: 15px; }
.pay-cash-card { padding: 0; overflow: hidden; }
.pay-cash { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 20px 24px; background: radial-gradient(circle at 10% 0%, #1b5bb0 0%, #10243e 70%); color: #fff; }
.pay-cash-item span { display: block; color: #8ea3bf; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pay-cash-item strong { font-size: 18px; font-weight: 700; }
.pay-cash-item .money-big { font-size: 26px; font-weight: 800; color: #7fe3c0; }
.pay-cash-link { margin-left: auto; background: #ffffff14; color: #fff; border-color: #ffffff33; }
.pay-search { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pay-search-row { display: flex; align-items: center; gap: 12px; padding: 4px 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--card); }
.pay-search-row:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.pay-search-row svg { width: 20px; height: 20px; color: var(--muted); }
.pay-search-input { border: 0 !important; box-shadow: none !important; font-size: 16px; padding: 12px 0 !important; max-width: none !important; }
.pay-panel { display: flex; flex-direction: column; gap: 22px; }
.pay-client-card { overflow: hidden; }
.pay-client-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--card-soft), var(--card)); }
.pay-client-head .avatar { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--teal)); }
.pay-client-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.pay-client-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; color: var(--muted); }
.pay-client-head .balance { margin-left: auto; text-align: right; }
.pay-client-head .balance span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pay-client-head .balance strong { font-size: 24px; font-weight: 800; }
.pay-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 20px 24px; }
.pay-field { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.pay-field span:not(.kpi-icon) { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pay-field strong { font-weight: 600; overflow-wrap: anywhere; }
.pay-client-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 24px 20px; }
.pay-client-actions .btn-dark { margin-left: auto; }
.pay-form-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 24px; padding: 22px 24px; }
.pay-form-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pay-amount { font-size: 30px !important; font-weight: 800; text-align: center; padding: 14px !important; font-variant-numeric: tabular-nums; }
.pay-form-side { display: flex; flex-direction: column; gap: 16px; }
.pay-summary { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pay-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pay-summary span { color: var(--muted); }
.pay-summary strong { font-variant-numeric: tabular-nums; }
.pay-summary-main { background: var(--primary-soft); border-bottom: 0 !important; }
.pay-summary-main strong { font-size: 18px; }
.pay-check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; }
.pay-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.pay-check small { display: block; color: var(--muted); font-size: 12px; }
.pay-foot { justify-content: flex-end; gap: 12px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 900px) { .pay-form-grid { grid-template-columns: 1fr; } .pay-cash-link { margin-left: 0; } }
