/**
 * SAGRILAFT - Tema Global
 * Paleta de colores y tipografía unificada para todo el proyecto
 */

:root {
    /* === COLORES DE FONDO === */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(59, 130, 246, 0.07);
    --bg-input: rgba(255, 255, 255, 0.95);
    --bg-input-focus: rgba(255, 255, 255, 1);
    
    /* === COLORES DE TEXTO === */
    --text-primary: #0f172a;
    --text-secondary: #1e293b;
    --text-muted: #475569;
    --text-disabled: #94a3b8;
    --text-placeholder: #94a3b8;
    
    /* === COLORES DE ACENTO === */
    --accent-primary: #38bdf8;
    --accent-secondary: #1d4ed8;
    --accent-light: #93c5fd;
    --accent-lighter: #7dd3fc;
    
    /* === COLORES DE ESTADO === */
    --success: #10b981;
    --success-light: #86efac;
    --success-bg: rgba(34, 197, 94, 0.2);
    --success-border: rgba(34, 197, 94, 0.5);
    
    --error: #ef4444;
    --error-light: #fca5a5;
    --error-lighter: #fecaca;
    --error-bg: rgba(239, 68, 68, 0.2);
    --error-border: rgba(239, 68, 68, 0.5);
    
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --warning-border: rgba(251, 191, 36, 0.5);
    
    --info: #3b82f6;
    --info-light: #93c5fd;
    --info-bg: rgba(59, 130, 246, 0.2);
    --info-border: rgba(59, 130, 246, 0.5);
    
    /* === BORDES === */
    --border-primary: rgba(71, 85, 105, 0.5);
    --border-secondary: rgba(71, 85, 105, 0.2);
    --border-accent: rgba(59, 130, 246, 0.4);
    --border-focus: rgba(56, 189, 248, 0.5);
    
    /* === SOMBRAS === */
    --shadow-sm: 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
    
    /* === TIPOGRAFÍA === */
    --font-primary: sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* === TAMAÑOS DE FUENTE === */
    --text-xs: 0.75rem;
    --text-sm: 0.85rem;
    --text-base: 0.95rem;
    --text-lg: 1.1rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    
    /* === ESPACIADO === */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    
    /* === BORDER RADIUS === */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 999px;
    
    /* === TRANSICIONES === */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* === RESET Y BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background: #ffffff;
    color: var(--text-primary);
    line-height: 1.6;
}

/* === TIPOGRAFÍA === */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin: 0;
}

p {
    color: var(--text-secondary);
    margin: 0;
}

a {
    color: var(--accent-lighter);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-light);
}

/* === INPUTS Y FORMULARIOS === */
input, select, textarea {
    font-family: var(--font-primary);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    font-size: var(--text-base);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

input::placeholder,
select::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--border-focus);
    background: var(--bg-input-focus);
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === BOTONES === */
button, .btn {
    font-family: var(--font-primary);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-full);
    padding: 0.65rem 1rem;
    font-size: var(--text-base);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.4), 0 4px 6px -4px rgba(30, 64, 175, 0.3);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(241, 245, 249, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: var(--text-primary);
}

.btn-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.btn-success:hover {
    background: #bbf7d0;
}

.btn-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}
    border: 1px solid var(--error-border);
}

.btn-error:hover {
    background: #fecaca;
}

/* === BADGES Y PILLS === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.badge-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.badge-warning {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde047;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
}

/* === TABLAS === */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

th, td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-secondary);
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(241, 245, 249, 0.8);
}

td {
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-card-hover);
}

/* === MENSAJES === */
.message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-lg);
}

.message-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.message-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.message-warning {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #a16207;
}

.message-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

/* Alias para compatibilidad */
.message.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.message.error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.message.warning {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #a16207;
}

.message.info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

/* === UTILIDADES === */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-light); }
.text-error { color: var(--error-light); }
.text-warning { color: var(--warning-light); }
.text-info { color: var(--info-light); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-card { background: var(--bg-card); }

.font-mono { font-family: var(--font-mono); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Utilidad: ocultar completamente */
.d-none { display: none !important; }
