/* ==========================================================================
   BNF · Sistema de Recupero de Créditos — Design System
   Paleta institucional extraída de bnf.gov.py
   ========================================================================== */
:root {
  --bnf-navy: #071B82;
  --bnf-navy-900: #050F4F;
  --bnf-royal: #1338B5;
  --bnf-blue: #4272F8;
  --bnf-sky: #B4D4FF;
  --bnf-sky-50: #EEF4FF;
  --bnf-gold: #B37D1C;
  --bnf-gold-300: #E6C87D;
  --bnf-gold-50: #FBF4E4;
  --bnf-ink: #0F172A;
  --bnf-muted: #64748B;
  --bnf-line: #E6EAF2;
  --bnf-bg: #F4F6FB;
  --sidebar-w: 264px;
  --sidebar-w-mini: 84px;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow: 0 4px 24px -6px rgba(7, 27, 130, .12), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 50px -12px rgba(7, 27, 130, .28);

  --bs-primary: #1338B5;
  --bs-primary-rgb: 19, 56, 181;
  --bs-link-color: #1338B5;
  --bs-link-color-rgb: 19, 56, 181;
  --bs-link-hover-color: #071B82;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: #0F172A;
  --bs-body-bg: #F4F6FB;
  --bs-border-color: #E6EAF2;
  --bs-success: #0E9F6E;
  --bs-success-rgb: 14, 159, 110;
  --bs-danger: #D92D20;
  --bs-danger-rgb: 217, 45, 32;
  --bs-warning: #E8A317;
  --bs-warning-rgb: 232, 163, 23;
  --bs-info: #0EA5E9;
  --bs-info-rgb: 14, 165, 233;
  --bs-focus-ring-color: rgba(66, 114, 248, .25);
}

html { scroll-behavior: smooth; }
body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; font-size: .925rem; }
.fw-semibold { font-weight: 600 !important; }
.text-muted, .text-secondary { color: var(--bnf-muted) !important; }
.small-caps { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--bnf-muted); }
.tabular { font-variant-numeric: tabular-nums; }
a { text-decoration: none; }

/* ---------- Botones ---------- */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: .005em; padding: .5rem 1rem; transition: all .15s ease; }
.btn-sm { border-radius: 8px; padding: .35rem .7rem; font-size: .8rem; }
.btn-lg { border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--bnf-royal); --bs-btn-border-color: var(--bnf-royal); --bs-btn-hover-bg: var(--bnf-navy);
  --bs-btn-hover-border-color: var(--bnf-navy); --bs-btn-active-bg: var(--bnf-navy-900); --bs-btn-disabled-bg: var(--bnf-royal);
  box-shadow: 0 4px 14px -4px rgba(19, 56, 181, .5); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(19, 56, 181, .55); }
.btn-gold { background: linear-gradient(135deg, #C9952F, var(--bnf-gold)); color: #fff; border: 0; box-shadow: 0 4px 14px -4px rgba(179, 125, 28, .55); }
.btn-gold:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--bnf-line); --bs-btn-hover-bg: var(--bnf-sky-50); --bs-btn-hover-border-color: var(--bnf-sky); color: var(--bnf-ink); }
.btn-soft { background: var(--bnf-sky-50); color: var(--bnf-royal); border: 1px solid transparent; }
.btn-soft:hover { background: #DCE8FF; color: var(--bnf-navy); }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-success { --bs-btn-bg: #0E9F6E; --bs-btn-border-color: #0E9F6E; --bs-btn-hover-bg: #0B8A5F; --bs-btn-hover-border-color: #0B8A5F; }
.btn-outline-primary { --bs-btn-color: var(--bnf-royal); --bs-btn-border-color: #C7D6FB; --bs-btn-hover-bg: var(--bnf-royal); --bs-btn-hover-border-color: var(--bnf-royal); }

/* ---------- Formularios ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #DCE2EE; padding: .55rem .85rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--bnf-blue); box-shadow: 0 0 0 4px rgba(66, 114, 248, .15); }
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .35rem .7rem; font-size: .82rem; }
.form-label { font-weight: 600; font-size: .8rem; color: #334155; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--bnf-royal); border-color: var(--bnf-royal); }
.input-group-text { border-radius: 10px; background: #F8FAFC; border-color: #DCE2EE; color: var(--bnf-muted); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
  background: radial-gradient(120% 60% at 0% 0%, #1338B5 0%, transparent 60%), linear-gradient(180deg, #071B82 0%, #06156A 55%, #050F4F 100%);
  color: #fff; display: flex; flex-direction: column; transition: width .2s ease, transform .25s ease;
}
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("../img/bnf-mark.png") no-repeat right -60px bottom -40px / 260px; opacity: .06; }
.sidebar-brand { padding: 1.4rem 1.4rem 1rem; display: flex; align-items: center; gap: .75rem; }
.sidebar-brand img { height: 40px; }
.sidebar-brand .brand-sub { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bnf-gold-300); font-weight: 700; line-height: 1.25; border-left: 1px solid rgba(255,255,255,.2); padding-left: .75rem; white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .85rem 1rem; position: relative; z-index: 1; }
.sidebar-nav::-webkit-scrollbar { width: 4px; } .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.nav-section { font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.42); font-weight: 700; padding: 1.1rem .8rem .45rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .8rem; color: rgba(255,255,255,.76); padding: .62rem .8rem; border-radius: 10px;
  font-weight: 500; font-size: .88rem; position: relative; transition: background .15s, color .15s; white-space: nowrap;
}
.sidebar .nav-link i { font-size: 1.12rem; width: 1.3rem; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sidebar .nav-link.active::before { content: ""; position: absolute; left: -.85rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--bnf-gold-300); }
.sidebar .nav-link .badge { margin-left: auto; font-size: .66rem; border-radius: 20px; padding: .3em .6em; }
.sidebar-footer { padding: 1rem 1.2rem 1.2rem; position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer .tag { font-size: .7rem; color: rgba(255,255,255,.55); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .2s ease; }
.topbar {
  position: sticky; top: 0; z-index: 1030; background: rgba(244, 246, 251, .82); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 234, 242, .8); padding: .8rem 1.75rem; display: flex; align-items: center; gap: 1rem;
}
.content { padding: 1.6rem 1.75rem 3rem; flex: 1; }
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--bnf-line);
  border-radius: 12px; padding: .55rem .9rem; color: var(--bnf-muted); cursor: pointer; box-shadow: var(--shadow-sm); transition: all .15s;
}
.search-trigger:hover { border-color: var(--bnf-sky); box-shadow: 0 0 0 4px rgba(66,114,248,.08); }
.kbd { font-size: .7rem; border: 1px solid var(--bnf-line); border-bottom-width: 2px; border-radius: 6px; padding: .05rem .4rem; color: var(--bnf-muted); background: #F8FAFC; margin-left: auto; font-family: inherit; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--bnf-blue), var(--bnf-navy)); flex-shrink: 0; letter-spacing: .02em; }
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: .68rem; }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.avatar-xl { width: 76px; height: 76px; border-radius: 22px; font-size: 1.6rem; }
.avatar-gold { background: linear-gradient(135deg, var(--bnf-gold-300), var(--bnf-gold)); }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #D92D20; color: #fff;
  font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #F4F6FB; }

/* Sidebar colapsado (escritorio) */
body.sb-mini .sidebar { width: var(--sidebar-w-mini); }
body.sb-mini .main { margin-left: var(--sidebar-w-mini); }
body.sb-mini .sidebar .nav-link span, body.sb-mini .sidebar .nav-link .badge, body.sb-mini .nav-section,
body.sb-mini .brand-sub, body.sb-mini .sidebar-footer .tag, body.sb-mini .brand-full { display: none !important; }
body.sb-mini .brand-mini { display: block !important; }
body.sb-mini .sidebar .nav-link { justify-content: center; }
body.sb-mini .sidebar-brand { justify-content: center; padding-inline: .5rem; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; }
  .main, body.sb-mini .main { margin-left: 0; }
  .content { padding: 1.1rem 1rem 2.5rem; }
  .topbar { padding: .7rem 1rem; }
}
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(5, 15, 79, .45); z-index: 1035; backdrop-filter: blur(2px); }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0; color: var(--bnf-ink); }
.page-head .lead-sm { color: var(--bnf-muted); margin: .25rem 0 0; font-size: .9rem; }
.breadcrumb { font-size: .78rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: #94A3B8; }
.breadcrumb a { color: var(--bnf-muted); } .breadcrumb .active { color: var(--bnf-royal); font-weight: 600; }

/* ---------- Cards ---------- */
.card { border: 1px solid rgba(230, 234, 242, .7); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
.card-header { background: transparent; border-bottom: 1px solid var(--bnf-line); padding: 1rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.card-header h2, .card-header h3, .card-title { font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .15s, box-shadow .15s; } .card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi { position: relative; overflow: hidden; padding: 1.15rem 1.25rem; height: 100%; }
.kpi .kpi-label { font-size: .78rem; color: var(--bnf-muted); font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.kpi .kpi-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; margin-top: .4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .kpi-foot { font-size: .76rem; color: var(--bnf-muted); margin-top: .45rem; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.ic-blue { background: #E8EFFF; color: var(--bnf-royal); }
.ic-gold { background: var(--bnf-gold-50); color: var(--bnf-gold); }
.ic-green { background: #E3F7EF; color: #0E9F6E; }
.ic-red { background: #FDECEA; color: #D92D20; }
.ic-amber { background: #FEF5E1; color: #C27C0E; }
.ic-violet { background: #F1EBFE; color: #7C3AED; }
.ic-cyan { background: #E0F4FD; color: #0284C7; }
.ic-slate { background: #EEF1F6; color: #475569; }

.kpi-hero {
  background: radial-gradient(90% 120% at 100% 0%, rgba(66,114,248,.55) 0%, transparent 55%), linear-gradient(135deg, #071B82 0%, #1338B5 100%);
  color: #fff; border: 0; box-shadow: var(--shadow-lg);
}
.kpi-hero .kpi-label, .kpi-hero .kpi-foot { color: rgba(255,255,255,.75); }
.kpi-hero::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 180px; height: 180px; background: url("../img/bnf-mark.png") no-repeat center/contain; opacity: .12; filter: brightness(3); }

/* ---------- Tramos / badges ---------- */
.badge-tramo { --c: #1338B5; display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 600; padding: .28rem .65rem .28rem .55rem;
  border-radius: 20px; color: var(--c); background: color-mix(in srgb, var(--c) 11%, white); white-space: nowrap; }
.badge-tramo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .28rem .6rem; border-radius: 7px; white-space: nowrap; }
.badge-soft-primary { background: #E8EFFF; color: var(--bnf-royal); }
.badge-soft-secondary { background: #EEF1F6; color: #475569; }
.badge-soft-success { background: #E3F7EF; color: #067A53; }
.badge-soft-danger { background: #FDECEA; color: #B42318; }
.badge-soft-warning { background: #FEF5E1; color: #A15C07; }
.badge-soft-info { background: #E0F4FD; color: #036796; }
.badge-soft-dark { background: #1E293B; color: #fff; }
.prio { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 600; }
.prio i { font-size: .45rem; }
.prio-danger { color: #D92D20; } .prio-warning { color: #C27C0E; } .prio-secondary { color: #94A3B8; }
.dias-chip { display: inline-block; min-width: 52px; text-align: center; font-weight: 700; font-size: .76rem; padding: .25rem .5rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.dias-ok { background: #E3F7EF; color: #067A53; }
.dias-low { background: #E8EFFF; color: var(--bnf-royal); }
.dias-mid { background: #FEF5E1; color: #A15C07; }
.dias-high { background: #FDEBD8; color: #B54708; }
.dias-crit { background: #FDECEA; color: #B42318; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; margin: 0; font-size: .86rem; }
.table > thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--bnf-muted); background: #F8FAFD;
  border-bottom: 1px solid var(--bnf-line); padding: .75rem 1rem; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: #EEF1F6; }
.table-hover > tbody > tr { transition: background .1s; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F6F9FF; }
.table .tabular, .table .mono, .table .dias-chip, .table .badge-tramo, .table .badge-soft { white-space: nowrap; }
.table .cli-name { font-weight: 600; color: var(--bnf-ink); display: block; line-height: 1.25; }
.table .cli-sub { font-size: .75rem; color: var(--bnf-muted); }
.table tr.row-link { cursor: pointer; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
th a.sort { color: inherit; } th a.sort.active { color: var(--bnf-royal); }

/* Chips de filtro */
.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 999px; border: 1px solid var(--bnf-line); background: #fff;
  font-size: .8rem; font-weight: 600; color: #334155; transition: all .15s; }
.chip:hover { border-color: var(--bnf-sky); color: var(--bnf-royal); }
.chip.active { background: var(--bnf-royal); border-color: var(--bnf-royal); color: #fff; box-shadow: 0 4px 12px -4px rgba(19,56,181,.5); }
.chip .count { background: rgba(15,23,42,.06); border-radius: 999px; padding: 0 .45rem; font-size: .7rem; }
.chip.active .count { background: rgba(255,255,255,.22); }
.chip .sw { width: 8px; height: 8px; border-radius: 50%; }

/* Barra de acciones masivas */
.bulk-bar { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 1050; background: var(--bnf-ink); color: #fff;
  border-radius: 16px; padding: .65rem .75rem .65rem 1.2rem; display: flex; align-items: center; gap: .75rem; box-shadow: var(--shadow-lg); transition: transform .25s cubic-bezier(.2,.9,.3,1.2); }
.bulk-bar.show { transform: translate(-50%, 0); }
.bulk-bar .btn { --bs-btn-color: #fff; }
.bulk-bar .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 0; }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ---------- Progreso ---------- */
.progress { border-radius: 99px; background: #EEF1F6; height: 8px; }
.progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--bnf-blue), var(--bnf-royal)); }
.progress-gold .progress-bar { background: linear-gradient(90deg, var(--bnf-gold-300), var(--bnf-gold)); }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #EEF1F6; gap: 2px; }
.stack-bar > div { height: 100%; }

/* ---------- Cliente 360 ---------- */
.c360-hero { background: linear-gradient(135deg, #071B82 0%, #1338B5 70%, #4272F8 130%); color: #fff; border-radius: 20px; padding: 1.5rem 1.6rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.c360-hero::after { content: ""; position: absolute; right: -20px; top: -30px; width: 260px; height: 260px; background: url("../img/bnf-mark.png") no-repeat center/contain; opacity: .09; filter: brightness(3); }
.c360-hero .avatar { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.c360-hero h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.c360-hero .meta { color: rgba(255,255,255,.78); font-size: .84rem; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin-top: .35rem; }
.c360-hero .meta i { opacity: .7; margin-right: .25rem; }
.c360-stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: .8rem 1rem; min-width: 140px; }
.c360-stat .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); font-weight: 600; }
.c360-stat .v { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .65rem; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; padding: .95rem .5rem; border-radius: 14px; background: #fff;
  border: 1px solid var(--bnf-line); color: var(--bnf-ink); font-weight: 600; font-size: .8rem; transition: all .15s; cursor: pointer; text-align: center; }
.qa i { font-size: 1.35rem; width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.qa:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.credit-tab { border: 1px solid var(--bnf-line); border-radius: 14px; padding: .85rem 1rem; background: #fff; display: block; color: inherit; transition: all .15s; }
.credit-tab:hover { border-color: var(--bnf-sky); }
.credit-tab.active { border-color: var(--bnf-royal); box-shadow: 0 0 0 3px rgba(19,56,181,.12); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 1.25rem; }
.dl-grid .l { font-size: .72rem; color: var(--bnf-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.dl-grid .v { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .15rem; }

.nav-tabs-modern { border: 0; gap: .25rem; background: #EDF1F8; padding: .3rem; border-radius: 12px; display: inline-flex; flex-wrap: wrap; }
.nav-tabs-modern .nav-link { border: 0; border-radius: 9px; color: #475569; font-weight: 600; font-size: .84rem; padding: .45rem .9rem; display: flex; align-items: center; gap: .4rem; }
.nav-tabs-modern .nav-link:hover { color: var(--bnf-royal); }
.nav-tabs-modern .nav-link.active { background: #fff; color: var(--bnf-royal); box-shadow: var(--shadow-sm); }
.nav-tabs-modern .nav-link .badge { background: #E2E8F0; color: #475569; font-size: .66rem; }
.nav-tabs-modern .nav-link.active .badge { background: #E8EFFF; color: var(--bnf-royal); }

/* Timeline */
.timeline { position: relative; padding-left: 2.6rem; margin: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--bnf-line), transparent); }
.timeline > li { position: relative; padding-bottom: 1.15rem; }
.timeline .t-icon { position: absolute; left: -2.6rem; top: 0; width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--bnf-line); color: var(--bnf-royal); font-size: .95rem; box-shadow: var(--shadow-sm); }
.timeline .t-title { font-weight: 600; font-size: .87rem; }
.timeline .t-meta { font-size: .74rem; color: var(--bnf-muted); }
.timeline .t-body { font-size: .84rem; color: #334155; margin-top: .2rem; }

/* ---------- Bandeja ---------- */
.task { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 14px; background: #fff; border: 1px solid var(--bnf-line); transition: all .15s; position: relative; }
.task + .task { margin-top: .6rem; }
.task:hover { box-shadow: var(--shadow); border-color: transparent; }
.task.late { border-left: 4px solid #D92D20; }
.task.prio-ALTA:not(.late) { border-left: 4px solid #E8A317; }
.task .t-ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.task .t-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--bnf-gold-300) calc(var(--p) * 1%), rgba(255,255,255,.15) 0); }
.ring > div { width: 74px; height: 74px; border-radius: 50%; background: var(--bnf-navy); display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; }
.welcome { background: radial-gradient(80% 140% at 100% 0%, rgba(66,114,248,.6), transparent 60%), linear-gradient(135deg, #071B82, #1338B5); color: #fff;
  border-radius: 20px; padding: 1.5rem 1.6rem; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.welcome h1 { font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.welcome .mini-stat { background: rgba(255,255,255,.1); border-radius: 14px; padding: .7rem 1rem; border: 1px solid rgba(255,255,255,.12); }
.welcome .mini-stat .v { font-size: 1.35rem; font-weight: 800; }
.welcome .mini-stat .l { font-size: .72rem; color: rgba(255,255,255,.72); }

/* ---------- Importación ---------- */
.dropzone { border: 2px dashed #C7D6FB; border-radius: 18px; background: linear-gradient(180deg, #F8FAFF, #fff); padding: 2.5rem 1.5rem; text-align: center; transition: all .2s; cursor: pointer; position: relative; }
.dropzone:hover, .dropzone.drag { border-color: var(--bnf-blue); background: var(--bnf-sky-50); }
.dropzone .dz-icon { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 2rem; background: #E8EFFF; color: var(--bnf-royal); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.stepper { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.stepper .step { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; color: var(--bnf-muted); }
.stepper .step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #E2E8F0; color: #475569; font-size: .75rem; }
.stepper .step.done .n { background: #0E9F6E; color: #fff; }
.stepper .step.current .n { background: var(--bnf-royal); color: #fff; box-shadow: 0 0 0 4px rgba(19,56,181,.15); }
.stepper .step.current { color: var(--bnf-ink); }
.stepper .sep { flex: 0 0 28px; height: 2px; background: #E2E8F0; border-radius: 2px; }
.flow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .78rem; }
.flow span { background: #fff; border: 1px solid var(--bnf-line); padding: .3rem .6rem; border-radius: 8px; font-weight: 600; }
.flow i { color: #94A3B8; }

/* ---------- Modal ---------- */
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--bnf-line); padding: 1.1rem 1.4rem; }
.modal-title { font-weight: 800; letter-spacing: -.01em; }
.modal-body { padding: 1.3rem 1.4rem; }
.modal-footer { border-top: 1px solid var(--bnf-line); padding: .9rem 1.4rem; }
.modal-backdrop.show { opacity: .4; }
.channel-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
@media (max-width: 575.98px) { .channel-pick { grid-template-columns: repeat(3, 1fr); } }
.channel-pick input { display: none; }
.channel-pick label { border: 1.5px solid var(--bnf-line); border-radius: 12px; padding: .65rem .3rem; text-align: center; cursor: pointer; font-size: .74rem; font-weight: 600; color: #475569; transition: all .15s; }
.channel-pick label i { display: block; font-size: 1.25rem; margin-bottom: .2rem; color: var(--c); }
.channel-pick input:checked + label { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, white); color: var(--bnf-ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.toggle-section { border: 1px solid var(--bnf-line); border-radius: 14px; padding: .85rem 1rem; background: #FAFBFE; }
.toggle-section .body { display: none; margin-top: .85rem; }
.toggle-section.on { background: #fff; border-color: #C7D6FB; }
.toggle-section.on .body { display: block; }
.msg-preview { background: #E7FFDB; border-radius: 12px 12px 12px 2px; padding: .7rem .9rem; font-size: .84rem; white-space: pre-wrap; position: relative; box-shadow: var(--shadow-sm); }

/* Command palette */
.cmdk .modal-content { overflow: hidden; }
.cmdk .cmdk-input { border: 0; font-size: 1.05rem; padding: 1.1rem 1.2rem 1.1rem 3.2rem; border-radius: 0; box-shadow: none !important; border-bottom: 1px solid var(--bnf-line); }
.cmdk .cmdk-ic { position: absolute; left: 1.2rem; top: 1.15rem; font-size: 1.15rem; color: var(--bnf-muted); }
.cmdk .res { display: flex; align-items: center; gap: .85rem; padding: .7rem 1.2rem; color: var(--bnf-ink); border-left: 3px solid transparent; }
.cmdk .res:hover, .cmdk .res.sel { background: var(--bnf-sky-50); border-left-color: var(--bnf-royal); }
.cmdk .res-empty { padding: 2rem; text-align: center; color: var(--bnf-muted); font-size: .88rem; }

/* Dropdowns */
.dropdown-menu { border: 1px solid var(--bnf-line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; font-size: .88rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--bnf-royal); }
.notif-menu { width: 380px; max-width: 92vw; padding: 0; }
.notif-item { display: flex; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid #F1F4F9; color: var(--bnf-ink); white-space: normal; }
.notif-item:hover { background: #F8FAFF; }
.notif-item .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* Toasts */
.toast-stack { position: fixed; top: 76px; right: 20px; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; max-width: 420px; }
.toast-bnf { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: .85rem 1rem; display: flex; gap: .75rem; align-items: flex-start;
  border-left: 4px solid var(--bnf-royal); animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2); font-size: .87rem; }
.toast-bnf.success { border-left-color: #0E9F6E; } .toast-bnf.danger { border-left-color: #D92D20; } .toast-bnf.warning { border-left-color: #E8A317; }
.toast-bnf .ti { font-size: 1.15rem; }
.toast-bnf.success .ti { color: #0E9F6E; } .toast-bnf.danger .ti { color: #D92D20; } .toast-bnf.warning .ti { color: #E8A317; } .toast-bnf.info .ti { color: var(--bnf-royal); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* Estado vacío */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--bnf-muted); }
.empty i { font-size: 2.2rem; display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 20px; background: var(--bnf-sky-50); color: var(--bnf-blue); margin-bottom: .8rem; }
.empty h3 { font-size: 1rem; color: var(--bnf-ink); font-weight: 700; }

/* Paginación */
.pagination { --bs-pagination-border-radius: 9px; --bs-pagination-color: #334155; --bs-pagination-active-bg: var(--bnf-royal); --bs-pagination-active-border-color: var(--bnf-royal); gap: .25rem; margin: 0; }
.pagination .page-link { border-radius: 9px !important; border-color: var(--bnf-line); font-size: .82rem; font-weight: 600; min-width: 34px; text-align: center; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(70% 60% at 85% 10%, rgba(66,114,248,.7), transparent 60%), radial-gradient(60% 60% at 0% 100%, rgba(179,125,28,.35), transparent 60%), linear-gradient(160deg, #071B82, #050F4F); }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -80px; width: 560px; height: 560px; background: url("../img/bnf-mark.png") no-repeat center/contain; opacity: .14; filter: brightness(2.5); }
.login-art h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.08; max-width: 520px; }
.login-art .feat { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; max-width: 460px; position: relative; z-index: 1; }
.login-art .feat i { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex-shrink: 0; color: var(--bnf-gold-300); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.login-card { width: 100%; max-width: 410px; }
.demo-user { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border: 1px solid var(--bnf-line); border-radius: 12px; cursor: pointer; transition: all .15s; background: #fff; width: 100%; text-align: left; }
.demo-user:hover { border-color: var(--bnf-royal); background: var(--bnf-sky-50); }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* Utilidades */
.divider-v { width: 1px; align-self: stretch; background: var(--bnf-line); }
.hover-lift { transition: transform .15s; } .hover-lift:hover { transform: translateY(-2px); }
.text-royal { color: var(--bnf-royal) !important; } .text-gold { color: var(--bnf-gold) !important; } .text-navy { color: var(--bnf-navy) !important; }
.bg-royal { background: var(--bnf-royal) !important; }
.min-w-0 { min-width: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.sticky-side { position: sticky; top: 84px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82em; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0 !important; } }
