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


:root {
    --navy: #173f56;
    --navy-2: #1e506b;
    --blue: #67bfe5;
    --blue-strong: #2c95bd;
    --blue-soft: #e9f6fb;

    --background: #eef3f6;
    --surface: #ffffff;
    --surface-soft: #f7fafc;

    --border: #dce5ea;
    --border-strong: #cbd9e0;

    --text: #273943;
    --text-soft: #73858f;
    --text-faint: #94a2a9;

    --green: #2f8a64;
    --green-soft: #e9f6ef;

    --red: #b84b4b;
    --red-soft: #fbecec;

    --warning-bg: #fff6dc;
    --warning-border: #f0dfaa;
    --warning-text: #8d6b12;

    --shadow:
        0 10px 28px rgba(23, 63, 86, 0.06);
}


body {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);
}


button,
input,
select,
textarea {
    font: inherit;
}


.app-layout {
    display: flex;
    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    width: 245px;
    background: var(--navy);
    color: white;

    padding: 28px 18px;

    display: flex;
    flex-direction: column;
}


.brand {
    padding: 4px 12px 30px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.12);

    margin-bottom: 20px;
}


.brand-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
}


.brand-subtitle {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.68;
}


.menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.menu-item {
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;

    padding: 11px 14px;

    border-radius: 9px;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.menu-item:hover {
    background:
        rgba(255, 255, 255, 0.08);

    color: white;
}


.menu-item.active {
    background: var(--blue);
    color: #123143;

    font-weight: 700;
}


/* ÁREA PRINCIPAL */

.main-content {
    flex: 1;
    min-width: 0;
}


.topbar {
    min-height: 105px;

    padding: 26px 34px;

    background: white;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}


.page-title {
    font-size: 25px;
    color: var(--navy);
}


.page-description {
    margin-top: 6px;

    color: var(--text-soft);
    font-size: 14px;
}


.status-badge {
    background: var(--blue-soft);
    color: #2785ae;

    border: 1px solid #cde9f5;

    padding: 8px 12px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 700;
}


.content {
    padding: 38px;

    max-width: 1440px;
    margin: 0 auto;
}


/* DASHBOARD */

.welcome-card {
    background:
        linear-gradient(
            135deg,
            #1e506b,
            #287a9c
        );

    color: white;

    border-radius: 18px;

    padding: 34px;

    box-shadow:
        0 12px 28px rgba(20, 57, 78, 0.12);
}


.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;

    opacity: 0.72;

    font-weight: 800;
}


.eyebrow.dark {
    color: #237fa8;
    opacity: 1;
}


.welcome-card h2 {
    margin-top: 10px;
    font-size: 30px;
}


.welcome-card p {
    margin-top: 12px;

    max-width: 650px;

    line-height: 1.6;

    color:
        rgba(255, 255, 255, 0.82);
}


.module-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;

    margin-top: 24px;
}


.module-card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 15px;

    padding: 22px;

    min-height: 180px;

    box-shadow:
        0 6px 18px rgba(20, 57, 78, 0.04);
}


.module-card.highlighted {
    border:
        2px solid var(--blue);
}


.module-card h3 {
    margin-top: 24px;

    color: #1e4e68;

    font-size: 19px;
}


.module-card p {
    margin-top: 10px;

    color: var(--text-soft);

    line-height: 1.55;

    font-size: 14px;
}


.module-status {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}


.module-status.current {
    background: #def3fc;
    color: #237fa8;
}


.module-status.ready {
    background: #eff2f4;
    color: #89969d;
}


/* DOCUMENTOS */

.documents-page {
    display: flex;
    flex-direction: column;
    gap: 42px;
}


.documents-hero {
    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f8fbfd 100%
        );

    border: 1px solid var(--border);

    border-radius: 20px;

    padding: 32px 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;

    box-shadow: var(--shadow);
}


.documents-hero-copy {
    max-width: 760px;
}


.documents-hero h2 {
    margin-top: 8px;

    color: var(--navy);
    font-size: 28px;

    letter-spacing: -0.4px;
}


.documents-hero p {
    margin-top: 11px;

    color: var(--text-soft);
    line-height: 1.65;

    font-size: 14px;
}


.documents-hero-status {
    min-width: 205px;

    border-radius: 14px;

    padding: 14px 16px;

    display: flex;
    align-items: center;
    gap: 11px;
}


.documents-hero-status.status-detectado {
    background: var(--green-soft);
    border: 1px solid #cbe9d8;
    color: var(--green);
}


.documents-hero-status.status-no_detectado,
.documents-hero-status.status-incompleto {
    background: var(--red-soft);
    border: 1px solid #f0caca;
    color: var(--red);
}


.documents-hero-status.status-advertencia {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}


.status-dot {
    width: 10px;
    height: 10px;

    flex: 0 0 10px;

    border-radius: 50%;

    background: currentColor;

    box-shadow:
        0 0 0 4px rgba(80, 120, 100, 0.10);
}


.documents-hero-status strong,
.documents-hero-status small {
    display: block;
}


.documents-hero-status strong {
    font-size: 12px;
}


.documents-hero-status small {
    margin-top: 3px;
    font-size: 11px;
    opacity: 0.82;
}


/* INTEGRACIÓN */

.integration-panel {
    background: white;

    border: 1px solid var(--border);
    border-radius: 18px;

    padding: 26px 28px;

    box-shadow: var(--shadow);
}


.integration-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}


.integration-panel-header h3 {
    color: var(--navy);
    font-size: 21px;
}


.integration-panel-header p {
    margin-top: 6px;

    color: var(--text-faint);
    font-size: 11px;

    overflow-wrap: anywhere;
}


.readonly-badge {
    flex: 0 0 auto;

    padding: 7px 10px;

    border-radius: 999px;

    background: #eef4f7;
    color: #69808b;

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.integration-grid {
    margin-top: 23px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;
}


.integration-item {
    min-height: 98px;

    padding: 15px 16px;

    border: 1px solid #e4ebef;
    border-radius: 13px;

    background: #f9fbfc;

    display: flex;
    flex-direction: column;
    justify-content: center;
}


.integration-label {
    color: var(--text-faint);

    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.55px;
}


.integration-item strong {
    margin-top: 8px;

    color: var(--navy);
    font-size: 17px;
}


.integration-item small {
    margin-top: 5px;

    color: #8a999f;
    font-size: 10px;
}


.text-ok {
    color: var(--green) !important;
}


.text-error {
    color: var(--red) !important;
}


.text-muted {
    color: var(--text-soft) !important;
}


.scripts-check {
    margin-top: 18px;

    padding-top: 18px;

    border-top: 1px solid #edf1f3;

    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
}


.script-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: #6f818a;

    font-size: 11px;
    font-weight: 600;
}


.check-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #aab5ba;
}


.check-dot.ok {
    background: #46a978;
}


.check-dot.missing {
    background: #d66363;
}


.integration-warning {
    margin-top: 18px;

    padding: 12px 14px;

    border-radius: 11px;

    background: var(--warning-bg);
    border: 1px solid var(--warning-border);

    color: var(--warning-text);

    font-size: 11px;
    line-height: 1.5;
}


/* TARJETAS */

.document-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}


.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    padding: 0 4px;
}


.section-kicker {
    display: block;

    margin-bottom: 6px;

    color: var(--blue-strong);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.5px;
}


.section-heading h3 {
    color: var(--navy);
    font-size: 22px;
}


.section-heading p {
    margin-top: 7px;

    color: var(--text-soft);
    font-size: 13px;
}


.section-count {
    padding: 6px 9px;

    border-radius: 999px;

    background: #e8eef2;

    color: #74868f;

    font-size: 10px;
    font-weight: 800;

    white-space: nowrap;
}


.document-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 22px;
}


.commercial-grid {
    display: grid;
    grid-template-columns: 1fr;
}


.document-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 18px;

    min-height: 270px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow: var(--shadow);

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease;
}


.document-card:hover {
    transform: translateY(-2px);

    border-color: var(--border-strong);

    box-shadow:
        0 14px 32px rgba(23, 63, 86, 0.09);
}


.document-card.recommended-card {
    border-color: #b8e2f4;
}


.document-card.all-card {
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #f7fbfd
        );
}


.document-card.commercial-document-card {
    min-height: 285px;

    border: 2px solid #cbe6f1;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f7fbfd 100%
        );
}


.document-card-header {
    padding: 22px 24px 0;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}


.document-icon {
    width: 48px;
    height: 48px;

    flex: 0 0 48px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: var(--blue-soft);
    color: #2689b1;

    border: 1px solid #d7eef7;

    font-size: 12px;
    font-weight: 900;

    letter-spacing: 0.5px;
}


.commercial-document-icon {
    width: 58px;
    height: 58px;

    flex-basis: 58px;

    border: none;

    background:
        linear-gradient(
            135deg,
            #1d506b,
            #2d83a7
        );

    color: white;

    font-size: 14px;
}


.document-card-tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}


.document-label {
    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    background: #eef2f4;
    color: #667983;

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.45px;
}


.document-label.recommended {
    background: #def3fc;
    color: #237fa8;
}


.document-label.all {
    background: #e8edf9;
    color: #45679a;
}


.document-label.commercial {
    background: #e4f5f9;
    color: #207897;
}


.document-state {
    display: inline-flex;

    padding: 5px 8px;

    border: 1px solid #e4eaed;

    border-radius: 999px;

    color: var(--text-faint);

    background: #fafcfd;

    font-size: 9px;
    font-weight: 700;
}


.document-state.available {
    color: var(--green);

    background: var(--green-soft);

    border-color: #cfe9da;
}


.document-card-body {
    padding: 23px 24px 22px;
}


.document-card h4 {
    color: #1b4b65;

    font-size: 20px;
    letter-spacing: -0.25px;
}


.document-card p {
    margin-top: 11px;

    color: var(--text-soft);

    line-height: 1.62;
    font-size: 14px;

    max-width: 720px;
}


.document-meta {
    margin-top: 20px;

    padding-top: 15px;

    border-top: 1px solid #edf1f3;

    color: #86959c;

    font-size: 11px;
    font-weight: 600;
}


.file-status-grid {
    margin-top: 19px;

    padding-top: 15px;

    border-top: 1px solid #edf1f3;

    display: grid;

    grid-template-columns:
        78px minmax(0, 1fr);

    gap: 7px 10px;

    font-size: 10px;
}


.file-status-grid span {
    color: #99a6ac;

    text-transform: uppercase;

    font-weight: 800;
    letter-spacing: 0.35px;
}


.file-status-grid strong {
    min-width: 0;

    color: #687d87;

    font-weight: 700;

    overflow-wrap: anywhere;
}


.document-card-footer {
    margin-top: auto;

    padding: 17px 24px 21px;

    background: #fbfcfd;

    border-top: 1px solid #edf1f3;
}


.document-button {
    border: 1px solid #dbe4e8;
    border-radius: 10px;

    padding: 11px 16px;

    background: #f0f4f6;
    color: #84939a;

    font-weight: 800;
    font-size: 12px;

    cursor: not-allowed;
}


.document-button.primary {
    background: #e3f4fb;
    border-color: #cce9f5;

    color: #348aaa;
}


.document-button:disabled {
    opacity: 1;
}


.commercial-document-body {
    padding-bottom: 24px;
}


.commercial-specs {
    margin-top: 20px;

    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}


.commercial-specs span {
    padding: 7px 10px;

    border-radius: 9px;

    background: #eef5f8;

    border: 1px solid #e1ebef;

    color: #607986;

    font-size: 10px;
    font-weight: 700;
}


.commercial-file-status {
    max-width: 620px;
}


/* RESPONSIVE */

@media (max-width: 1100px) {

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

}


@media (max-width: 1000px) {

    .document-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 820px) {

    .documents-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .documents-hero-status {
        min-width: 0;
    }

}


@media (max-width: 700px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .menu {
        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .content {
        padding: 20px;
    }

    .topbar {
        padding: 20px;
        gap: 18px;
    }

    .section-heading,
    .integration-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .integration-grid {
        grid-template-columns: 1fr;
    }

    .document-card-header {
        flex-direction: column;
    }

    .document-card-tags {
        justify-content: flex-start;
    }

}


/* ACCIONES Y MENSAJES */

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-message {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.flash-message.success {
    background: var(--green-soft);
    border: 1px solid #cbe9d8;
    color: var(--green);
}

.flash-message.error {
    background: var(--red-soft);
    border: 1px solid #f0caca;
    color: var(--red);
}

.document-button.enabled {
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.document-button.enabled:hover {
    transform: translateY(-1px);
    background: #d6eff9;
    box-shadow: 0 6px 14px rgba(52, 138, 170, 0.12);
}

.document-button.enabled:active {
    transform: translateY(0);
}


/* PROGRESO INTEGRADO EN BOTÓN Y DESCARGAS */

.is-hidden {
    display: none !important;
}

.generation-result {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.generation-result.success {
    background: var(--green-soft);
    border-color: #cbe9d8;
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
}

.generation-result.error {
    background: var(--red-soft);
    border-color: #f0caca;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
}

.document-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 9px;
}

.inline-progress-action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.progress-button {
    position: relative;
    min-width: 185px;
    overflow: hidden;
    isolation: isolate;
}

.progress-button:disabled {
    cursor: wait;
}

.progress-button-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background:
        linear-gradient(
            90deg,
            rgba(44, 149, 189, 0.28),
            rgba(44, 149, 189, 0.52)
        );
    transition: width 0.4s ease;
    z-index: -1;
}

.progress-button-label {
    position: relative;
    z-index: 1;
}

.inline-progress-meta {
    max-width: 330px;
    color: #73858f;
    font-size: 10px;
    line-height: 1.45;
}

.inline-progress-meta strong {
    color: #4f7181;
}

.document-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 10px 14px;
    border: 1px solid #d5e2e8;
    border-radius: 10px;
    background: #ffffff;
    color: #55717f;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.document-link-button:hover {
    transform: translateY(-1px);
    border-color: #bcd9e5;
    background: #f8fbfc;
}

.document-link-button.download {
    color: #227fa6;
    border-color: #cbe7f2;
    background: #eaf7fc;
}
