:root {
    /* Editorial Light Theme Palette */
    --editorial-bg: #FFFFFF;
    --editorial-surface: #F8FAFC;
    /* Corporate Palette */
    --merco-red: #CE311E;
    --merco-deep: #A01421;
    --editorial-text: #1E293B;
    --editorial-text-secondary: #64748B;
    --editorial-accent: var(--merco-red);
    --editorial-accent-deep: var(--merco-deep);
    --editorial-border: #E2E8F0;
    /* Very light gray for structure */

    /* Editorial Structure & Typography */
    --editorial-padding: 3rem;
    --font-jakarta: 'Plus Jakarta Sans', sans-serif;
    --transition-fast: all 0.2s ease-in-out;
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

body {
    background-color: var(--editorial-bg);
    color: var(--editorial-text);
    font-family: var(--font-jakarta);
    margin: 0;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar: Refined & Modern */
.sidebar {
    background: var(--editorial-surface);
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--editorial-border);
}

.sidebar-logo {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: var(--merco-red);
    margin-bottom: 4rem;
    padding-left: 1rem;
    text-transform: uppercase;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    color: var(--editorial-text-secondary);
    text-decoration: none;
    padding: 0.8rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 12px;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--editorial-text);
}

.nav-link.active {
    background: #fff;
    color: var(--merco-red);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-link.active svg {
    color: var(--merco-red);
    transform: scale(1.1);
}

/* User Profile Section */
.sidebar-user {
    margin-top: auto;
    background: #fff;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--editorial-border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--merco-red);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-details {
    overflow: hidden;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--editorial-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 0.7rem;
    color: var(--editorial-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Content Area */
.main-content {
    padding: 4rem 6rem;
    max-width: 1600px;
    width: 100%;
    background: #fff;
}

/* Header Typography */
.header {
    margin-bottom: 5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--editorial-border);
}

.header h1 {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.05em;
    margin: 0 0 1rem 0;
    color: var(--editorial-text);
    line-height: 1.1;
}

.header h1 strong {
    font-weight: 800;
}

.header p {
    color: var(--editorial-text-secondary);
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0;
    max-width: 800px;
}

/* Minimalist Grids */
.editorial-grid-flex {
    display: flex;
    gap: 4rem;
    flex-wrap: wrap;
    margin-bottom: 5rem;
}

.editorial-metric {
    display: flex;
    flex-direction: column;
}

.editorial-label {
    font-size: 0.75rem;
    color: var(--editorial-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.editorial-value {
    font-size: 3rem;
    font-weight: 300;
    color: var(--editorial-text);
    line-height: 1;
    letter-spacing: -0.04em;
}

.editorial-value strong {
    font-weight: 800;
}

/* Structural Dividers */
.section-divider {
    height: 1px;
    background: var(--editorial-border);
    margin: 4rem 0;
    width: 100%;
}

/* Premium Cards */
.premium-card {
    background: #fff;
    border: 1px solid var(--editorial-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--editorial-text);
    margin-bottom: 2.5rem;
}

/* Tables: Data-Ink Optimized */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 3rem;
}

th {
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--editorial-text-secondary);
    padding: 1rem 0;
    border-bottom: 2px solid var(--editorial-text);
}

td {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--editorial-border);
    font-weight: 400;
    color: var(--editorial-text);
}

tr:last-child td {
    border-bottom: 1px solid var(--editorial-text);
}

/* Ultra-thin Data Bars */
.chart-bar-bg {
    background: var(--editorial-surface);
    height: 4px !important;
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    background: var(--editorial-accent) !important;
    height: 100%;
    border-radius: 0;
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Tabs: Text-based Sub-navigation */
.tabs-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--editorial-border);
    padding-bottom: 0;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--editorial-text-secondary);
    padding: 0 0 1rem 0;
    font-family: inherit;
    font-weight: 500;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    outline: none;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--editorial-text);
    transition: width 0.3s ease;
}

.tab-btn:hover {
    color: var(--editorial-text);
}

.tab-btn.active {
    color: var(--editorial-text);
    font-weight: 700;
}

.tab-btn.active::after {
    width: 100%;
    background: var(--editorial-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Traits and Fuentes: Inline Text */
.inline-trait {
    font-size: 0.85rem;
    color: var(--editorial-text);
    font-weight: 600;
    margin-right: 0.5rem;
    background: var(--editorial-surface);
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--editorial-border);
}

.inline-fuente {
    font-size: 0.85rem;
    color: var(--editorial-text-secondary);
    text-decoration: none;
    display: block;
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.inline-fuente:hover {
    color: var(--editorial-text);
    text-decoration: underline;
    text-decoration-color: var(--editorial-accent);
}

/* Form Elements */
.custom-select {
    background: var(--editorial-surface) !important;
    border: 1px solid var(--editorial-border) !important;
    border-radius: 0 !important;
    color: var(--editorial-text) !important;
    padding: 1rem !important;
    font-family: inherit;
    font-size: 0.95rem;
}

.custom-select:focus {
    border-color: var(--editorial-text) !important;
    outline: none;
}

.btn-premium {
    background: var(--editorial-text) !important;
    color: var(--editorial-bg) !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 1rem 2.5rem;
    border-radius: 0;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-premium:hover {
    background: var(--merco-deep) !important;
    color: var(--editorial-bg) !important;
}

/* Specific Content Layouts */
.editorial-module {
    margin-bottom: 4rem;
}

.editorial-module-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--editorial-text);
    margin-bottom: 1rem;
}

.editorial-module-desc {
    color: var(--editorial-text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

/* A link style for homepage blocks */
.editorial-link-block {
    text-decoration: none;
    color: inherit;
    display: block;
    border-left: 2px solid var(--editorial-border);
    padding-left: 2rem;
    transition: border-color 0.3s ease;
}

.editorial-link-block:hover {
    border-left-color: var(--editorial-accent);
}