:root {
    --bg: #f4efe7;
    --bg-accent: #d9efe4;
    --panel: rgba(255, 252, 247, 0.92);
    --panel-border: rgba(34, 53, 41, 0.12);
    --ink: #18261d;
    --muted: #536458;
    --brand: #12664f;
    --brand-strong: #0a4f3c;
    --hero-blue: #0f6bdc;
    --hero-blue-strong: #0a4f9f;
    --hero-blue-deep: #083f82;
    --hero-gold: #ffd166;
    --info-blue: #1f5fbf;
    --info-blue-soft: rgba(31, 95, 191, 0.1);
    --info-blue-border: rgba(31, 95, 191, 0.22);
    --signal: #c96f2d;
    --danger: #9b3024;
    --shadow: 0 16px 40px rgba(24, 38, 29, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(18, 102, 79, 0.16), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(201, 111, 45, 0.12), transparent 22rem),
        linear-gradient(180deg, var(--bg) 0%, #fbf7f0 100%);
}

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

.page-shell {
    width: min(1360px, calc(100% - 24px));
    max-width: 100%;
    margin: 0 auto;
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: 1.5fr 0.9fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel,
.entry-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 32px;
}

.hero-copy-brand {
    min-height: 176px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(255, 209, 102, 0.18), transparent 10rem),
        linear-gradient(120deg, var(--hero-blue), var(--hero-blue-strong) 58%, var(--hero-blue-deep));
    color: #f7fbff;
    border-color: rgba(8, 63, 130, 0.28);
    box-shadow: 0 20px 44px rgba(8, 63, 130, 0.2);
}

.hero-copy-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.hero-copy-main {
    display: grid;
    gap: 3px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: var(--hero-gold);
    font-weight: 700;
}

.hero-copy-brand .eyebrow {
    margin: 0;
}

.hero-powered {
    margin: 8px 0 0;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: rgba(247, 251, 255, 0.76);
    font-style: italic;
    text-align: right;
    align-self: end;
}

.hero-powered a {
    color: var(--hero-gold);
    font-weight: 700;
    text-decoration: none;
}

.hero-powered a:hover {
    text-decoration: underline;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    line-height: 0.95;
}

.hero-copy-brand h1 {
    color: #ffffff;
    text-shadow: 0 8px 20px rgba(5, 30, 66, 0.22);
}

.hero-slogan {
    margin: 0;
    max-width: 54ch;
    font-size: 1rem;
    line-height: 1.45;
    color: rgba(247, 251, 255, 0.88);
}

.hero-text {
    max-width: 52ch;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.hero-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(150deg, rgba(9, 63, 128, 0.98), rgba(8, 52, 105, 0.95)),
        var(--hero-blue-deep);
    color: #f5fff8;
    border-color: rgba(8, 63, 130, 0.32);
    box-shadow: 0 18px 34px rgba(8, 63, 130, 0.18);
}

.hero-card-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    opacity: 0.72;
}

.hero-card strong {
    font-size: 2rem;
    margin-bottom: 8px;
}

.hero-card a {
    color: #f5fff8;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 10px;
}

.hero-card a[target="_blank"] {
    display: none;
}

.hero-link-child {
    margin-left: 18px;
    position: relative;
}

.hero-link-child::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 0.5em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--hero-gold);
}

.hero-card a:hover {
    text-decoration: underline;
}

.hero-card span {
    display: none;
}

.layout {
    display: grid;
    gap: 24px;
}

.layout-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 420px);
    gap: 24px;
    align-items: start;
}

.layout-column {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.layout-main {
    min-width: 0;
    width: 100%;
}

.layout-side {
    width: 100%;
    min-width: 0;
}

.layout-side > .panel:nth-child(4) {
    display: none;
}

.intro-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.page-intro {
    margin-bottom: 24px;
    position: sticky;
    top: 10px;
    z-index: 30;
}

.hero-card-compact {
    min-height: 100%;
    width: 100%;
}

.panel-sticky {
    position: sticky;
    top: 20px;
}

.panel {
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}

.panel-collapsible {
    padding: 0;
}

.panel-collapsible details {
    padding: 24px;
}

.panel-summary {
    list-style: none;
    cursor: pointer;
}

.panel-summary::-webkit-details-marker {
    display: none;
}

.panel-summary h2,
.panel-summary p {
    margin: 0;
}

.panel-summary p {
    margin-top: 6px;
    color: var(--ink);
}

.panel-summary p code,
.panel-head p code,
.collapsible-summary p code,
.subpanel-head p code {
    color: inherit;
}

.panel-content {
    padding-top: 18px;
    min-width: 0;
}

.panel-head {
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.panel-head p {
    margin: 0;
    color: var(--ink);
}

.summary-head-inline {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: nowrap;
}

.summary-head-inline h2,
.summary-head-inline p {
    margin: 0;
}

.summary-caption {
    white-space: nowrap;
    color: var(--info-blue);
}

.inline-help,
.inline-status {
    display: block;
    color: var(--info-blue);
    font-size: 0.84rem;
    line-height: 1.35;
}

.inline-help {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    margin: 0;
}

.inline-status {
    margin: 0 0 8px;
}

.inline-status-wrap {
    position: relative;
}

.license-hover-card {
    position: fixed;
    left: 16px;
    top: 16px;
    width: min(760px, calc(100vw - 32px));
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(34, 102, 204, 0.18);
    box-shadow: 0 18px 40px rgba(13, 39, 80, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 30;
    pointer-events: none;
}

.license-hover-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.license-hover-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.inline-status-wrap .inline-status[hidden] + .license-hover-card {
    display: none;
}

.inline-help[hidden],
.inline-status[hidden] {
    display: none !important;
}

.panel-commercial-link {
    margin: -0.2rem 0 0.85rem;
    color: var(--info-blue);
    font-size: 0.92rem;
    line-height: 1.25;
}

.panel-commercial-prefix {
    color: var(--ink);
    margin-right: 0.9rem;
}

.panel-commercial-link a {
    color: var(--info-blue);
    font-size: 1.25em;
    text-decoration: none;
    font-weight: 700;
}

.panel-commercial-link a:hover {
    text-decoration: underline;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

.grid.two > label {
    position: relative;
}

.full {
    grid-column: 1 / -1;
}

label,
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grid.two > label {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.grid.two > label > span {
    min-height: 2.6em;
    display: flex;
    align-items: flex-end;
}

.field-wide {
    grid-column: span 2;
}

.field-compact {
    max-width: 190px;
}

.field-auth input {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    letter-spacing: -0.02em;
    padding: 0 10px;
}

label span,
.field span {
    font-size: 0.92rem;
    font-weight: 500;
}

input,
select {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(24, 38, 29, 0.14);
    background: rgba(255, 255, 255, 0.92);
    padding: 0 14px;
    color: var(--ink);
}

input:focus,
select:focus {
    outline: 2px solid rgba(18, 102, 79, 0.22);
    border-color: var(--brand);
}

button {
    border: 0;
    border-radius: 999px;
    min-height: 46px;
    padding: 0 18px;
    background: var(--brand);
    color: #f7fff9;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    background: var(--brand-strong);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: rgba(24, 38, 29, 0.08);
    color: var(--ink);
}

button.secondary:hover {
    background: rgba(24, 38, 29, 0.14);
}

.stack {
    display: grid;
    gap: 16px;
}

.entry-card {
    padding: 18px;
    border-radius: 18px;
}

.admin-launch-panel {
    margin-top: -6px;
    margin-bottom: 12px;
}

.panel-launch-button {
    width: 100%;
    justify-content: flex-start;
    min-height: 64px;
    padding: 0 24px;
    background: rgba(255, 252, 247, 0.92);
    color: var(--ink);
    border-radius: 18px;
    text-align: left;
    box-shadow: none;
}

.panel-launch-button span {
    font-weight: 700;
}

.panel-launch-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.panel-launch-meta {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-left: 28px;
    white-space: nowrap;
}

input[data-numeric="money"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

input[data-numeric="percent"] {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.app-modal {
    width: min(1180px, calc(100vw - 48px));
    border: 0;
    padding: 0;
    background: transparent;
}

.app-modal-small {
    width: min(520px, calc(100vw - 48px));
}

.app-modal::backdrop {
    background: rgba(24, 38, 29, 0.45);
    backdrop-filter: blur(4px);
}

#retentionCatalogAdminAuth {
    display: none !important;
}

.modal-panel {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.promo-video-modal {
    width: min(760px, calc(100vw - 40px));
}

.promo-video-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.promo-video-copy {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink);
    text-align: center;
}

.promo-video-player {
    width: 100%;
    border-radius: 18px;
    background: #0f1720;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.catalog-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid rgba(24, 38, 29, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    max-height: 520px;
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-size: 0.9rem;
    table-layout: fixed;
}

.catalog-table th,
.catalog-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(24, 38, 29, 0.08);
    white-space: nowrap;
}

.catalog-table th {
    position: sticky;
    top: 0;
    background: #f5f1ea;
    z-index: 1;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.catalog-table td input,
.catalog-table td select {
    min-height: 30px;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.catalog-table th:nth-child(1),
.catalog-table td:nth-child(1) {
    width: 42px;
}

.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2) {
    width: 90px;
}

.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3) {
    width: 42%;
}

.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) {
    width: 150px;
}

.catalog-table th:nth-child(5),
.catalog-table td:nth-child(5) {
    width: 90px;
}

.catalog-table th:nth-child(6),
.catalog-table td:nth-child(6) {
    width: 88px;
}

.catalog-table th:nth-child(7),
.catalog-table td:nth-child(7) {
    width: 110px;
}

.catalog-table td:nth-child(3) input {
    text-overflow: ellipsis;
}

.iva-catalog-table th:nth-child(2),
.iva-catalog-table td:nth-child(2) {
    width: 62%;
}

.iva-catalog-table th:nth-child(3),
.iva-catalog-table td:nth-child(3) {
    width: 90px;
}

.iva-catalog-table th:nth-child(4),
.iva-catalog-table td:nth-child(4) {
    width: 88px;
}

.iva-catalog-table th:nth-child(5),
.iva-catalog-table td:nth-child(5) {
    width: 110px;
}

.catalog-table td input:focus,
.catalog-table td select:focus {
    outline: 1px solid rgba(18, 102, 79, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0 6px;
}

.catalog-table td .remove-btn {
    min-height: 32px;
    padding: 0 12px;
}

.catalog-card {
    padding: 14px;
    border: 1px solid rgba(24, 38, 29, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
}

.catalog-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-card-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.compact-editor {
    padding: 14px;
}

.editor-collapsible {
    padding: 12px 14px;
}

.editor-summary {
    align-items: flex-start;
}

.editor-collapsible .compra-toolbar {
    margin-bottom: 8px;
}

.compact-editor .entry-grid {
    gap: 10px;
}

.compact-editor label,
.compact-editor .field {
    gap: 5px;
}

.compact-editor label span,
.compact-editor .field span {
    font-size: 0.8rem;
}

.compact-editor input,
.compact-editor select {
    min-height: 38px;
    border-radius: 12px;
    padding: 0 10px;
}

.compras-workspace,
.compras-summary {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.compra-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.compras-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid rgba(24, 38, 29, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    max-height: 420px;
}

.compras-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-size: 0.9rem;
}

.compras-table th,
.compras-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(24, 38, 29, 0.08);
    white-space: nowrap;
}

.compras-table th {
    position: sticky;
    top: 0;
    background: #f5f1ea;
    z-index: 1;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.compras-table tbody tr {
    cursor: pointer;
}

.compras-table tbody tr:hover {
    background: rgba(217, 239, 228, 0.42);
}

.compras-table tbody tr.active {
    background: rgba(217, 239, 228, 0.72);
}

.compra-toolbar-copy h3,
.compra-toolbar-copy p,
.compra-toolbar-copy span {
    margin: 0;
}

.compra-toolbar-copy h3 {
    font-size: 0.92rem;
    letter-spacing: 0.08em;
}

.compra-toolbar-copy p {
    margin-top: 2px;
    font-size: 0.88rem;
    font-weight: 700;
}

.compra-toolbar-copy span {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 0.8rem;
}

.subentry-card {
    padding: 16px;
    border: 1px solid rgba(24, 38, 29, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.entry-top h3 {
    margin: 0;
    font-size: 1rem;
}

.entry-top h4,
.entry-top h5,
.subpanel-head h4 {
    margin: 0;
}

.entry-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.compras-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.compras-toolbar-mode {
    flex: 0 0 auto;
}

.compras-toolbar-mode select {
    width: 220px;
    max-width: 100%;
}

.compras-toolbar-actions {
    justify-content: flex-end;
    margin-left: auto;
}

.entry-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.field-air-code {
    margin-bottom: 10px;
}

.subpanel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(24, 38, 29, 0.18);
    min-width: 0;
}

.collapsible-panel {
    border-top: 1px dashed rgba(24, 38, 29, 0.18);
    padding-top: 12px;
}

.editor-collapsible .collapsible-panel {
    margin-left: 28px;
    padding-left: 18px;
    border-left: 2px solid rgba(18, 102, 79, 0.12);
}

.retenciones-cluster {
    margin: 16px 0 8px 34px;
    padding: 16px 16px 8px 20px;
    border: 1px solid rgba(18, 102, 79, 0.22);
    border-left: 6px solid rgba(18, 102, 79, 0.5);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(224, 242, 234, 0.88), rgba(255, 255, 255, 0.96)),
        rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.retenciones-cluster-head {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(18, 102, 79, 0.08);
    border: 1px solid rgba(18, 102, 79, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.retencion-upload-hint,
.retencion-inline-hint {
    margin: 8px 6px 0;
    color: var(--info-blue);
    font-size: 0.82rem;
    line-height: 1.35;
}

.retencion-inline-hint {
    margin-top: 10px;
}

.reembolso-progress-hint {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reembolso-progress-line {
    display: block;
}

.field-hint-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-hint-stack .field {
    min-width: 0;
}

.field-hint-stack .retencion-inline-hint {
    margin: 0 4px;
}

.iva-hint-grid .iva-selection-hint {
    margin-top: -2px;
    max-width: none;
}

.iva-hint-grid .iva-selection-hint-bienes {
    grid-column: 1 / span 2;
}

.iva-hint-grid .iva-selection-hint-servicios {
    grid-column: 3 / span 2;
}

.retenciones-cluster-head strong,
.retenciones-cluster-head span {
    display: block;
    margin: 0;
}

.retenciones-cluster-head strong {
    order: 1;
    margin-right: auto;
    font-size: 0.84rem;
    letter-spacing: 0.14em;
    color: var(--brand-strong);
}

.ats-report-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.ats-report-head strong {
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    color: var(--brand-strong);
}

.ats-report-head span {
    font-size: 0.8rem;
    color: var(--ink);
}

.ats-report-block + .ats-report-block {
    margin-top: 14px;
}

.ats-report-block h3 {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--brand-strong);
}

.ats-report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    font-size: 0.78rem;
}

.ats-report-table th,
.ats-report-table td {
    padding: 7px 8px;
    border: 1px solid rgba(18, 102, 79, 0.14);
    text-align: left;
}

.ats-report-table thead th {
    background: rgba(18, 102, 79, 0.1);
    color: var(--brand-strong);
}

.ats-report-table tfoot td {
    font-weight: 700;
    background: rgba(18, 102, 79, 0.06);
}

.retenciones-cluster-head span {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--ink);
}

.retencion-upload-btn {
    order: 2;
    flex: 0 0 auto;
    white-space: nowrap;
}

.collapsible-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary p,
.collapsible-summary strong {
    margin: 0;
}

.collapsible-summary p {
    color: var(--ink);
    margin-top: 3px;
    font-size: 0.82rem;
    line-height: 1.25;
}

.collapsible-badge {
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(24, 38, 29, 0.08);
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
    margin-top: 2px;
}

.collapsible-content {
    padding-top: 10px;
    min-width: 0;
}

.empty-workspace {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(18, 102, 79, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(217, 239, 228, 0.45));
}

.empty-workspace-copy {
    max-width: 42ch;
    text-align: center;
}

.empty-workspace-copy h3,
.empty-workspace-copy p,
.empty-workspace-copy span {
    margin: 0;
    display: block;
}

.empty-workspace-copy p {
    margin-top: 8px;
    font-weight: 700;
}

.empty-workspace-copy span {
    margin-top: 6px;
    color: var(--muted);
}

.subpanel-head {
    margin-bottom: 12px;
}

.subpanel-head p {
    margin: 6px 0 0;
    color: var(--ink);
    font-size: 0.92rem;
}

.compact {
    gap: 12px;
}

.mini-btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.remove-btn {
    background: rgba(155, 48, 36, 0.1);
    color: var(--danger);
}

.remove-btn:hover {
    background: rgba(155, 48, 36, 0.18);
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-group + .summary-group {
    margin-top: 16px;
}

.summary-group h3 {
    margin: 0 0 8px;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: var(--brand-strong);
    opacity: 0.88;
}

.summary-details {
    border-top: 1px dashed rgba(18, 102, 79, 0.18);
    padding-top: 14px;
}

.summary-details:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.summary-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.summary-toggle::-webkit-details-marker {
    display: none;
}

.summary-toggle h3 {
    margin: 0;
}

.summary-toggle-indicator {
    width: 11px;
    height: 11px;
    border-right: 2px solid rgba(18, 102, 79, 0.62);
    border-bottom: 2px solid rgba(18, 102, 79, 0.62);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
    flex: 0 0 auto;
    margin-right: 4px;
}

.summary-details[open] .summary-toggle-indicator {
    transform: rotate(225deg) translateY(-1px);
}

.summary-content {
    padding-top: 10px;
}

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

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

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

.stat {
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 244, 0.95));
    border: 1px solid rgba(18, 102, 79, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.stat span {
    display: block;
    color: var(--muted);
    margin-bottom: 4px;
    font-size: 0.74rem;
    line-height: 1.2;
}

.stat strong {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.98rem;
    line-height: 1;
}

.actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    min-width: 0;
}

.actions button {
    width: 100%;
    min-width: 0;
}

.validation-box,
.muted-box {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(24, 38, 29, 0.12);
    background: rgba(255, 255, 255, 0.8);
    color: var(--info-blue);
}

#comprasImportStatus,
#draftStatus {
    margin-top: 16px;
}

.validation-box ul {
    margin: 0;
    padding-left: 18px;
}

.success-box {
    background: rgba(18, 102, 79, 0.12);
    border-color: rgba(18, 102, 79, 0.26);
}

.error-box {
    background: rgba(155, 48, 36, 0.1);
    border-color: rgba(155, 48, 36, 0.22);
}

.muted-box {
    color: var(--info-blue);
    border-color: var(--info-blue-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--info-blue-soft));
}

.validation-box:not(.error-box):not(.success-box) {
    color: var(--info-blue);
    border-color: var(--info-blue-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--info-blue-soft));
}

.validation-warning-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(31, 92, 198, 0.28);
    color: var(--info-blue);
}

.validation-warning-block strong {
    display: block;
    margin-bottom: 6px;
}

.validation-warning-block ul {
    margin: 0;
}

.blocked-hint {
    margin: 10px 0 0;
    font-size: 0.84rem;
    color: var(--ink);
}

.xml-output {
    margin: 0;
    min-height: 260px;
    max-height: 520px;
    overflow: auto;
    padding: 18px;
    border-radius: 18px;
    background: #122019;
    color: #d8f5df;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.xml-output-fresh {
    animation: xmlOutputRefresh 0.45s ease;
}

@keyframes xmlOutputRefresh {
    0% {
        opacity: 0.72;
        transform: translateY(2px);
        box-shadow: 0 0 0 0 rgba(84, 180, 126, 0.35);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 0 0 rgba(84, 180, 126, 0);
    }
}

@media (max-width: 920px) {
    .page-intro {
        position: static;
    }

    .hero,
    .intro-stack,
    .grid.two,
    .stats-grid,
    .stats-grid-compras,
    .stats-grid-ventas,
    .stats-grid-retenciones,
    .entry-grid,
    .entry-grid.three,
    .air-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-card {
        min-height: 180px;
    }

    .layout-two-columns {
        display: grid;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .layout-side {
        width: auto;
        max-width: none;
    }

    .panel-sticky {
        position: static;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding-top: 20px;
    }

    .hero,
    .intro-stack,
    .grid.two,
    .stats-grid,
    .stats-grid-compras,
    .stats-grid-ventas,
    .stats-grid-retenciones,
    .entry-grid,
    .entry-grid.three,
    .air-grid {
        grid-template-columns: 1fr;
    }

    .row-between,
    .entry-top,
    .entry-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .panel,
    .hero-copy,
    .hero-card {
        padding: 20px;
    }
}
