/* ================================================
   THROMBIA - Sistema Médico Profesional
   Paleta: Blanco roto/sucio + Azules corporativos
   ================================================ */

:root {
    /* Colores principales */
    --bg-primary: #f8f9fa;        /* Fondo general - blanco sucio */
    --bg-secondary: #fefefe;      /* Tarjetas - blanco roto */
    --bg-white: #ffffff;          /* Blanco puro para contraste */
    
    /* Azules profesionales médicos */
    --blue-primary: #1e40af;      /* Azul principal */
    --blue-dark: #1e3a8a;         /* Azul oscuro hover */
    --blue-light: #3b82f6;        /* Azul claro */
    --blue-subtle: #dbeafe;       /* Azul muy suave */
    --blue-pale: #eff6ff;         /* Azul pálido */
    
    /* Grises neutros */
    --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;
    
    /* Colores de estado médico */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
}

/* ============ RESET Y BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif !important;
    color: var(--gray-800) !important;
    line-height: 1.6;
}

/* ============ CONTENEDORES ============ */
.container, .main-container {
    background: var(--bg-secondary) !important;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin: 20px auto;
}

/* ============ HEADER Y TÍTULOS ============ */
h1, h2, h3, h4, h5, h6 {
    color: var(--blue-dark) !important;
    font-weight: 600;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ============ TARJETAS DE ESTADÍSTICAS ============ */
.stat-card, .card {
    background: var(--bg-white) !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.12);
    transform: translateY(-2px);
}

.stat-card h3, .stat-card .number {
    color: var(--blue-primary) !important;
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-card p, .stat-card .label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============ BADGES Y ETIQUETAS ============ */
.badge {
    background: var(--blue-pale) !important;
    color: var(--blue-primary) !important;
    border: 1px solid var(--blue-subtle);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success {
    background: #d1fae5 !important;
    color: var(--success) !important;
    border-color: #a7f3d0;
}

.badge-warning {
    background: #fef3c7 !important;
    color: var(--warning) !important;
    border-color: #fde68a;
}

/* ============ BOTONES ============ */
button, .btn, input[type="submit"] {
    background: var(--blue-primary) !important;
    color: white !important;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

button:hover, .btn:hover {
    background: var(--blue-dark) !important;
    box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
    transform: translateY(-1px);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* Botón secundario */
.btn-secondary, .btn-outline {
    background: white !important;
    color: var(--blue-primary) !important;
    border: 2px solid var(--blue-primary) !important;
}

.btn-secondary:hover {
    background: var(--blue-pale) !important;
}

/* ============ NAVEGACIÓN Y PESTAÑAS ============ */
.nav-tabs {
    border-bottom: 2px solid var(--gray-200) !important;
    background: transparent !important;
}

.nav-tabs .nav-link {
    color: var(--gray-600) !important;
    border: none !important;
    background: transparent !important;
    padding: 12px 24px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
    color: var(--blue-primary) !important;
    background: transparent !important;
    border-bottom: 3px solid var(--blue-primary) !important;
    font-weight: 600;
}

.nav-tabs .nav-link:hover {
    color: var(--blue-primary) !important;
    background: var(--blue-pale) !important;
}

/* ============ FORMULARIOS ============ */
input, textarea, select {
    background: var(--bg-white) !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    color: var(--gray-800) !important;
}

input:focus, textarea:focus, select:focus {
    outline: none !important;
    border-color: var(--blue-primary) !important;
    box-shadow: 0 0 0 3px var(--blue-pale) !important;
}

label {
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    font-size: 0.9rem;
}

/* ============ TABLAS ============ */
table {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: var(--gray-50) !important;
}

th {
    color: var(--gray-700) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 2px solid var(--gray-200) !important;
}

td {
    color: var(--gray-600);
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

tr:hover {
    background: var(--gray-50) !important;
}

/* ============ BARRAS DE PROGRESO ============ */
.progress {
    background: var(--gray-100) !important;
    border-radius: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-light)) !important;
}

/* ============ ALERTAS Y NOTIFICACIONES ============ */
.alert {
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid;
}

.alert-info {
    background: var(--blue-pale);
    border-left-color: var(--blue-primary);
    color: var(--blue-dark);
}

.alert-success {
    background: #d1fae5;
    border-left-color: var(--success);
    color: #065f46;
}

/* ============ COLORES DE FONDO ESPECÍFICOS ============ */
/* Eliminar gradientes morados/rosas */
.bg-gradient-primary,
.bg-primary,
body[class*="gradient"],
div[class*="gradient"] {
    background: var(--bg-primary) !important;
}

/* Forzar fondos profesionales en elementos con inline styles */
[style*="background: linear-gradient"],
[style*="background: rgb"],
[style*="background: #"] {
    background: var(--bg-secondary) !important;
}

/* ============ ICONOS Y EMOJIS ============ */
.icon {
    color: var(--blue-primary);
}

/* Reemplazar emojis por colores profesionales si es posible */
.emoji-icon {
    display: none;
}

/* ============ SOMBRAS Y ELEVACIONES ============ */
.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow-lg {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

/* ============ ESTADOS DE COLOR ============ */
.text-primary { color: var(--blue-primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--gray-500) !important; }

/* ============ SCROLLBAR PERSONALIZADO ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .container, .main-container {
        padding: 16px;
        margin: 10px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card h3 {
        font-size: 2rem;
    }
}
