/* ========================================
   SISTEMA DE GESTIÓN DE EQUIPOS TECNOLÓGICOS
   Estilos Globales - Portal FRMX
   ======================================== */

/* Variables CSS - Colores MINERD (igual que encuesta) */
:root {
    --primary-color: #1f2f72;
    --primary-dark: #151f4d;
    --secondary-color: #3a4a8f;
    --primary-light: #4a5aa0;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --dark: #2d3748;
    --light: #f7fafc;
    --gray-50: #f9fafb;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #cbd5e0;
    --gray-500: #a0aec0;
    --gray-600: #718096;
    --gray-700: #4a5568;
    --gray-800: #2d3748;
    --gray-900: #1a202c;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, rgba(31, 47, 114, 0.05) 0%, rgba(58, 74, 143, 0.05) 100%);
    background-attachment: fixed;
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Principal */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-brand i {
    font-size: 1.75rem;
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* Contenedor Principal */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards Mejoradas */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: none !important;
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-300);
}

.card-header h2,
.card-header h3,
.card-header h4 {
    margin: 0;
    color: var(--dark);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-100);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* Botones Modernos */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-700);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    filter: brightness(1.1);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    filter: brightness(1.1);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--gray-400);
    color: var(--gray-700);
}

.btn-outline-secondary:hover:not(:disabled) {
    background: var(--gray-400);
    color: var(--dark);
    border-color: var(--gray-500);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Formularios Mejorados */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Input Groups */
.input-group {
    display: flex;
    width: 100%;
}

.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
}

.input-group-text {
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-right: none;
    border-radius: 8px 0 0 8px;
}

/* Tablas Mejoradas */
.table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Badges y Estados */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-pendiente {
    background: var(--warning-color);
    color: white;
}

.badge-aprobado {
    background: var(--success-color);
    color: white;
}

.badge-rechazado {
    background: var(--danger-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.bg-primary {
    background: var(--primary-color) !important;
    color: white;
}

.bg-light {
    background: var(--gray-100) !important;
}

.text-dark {
    color: var(--dark) !important;
}

/* Alertas Mejoradas */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1) 0%, rgba(252, 132, 132, 0.1) 100%);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.1) 0%, rgba(246, 173, 85, 0.1) 100%);
    border-left: 4px solid var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.1) 0%, rgba(99, 179, 237, 0.1) 100%);
    border-left: 4px solid var(--info-color);
    color: var(--info-color);
}

.alert-light {
    background: var(--gray-100);
    color: var(--gray-700);
}

.alert-heading {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Items de Equipos */
.equipo-item {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.equipo-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: none;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.stat-card .stat-label {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Lista de Solicitudes */
.solicitud-list-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.solicitud-list-item:hover {
    box-shadow: var(--shadow-md);
    transform: none;
}

.solicitud-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.solicitud-codigo {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.solicitud-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    color: var(--gray-700);
}

.solicitud-detail {
    display: flex;
    flex-direction: column;
}

.solicitud-detail label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.solicitud-detail span {
    font-weight: 500;
}

/* Loader Mejorado */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray-600);
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Modal Styles */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-bottom: 1px solid var(--gray-300);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.modal-title {
    color: var(--dark);
    font-weight: 600;
}

.btn-close {
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .solicitud-details {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Collapse mejorado */
.collapse {
    transition: height 0.35s ease;
}

.collapsing {
    position: relative;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Alert links */
.alert-link {
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.alert-link:hover {
    text-decoration: none;
}

/* Float utilities */
.float-end {
    float: right !important;
}

.float-start {
    float: left !important;
}

/* Utilidades */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--gray-600) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.mx-2 { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }
.p-5 { padding: 3rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.w-100 { width: 100% !important; }
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

.border { border: 1px solid var(--gray-300) !important; }
.rounded { border-radius: var(--border-radius) !important; }

.small { font-size: 0.875rem !important; }
.fs-1 { font-size: 2.5rem !important; }
.fs-3 { font-size: 1.75rem !important; }

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(31, 47, 114, 0.95) 0%, rgba(58, 74, 143, 0.90) 100%),
                url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1920&q=80') center/cover fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 650px;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1f2f72 0%, #3a4a8f 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

.login-header h1 {
    font-weight: 600;
    margin-bottom: 10px;
}

.login-body {
    padding: 40px;
}

.login-footer {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 0.875rem;
}

/* Logo Styles */
.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-section {
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-minerd {
    width: 180px;
    height: auto;
}

/* Microsoft Login Button */
.btn-microsoft {
    background-color: #ffffff;
    color: #5e5e5e;
    border: 1px solid #8c8c8c;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-microsoft:hover {
    background-color: #f8f8f8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #5e5e5e;
}

.microsoft-logo {
    width: 20px;
    height: 20px;
    margin-right: 12px;
}

/* Estilos para Catálogo de Equipos */
.catalogo-equipos-list {
    max-height: 60vh;
    overflow-y: auto;
}

.catalogo-equipo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: var(--transition);
    background: white;
}

.catalogo-equipo-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(31, 47, 114, 0.1);
}

.catalogo-equipo-info {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.catalogo-equipo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.catalogo-equipo-details {
    flex: 1;
}

.catalogo-equipo-details h6 {
    color: var(--dark);
    margin: 0;
    font-weight: 600;
}

.btn-seleccionar-equipo {
    flex-shrink: 0;
}

/* Estilos para Equipos Seleccionados */
.equipos-seleccionados-container {
    min-height: 100px;
}

.equipos-table {
    margin-bottom: 0;
}

.equipos-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.equipos-table thead th {
    border: none;
    padding: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
    color: white !important;
}

.equipos-table tbody tr {
    transition: var(--transition);
}

.equipos-table tbody tr:hover {
    background-color: rgba(31, 47, 114, 0.05);
}

.equipos-table tbody td {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

.especificaciones-text {
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.5;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-editar-equipo {
    padding: 0.375rem 0.5rem;
}

.btn-eliminar-equipo {
    padding: 0.375rem 0.5rem;
}

/* Modal Styles */
.modal-header {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-bottom: 2px solid var(--primary-color);
}

.modal-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive para modales */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .catalogo-equipo-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .btn-seleccionar-equipo {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
    }

    .main-header,
    .btn,
    .alert-warning,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }

    .d-print-block {
        display: block !important;
    }
}