/* ==========================
   ESTILOS COMPLEMENTARIOS PARA EL SISTEMA DINÁMICO
   ========================== */

/* Tarjetas de cliente en agenda dinámica */
.agenda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.agenda-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
    transition: all .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.agenda-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.agenda-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 0.85rem; padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border, #e5e7eb);
}
.agenda-card-header h3 { margin: 0 0 0.2rem; font-size: 1rem; color: #111827; }
.agenda-card-header .text-muted { font-size: 0.8rem; }
.agenda-card-body .metrics {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.metrics .metric {
    text-align: center; background: #f9fafb; padding: 0.5rem; border-radius: 6px;
}
.metrics .metric label { display: block; font-size: 0.65rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.metrics .metric strong { font-size: 0.95rem; color: #111827; }
.last-gestion { display: block; font-size: 0.75rem; color: #6b7280; }
.agenda-card-actions {
    display: flex; gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e5e7eb);
}
.agenda-card-actions .btn { flex: 1; }
.agenda-card-actions .manage-btn { flex: 2; }

/* Badges */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 12px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success   { background: rgba(16,185,129,.15); color: #047857; }
.badge-info      { background: rgba(79,70,229,.15);  color: #4338ca; }
.badge-warning   { background: rgba(245,158,11,.15); color: #b45309; }
.badge-danger    { background: rgba(239,68,68,.15);  color: #b91c1c; }
.badge-secondary { background: rgba(100,116,139,.1); color: #475569; }

/* Status operadores */
.status-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.6rem; border-radius: 12px; font-size: 0.7rem; font-weight: 700;
}
.status-badge::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
}
.status-badge.online::before  { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.5); }
.status-badge.offline::before { background: #94a3b8; }
.status-badge.busy::before    { background: #ef4444; }
.status-badge.away::before    { background: #f59e0b; }

/* Progress stack para reportes */
.progress-stack {
    display: flex; height: 22px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
    min-width: 120px;
}
.progress-stack .seg {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.7rem; font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,.3); transition: width .8s;
}
.progress-stack .seg.green { background: linear-gradient(90deg, #059669, #10b981); }
.progress-stack .seg.red   { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Filtros agenda */
.advanced-filters {
    background: #fff; border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px; padding: 1rem; margin: 1rem 0;
    display: none;
}
.advanced-filters.show { display: block; }
.advanced-filters .filter-row {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 0.75rem; align-items: end;
}
.filter-group label { display: block; font-size: 0.75rem; color: #6b7280; margin-bottom: 0.25rem; font-weight: 600; }
.form-control {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 0.875rem; font-family: inherit;
}
.form-control:focus { outline: 2px solid #4F46E5; outline-offset: 1px; }
.filter-actions { display: flex; gap: 0.5rem; }

/* Stats bar */
.agenda-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem; margin: 1rem 0;
}
.agenda-stats .stat-item {
    display: flex; gap: 0.75rem; padding: 1rem; background: #fff;
    border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
}
.stat-item .stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: linear-gradient(135deg, #4F46E5, #7c3aed); color: #fff;
    display: grid; place-items: center; font-size: 1.2rem;
}
.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: #111827; line-height: 1; }
.stat-label { font-size: 0.75rem; color: #6b7280; }

/* Productos en reportes */
.proy-prod-card {
    background: #fff; border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px; padding: 1rem; margin-bottom: 0.75rem;
}
.proy-prod-header {
    display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem 1rem; align-items: center;
    margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px dashed #e5e7eb;
}
.proy-prod-header h4 { margin: 0; font-size: 0.95rem; }
.text-sm { font-size: 0.75rem; }
.proy-prod-list { display: flex; flex-direction: column; gap: 0.3rem; }
.prod-row {
    display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
    padding: 0.4rem 0.6rem; background: #f9fafb; border-radius: 6px; font-size: 0.85rem;
}
.prod-name { font-weight: 600; color: #374151; }
.prod-meta { color: #6b7280; font-size: 0.75rem; }
.prod-amt  { color: #b91c1c; font-weight: 700; }

/* Filter bar pequeño */
.filter-bar {
    display: flex; gap: 0.75rem; margin: 1rem 0; align-items: center;
}
.filter-bar .form-control { width: auto; flex: 1; }

/* User cell */
.user-cell { display: flex; align-items: center; gap: 0.75rem; }
.user-cell img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-cell .user-details h4 { margin: 0; font-size: 0.875rem; color: #111827; }
.user-cell .user-details span { font-size: 0.7rem; color: #6b7280; }

/* Effectiveness meter */
.effectiveness-meter { display: flex; align-items: center; gap: 0.5rem; }
.meter-value { font-size: 0.85rem; font-weight: 700; min-width: 45px; }
.meter-bar { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; min-width: 80px; }
.meter-fill { height: 100%; transition: width .8s; }
.meter-fill.high   { background: linear-gradient(90deg, #10B981, #059669); }
.meter-fill.medium { background: linear-gradient(90deg, #F59E0B, #d97706); }
.meter-fill.low    { background: linear-gradient(90deg, #EF4444, #dc2626); }

/* KPI Trend */
.kpi-trend.positive { color: #047857; }
.kpi-trend.negative { color: #b91c1c; }
.kpi-trend.neutral  { color: #6b7280; }

/* Empty state */
.empty-state {
    padding: 3rem 1rem; text-align: center; color: #6b7280; grid-column: 1/-1;
}
.empty-state.error { color: #b91c1c; }

/* Pagination */
.agenda-pagination { text-align: center; margin: 1.5rem 0; }

/* Toast animation */
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Text helpers */
.text-right    { text-align: right !important; }
.text-center   { text-align: center !important; }
.text-success  { color: #047857; }
.text-danger   { color: #b91c1c; }
.text-warning  { color: #b45309; }
.text-info     { color: #4338ca; }
.text-muted    { color: #6b7280; }
.text-secondary{ color: #475569; }
