/**
 * Estilos del Sistema de Guías
 * Laboratorios Columbia
 * Color corporativo: #002855
 */

/* =====================================================
   VARIABLES Y RESET
   ===================================================== */
:root {
    --primary-color: #002855;
    --primary-light: #003d80;
    --primary-dark: #001a3d;
    --primary-gradient: linear-gradient(135deg, #002855 0%, #003d80 50%, #004a99 100%);
    
    --secondary-color: #f8f9fa;
    --accent-color: #0066cc;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    
    --border-color: #dee2e6;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 2px 4px rgba(0, 40, 85, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 40, 85, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 40, 85, 0.16);
    --shadow-xl: 0 12px 40px rgba(0, 40, 85, 0.2);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* =====================================================
   PÁGINA DE LOGIN
   ===================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: backgroundMove 30s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50%, -50%); }
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-title {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--primary-gradient);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    width: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login svg {
    width: 24px;
    height: 24px;
}

/* =====================================================
   NAVEGACIÓN
   ===================================================== */
.navbar {
    background: var(--primary-gradient);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-brand img {
    height: 40px;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-menu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.navbar-menu a svg {
    width: 18px;
    height: 18px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    text-align: right;
    color: white;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =====================================================
   CONTENIDO PRINCIPAL
   ===================================================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title svg {
    width: 32px;
    height: 32px;
}

/* =====================================================
   TARJETAS
   ===================================================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header svg {
    width: 22px;
    height: 22px;
}

.card-body {
    padding: 1.5rem;
}

/* =====================================================
   FORMULARIOS
   ===================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 40, 85, 0.1);
}

.form-control:disabled,
.form-control[readonly] {
    background: #f8f9fa;
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-control::placeholder {
    color: #adb5bd;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =====================================================
   BOTONES
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =====================================================
   TABLAS
   ===================================================== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table th {
    background: var(--primary-color);
    color: white;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.table th:first-child {
    border-radius: var(--border-radius-sm) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--border-radius-sm) 0 0;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-empty {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-secondary);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(0, 40, 85, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* =====================================================
   FILTROS
   ===================================================== */
.filters-bar {
    background: white;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.filter-group .form-control {
    padding: 10px 14px;
}

/* =====================================================
   ESTADÍSTICAS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =====================================================
   LOADER
   ===================================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 40, 85, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader {
    text-align: center;
    color: white;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 1rem;
    font-weight: 500;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 992px) {
    .navbar-container {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }
    
    .navbar-menu {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-menu {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .navbar-menu a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

/* =====================================================
   UTILIDADES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-none { display: none !important; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* =====================================================
   LOGOS - Agregar al final de styles.css
   ===================================================== */

/* Logo en navbar */
.navbar-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
}

/* Logo en login */
.login-logo-img {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
}

/* Ocultar el SVG anterior del login si existe */
.login-logo {
    display: none;
}

