:root {
    /* Paleta Maestra: Cálida, Corporativa, Premium */
    --bg-bone: #F7F5F0;
    --surface-white: #FFFFFF;
    --petrol-deep: #142331; /* Más fiel a la imagen */
    --petrol-soft: #1B2D3D; /* Color del navbar */
    --terracotta: #D36A45;  /* Naranja de los botones */
    --sand-beige: #E1D3C0;
    --copper-accent: #B8860B;
    --warm-gray: #6B7280;
    --border-soft: rgba(15, 23, 42, 0.08);

    /* Functional Colors */
    --success: #16A34A;
    --success-bg: rgba(22, 163, 74, 0.1);
    --danger: #DC2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --warning: #D97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --info: #0284C7;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-sans); background-color: var(--bg-bone);
    color: var(--petrol-deep); line-height: 1.6; min-height: 100vh;
}

/* Background Texture */
.background-mesh {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: -1;
    background-image: radial-gradient(at 0% 0%, rgba(229, 211, 179, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(193, 110, 78, 0.05) 0px, transparent 50%);
}

/* Navigation - Dark Theme */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.5rem; background: var(--petrol-soft); color: white;
    position: sticky; top: 0; z-index: 100;
}

.logo { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: white; }
.logo i { color: var(--terracotta); font-size: 1.5rem; }

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-item {
    text-decoration: none; color: rgba(255, 255, 255, 0.7); font-weight: 500; font-size: 0.85rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.5rem 0; position: relative; transition: all 0.3s ease;
}
.nav-item i { font-size: 1.1rem; }
.nav-item:hover, .nav-item.active { color: white; }
.nav-item.active::after {
    content: ''; position: absolute; bottom: -12px; left: 0; width: 100%; height: 3px;
    background: var(--terracotta); border-radius: 3px 3px 0 0;
}

.nav-user { display: flex; align-items: center; gap: 1.5rem; }
.nav-user i { font-size: 1.2rem; color: rgba(255,255,255,0.8); cursor: pointer; }
.nav-avatar {
    width: 36px; height: 36px; background: #E5E7EB; color: var(--petrol-soft);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem;
}

/* Main Container */
.container { width: 100%; max-width: none; margin: 0; padding: 1.5rem 1.5rem; }

/* Firma institucional compartida con el ecosistema Aseguramiento IA */
.site-authorship {
    width: 100%;
    margin-top: 6px;
    padding: 0 4vw 18px;
    color: var(--petrol-deep);
    background: #eef2f3;
}

.authorship-layout {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 4px 0;
    border-top: 1px solid #c9d5d9;
}

.authorship-monogram {
    position: relative;
    display: block;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    height: 58px;
    padding: 0;
    overflow: hidden;
    background: #eef2f3;
}

.authorship-monogram img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 1084px;
    max-width: none;
    height: 85px;
    transform: translate(-1px, -1px);
}

.authorship-copy {
    display: grid;
    gap: 4px;
    line-height: normal;
}

.authorship-copy strong {
    color: var(--petrol-deep);
    font-size: 0.88rem;
}

.authorship-copy span,
.authorship-domain {
    color: var(--warm-gray);
    font-size: 0.72rem;
}

.authorship-domain {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 620px) {
    .site-authorship { padding-right: 1.25rem; padding-left: 1.25rem; }

    .authorship-layout {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: flex-start;
        gap: 16px;
    }

    .authorship-domain {
        grid-column: 2;
        text-align: left;
    }
}

/* Header / Hero Row */
.header-hero { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; }
.header-content { flex: 1; }

.module-pill {
    display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(211, 106, 69, 0.1);
    color: var(--terracotta); padding: 0.4rem 1rem; border-radius: 2rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 1rem;
}
.module-pill i { font-size: 0.9rem; }
.hero h1 { font-family: var(--font-heading); font-size: 2.2rem; color: var(--petrol-deep); margin-bottom: 0.5rem; font-weight: 700; }
.hero p { color: var(--warm-gray); font-size: 1rem; font-weight: 400; }

.header-actions { display: flex; gap: 1rem; }
.btn-primary {
    background: var(--terracotta); color: white; border: none; padding: 0.75rem 1.5rem;
    font-size: 0.9rem; font-weight: 600; font-family: var(--font-heading); border-radius: 0.5rem;
    cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s;
}
.btn-primary:hover:not(:disabled) { background: #C15B38; }
.btn-secondary {
    background: white; color: var(--petrol-deep); border: 1px solid var(--border-soft);
    padding: 0.75rem 1.5rem; font-size: 0.9rem; font-weight: 600; font-family: var(--font-heading);
    border-radius: 0.5rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg-bone); }

/* Landing */
.landing-shell {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0 4rem;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 1.75rem;
    align-items: stretch;
}

.landing-copy,
.landing-highlight-card,
.landing-card,
.landing-module-card,
.landing-band,
.landing-proof-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-soft);
    box-shadow: 0 20px 45px rgba(20, 35, 49, 0.06);
}

.landing-copy {
    padding: 3rem;
    border-radius: 2rem;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,248,243,0.94)),
        radial-gradient(circle at top right, rgba(211, 106, 69, 0.14), transparent 35%);
}

.landing-kicker,
.landing-section-heading span,
.landing-band-kicker,
.landing-proof span,
.highlight-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--terracotta);
}

.landing-copy h1 {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: 10ch;
}

.landing-copy p {
    margin-top: 1.25rem;
    max-width: 60ch;
    font-size: 1.06rem;
    color: var(--warm-gray);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.landing-cta,
.landing-cta-secondary {
    width: auto;
    border-radius: 999px;
    padding: 1rem 1.5rem;
}

.landing-microcopy {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-top: 1.5rem;
    color: var(--petrol-soft);
    font-size: 0.88rem;
}

.landing-microcopy span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.landing-highlight-card {
    border-radius: 2rem;
    padding: 2rem;
    background: linear-gradient(180deg, var(--petrol-soft), var(--petrol-deep));
    color: white;
}

.landing-highlight-card h2 {
    margin-top: 0.9rem;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.1;
}

.highlight-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.highlight-metric {
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
}

.highlight-metric strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.7rem;
}

.highlight-metric span,
.highlight-list li {
    color: rgba(255,255,255,0.78);
    font-size: 0.9rem;
}

.highlight-list {
    margin-top: 1.25rem;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.8rem;
}

.landing-section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.landing-section-heading h2,
.landing-band h2,
.landing-proof h2 {
    margin-top: 0.55rem;
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    line-height: 1.1;
    color: var(--petrol-deep);
    max-width: 18ch;
}

.landing-grid {
    display: grid;
    gap: 1.25rem;
}

.landing-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-card,
.landing-module-card {
    border-radius: 1.5rem;
    padding: 1.6rem;
}

.landing-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(211, 106, 69, 0.12);
    color: var(--terracotta);
    font-size: 1.2rem;
}

.landing-card-icon.accent-blue {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.landing-card-icon.accent-green {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.landing-card h3,
.landing-module-card h3,
.landing-proof-card h3 {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--petrol-deep);
}

.landing-card p,
.landing-module-card p,
.landing-proof p,
.landing-proof-card p {
    margin-top: 0.7rem;
    color: var(--warm-gray);
    font-size: 0.95rem;
}

.landing-module-card {
    position: relative;
    overflow: hidden;
}

.landing-module-card small {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--terracotta);
    letter-spacing: 0.08em;
}

.landing-band {
    border-radius: 2rem;
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
}

.landing-timeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.timeline-step {
    padding: 1.15rem;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #fffaf7, #ffffff);
    border: 1px solid rgba(211, 106, 69, 0.12);
}

.timeline-step strong {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--terracotta);
    color: white;
    font-family: var(--font-heading);
}

.timeline-step p {
    margin-top: 0.9rem;
    color: var(--petrol-soft);
    font-size: 0.92rem;
}

.landing-split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 1.25rem;
    align-items: stretch;
}

.landing-proof {
    padding: 0.5rem 0;
}

.landing-proof ul {
    margin-top: 1.2rem;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.75rem;
    color: var(--petrol-soft);
}

.landing-proof-card {
    border-radius: 1.75rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

@media (max-width: 1100px) {
    .landing-hero,
    .landing-split,
    .landing-grid-4,
    .landing-timeline {
        grid-template-columns: 1fr 1fr;
    }

    .landing-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .landing-hero,
    .landing-split,
    .landing-grid-4,
    .landing-timeline,
    .highlight-metrics {
        grid-template-columns: 1fr;
    }

    .landing-copy,
    .landing-highlight-card,
    .landing-band,
    .landing-proof-card {
        padding: 1.5rem;
        border-radius: 1.5rem;
    }

    .landing-copy h1 {
        max-width: none;
        font-size: 2.4rem;
    }
}

/* Stepper */
.stepper-container {
    display: flex; align-items: center; justify-content: space-between; background: var(--surface-white);
    padding: 1.5rem 2rem; border-radius: 1rem; border: 1px solid var(--border-soft); margin-bottom: 2rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.step { display: flex; align-items: center; gap: 0.75rem; position: relative; }
.step-number {
    width: 32px; height: 32px; border-radius: 50%; background: #E5E7EB; color: #6B7280;
    display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem;
    transition: all 0.3s;
}
.step-text h4 { font-family: var(--font-heading); font-size: 0.9rem; color: #6B7280; margin: 0; transition: color 0.3s; }
.step-text p { font-size: 0.75rem; color: var(--warm-gray); margin: 0; }
.step-separator { color: var(--sand-beige); font-size: 1.2rem; transition: color 0.3s; }

/* Stepper States */
.step.active .step-number { background: var(--terracotta); color: white; box-shadow: 0 0 0 4px rgba(211, 106, 69, 0.1); }
.step.active .step-text h4 { color: var(--terracotta); }

.step.completed .step-number { background: var(--success); color: white; }
.step.completed .step-text h4 { color: var(--success); }
.step.completed + .step-separator { color: var(--success); }


/* Filters Row */
.filters-row { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-group label { font-size: 0.8rem; font-weight: 600; color: var(--petrol-soft); }
.filter-input {
    background: white; border: 1px solid var(--border-soft); padding: 0.6rem 1rem;
    border-radius: 0.5rem; font-family: inherit; font-size: 0.9rem; color: var(--petrol-deep);
    min-width: 140px; outline: none;
}
.filter-input:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(211, 106, 69, 0.1); }

/* EAPB Multi-Select Widget (Restored) */
.eapb-multiselect { position: relative; width: 100%; min-width: 220px; font-family: var(--font-sans); font-size: 0.9rem; }
.eapb-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.6rem 1rem; background: white; border: 1px solid var(--border-soft);
    border-radius: 0.5rem; cursor: pointer; color: var(--petrol-deep);
    transition: all 0.25s; min-height: 40px; user-select: none;
    flex-wrap: wrap; max-width: 450px;
}
.eapb-trigger:focus { outline: none; border-color: var(--terracotta); }
.eapb-trigger-label { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1; }

.eapb-pill {
    background: rgba(211, 106, 69, 0.08); border: 1px solid rgba(211, 106, 69, 0.15);
    color: var(--terracotta); padding: 2px 8px; border-radius: 4px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
    display: inline-flex; align-items: center;
}
.eapb-pill.all { background: var(--petrol-soft); color: white; border: none; }
.eapb-pill.count { background: var(--bg-bone); color: var(--warm-gray); border-color: var(--border-soft); }

.eapb-chevron { font-size: 0.7rem; color: var(--warm-gray); transition: transform 0.25s; flex-shrink: 0; }
/* Estado de Dropdown EAPB - Refinado para robustez */
.eapb-trigger.is-active {
    border-color: var(--terracotta) !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.eapb-trigger.is-active .eapb-chevron {
    transform: rotate(180deg);
}

.eapb-dropdown {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-soft);
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.eapb-dropdown.is-active {
    display: block !important;
}
.eapb-search-row { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-soft); background: #FFF9F5; }
.eapb-list { max-height: 220px; overflow-y: auto; padding: 0.35rem 0; }
.eapb-list::-webkit-scrollbar { width: 5px; }
.eapb-list::-webkit-scrollbar-thumb { background: var(--sand-beige); border-radius: 4px; }
.eapb-check-item {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.85rem; cursor: pointer;
    color: var(--petrol-deep); font-size: 0.85rem;
}
.eapb-check-item:hover { background: rgba(211,106,69,0.05); }
.eapb-all-row { font-weight: 700; color: var(--terracotta); }
.eapb-check-item input[type="checkbox"] { accent-color: var(--terracotta); width: 15px; height: 15px; cursor: pointer; }
.eapb-cod-badge {
    margin-left: auto; font-size: 0.68rem; font-family: 'JetBrains Mono', monospace; color: var(--warm-gray);
    background: var(--bg-bone); padding: 0.1rem 0.35rem; border-radius: 0.3rem; border: 1px solid var(--border-soft);
}

/* Dashboard Metrics Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin-bottom: 3rem; }
.stat-card {
    background: var(--surface-white); padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border-soft);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02); display: flex; flex-direction: column; gap: 0.5rem; position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card:nth-child(1)::before { background: #FFEDD5; }
.stat-card:nth-child(2)::before { background: #DBEAFE; }
.stat-card:nth-child(4)::before { background: #DCFCE7; }
.stat-card:nth-child(5)::before { background: #FEF3C7; }
.stat-header { display: flex; align-items: center; gap: 0.75rem; color: var(--petrol-deep); font-weight: 600; font-size: 0.85rem; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.c-orange { background: #FFEDD5; color: #EA580C; }
.c-blue { background: #DBEAFE; color: #2563EB; }
.c-green { background: #DCFCE7; color: #16A34A; }
.c-yellow { background: #FEF3C7; color: #D97706; }
.stat-value { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--petrol-deep); }
.stat-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--warm-gray); }
.trend { display: flex; align-items: center; gap: 0.25rem; font-weight: 600; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Dark Card (Brecha Neta) */
.dark-card { background: var(--petrol-deep); color: white; border-color: var(--petrol-deep); }
.dark-card .stat-header { color: white; }
.dark-card .stat-value { color: white; }
.dark-card .stat-footer { color: rgba(255,255,255,0.7); }
.dark-card::before { display: none; }
.dark-card .stat-icon { background: rgba(255,255,255,0.1); color: var(--terracotta); }

/* Dropzones */
.upload-section {
    background: var(--surface-white); border: 1px solid var(--border-soft); border-radius: 1.5rem;
    padding: 2.5rem; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05); margin-bottom: 3rem;
}
.dropzone-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.dropzone {
    position: relative;
    overflow: hidden;
    border: 1.5px dashed var(--sand-beige); border-radius: 1rem; padding: 2.5rem 1rem; text-align: center;
    cursor: pointer; background: #FFFEFC; transition: all 0.3s;
}
.dropzone:hover { border-color: var(--terracotta); background: #FFF9F5; }
.dropzone i { font-size: 2.5rem; color: var(--copper-accent); margin-bottom: 1rem; display: block;}
.dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 20;
}

/* Table Section */
.table-header {
    display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem;
    background: white; border: 1px solid var(--border-soft); border-radius: 1rem 1rem 0 0; border-bottom: none;
}
.table-header-title { display: flex; align-items: center; gap: 1rem; }
.table-header-title h3 { font-family: var(--font-heading); font-size: 1.1rem; text-transform: uppercase; color: var(--petrol-deep); }
.table-header-title span { color: var(--warm-gray); font-size: 0.85rem; }
.table-actions { display: flex; gap: 0.75rem; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box i { position: absolute; left: 10px; color: var(--warm-gray); font-size: 0.85rem; }
.search-box input { padding: 0.5rem 1rem 0.5rem 2rem; border: 1px solid var(--border-soft); border-radius: 0.5rem; font-size: 0.85rem; outline: none; width: 250px; }
.search-box input:focus { border-color: var(--terracotta); }
.btn-icon {
    background: white; border: 1px solid var(--border-soft); padding: 0.5rem 1rem;
    border-radius: 0.5rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 500;
}
.btn-icon:hover { background: var(--bg-bone); }

.table-container { background: var(--surface-white); border-radius: 0 0 1rem 1rem; border: 1px solid var(--border-soft); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem 0.75rem; font-size: 0.8rem; text-align: center; }
th:first-child, td:first-child { text-align: left; padding-left: 1.5rem; }
th { background: #F8FAFC; font-family: var(--font-heading); font-size: 0.75rem; font-weight: 600; color: var(--petrol-soft); border-bottom: 1px solid var(--border-soft); border-top: 1px solid var(--border-soft); white-space: nowrap; }
td { border-bottom: 1px solid var(--border-soft); color: var(--petrol-deep); }
tr:hover td { background: #F8FAFC; }

.badge { padding: 0.3rem 0.8rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; }
.badge-critica { background: #FECACA; color: #991B1B; }
.badge-alta { background: #FED7AA; color: #9A3412; }
.badge-media { background: #FEF08A; color: #854D0E; }
.badge-baja { background: #BBF7D0; color: #166534; }

.action-buttons { display: flex; gap: 0.4rem; justify-content: center; }
.action-btn { border: 1px solid var(--border-soft); background: white; border-radius: 4px; padding: 0.3rem 0.4rem; cursor: pointer; color: var(--warm-gray); }
.action-btn:hover { background: var(--bg-bone); color: var(--petrol-deep); }

/* Matrix Inputs (Premium Styling) */
.matrix-input {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    color: var(--petrol-deep);
    background: #FDFCFB;
    transition: all 0.2s;
    text-align: center;
}
.matrix-input:focus {
    border-color: var(--terracotta);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(211, 106, 69, 0.1);
}
.matrix-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.matrix-input::-webkit-outer-spin-button,
.matrix-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Highlight columns */
.val-final { font-weight: 700; color: var(--terracotta); }
.dif-giros { font-weight: 600; }
.dif-dias { color: var(--warm-gray); }

.row-anomaly {
    background-color: rgba(211, 106, 69, 0.05) !important;
}
.row-anomaly td {
    border-left: 4px solid var(--terracotta);
}

/* Giro Table (Restored) */
.giro-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.giro-table th {
    background: #F8FAFC;
    color: var(--petrol-soft);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 12px 15px;
    border-bottom: 2px solid var(--sand-beige);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.giro-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.85rem;
    color: var(--petrol-deep);
}
.giro-table tr:last-child td {
    border-bottom: none;
}
.giro-table tr:hover td {
    background: rgba(211, 106, 69, 0.02);
}

/* --- 🚀 Loader Overlay Profesional (Smart Scan) --- */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.75); /* Fondo blanco cristalino */
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 4rem 2rem;
    background: white;
    border-radius: 2.5rem;
    box-shadow: 0 40px 100px rgba(0,0,0,0.12);
    border: 1px solid rgba(211, 106, 69, 0.05);
    animation: zoomIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-circle-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-circle {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: rgba(211, 106, 69, 0.08);
    stroke-width: 8;
}

.progress-circle-fill {
    fill: none;
    stroke: var(--terracotta);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 389.5; /* 2 * PI * 62 */
    stroke-dashoffset: 389.5; /* starts empty = 0% */
    transition: stroke-dashoffset 0.6s ease-in-out;
}

.progress-percentage {
    position: absolute;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--petrol-deep);
}

.loader-record-count {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--petrol-soft);
    opacity: 0.8;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: var(--font-sans);
}


@keyframes scanLine {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#processing-loader.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.validation-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Findings Container (Step 4) */
.findings-container {
    background: white; border: 1px solid var(--border-soft); border-radius: 1rem;
    padding: 1.5rem; margin-bottom: 2rem; box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.findings-header { display: flex; align-items: center; gap: 0.75rem; color: var(--terracotta); margin-bottom: 1rem; border-bottom: 1px solid var(--border-soft); padding-bottom: 0.75rem; }
.findings-header h4 { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; }
.findings-list { display: flex; flex-direction: column; gap: 0.75rem; }
.finding-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: rgba(211, 106, 69, 0.03); border-radius: 0.75rem; border: 1px solid rgba(211, 106, 69, 0.08); font-size: 0.85rem; }
.finding-item i { color: var(--terracotta); font-size: 1.1rem; }
.finding-text { flex: 1; }
.finding-badge { padding: 2px 8px; border-radius: 4px; background: var(--terracotta); color: white; font-size: 0.7rem; font-weight: 700; margin-left: auto; }
/* --- 📊 Módulo de Analítica WOW --- */
.analytics-container {
    margin-bottom: 2.5rem;
    animation: fadeInSlide 0.8s ease-out;
}

.analytics-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    color: var(--petrol-deep);
}

.analytics-header h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* KPI Cards Vibrantes */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    position: relative;
    padding: 1.5rem;
    border-radius: 1.25rem;
    color: white;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.kpi-label { font-size: 0.8rem; font-weight: 500; opacity: 0.9; margin-bottom: 0.5rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; font-family: var(--font-heading); }
.kpi-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 4rem;
    opacity: 0.15;
    transform: rotate(-15deg);
}

/* Paleta Vibrante */
.vibrant-blue { background: linear-gradient(135deg, #0ea5e9, #2563eb); box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2); }
.vibrant-orange { background: linear-gradient(135deg, #fb923c, #f97316); box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2); }
.vibrant-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 10px 20px rgba(124, 58, 237, 0.2); }
.vibrant-green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 20px rgba(5, 150, 105, 0.2); }

/* Charts Layout */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--petrol-deep);
    font-size: 0.9rem;
}

.btn-chart-export {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--petrol-soft);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-chart-export:hover {
    background: var(--terracotta);
    color: white;
    transform: scale(1.1);
}

canvas {
    max-height: 280px;
    width: 100% !important;
}

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

/* --- 🏛️ Sistema de Navegación por Vistas (SPA) --- */
.view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Animación de entrada para vistas */
.active {
    animation: viewFadeIn 0.5s ease forwards;
}

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

/* --- 🏛️ Estilos Página de INICIO --- */
.strategic-card {
    background: white;
    padding: 2.2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.strategic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: var(--terracotta);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* --- 🌫️ Sistema de Avance Progresivo (Secuencial) --- */
.step-container {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideDownExpanded 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Estado tenue para pasos completados */
.completed-step {
    opacity: 0.7;
    filter: grayscale(0.2);
    pointer-events: auto; /* Permitir edición si es necesario */
}

@keyframes slideDownExpanded {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.99);
        max-height: 0;
        overflow: hidden;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 2000px;
    }
}
/* --- 💳 Módulo de Cartera (Premium) --- */
.cartera-bar {
    transition: height 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: help;
    position: relative;
}

.cartera-bar:hover {
    filter: brightness(1.1);
    transform: scaleX(1.05);
}

.cartera-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--petrol-deep);
    opacity: 0;
    transition: opacity 0.3s;
}

.cartera-bar:hover::after {
    opacity: 1;
}

@keyframes growBar {
    from { height: 0; }
}

.cartera-bar-animate {
    animation: growBar 1.2s ease-out forwards;
}

/* --- �� Dashboard Analítico (Command Center) --- */
.analytics-grid-premium {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.analytics-card-premium {
    background: white;
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(20, 35, 49, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.analytics-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.analytics-card-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--terracotta);
    opacity: 0.1;
}

.chart-title-premium {
    font-family: var(--font-heading);
    color: var(--petrol-deep);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kpi-card-modern {
    background: var(--petrol-deep);
    color: white;
    padding: 2rem;
    border-radius: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    box-shadow: 0 15px 35px rgba(20, 35, 49, 0.2);
    overflow: hidden;
}

.kpi-card-modern .kpi-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    font-weight: 600;
}

.kpi-card-modern .kpi-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.kpi-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

.kpi-trend.up { color: #10b981; }
.kpi-trend.down { color: #f43f5e; }

.insight-panel {
    background: #f8fafc;
    border-radius: 1.5rem;
    padding: 2rem;
    border-left: 5px solid var(--petrol-deep);
}

.badge-ai {
    background: var(--petrol-deep);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pulse-ai {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- 🍞 Toast Notifications --- */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--petrol-deep);
    border-left: 4px solid var(--terracotta);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.17, 0.67, 0.44, 1.09);
    pointer-events: auto;
}

.toast.visible {
    transform: translateX(0);
}

.toast-success { border-left-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger i { color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast-info i { color: var(--info); }

/* --- 🏷️ Observaciones Badges (Premium Restoration) --- */
.obs-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    width: fit-content;
}

.badge-inconsis {
    background: #fef2f2;
    color: #991b1b;
    border-left: 3px solid #ef4444;
}

.badge-retro-liq {
    background: #f0fdf4;
    color: #166534;
    border-left: 3px solid #22c55e;
}

.badge-retro-rest {
    background: #fff7ed;
    color: #9a3412;
    border-left: 3px solid #f97316;
}

.matrix-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--petrol-deep);
    transition: all 0.2s;
}

.matrix-input:focus {
    border-color: var(--terracotta);
    outline: none;
    box-shadow: 0 0 0 2px rgba(211, 106, 69, 0.2);
}
