/* ─── Accesibilidad ─────────────────────────────────────────────── */
.sga-skip {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 1080;
}

.sga-skip:not(:focus):not(:focus-visible) {
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── Marca / sidebar ───────────────────────────────────────────── */
.sga-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.25rem 0;
}

.sga-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.5rem;
    background: var(--sga-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.sga-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sga-brand-text strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.sga-brand-text small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.navbar-brand {
    padding-top: 0.85rem;
    padding-bottom: 0.5rem;
}

.sga-nav-section {
    list-style: none;
    padding: 1.15rem 1.35rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
}

.sga-sidebar-footer {
    margin-top: auto;
    padding: 0.85rem 0.85rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sga-version-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.35rem 0.65rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.sga-version-link:hover {
    color: #fff;
}

.sga-release-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.35rem 0;
}

.sga-release-list .badge {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.sga-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.35rem 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.sga-sidebar-user .sga-avatar {
    flex-shrink: 0;
}

.sga-sidebar-user-meta {
    min-width: 0;
}

.sga-sidebar-user-meta strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sga-sidebar-user-meta span {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sga-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #e11d48, #9b0000);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sga-avatar-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.8rem;
}

/* ─── Topbar ────────────────────────────────────────────────────── */
.sga-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 3.75rem;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sga-line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sga-topbar .container-xl {
    min-height: 3.75rem;
}

.sga-topbar-date {
    font-size: 0.8rem;
    color: var(--sga-muted);
}

.sga-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.4rem 0.25rem 0.25rem;
    border-radius: 999px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s ease;
}

.sga-user-toggle:hover {
    background: rgba(16, 24, 40, 0.05);
}

.sga-user-toggle-meta {
    line-height: 1.2;
}

.sga-user-toggle-meta strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
}

.sga-user-toggle-meta span {
    font-size: 0.72rem;
    color: var(--sga-muted);
}

/* ─── Página ────────────────────────────────────────────────────── */
.page-body {
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
}

.page-header {
    margin-bottom: 1.5rem !important;
}

.page-header .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sga-ink);
    line-height: 1.3;
}

.page-header .text-muted {
    font-size: 0.8125rem;
}

.breadcrumb {
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--sga-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--sga-red);
}

/* ─── Cards ─────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--sga-line);
    box-shadow: var(--sga-shadow);
    border-radius: var(--sga-radius);
}

.card-header {
    background: transparent;
    border-bottom-color: var(--sga-line);
    min-height: 3.15rem;
}

.card-title {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-md > .card-body.p-0 .table {
    margin-bottom: 0;
}

/* ─── Switch de pestañas (bandejas) ─────────────────────────────── */
.sga-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem;
    border: 1px solid var(--sga-line);
    border-radius: 0.85rem;
    background: #eef1f5;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.04);
}

.sga-switch-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 8.5rem;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    color: var(--sga-muted);
    font-size: 0.875rem;
    font-weight: 550;
    text-decoration: none !important;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sga-switch-item i {
    font-size: 1.05rem;
    opacity: 0.85;
}

.sga-switch-item:hover {
    color: var(--sga-ink);
    background: rgba(255, 255, 255, 0.55);
}

.sga-switch-item.is-active {
    color: var(--sga-ink);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    font-weight: 650;
}

.sga-switch-item.is-active i {
    color: #475569;
    opacity: 1;
}

@media (max-width: 575.98px) {
    .sga-switch {
        display: flex;
        width: 100%;
    }

    .sga-switch-item {
        flex: 1;
        min-width: 0;
        padding-inline: 0.7rem;
    }
}

/* ─── Filtros (GET) ─────────────────────────────────────────────── */
.card:has(> .card-body > form[method="get"]) {
    box-shadow: none;
}

.card:has(> .card-body > form[method="get"]) .card-body {
    padding: 1rem 1.15rem;
}

.card:has(> .card-body > form[method="get"]) .form-label {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sga-muted);
    margin-bottom: 0.3rem;
}

/* ─── Tablas ────────────────────────────────────────────────────── */
.table thead th {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sga-muted);
    background: #f8fafc;
    white-space: nowrap;
    border-bottom-color: var(--sga-line);
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table-vcenter tbody tr:hover {
    background-color: #f8fafc;
}

.table td {
    vertical-align: middle;
}

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 999px;
    padding: 0.35em 0.7em;
    line-height: 1.2;
    overflow: visible;
}

/*
 * Tabler beta20 deja el texto del badge en gris (--tblr-secondary).
 * En fondos sólidos ese gris se pierde: bg-secondary queda invisible
 * y success/danger/info quedan ilegibles.
 */
.badge.bg-primary,
.badge.bg-secondary,
.badge.bg-success,
.badge.bg-info,
.badge.bg-warning,
.badge.bg-danger,
.badge.bg-dark,
.badge.bg-muted,
.badge.bg-blue,
.badge.bg-azure,
.badge.bg-indigo,
.badge.bg-purple,
.badge.bg-pink,
.badge.bg-red,
.badge.bg-orange,
.badge.bg-green,
.badge.bg-teal,
.badge.bg-cyan {
    color: #fff !important;
}

.badge.bg-yellow,
.badge.bg-lime,
.badge.bg-light {
    color: #1f2e41 !important;
}

.sga-status {
    font-size: 0.72rem;
}

/* ─── KPI / accesos ─────────────────────────────────────────────── */
.sga-kpi {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.sga-kpi:hover,
a.card.sga-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sga-shadow-md);
    border-color: rgba(196, 0, 0, 0.18);
}

.sga-kpi-value {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--sga-ink);
}

.sga-kpi-label {
    font-size: 0.75rem;
    color: var(--sga-muted);
    margin-top: 0.1rem;
}

.sga-kpi-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sga-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sga-muted);
    margin: 0 0 0.85rem;
}

.sga-stat-card {
    height: 100%;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sga-stat-card:hover {
    box-shadow: var(--sga-shadow-md);
    border-color: rgba(16, 24, 40, 0.14);
}

.sga-stat-card .card-body {
    position: relative;
    padding-right: 3.2rem;
}

.sga-stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sga-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sga-muted);
    margin-bottom: 0.35rem;
}

.sga-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--sga-ink);
}

.sga-stat-hint {
    font-size: 0.75rem;
    color: var(--sga-muted);
    margin-top: 0.25rem;
}

.sga-status-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    height: 100%;
    padding: 0.85rem 0.9rem;
    background: #fff;
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    box-shadow: var(--sga-shadow);
    color: inherit;
}

.sga-status-tile:hover {
    border-color: rgba(16, 24, 40, 0.16);
    color: inherit;
}

.sga-status-dot {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    margin-bottom: 0.35rem;
}

.sga-status-count {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sga-ink);
}

.sga-status-name {
    font-size: 0.75rem;
    color: var(--sga-muted);
    line-height: 1.3;
}

.sga-status-pct {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
}

.sga-attn-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.sga-attn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.65rem;
    font-size: 0.8125rem;
    text-decoration: none !important;
    color: inherit;
    background: #fff;
    border: 1px solid var(--sga-line);
}

.sga-attn:hover {
    color: inherit;
    border-color: rgba(16, 24, 40, 0.16);
}

.sga-attn--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.sga-attn--danger {
    background: #fef2f2;
    border-color: #fecaca;
}

.sga-attn--info {
    background: #f0f7ff;
    border-color: #bfdbfe;
}

.sga-attn-cta {
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}

.sga-shortcut {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    text-decoration: none !important;
    color: inherit;
    box-shadow: var(--sga-shadow);
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.sga-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: var(--sga-shadow-md);
    border-color: rgba(196, 0, 0, 0.2);
    color: inherit;
}

.sga-shortcut-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.6rem;
    background: var(--sga-red-soft);
    color: var(--sga-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.sga-shortcut-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.sga-shortcut-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--sga-muted);
    font-weight: 400;
}

/* ─── Formularios ───────────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 0.55rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(196, 0, 0, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(196, 0, 0, 0.12);
}

.form-label {
    font-weight: 550;
}

@media (min-width: 992px) {
    form > .row > [class*="col-lg-4"] {
        position: sticky;
        top: 5.25rem;
        align-self: flex-start;
    }
}

/* ─── Upload ────────────────────────────────────────────────────── */
.upload-zone {
    border: 1.5px dashed #d0d5dd;
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    background: #f8fafc;
    color: #344054;
    font-size: 0.875rem;
}

.upload-zone:hover,
.upload-zone.is-dragover {
    border-color: var(--tblr-primary, #C40000);
    background: var(--sga-red-soft);
    box-shadow: inset 0 0 0 1px rgba(196, 0, 0, 0.08);
}

.upload-zone .upload-zone-icon {
    font-size: 1.75rem;
    color: #98a2b3;
    margin-bottom: 0.4rem;
}

.upload-zone.is-dragover .upload-zone-icon {
    color: var(--tblr-primary, #C40000);
}

.upload-zone-files {
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: var(--sga-muted);
    word-break: break-all;
}

.upload-zone.has-file {
    border-style: solid;
    border-color: #86efac;
    background: #f0fdf4;
    box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.06);
    color: #166534;
}

.upload-zone.has-file .upload-zone-icon {
    color: #16a34a;
}

.upload-zone.has-file .upload-zone-files {
    color: #14532d;
    font-weight: 600;
}

.upload-zone.has-file:hover {
    border-color: #4ade80;
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px rgba(22, 101, 52, 0.1);
}

.upload-progress {
    display: none;
    margin-top: 1rem;
}

.upload-progress.is-active {
    display: block;
}

.preview-frame {
    width: 100%;
    min-height: 70vh;
    border: 0;
    background: #f8fafc;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.sga-xml-preview {
    min-height: 420px;
    background: linear-gradient(180deg, #fafbfc 0%, #fff 48%);
}

.sga-xml-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.85rem 1rem 0;
    border-bottom: 1px solid var(--sga-line);
    background: #fff;
}

.sga-xml-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--sga-muted);
    font: inherit;
    font-weight: 550;
    font-size: 0.8125rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.55rem 0.55rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease;
}

.sga-xml-tab i {
    font-size: 1rem;
    opacity: 0.85;
}

.sga-xml-tab:hover {
    color: var(--sga-ink);
    background: rgba(16, 24, 40, 0.04);
}

.sga-xml-tab.active {
    color: var(--sga-ink);
    background: rgba(16, 24, 40, 0.06);
}

.sga-xml-tab.active::after {
    content: '';
    position: absolute;
    left: 0.65rem;
    right: 0.65rem;
    bottom: -1px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: #475569;
}

.sga-xml-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 280px;
    color: var(--sga-muted);
}

.sga-xml-readable-wrap {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sga-xml-warn {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.65rem 0.8rem;
    font-size: 0.8125rem;
}

.sga-xml-warn i {
    margin-top: 0.1rem;
}

.sga-xml-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--sga-line);
    border-radius: calc(var(--sga-radius) + 0.1rem);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(71, 85, 105, 0.1), transparent 55%),
        linear-gradient(135deg, #fff 0%, #f5f7fa 100%);
    box-shadow: var(--sga-shadow);
}

.sga-xml-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
    background: rgba(71, 85, 105, 0.1);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    margin-bottom: 0.45rem;
}

.sga-xml-hero-doc {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--sga-ink);
    line-height: 1.15;
    margin-bottom: 0.45rem;
}

.sga-xml-hero-supplier {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sga-xml-hero-supplier strong {
    font-weight: 600;
    color: var(--sga-ink);
}

.sga-xml-hero-supplier span {
    color: var(--sga-muted);
    font-size: 0.8125rem;
}

.sga-xml-hero-amount {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    background: #fff;
    border: 1px solid var(--sga-line);
    border-left: 3px solid var(--sga-red);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sga-xml-hero-amount-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sga-muted);
    margin-bottom: 0.2rem;
}

.sga-xml-hero-amount strong {
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--sga-ink);
    line-height: 1.15;
}

.sga-xml-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.sga-xml-meta-item {
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--sga-line);
    border-radius: 0.65rem;
    background: #fff;
    min-width: 0;
}

.sga-xml-meta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sga-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.sga-xml-meta-label i {
    font-size: 0.9rem;
    opacity: 0.9;
}

.sga-xml-meta-value {
    display: block;
    color: var(--sga-ink);
    font-weight: 600;
    font-size: 0.875rem;
    word-break: break-word;
}

.sga-xml-meta-card {
    padding: 0.85rem 1rem;
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    box-shadow: var(--sga-shadow);
}

.sga-xml-readable {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0;
}

.sga-xml-readable-row {
    display: grid;
    grid-template-columns: minmax(120px, 32%) 1fr;
    gap: 0.5rem 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--sga-line);
}

.sga-xml-readable-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.sga-xml-readable dt {
    margin: 0;
    color: var(--sga-muted);
    font-weight: 600;
    font-size: 0.78rem;
}

.sga-xml-readable dd {
    margin: 0;
    word-break: break-word;
    font-weight: 550;
    color: var(--sga-ink);
}

.sga-xml-preview-code {
    max-height: 70vh;
    overflow: auto;
    padding: 1rem 1.1rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 0 0 var(--sga-radius) var(--sga-radius);
}

.sga-xml-lineas {
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    box-shadow: var(--sga-shadow);
    overflow: hidden;
}

.sga-xml-lineas-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--sga-line);
    background: #fafbfc;
}

.sga-xml-lineas-head h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.sga-xml-lineas-count {
    font-size: 0.72rem;
    font-weight: 650;
    color: var(--sga-muted);
    background: rgba(16, 24, 40, 0.05);
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
}

.sga-xml-table {
    font-size: 0.8125rem;
    margin: 0;
}

.sga-xml-table thead th {
    background: #f3f5f8;
    color: var(--sga-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-color: var(--sga-line) !important;
    padding: 0.65rem 0.8rem;
    white-space: nowrap;
}

.sga-xml-table tbody td {
    padding: 0.7rem 0.8rem;
    border-color: var(--sga-line);
    vertical-align: top;
}

.sga-xml-table tbody tr:last-child td {
    border-bottom: 0;
}

.sga-xml-table tbody tr:hover {
    background: rgba(71, 85, 105, 0.04);
}

.sga-xml-col-n {
    width: 2.5rem;
}

.sga-xml-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    height: 1.45rem;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.06);
    color: var(--sga-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.sga-xml-desc {
    color: var(--sga-ink);
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
}

.sga-xml-num {
    white-space: nowrap;
}

.sga-xml-num small {
    display: block;
    color: var(--sga-muted);
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.1rem;
}

.sga-xml-money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--sga-ink);
}

.sga-xml-subtotal {
    font-weight: 650;
}

.sga-xml-totales {
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    box-shadow: var(--sga-shadow);
    overflow: hidden;
    margin-left: auto;
    width: min(100%, 22rem);
}

.sga-xml-totales-head {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--sga-line);
    background: #fafbfc;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--sga-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sga-xml-totales-list {
    margin: 0;
    padding: 0.35rem 0;
}

.sga-xml-totales-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem 0.9rem;
}

.sga-xml-totales-row dt {
    margin: 0;
    color: var(--sga-muted);
    font-weight: 550;
    font-size: 0.8125rem;
}

.sga-xml-totales-row dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: var(--sga-ink);
    white-space: nowrap;
}

.sga-xml-totales-row--total {
    margin-top: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--sga-line);
}

.sga-xml-totales-row--total dt {
    color: var(--sga-ink);
    font-weight: 650;
}

.sga-xml-totales-row--total dd {
    font-size: 1.05rem;
    font-weight: 750;
}

@media (max-width: 767.98px) {
    .sga-xml-hero {
        grid-template-columns: 1fr;
    }

    .sga-xml-hero-amount {
        align-items: flex-start;
        text-align: left;
    }

    .sga-xml-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .sga-xml-meta-grid {
        grid-template-columns: 1fr;
    }

    .sga-xml-readable-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}

.border-primary-subtle {
    border-color: rgba(196, 0, 0, 0.35) !important;
}

.bg-success-lt {
    background-color: rgba(47, 179, 68, 0.08) !important;
}

/* ─── Alertas ───────────────────────────────────────────────────── */
.alert {
    border-radius: 0.75rem;
    border: 0;
    box-shadow: var(--sga-shadow);
}

.sga-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.sga-alert-icon {
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 0.1rem;
}

/* ─── Empty ─────────────────────────────────────────────────────── */
.empty {
    padding: 2.5rem 1.25rem;
}

.empty-title {
    font-weight: 650;
}

/* ─── Paginación ────────────────────────────────────────────────── */
.pagination .page-link {
    border-radius: 0.45rem;
    margin: 0 0.12rem;
}

.pagination .page-item.active .page-link {
    background: var(--sga-red);
    border-color: var(--sga-red);
}

/* ─── Login / guest ─────────────────────────────────────────────── */
.sga-guest {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 640px 420px at 50% 46%, rgba(255, 255, 255, 0.92) 0%, transparent 72%),
        radial-gradient(ellipse 900px 560px at 50% 48%, rgba(28, 35, 48, 0.08) 0%, transparent 70%),
        #e9ecef;
}

.sga-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.sga-login-shell {
    display: grid;
    width: 100%;
    max-width: 860px;
    min-height: 520px;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(28, 35, 48, 0.12);
}

.sga-login-panel {
    display: none;
    background: #1c2330;
    color: #fff;
    padding: 2.25rem 2rem;
    flex-direction: column;
    justify-content: space-between;
}

.sga-login-shell--portal .sga-login-panel {
    background: #1b2838;
}

.sga-login-panel h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}

.sga-login-panel p {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.sga-login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    color: rgba(255, 255, 255, 0.88);
}

.sga-login-hero .ti {
    font-size: 6.5rem;
    line-height: 1;
}

.sga-login-tagline {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.78) !important;
    margin-bottom: 0.85rem !important;
}

.sga-login-copy {
    font-size: 0.72rem !important;
    color: rgba(255, 255, 255, 0.42) !important;
}

.sga-login-form-pane {
    padding: 2.25rem 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sga-login-lock {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.5rem;
    background: #f4e8ea;
    color: #9b1c2a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.85rem;
}

.sga-login-lock--portal {
    background: #e8eef6;
    color: #1d4ed8;
}

.sga-login-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 0.25rem;
}

.sga-login-lead {
    color: var(--sga-muted);
    font-size: 0.8125rem;
    margin-bottom: 1.35rem;
}

.sga-login-form-pane .form-label {
    font-size: 0.8125rem;
    font-weight: 500;
}

.sga-login-form-pane .input-group-text {
    background: #fff;
    color: #98a2b3;
}

.sga-login-form-pane .input-group .btn {
    border: 1px solid var(--tblr-border-color, #d0d5dd);
    border-left: 0;
    color: #667085;
    background: #fff;
}

.sga-login-form-pane .input-group .btn:hover {
    color: var(--sga-ink);
    background: #f8fafc;
}

.sga-login-foot {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: 0.78rem;
    color: var(--sga-muted);
}

.sga-login-foot a {
    color: var(--sga-ink);
    font-weight: 500;
}

@media (min-width: 768px) {
    .sga-login-shell {
        grid-template-columns: 0.92fr 1.08fr;
    }

    .sga-login-panel {
        display: flex;
    }
}

.sga-portal .navbar-vertical.navbar-dark {
    background: #0f2744;
}

.sga-brand-logo {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
}

.sga-portal .navbar-vertical.navbar-dark .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.sga-portal .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Portal: detalle factura ───────────────────────────────────── */
.sga-portal-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 0.85rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--sga-line);
    border-radius: calc(var(--sga-radius) + 0.1rem);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(29, 78, 216, 0.1), transparent 55%),
        linear-gradient(135deg, #fff 0%, #f5f8fc 100%);
    box-shadow: var(--sga-shadow);
}

.sga-portal-hero--ok {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(22, 163, 74, 0.1), transparent 55%),
        linear-gradient(135deg, #fff 0%, #f5faf7 100%);
}

.sga-portal-hero--warn {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(217, 119, 6, 0.12), transparent 55%),
        linear-gradient(135deg, #fff 0%, #fffaf3 100%);
}

.sga-portal-hero-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sga-muted);
    margin-bottom: 0.25rem;
}

.sga-portal-hero-doc {
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--sga-ink);
    line-height: 1.15;
}

.sga-portal-hero-meta {
    margin-top: 0.35rem;
    color: var(--sga-muted);
    font-size: 0.875rem;
}

.sga-portal-hero-amount {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding: 0.75rem 0.9rem;
    border-radius: 0.7rem;
    background: #fff;
    border: 1px solid var(--sga-line);
}

.sga-portal-hero-amount strong {
    font-size: 1.4rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: #1d4ed8;
    line-height: 1.15;
}

.sga-portal-hero--ok .sga-portal-hero-amount strong {
    color: #15803d;
}

.sga-portal-hero--warn .sga-portal-hero-amount strong {
    color: #b45309;
}

.sga-portal-status {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--sga-radius);
    border: 1px solid var(--sga-line);
    background: #fff;
    box-shadow: var(--sga-shadow);
}

.sga-portal-status--info {
    border-color: rgba(29, 78, 216, 0.18);
    background: #f5f8ff;
}

.sga-portal-status--ok {
    border-color: rgba(22, 163, 74, 0.18);
    background: #f0fdf4;
}

.sga-portal-status--warn {
    border-color: rgba(217, 119, 6, 0.2);
    background: #fffbeb;
}

.sga-portal-status-text {
    color: var(--sga-ink);
    font-size: 0.9rem;
    line-height: 1.35;
}

.sga-portal-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.sga-portal-meta-item {
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--sga-line);
    border-radius: 0.65rem;
    background: #fafbfc;
    min-width: 0;
}

.sga-portal-meta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--sga-muted);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

.sga-portal-meta-label i {
    font-size: 0.95rem;
}

.sga-portal-meta-value {
    display: block;
    color: var(--sga-ink);
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-word;
}

.sga-portal-meta-value--strong {
    font-weight: 750;
    font-size: 1.05rem;
}

.sga-portal-doc-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sga-muted);
    background: rgba(16, 24, 40, 0.06);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.sga-portal-docs {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.sga-portal-doc {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--sga-line);
    border-radius: 0.7rem;
    background: #fff;
}

.sga-portal-doc-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    color: #475569;
    flex-shrink: 0;
}

.sga-portal-doc-icon i {
    font-size: 1.25rem;
}

.sga-portal-doc--pdf .sga-portal-doc-icon {
    background: rgba(180, 83, 9, 0.1);
    color: #b45309;
}

.sga-portal-doc--xml .sga-portal-doc-icon {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}

.sga-portal-doc-info {
    min-width: 0;
    flex: 1;
}

.sga-portal-doc-type {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sga-muted);
}

.sga-portal-doc-name {
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--sga-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sga-portal-doc-actions {
    display: inline-flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.sga-portal-doc-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    border: 1px solid var(--sga-line);
    background: #f8fafc;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sga-portal-doc-btn i {
    font-size: 1.15rem;
    line-height: 1;
}

.sga-portal-doc-btn:hover {
    background: #e8eef8;
    border-color: rgba(29, 78, 216, 0.25);
    color: #1d4ed8;
}

.sga-portal-msg {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.sga-portal-msg.is-mine {
    flex-direction: row-reverse;
}

.sga-portal-msg-avatar {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    color: #475569;
    flex-shrink: 0;
}

.sga-portal-msg.is-mine .sga-portal-msg-avatar {
    background: rgba(29, 78, 216, 0.12);
    color: #1d4ed8;
}

.sga-portal-msg.is-theirs .sga-portal-msg-avatar {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.sga-portal-msg-bubble {
    max-width: 90%;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--sga-line);
}

.sga-portal-msg.is-mine .sga-portal-msg-bubble {
    background: #eef4ff;
    border-color: rgba(29, 78, 216, 0.15);
}

.sga-portal-msg-author {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.sga-portal-msg-time {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--sga-muted);
}

.sga-portal-msg.is-mine .sga-portal-msg-time {
    text-align: right;
}

@media (max-width: 767.98px) {
    .sga-portal-hero {
        grid-template-columns: 1fr;
    }

    .sga-portal-hero-amount {
        align-items: flex-start;
        text-align: left;
    }

    .sga-portal-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sga-portal-status {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .sga-portal-meta-grid {
        grid-template-columns: 1fr;
    }
}

.sga-error {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sga-error .empty-header {
    color: var(--sga-red);
    font-weight: 700;
    letter-spacing: -0.03em;
}

/* ─── Autocomplete proveedor ────────────────────────────────────── */
#proveedor-results.list-group {
    top: calc(100% + 0.25rem);
    left: 0;
    background: #fff;
    border: 1px solid var(--sga-line);
    box-shadow: var(--sga-shadow-md);
    border-radius: 0.6rem;
    overflow: hidden;
}

/* ─── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .page-header .col-auto {
        margin-top: 0.85rem;
        width: 100%;
    }

    .page-header .col-auto .btn,
    .page-header .col-auto.d-flex {
        width: 100%;
    }

    .page-header .col-auto.d-flex {
        flex-wrap: wrap;
    }
}

@media print {
    .navbar-vertical,
    .sga-topbar,
    .sga-skip,
    .btn {
        display: none !important;
    }
}

/* ─── Tesorería bandeja ─────────────────────────────────────────── */
.sga-row-urgent td:first-child {
    box-shadow: inset 3px 0 0 #d63939;
}

.sga-row-soon td:first-child {
    box-shadow: inset 3px 0 0 #f59f00;
}

.sga-row-unscheduled td:first-child {
    box-shadow: inset 3px 0 0 #4263eb;
}

.sga-pago-actions .btn {
    white-space: nowrap;
}

.sga-pago-monto {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* ─── Rendiciones ───────────────────────────────────────────────── */
.sga-rend-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sga-rend-step {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f2f4f7;
    color: var(--sga-muted);
}

.sga-rend-step.is-done {
    background: rgba(47, 179, 68, 0.12);
    color: #2fb344;
}

.sga-rend-step.is-active {
    background: var(--sga-red-soft);
    color: var(--sga-red);
    box-shadow: inset 0 0 0 1px rgba(196, 0, 0, 0.15);
}

.sga-rend-checklist .list-group-item {
    border-left: 0;
    border-right: 0;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.sga-rend-checklist .sga-check-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2f4f7;
    color: #98a2b3;
    flex-shrink: 0;
}

.sga-rend-checklist .is-done .sga-check-icon {
    background: rgba(47, 179, 68, 0.12);
    color: #2fb344;
}

.sga-rend-checklist .is-pending .sga-check-icon {
    background: rgba(245, 159, 0, 0.12);
    color: #f59f00;
}

.sga-rend-preview {
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    padding: 0.85rem 1rem;
}

.sga-rend-preview dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.75rem;
    font-size: 0.8125rem;
}

.sga-rend-preview dt {
    color: var(--sga-muted);
    margin: 0;
}

.sga-rend-preview dd {
    margin: 0;
    font-weight: 500;
}

.sga-linea-row > td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    vertical-align: middle;
}

.sga-linea-n {
    color: var(--sga-muted);
    font-weight: 650;
}

.sga-linea-cat {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #eef2f6;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.sga-linea-desc {
    line-height: 1.35;
    color: var(--sga-ink);
}

.sga-linea-monto {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.sga-doc-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.sga-doc-pair {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--sga-line);
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--sga-shadow);
}

.sga-doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: #344054;
    text-decoration: none !important;
    background: #f8fafc;
    line-height: 1;
}

.sga-doc-chip i {
    font-size: 1.15rem;
    line-height: 1;
}

.sga-doc-pair--xml .sga-doc-chip i {
    color: #0f766e;
}

.sga-doc-pair--pdf .sga-doc-chip i {
    color: #b45309;
}

.sga-doc-chip:hover {
    background: #eef2f6;
    color: var(--sga-ink);
}

.sga-doc-view {
    appearance: none;
    border: 0;
    border-left: 1px solid var(--sga-line);
    background: #fff;
    color: #475569;
    width: 2.35rem;
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.sga-doc-view i {
    font-size: 1.2rem;
    line-height: 1;
}

.sga-doc-view:hover {
    background: #eef2f6;
    color: var(--sga-ink);
}

.sga-linea-delete {
    appearance: none;
    border: 1px solid rgba(196, 0, 0, 0.18);
    background: #fff;
    color: var(--sga-red);
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sga-linea-delete i {
    font-size: 1.2rem;
    line-height: 1;
}

.sga-linea-delete:hover {
    background: var(--sga-red-soft);
    border-color: rgba(196, 0, 0, 0.35);
}

.sga-linea-adjuntar {
    border-top: 1px dashed var(--sga-line);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.sga-rend-kpi {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sga-rend-kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.sga-rend-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-size: 0.8125rem;
    color: var(--sga-muted);
}

.sga-rend-meta i {
    margin-right: 0.2rem;
}

.sga-rend-meta strong {
    color: var(--tblr-body-color, #1d273b);
    font-weight: 600;
}

.sga-rend-drops {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sga-rend-drop.upload-zone {
    padding: 0.7rem 0.5rem;
    min-height: 5.5rem;
}

.sga-rend-drop .upload-zone-icon {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.sga-rend-drop .upload-zone-files {
    margin-top: 0.25rem;
    font-size: 0.72rem;
}

.sga-firma-pad {
    display: block;
    width: 100%;
    height: 160px;
    border: 1px dashed var(--sga-line);
    border-radius: var(--sga-radius);
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}

.sga-firma-preview {
    background: #fff;
    border: 1px solid var(--sga-line);
    border-radius: var(--sga-radius);
    padding: 0.35rem 0.5rem;
}

.sga-firma-preview img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: contain;
    background: #fff;
}

.sga-rend-summary {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.8125rem;
    line-height: 1.35;
}

@media (max-width: 767.98px) {
    .sga-rend-add-grid {
        flex-direction: column-reverse;
    }

    .sga-rend-drops {
        grid-template-columns: 1fr;
    }
}
