
/* ================================================================
   Tokeniza — Dashboard
   ================================================================ */

/* ── Section label ──────────────────────────────────────────── */
.tz-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 20px 0 10px;
}

/* ── Stats card con icono ───────────────────────────────────── */
.tz-stat-card-accent {
    display: flex;
    align-items: center;
    gap: 14px;
}
.tz-stat-card-accent .tz-stat-value { font-size: 28px; }
.tz-stat-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ── Dashboard grid 2 columnas ──────────────────────────────── */
.tz-dash-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .tz-dash-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard card ─────────────────────────────────────────── */
.tz-dash-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tz-dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.tz-dash-card-header i { margin-right: 6px; color: var(--color-primary); }

/* ── Link de navegación ─────────────────────────────────────── */
.tz-link {
    font-size: 12px;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}
.tz-link:hover { text-decoration: underline; }
.tz-link i { font-size: 11px; }

/* ── Actividad reciente ─────────────────────────────────────── */
.tz-actividad-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tz-actividad-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.tz-actividad-item:last-child { border-bottom: none; }
.tz-actividad-icon {
    width: 30px;
    height: 30px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.tz-actividad-icon.tz-actividad-icon-error {
    background: rgba(185,28,28,0.08);
    color: var(--color-danger);
}
.tz-actividad-body { flex: 1; min-width: 0; }

/* ── KPIs de negocio ────────────────────────────────────────── */
.tz-negocio-kpis {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
}
.tz-negocio-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.tz-negocio-kpi-card:hover { box-shadow: var(--shadow-md); }
.tz-negocio-kpi-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.tz-negocio-kpi-icon {
    width: 36px; height: 36px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.tz-negocio-kpi-title {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.3;
}
.tz-negocio-kpi-monto {
    font-size: 26px; font-weight: 800;
    line-height: 1.1; margin-bottom: 5px;
    letter-spacing: -0.5px;
}
.tz-negocio-kpi-currency {
    font-size: 13px; font-weight: 500;
    color: var(--text-muted);
}
.tz-negocio-kpi-sub {
    font-size: 12px; color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 900px) {
    .tz-negocio-kpis { grid-template-columns: repeat(2, 1fr); }
}

.tz-negocio-kpi-sub2 {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── Acordeón dashboard ─────────────────────────────────────── */
.tz-dash-acordeon {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}
.tz-dash-acordeon-header {
    width: 100%; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    transition: background 0.15s;
}
.tz-dash-acordeon-header:hover { background: var(--bg-surface-2); }
.tz-dash-acordeon-body {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s;
    padding: 0 20px;
}
.tz-dash-acordeon-body.tz-dash-acordeon-open {
    max-height: 600px;
    padding: 0 20px 16px;
}

/* ── Panel de alertas (pagarés a sustituir) ─────────────────── */
.tz-alertas-list { display:flex; flex-direction:column; gap:10px; padding:12px; }
.tz-alerta-item {
    border:1px solid var(--border-color,#e5e7eb);
    border-left:3px solid var(--color-warning,#ca8a04);
    border-radius:var(--radius-sm,8px); padding:10px 12px; background:var(--surface,#fff);
}
.tz-alerta-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.tz-alerta-causa { color:#9a3b3b; margin:5px 0 3px; line-height:1.5; }
.tz-alerta-meta { margin-bottom:8px; }
.tz-alerta-btn { width:100%; justify-content:center; }

/* ── Drawer de reemplazo ────────────────────────────────────── */
.tz-reemp-saliente {
    border:1px solid rgba(220,38,38,0.25); background:rgba(220,38,38,0.05);
    border-radius:var(--radius-sm,8px); padding:12px;
}
.tz-reemp-row { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.tz-reemp-cands { display:flex; flex-direction:column; gap:8px; }
.tz-reemp-cand {
    display:flex; align-items:center; gap:10px; cursor:pointer;
    border:1px solid var(--border-color,#e5e7eb); border-radius:var(--radius-sm,8px);
    padding:10px 12px; transition:border-color .12s, background .12s;
}
.tz-reemp-cand:hover { border-color:var(--brand-primary,#1e3a8a); background:var(--surface-2,#f8fafc); }
.tz-reemp-cand input { margin:0; flex-shrink:0; }
.tz-reemp-cand-info { flex:1; min-width:0; }
.tz-reemp-cand:has(input:checked) { border-color:var(--brand-primary,#1e3a8a); background:rgba(30,58,138,0.05); }

/* ── Alerta agrupada por cesión (compacta) ──────────────────── */
.tz-alerta-grupo {
    display:flex; align-items:center; gap:10px; width:100%; text-align:left;
    background:var(--surface,#fff); border:1px solid var(--border-color,#e5e7eb);
    border-left:3px solid var(--color-warning,#ca8a04);
    border-radius:var(--radius-sm,8px); padding:10px 12px; cursor:pointer;
    transition:border-color .12s, background .12s; font-family:inherit;
}
.tz-alerta-grupo:hover { border-color:var(--color-warning,#ca8a04); background:#fffdf5; }
.tz-alerta-grupo-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.tz-alerta-grupo-ces { font-weight:700; font-size:13px; }
.tz-alerta-grupo-contrato { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; }
.tz-alerta-grupo-right { text-align:right; display:flex; flex-direction:column; gap:2px; flex-shrink:0; align-items:flex-end; }
.tz-alerta-grupo-monto { font-weight:700; font-size:13px; }
.tz-alerta-grupo-chev { color:var(--text-muted,#9ca3af); flex-shrink:0; }

/* ── Salientes dentro del drawer de sustitución ─────────────── */
.tz-reemp-salientes { margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.tz-reemp-saliente-row { display:flex; justify-content:space-between; gap:12px; padding-top:5px; border-top:1px dashed rgba(0,0,0,0.08); }

/* Botón pequeño (Autoseleccionar) */
.tz-btn-sm { padding:5px 10px; font-size:12px; border-radius:var(--radius-sm,8px); display:inline-flex; align-items:center; gap:5px; }

/* ── Acordeón MOTIVO DE REEMPLAZO (cerrado por defecto) ─────── */
.tz-reemp-motivo { border:1px solid var(--border-default,#e5e7eb); border-left:3px solid var(--color-warning,#ca8a04); border-radius:var(--radius-md,10px); background:#fffdf6; margin-bottom:14px; overflow:hidden; }
.tz-reemp-motivo-sum { list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; padding:11px 13px; user-select:none; }
.tz-reemp-motivo-sum::-webkit-details-marker { display:none; }
.tz-reemp-motivo-title { font-size:11.5px; font-weight:700; letter-spacing:0.04em; color:#92600c; display:flex; align-items:center; gap:7px; }
.tz-reemp-motivo-count { background:var(--color-warning,#ca8a04); color:#fff; font-size:11px; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; }
.tz-reemp-motivo-chev { color:#92600c; font-size:12px; transition:transform .18s; }
.tz-reemp-motivo[open] .tz-reemp-motivo-chev { transform:rotate(180deg); }
.tz-reemp-motivo-body { padding:0 13px 12px; }
.tz-reemp-motivo-ces { font-size:11px; color:var(--text-muted); margin-bottom:8px; }
.tz-reemp-saliente-row { display:flex; justify-content:space-between; gap:12px; padding:5px 0; font-size:12.5px; border-top:1px dashed rgba(0,0,0,0.07); }
.tz-reemp-causa { color:#b4341f; text-align:right; font-size:11.5px; }
.tz-reemp-motivo-exp { margin-top:10px; padding-top:9px; border-top:1px solid var(--border-default,#e5e7eb); font-size:11.5px; line-height:1.55; color:var(--text-secondary,#4b5563); }

/* ── Barra de progreso de selección ────────────────────────── */
.tz-reemp-cov { margin:4px 0 14px; }
.tz-reemp-cov-top { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:6px; }
.tz-reemp-cov-label { font-size:12.5px; color:var(--text-secondary,#4b5563); }
.tz-reemp-cov-pct { font-size:12.5px; font-weight:700; color:var(--text-muted,#6b7280); }
.tz-reemp-cov-pct.ok { color:var(--color-success,#15803d); }
.tz-reemp-cov-bar { height:9px; border-radius:6px; background:#eceff3; overflow:hidden; }
.tz-reemp-cov-fill { height:100%; border-radius:6px; background:var(--color-warning,#ca8a04); transition:width .25s ease; }
.tz-reemp-cov-fill.ok { background:var(--color-success,#16a34a); }

/* ── Encabezado de la lista + subtítulo de candidatos ──────── */
.tz-reemp-head { display:flex; justify-content:space-between; align-items:center; margin:0 0 8px; }
.tz-reemp-cand-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* ============================================================
   Dashboard Operativo (DT2/DT3) — vista de 4 dimensiones
   ============================================================ */
.op-tabs{display:flex;gap:2px;border-bottom:1px solid var(--border-subtle);margin-bottom:22px}
.op-tab{display:flex;align-items:center;gap:7px;padding:11px 16px;font-size:13.5px;font-weight:600;color:var(--text-muted);border-bottom:2.5px solid transparent;margin-bottom:-1px;background:none;border-top:none;border-left:none;border-right:none;cursor:pointer}
.op-tab.on{color:var(--color-primary);border-bottom-color:var(--color-primary)}
.op-tab .you{font-size:10px;font-weight:600;color:var(--color-accent);background:var(--bg-surface-2);padding:2px 6px;border-radius:20px}

.op-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:16px}
.op-kpi{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);padding:15px 16px}
.op-kpi.lead{box-shadow:inset 3px 0 0 var(--color-accent),var(--shadow-sm)}
.op-kpi-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:10px}
.op-kpi-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.op-kpi-title{font-size:13px;font-weight:700;color:var(--text-primary);letter-spacing:-.01em}
.op-chip{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-size:17px}
.op-deltachip{font-size:11px;font-weight:600;padding:3px 8px;border-radius:20px}
.op-kpi-label{font-size:11.5px;color:var(--text-muted);margin-bottom:4px}
.op-kpi-val{font-size:23px;font-weight:700;line-height:1.05;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.op-kpi-val .u{font-size:12px;font-weight:600;color:var(--text-muted);letter-spacing:0}
.op-kpi-sub{margin-top:10px;padding-top:9px;border-top:1px dashed var(--border-subtle);font-size:11.5px;color:var(--text-secondary)}

.op-banner{display:flex;align-items:center;gap:16px;background:linear-gradient(100deg,#fbecec,#fdf4f4);border:1px solid rgba(185,28,28,.28);border-left:4px solid var(--color-danger);border-radius:var(--radius-lg);padding:14px 18px;margin-bottom:18px}
.op-banner-ic{width:42px;height:42px;border-radius:11px;background:rgba(185,28,28,.12);color:var(--color-danger);display:grid;place-items:center;font-size:22px;flex:none}
.op-banner-txt{flex:1;min-width:0}
.op-banner-txt .t{font-weight:700;font-size:14px;color:#7f1d1d}
.op-banner-txt .s{font-size:12.5px;color:#9a3a3a;margin-top:2px}
.op-banner-groups{display:flex;gap:8px;flex-wrap:wrap}
.op-bchip{display:flex;align-items:center;gap:9px;background:#fff;border:1px solid rgba(185,28,28,.22);border-radius:10px;padding:8px 12px;cursor:pointer;transition:.15s}
.op-bchip:hover{border-color:var(--color-danger);box-shadow:0 2px 8px rgba(185,28,28,.12)}
.op-bchip .ces{font-weight:600;font-size:12px;color:var(--text-primary)}
.op-bchip .meta{font-size:11px;color:var(--text-muted)}
.op-bchip .n{background:var(--color-danger);color:#fff;font-size:10.5px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px}
/* Banner azul: SUS en revisión del fondo */
.op-banner-info{background:linear-gradient(100deg,#eff6ff,#f0f9ff);border:1px solid rgba(37,99,235,.25);border-left:4px solid #2563eb}
.op-banner-info .op-banner-ic{background:rgba(37,99,235,.10);color:#2563eb}
.op-banner-info .op-banner-txt .t{color:#1e3a8a}
.op-banner-info .op-banner-txt .s{color:#3b82f6}
.op-bchip-proceso{border-color:rgba(37,99,235,.22)}
.op-bchip-proceso:hover{border-color:#2563eb;box-shadow:0 2px 8px rgba(37,99,235,.12)}

.op-grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
.op-card{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
.op-ch{display:flex;align-items:center;justify-content:space-between;padding:15px 17px 0}
.op-ch h3{font-size:14px;font-weight:700;margin:0}
.op-ch .lnk{font-size:12px;font-weight:600;color:var(--color-accent);cursor:pointer}
.op-cb{padding:16px 17px 18px}

.op-donutwrap{display:flex;align-items:center;gap:18px}
.op-donut{position:relative;width:130px;height:130px;flex:none}
.op-donut .ctr{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.op-donut .ctr .v{font-size:19px;font-weight:700;font-variant-numeric:tabular-nums}
.op-donut .ctr .l{font-size:10px;color:var(--text-muted)}
.op-leg{flex:1;display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;font-size:11.5px}
.op-leg span{display:flex;align-items:center;gap:7px}
.op-leg i{width:9px;height:9px;border-radius:3px;flex:none}
.op-leg b{margin-left:auto;font-weight:600;font-variant-numeric:tabular-nums}

.op-contrato{margin-bottom:13px}
.op-contrato .top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.op-contrato .top .nm{font-weight:600;font-size:12.5px}
.op-bar{height:7px;border-radius:4px;background:var(--bg-surface-2);overflow:hidden;margin-bottom:5px}
.op-bar span{display:block;height:100%;border-radius:4px;background:var(--color-accent)}
.op-contrato .ft{display:flex;justify-content:space-between;font-size:10.5px;color:var(--text-muted);font-variant-numeric:tabular-nums}

.op-pipe{display:flex;align-items:center;justify-content:space-between}
.op-stage{text-align:center;flex:1}
.op-stage .ic{width:32px;height:32px;margin:0 auto 5px;border-radius:9px;display:grid;place-items:center;font-size:15px}
.op-stage .nm{font-size:9.5px;color:var(--text-muted)}
.op-stage .ct{font-weight:700;font-size:13px;font-variant-numeric:tabular-nums}
.op-pipe-chev{color:var(--border-default);font-size:14px}
.op-pipe-ft{margin-top:13px;padding-top:11px;border-top:1px solid var(--border-subtle);display:flex;gap:16px;font-size:11.5px;color:var(--text-secondary);align-items:center}

.op-vto{display:flex;align-items:center;gap:11px;padding:8px 0;border-bottom:1px solid var(--border-subtle)}
.op-vto:last-child{border-bottom:none}
.op-vto .bk{font-weight:600;font-size:12px;min-width:64px}
.op-vto .bar{flex:1;height:6px;border-radius:3px;background:var(--bg-surface-2);overflow:hidden}
.op-vto .bar span{display:block;height:100%;border-radius:3px}
.op-vto .amt{font-size:12px;font-weight:600;min-width:96px;text-align:right;font-variant-numeric:tabular-nums}
.op-vto .ct{font-size:11px;color:var(--color-accent);font-weight:600;min-width:50px;text-align:right;font-variant-numeric:tabular-nums}

.op-strip{background:linear-gradient(120deg,#16314f,#23456a 70%,#2a5680);border-radius:var(--radius-lg);padding:16px 6px;display:grid;grid-template-columns:repeat(4,1fr);box-shadow:var(--shadow-md)}
.op-strip .cell{padding:3px 18px}
.op-strip .cell+.cell{border-left:1px solid rgba(255,255,255,.10)}
.op-strip .pl{font-size:10.5px;color:rgba(255,255,255,.6);margin-bottom:6px}
.op-strip .pv{font-size:20px;font-weight:700;color:#fff;font-variant-numeric:tabular-nums}
.op-strip .pv .u{font-size:11px;font-weight:600;color:rgba(255,255,255,.6)}

@media(max-width:1100px){.op-kpis{grid-template-columns:repeat(2,1fr)}.op-grid2{grid-template-columns:1fr}.op-strip{grid-template-columns:repeat(2,1fr);gap:14px 0}}
@media(max-width:680px){.op-kpis{grid-template-columns:1fr}.op-strip{grid-template-columns:1fr}}

.op-updated{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--text-muted);padding-bottom:8px}
.op-updated i{font-size:12px;opacity:.8}

/* Sparkline de fondo en KPIs (estilo imagen 2) */
.op-kpi .op-kpi-sub{border-top:none;padding-top:0;margin-top:8px}
.op-kpi-mid{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
.op-kpi-mid .op-kpi-val{margin:0}
/* ── Barras de KPI (utilización de línea y cobertura) ─────── */
.op-kpi-bar-wrap{margin-top:9px}
.op-kpi-bar-track{position:relative;height:5px;background:var(--border-subtle);border-radius:99px;overflow:visible;margin-bottom:4px}
.op-kpi-bar-fill{height:100%;border-radius:99px;transition:width .5s ease}
.op-kpi-bar-min{position:absolute;top:-3px;width:2px;height:11px;background:var(--text-muted);border-radius:1px;opacity:.55;transform:translateX(-50%)}
.op-kpi-bar-label{font-size:10.5px;font-weight:600;color:var(--text-muted);letter-spacing:.01em}
.op-spark{flex:none;width:94px;height:32px;opacity:.95;align-self:flex-end;margin-bottom:2px}
