/**
 * Terracota - Estilos Globales Personalizados
 * Agregar en: public/assets/css/terracota-custom.css
 */

/* =====================================================
   AVATARES
   ===================================================== */
.avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

/* =====================================================
   FORMULARIOS - INPUT GROUP OUTLINE
   ===================================================== */
.input-group-outline .form-control,
.input-group-outline .form-select {
    border: 1px solid #d2d6da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.input-group-outline .form-control:focus,
.input-group-outline .form-select:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.1);
    outline: none;
}

.input-group-outline .form-control:disabled,
.input-group-outline .form-select:disabled {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

/* Select sin el estilo flotante problemático */
.input-group-static .form-control,
.input-group-static .form-select {
    border: none;
    border-bottom: 1px solid #d2d6da;
    border-radius: 0;
    padding-left: 0;
}

.input-group-static .form-control:focus,
.input-group-static .form-select:focus {
    border-bottom-color: #e91e63;
    box-shadow: none;
}

/* =====================================================
   TABLAS
   ===================================================== */
.table > :not(caption) > * > * {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-sm {
    padding: 0.35em 0.65em;
    font-size: 0.7rem;
}

.badge-lg {
    padding: 0.5em 1em;
    font-size: 0.85rem;
}

/* Estados comunes */
.badge-pending {
    background: linear-gradient(195deg, #FFA726 0%, #FB8C00 100%);
    color: #fff;
}

.badge-approved {
    background: linear-gradient(195deg, #66BB6A 0%, #43A047 100%);
    color: #fff;
}

.badge-rejected {
    background: linear-gradient(195deg, #EF5350 0%, #E53935 100%);
    color: #fff;
}

.badge-completed {
    background: linear-gradient(195deg, #42A5F5 0%, #1E88E5 100%);
    color: #fff;
}

/* =====================================================
   BOTONES
   ===================================================== */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
}

.btn-link {
    padding: 0.25rem 0.5rem;
}

.btn-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1rem 1.5rem;
}

.card-stats {
    transition: transform 0.2s ease;
}

.card-stats:hover {
    transform: translateY(-2px);
}

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-dismissible .btn-close {
    padding: 1rem;
    background-size: 0.75rem;
}

/* =====================================================
   MODALES
   ===================================================== */
.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* =====================================================
   UTILIDADES
   ===================================================== */

/* Gaps para flexbox */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Text truncate con tooltip */
.text-truncate-hover {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cursor pointer */
.cursor-pointer {
    cursor: pointer;
}

/* =====================================================
   PROGRESS BARS
   ===================================================== */
.progress {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-lg {
    height: 20px;
    border-radius: 10px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* =====================================================
   SIDEBAR ACTIVE STATE
   ===================================================== */
.sidenav .nav-link.active {
    box-shadow: 0 4px 6px -1px rgba(233, 30, 99, 0.4);
}

/* =====================================================
   RESPONSIVE HELPERS
   ===================================================== */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .card-header .btn {
        width: 100%;
    }
    
    .avatar {
        width: 32px;
        height: 32px;
    }
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h6 {
    color: #495057;
}

/* =====================================================
   TOASTS / NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .sidenav,
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
