/* ==========================================================================
   ESTILOS COMUNES, VARIABLES Y SISTEMA DE DISEÑO BASE
   Árbol de Valor Minero - Plataforma Corporativa
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Fondos Base Blanco / Grisáceo */
    --bg-dark: #f1f5f9;       /* Fondo principal grisáceo claro */
    --bg-canvas: #f8fafc;     /* Fondo del lienzo */
    --bg-surface: #ffffff;    /* Superficie blanca */
    --bg-card: #ffffff;       /* Fondo de las tarjetas */
    --bg-card-hover: #f8fafc;
    
    /* Bordes y Separadores */
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;
    --border-active: #0284c7;
    
    /* Acentos Minería */
    --copper-primary: #d97706;
    --copper-light: #fef3c7;
    --cyan-accent: #0284c7;
    --cyan-light: #e0f2fe;
    
    /* Semáforos (Textos nítidos con fondo suave) */
    --status-green: #16a34a;
    --status-green-bg: #dcfce7;
    --status-green-text: #15803d;
    --status-green-border: #86efac;
    
    --status-yellow: #d97706;
    --status-yellow-bg: #fef3c7;
    --status-yellow-text: #b45309;
    --status-yellow-border: #fde68a;
    
    --status-red: #dc2626;
    --status-red-bg: #fee2e2;
    --status-red-text: #b91c1c;
    --status-red-border: #fca5a5;
    
    /* Textos (Alto Contraste) */
    --text-main: #0f172a;     /* Casi negro para máxima nitidez */
    --text-muted: #475569;    /* Gris medio */
    --text-dim: #64748b;      /* Gris tenue */
    
    /* Sombras y Radios */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Fuentes Ejecutivas y Corporativas para Minería */
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
    background-image: 
        radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%),
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 28px 28px, 28px 28px;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

.view-section {
    display: none;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
}

.view-section.active {
    display: flex;
    animation: viewFadeIn 0.25s ease-out;
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: scale(0.995); }
    to { opacity: 1; transform: scale(1); }
}

/* Identidad Visual & Logos Globales */
.brand-section, .catalog-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 28px !important;
    max-height: 28px !important;
    width: auto !important;
    max-width: 160px !important;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.brand-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    align-items: center;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--copper-light);
    color: var(--copper-primary);
    border: 1px solid #fde68a;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

/* Botones Comunes y Píldoras */
.btn-pill {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.76rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    text-decoration: none;
    white-space: nowrap;
}

.btn-pill:hover {
    background: #f8fafc;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-pill.btn-primary {
    background: var(--cyan-accent);
    color: #ffffff;
    border-color: var(--cyan-accent);
}

.btn-pill.btn-primary:hover {
    background: #0369a1;
}

.btn-back {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 700;
}

.btn-back:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* Buscador Común */
.search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    width: 240px;
    gap: 8px;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--cyan-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--cyan-light);
}

.search-box svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-dim);
    flex-shrink: 0;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-main);
    font-size: 0.78rem;
    color: var(--text-main);
    width: 100%;
}

.search-input::placeholder {
    color: var(--text-dim);
}

/* Badges de Estado y Semáforos */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.status-badge.green { background: var(--status-green-bg); color: var(--status-green-text); }
.status-badge.yellow { background: var(--status-yellow-bg); color: var(--status-yellow-text); }
.status-badge.red { background: var(--status-red-bg); color: var(--status-red-text); }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green { background: var(--status-green); }
.status-dot.yellow { background: var(--status-yellow); }
.status-dot.red { background: var(--status-red); }

/* Scrollbar Sutil */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
