/* ============================================================================
   CallCenter Centhylon — Dashboard del Usuario (panel ejecutivo personal)
   "¿Cómo va mi actividad?" · Estética SaaS moderna. Solo visualización.
   Optimizado para caber completo en 1920×1080 sin scroll.
   ========================================================================== */

.dashboard-usuario {
    /* Tokens */
    --bg: #F7F8FA;
    --surface: #FFFFFF;
    --border: #EAECEF;
    --text-strong: #0F172A;
    --text: #334155;
    --text-muted: #94A3B8;

    --brand: #4F46E5;
    --brand-600: #4338CA;
    --brand-soft: #EEF0FF;

    --ok: #10B981;
    --warn: #F59E0B;
    --danger: #EF4444;
    --neutral: #64748B;
    --info: #3B82F6;

    --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
    --shadow-md: 0 4px 12px rgba(16,24,40,.08);
    --shadow-lg: 0 10px 28px rgba(16,24,40,.12);

    --radius-card: 14px;
    --radius-control: 10px;
    --radius-pill: 999px;

    --gap: 14px;

    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    width: 100%;
    max-width: 1520px;
    margin: 0 auto;
    padding: 0 0 12px;
    -webkit-font-smoothing: antialiased;
}
.dashboard-usuario * { box-sizing: border-box; }

/* ============================================================================
   CABECERA
   ========================================================================== */
.dash-cabecera { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; animation: fadeUp .34s ease-out both; }
.dc-avatar {
    width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #7c73f0);
    color: #fff; font-weight: 700; font-size: 19px; box-shadow: var(--shadow-sm);
}
.dc-txt { display: flex; flex-direction: column; }
.dc-titulo { font-size: 19px; font-weight: 600; color: var(--text-strong); margin: 0; line-height: 1.25; }
.dc-titulo strong { font-weight: 700; }
.dc-sub { font-size: 12.5px; color: var(--text-muted); text-transform: capitalize; }

/* ============================================================================
   BARRA DE FILTROS (compacta)
   ========================================================================== */
.filter-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
    padding: 7px 10px; margin-bottom: var(--gap);
    animation: fadeUp .34s ease-out .04s both;
}
.filter-periodos { display: inline-flex; background: #F1F2F7; border-radius: var(--radius-control); padding: 3px; gap: 2px; }
.fp-btn {
    border: none; background: transparent; cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--text-muted);
    padding: 6px 13px; border-radius: 8px; transition: all .15s ease;
}
.fp-btn:hover { color: var(--text-strong); }
.fp-active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

.filter-rango { display: inline-flex; align-items: center; gap: 8px; }
.fr-date {
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px;
    font-size: 12.5px; color: var(--text); font-family: inherit; background: var(--surface);
}
.fr-date:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fr-sep { color: var(--text-muted); }

.filter-right { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.filter-select { display: inline-flex; align-items: center; gap: 8px; }
.filter-select > i { color: var(--brand); }

/* ============================================================================
   ESTADO DE RECARGA
   ========================================================================== */
.dash-content { transition: opacity .2s ease; }
.dash-content.is-loading { opacity: .45; pointer-events: none; }

/* ============================================================================
   KPIs (KpiCard) — compactas
   ========================================================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.kpi-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
    padding: 12px 14px; transition: box-shadow .18s ease, transform .18s ease;
    animation: fadeUp .34s ease-out both;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card-highlight { background: linear-gradient(180deg,#fbfbff,#fff); border-color: #E2E1FB; }

.kpi-ico { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px; }
.kpi-ico-brand   { background: var(--brand-soft); color: var(--brand); }
.kpi-ico-info    { background: #E7F0FF; color: var(--info); }
.kpi-ico-ok      { background: #E6F7F1; color: var(--ok); }
.kpi-ico-warn    { background: #FEF3E2; color: var(--warn); }
.kpi-ico-neutral { background: #EEF1F5; color: var(--neutral); }
.kpi-ico-danger  { background: #FDEBEB; color: var(--danger); }

.kpi-body { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.kpi-num { font-size: 23px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-left: 1px; }
.kpi-lbl { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================================
   FILAS DE GRÁFICOS
   ========================================================================== */
.dash-row { margin-bottom: var(--gap); }
.dash-row:last-child { margin-bottom: 0; }
.dash-row-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.dash-row-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap); }

.panel-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); box-shadow: var(--shadow-sm);
    padding: 13px 16px 12px; animation: fadeUp .34s ease-out both;
    overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-title { font-size: 13.5px; font-weight: 700; color: var(--text-strong); display: inline-flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--brand); }
.panel-sub { font-size: 12px; color: var(--text-muted); }
.panel-pill { font-size: 11px; font-weight: 700; color: var(--text-muted); background: #F1F2F7; border-radius: var(--radius-pill); padding: 2px 9px; }
.panel-empty { text-align: center; padding: 30px 10px; color: var(--text-muted); }
.panel-empty i { font-size: 26px; display: block; margin-bottom: 6px; opacity: .55; }
.panel-empty span { font-size: 12.5px; }

/* ============================================================================
   CAMPAÑAS (CampaignSummary) — tarjetas visuales, no tabla
   ========================================================================== */
.camp-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px;
    max-height: 214px; overflow-y: auto; padding-right: 2px;
}
.camp-card {
    border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
    background: #FCFCFE; min-width: 0; overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
    animation: fadeUp .3s ease-out both;
}
.camp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #E2E1FB; }
.camp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.camp-card-nombre { font-size: 13.5px; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.camp-card-progress { display: flex; align-items: center; gap: 10px; }
.pb-wrap { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.pb-wrap .e-progressbar { width: 100% !important; }
.camp-card-pct { font-size: 12.5px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; flex: 0 0 auto; min-width: 34px; text-align: right; }

.camp-card-stats { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.camp-stat { display: inline-flex; align-items: baseline; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.camp-stat b { font-size: 15px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.camp-stat small { font-size: 10.5px; }
.camp-stat-ok { color: #067a54; }
.camp-stat-ok b { color: #067a54; }
.camp-stat-ok i { color: var(--warn); }

.conv-badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: var(--radius-pill); padding: 3px 8px; white-space: nowrap; flex: 0 0 auto; }
.conv-alta  { background: #E6F7F1; color: #067a54; }
.conv-media { background: #FEF3E2; color: #a9640a; }
.conv-baja  { background: #EEF1F5; color: #47566b; }

/* ============================================================================
   SKELETON
   ========================================================================== */
.dash-skeleton { display: flex; flex-direction: column; gap: var(--gap); }
.sk { border-radius: var(--radius-card); background: linear-gradient(90deg,#eef0f3 25%,#f6f7f9 37%,#eef0f3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-cabecera { height: 48px; width: 320px; }
.sk-filtros { height: 46px; }
.sk-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); }
.sk-kpi { height: 66px; }
.sk-charts { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.sk-chart-lg, .sk-chart-sm { height: 240px; }

/* ============================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================================
   RESPONSIVE (en < Full HD se permite scroll vertical)
   ========================================================================== */
@media (max-width: 1200px) {
    .kpi-grid, .sk-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .dash-row-2-1, .dash-row-1-2, .sk-charts { grid-template-columns: 1fr; }
    .filter-right { margin-left: 0; }
    .camp-grid { max-height: none; }
}
@media (max-width: 640px) {
    .kpi-grid, .sk-kpis { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { gap: 10px; }
    .filter-periodos { width: 100%; justify-content: space-between; }
    .fp-btn { flex: 1; padding: 7px 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-usuario *, .dashboard-usuario *::before { animation: none !important; transition: none !important; }
}
