/* =================================================================
   COLEF - Sistema de GestiÃ³n Administrativa
   Archivo de estilos globales para todas las pÃ¡ginas
   ================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #163F86;
    --secondary-color: #2E5AA8;
    --accent-color: #4A90E2;
    --light-blue: #E8F2FF;
    --white: #ffffff;
    
    /* Escala de grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Estados */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Bordes */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transiciones */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* =================================================================
   ESTILOS BASE
   ================================================================= */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 14px;
}

/* =================================================================
   LAYOUT PRINCIPAL
   ================================================================= */

.admin-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
}

.admin-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.main-container {
    position: relative;
    z-index: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* =================================================================
   HEADER
   ================================================================= */

.page-header {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 20px;
    font-weight: bold;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

.btn-logout {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: var(--white);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    color: var(--primary-color);
}

/* =================================================================
   TARJETAS Y CONTENEDORES
   ================================================================= */

.content-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.card-header {
    background: linear-gradient(135deg, var(--gray-50), var(--white));
    padding: 25px 30px;
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 30px;
}

/* =================================================================
   FORMULARIOS Y FILTROS
   ================================================================= */

.filters-section {
    margin-bottom: 30px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 63, 134, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
}

/* =================================================================
   BOTONES
   ================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
    text-decoration: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: var(--white);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.filters-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* =================================================================
   TABLAS
   ================================================================= */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* =================================================================
   BADGES Y ESTADOS
   ================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* =================================================================
   PAGINACIÃ“N
   ================================================================= */

.pagination-container {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--gray-200);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    margin: 0;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    min-width: 44px;
    height: 44px;
}

.pagination .page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

/* =================================================================
   MENSAJES Y ALERTAS
   ================================================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--gray-500);
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 1200px) {
    .main-container {
        padding: 15px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .page-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .user-section {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filters-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .card-header,
    .card-body {
        padding: 20px;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        min-width: 40px;
        height: 40px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 15px;
    }
    
    .logo-section {
        gap: 10px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .card-header,
    .card-body {
        padding: 15px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 6px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
}


/* =================================================================
   FLUJO DE ESTADOS - WORKFLOW
   Agregar al final del archivo styles.css existente
   ================================================================= */

.workflow-container {
    width: 100%;
    margin: 0 0 30px 0;
}

.workflow-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.workflow-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 25px 30px;
    text-align: center;
    position: relative;
}

.workflow-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.workflow-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.workflow-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.workflow-content {
    padding: 30px;
}

.states-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.state-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    padding: 20px 15px;
    border-radius: var(--radius-xl);
    background: var(--white);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow);
}

.state-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* Estados espec¨ªficos con tus colores */
.state-inicial {
    border-color: var(--gray-400);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
}

.state-registrado {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--white) 100%);
}

.state-verificado {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--white) 100%);
}

.state-pagado {
    border-color: var(--danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--white) 100%);
}

.state-aprobado {
    border-color: var(--info);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, var(--white) 100%);
}

/* Estados que requieren acci¨®n */
.state-pending {
    animation: pulse-border 2s infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

@keyframes pulse-border {
    0% { 
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
        border-color: var(--danger);
    }
    50% { 
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
        border-color: #dc2626;
    }
    100% { 
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
        border-color: var(--danger);
    }
}

.state-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.state-inicial .state-icon {
    background: linear-gradient(135deg, var(--gray-500), var(--gray-600));
}

.state-registrado .state-icon {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.state-verificado .state-icon {
    background: linear-gradient(135deg, var(--success), #059669);
}

.state-pagado .state-icon {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.state-aprobado .state-icon {
    background: linear-gradient(135deg, var(--info), #2563eb);
}

.state-info {
    text-align: center;
}

.state-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-800);
    margin-bottom: 5px;
    position: relative;
}

.state-description {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.state-badge {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-lg);
    margin-top: 5px;
    display: inline-block;
    letter-spacing: 0.5px;
    animation: blink 1.5s infinite;
    box-shadow: var(--shadow);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

.state-arrow {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    animation: moveArrow 2s ease-in-out infinite;
    text-shadow: var(--shadow);
}

@keyframes moveArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

.workflow-legend {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--gray-200);
    margin-top: 25px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

.legend-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.legend-indicator.pending {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    animation: pulse 1.5s infinite;
}

.legend-indicator.completed {
    background: linear-gradient(135deg, var(--success), #059669);
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        opacity: 1; 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.8; 
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* =================================================================
   RESPONSIVE PARA WORKFLOW
   ================================================================= */

@media (max-width: 1200px) {
    .states-flow {
        justify-content: center;
        gap: 12px;
    }
    
    .state-item {
        min-width: 120px;
        padding: 15px 10px;
    }
    
    .state-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .workflow-content {
        padding: 20px;
    }
    
    .states-flow {
        flex-direction: column;
        gap: 20px;
    }
    
    .state-arrow {
        transform: rotate(90deg);
        animation: moveArrowVertical 2s ease-in-out infinite;
    }
    
    @keyframes moveArrowVertical {
        0%, 100% { transform: rotate(90deg) translateX(0); }
        50% { transform: rotate(90deg) translateX(6px); }
    }
    
    .workflow-legend {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .state-item {
        min-width: 200px;
        width: 100%;
        max-width: 280px;
    }
    
    .workflow-header {
        padding: 20px;
    }
    
    .workflow-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .workflow-content {
        padding: 15px;
    }
    
    .workflow-header {
        padding: 15px;
    }
    
    .workflow-title {
        font-size: 16px;
        flex-direction: column;
        gap: 5px;
    }
    
    .workflow-subtitle {
        font-size: 12px;
    }
    
    .state-item {
        padding: 15px;
        min-width: 180px;
    }
    
    .state-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .state-name {
        font-size: 13px;
    }
    
    .state-description {
        font-size: 11px;
    }
}