/* ===================================
   CSS GLOBAL PARA VISTAS DEL SISTEMA
   =================================== */

/* Contenedor principal */
.vista-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
}

/* Header de pagina */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #5b7ee5;
}

.page-header h5 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

/* Estadisticas rapidas */
.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-mini {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-mini i {
    font-size: 20px;
    color: #5b7ee5;
}

.stat-mini.primary i { color: #5b7ee5; }
.stat-mini.success i { color: #28a745; }
.stat-mini.warning i { color: #ffc107; }
.stat-mini.danger i { color: #dc3545; }
.stat-mini.info i { color: #17a2b8; }

.stat-mini .info-text span,
.stat-mini .info span {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.stat-mini .info-text small,
.stat-mini .info small {
    color: #666;
    font-size: 12px;
}

/* Buscador */
.search-box {
    position: relative;
    max-width: 300px;
}

.search-box input {
    padding-left: 35px;
    border-radius: 20px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* Filtros */
.filtros-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtros-row .form-control,
.filtros-row .form-select {
    max-width: 200px;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #5b7ee5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 50px; height: 50px; font-size: 18px; }
.avatar.xl { width: 80px; height: 80px; font-size: 28px; }

/* Botones de accion */
.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

/* Tablas */
.table-vista {
    font-size: 14px;
}

.table-vista th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table-vista td {
    vertical-align: middle;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 15px;
    color: #ddd;
}

/* Badges de rol */
.badge-rol {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-ADMINISTRADOR { background: #ffebee; color: #c62828; }
.badge-SOPORTE { background: #e3f2fd; color: #1565c0; }
.badge-TECNICO { background: #e8f5e9; color: #2e7d32; }
.badge-USUARIO { background: #fff3e0; color: #ef6c00; }
.badge-SUPERVISOR { background: #f3e5f5; color: #7b1fa2; }

/* Badges de tipo/estatus */
.badge-tipo {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-success { background: #e8f5e9; color: #2e7d32; }

/* Badges de estatus */
.badge-estatus {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.badge-ACTIVO, .badge-Activo { background: #e8f5e9; color: #2e7d32; }
.badge-INACTIVO, .badge-Inactivo { background: #ffebee; color: #c62828; }
.badge-PENDIENTE, .badge-Pendiente { background: #fff3e0; color: #ef6c00; }
.badge-ENVIADO { background: #fff3cd; color: #856404; }
.badge-EN_PROCESO { background: #cce5ff; color: #004085; }
.badge-CERRADO { background: #d4edda; color: #155724; }

/* Cards */
.item-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.item-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.item-card.inactivo {
    opacity: 0.6;
    background: #f8f9fa;
}

.item-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.item-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.item-card .card-meta {
    font-size: 12px;
    color: #999;
}

.item-card .card-meta i {
    margin-right: 5px;
}

/* Switch toggle */
.switch-toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.switch-toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .slider {
    background-color: #28a745;
}

.switch-toggle input:checked + .slider:before {
    transform: translateX(24px);
}

/* Preview imagen */
.img-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.img-thumb:hover {
    transform: scale(1.1);
}

/* Form sections */
.form-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h6 {
    margin-bottom: 15px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-row {
        flex-direction: column;
    }

    .filtros-row {
        flex-direction: column;
    }

    .filtros-row .form-control,
    .filtros-row .form-select,
    .search-box {
        max-width: 100%;
    }
}
