:root {
    --hg-primary: #2E7D32;
    --hg-primary-light: #43A047;
    --hg-accent: #7CB342;
    --hg-bg: #F5F6FA;
    --hg-surface: #FFFFFF;
    --hg-text: #1A1A2E;
    --hg-text-muted: #6B7280;
    --hg-border: #E5E7EB;
    --hg-input-bg: color-mix(in srgb, #F3F6F4 88%, var(--hg-primary) 12%);
    --hg-input-focus-bg: #FFFFFF;
    --hg-input-border: color-mix(in srgb, var(--hg-border) 78%, var(--hg-primary) 22%);
    --hg-input-focus-border: color-mix(in srgb, var(--hg-primary-light) 72%, var(--hg-border));
    --hg-input-focus-shadow: 0 0 0 3px rgba(46,125,50,.13);
    --hg-success: #16A34A;
    --hg-warning: #D97706;
    --hg-danger: #DC2626;
    --hg-nav-height: 68px;
    --hg-mobile-bottom-clearance: calc(96px + env(safe-area-inset-bottom));
    --bs-primary: #2E7D32;
    --bs-primary-rgb: 46, 125, 50;
    --bs-link-color: #2E7D32;
    --bs-link-hover-color: #1B5E20;
    color-scheme: light;
}

/* Direcciones B2C: tratamiento visual propio dentro del panel lateral. */
.hgl-address-toolbar {
    display: flex;
    justify-content: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 28%, var(--hg-surface));
}

.hgl-address-toolbar button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 28%, var(--hg-border));
    border-radius: 10px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-address-list {
    overflow: visible;
}

.hgl-address-list .hgl-address-item {
    grid-template-columns: 52px minmax(220px, 1fr) minmax(90px, .3fr) auto;
    min-width: 0;
    gap: 14px;
    padding: 13px 16px;
    background: var(--hg-surface);
}

.hgl-address-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.hgl-address-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 26%, var(--hg-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
    color: var(--hg-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.hgl-address-actions button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--hg-primary) 11%, var(--hg-surface));
}

.hgl-address-actions button:disabled {
    cursor: default;
    opacity: .48;
}

.hgl-address-actions .hg-danger-action {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.hgl-address-editor {
    margin: 16px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 18%, var(--hg-border));
    border-radius: 14px;
    background: var(--hg-surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.hgl-address-editor > .hgl-panel-title {
    padding: 14px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
}

.hgl-address-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}

.hgl-address-form label {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.hgl-address-form .hg-input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}

.hgl-address-wide {
    grid-column: 1 / -1;
}

.hgl-address-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 16px 14px;
}

.hgl-address-checks .hg-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--hg-border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--hg-bg) 38%, var(--hg-surface));
    color: var(--hg-text);
    font-size: 12px;
    font-weight: 750;
}

.hgl-detail-drawer .hgl-address-save-actions,
.hgl-drawer-page .hgl-detail-drawer .hgl-address-save-actions {
    position: static;
    display: flex;
    grid-template-columns: none;
    justify-content: flex-end;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 24%, var(--hg-surface));
    box-shadow: none;
}

@media (max-width: 760px) {
    .hgl-address-list .hgl-address-item {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 8px 12px;
    }

    .hgl-address-item > span:nth-child(3) {
        grid-column: 2;
    }

    .hgl-address-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .hgl-address-editor {
        margin: 12px;
    }

    .hgl-address-form {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .hgl-address-wide {
        grid-column: auto;
    }

    .hgl-detail-drawer .hgl-address-save-actions,
    .hgl-drawer-page .hgl-detail-drawer .hgl-address-save-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.hg-dashboard-redirect {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--hg-text-muted);
    font-weight: 800;
}

.hg-dashboard-page {
    gap: 16px;
}

.hg-dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg, #174f2c, #2f7d47 58%, #4e9661);
    color: #fff;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(22, 78, 43, .2);
}

.hg-dashboard-hero-copy {
    min-width: 0;
    position: relative;
    z-index: 1;
}

.hg-dashboard-eyebrow {
    color: #bff3cb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hg-dashboard-hero h1 {
    margin: 3px 0 7px;
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
}

.hg-dashboard-hero .hg-dashboard-greeting {
    margin: 0;
    color: rgba(255,255,255,.8);
    font-size: 14px;
    font-weight: 650;
}

.hg-dashboard-hero .hg-dashboard-connection {
    margin: 5px 0 0;
    max-width: 760px;
    color: rgba(255,255,255,.56);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.hg-dashboard-page .hgl-admin-title {
    padding: 26px 32px;
}

.hg-dashboard-page .hgl-admin-title h1 {
    margin-bottom: 6px;
}

.hg-dashboard-page .hgl-admin-title .hg-dashboard-title,
.hg-dashboard-page .hgl-admin-title .hg-dashboard-title strong {
    font-weight: 900 !important;
}

.hg-dashboard-page .hgl-admin-title .hg-dashboard-greeting {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.hg-dashboard-page .hgl-admin-title .hg-dashboard-connection {
    margin: 4px 0 0;
    max-width: 780px;
    color: color-mix(in srgb, var(--hg-text-muted) 58%, var(--hg-surface) 42%);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

:root[data-theme="dark"] .hg-dashboard-page .hgl-admin-title .hg-dashboard-connection {
    color: color-mix(in srgb, var(--hg-text-muted) 56%, transparent);
}

.hg-dashboard-period {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--hg-border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--hg-surface) 94%, var(--hg-primary) 6%);
    box-shadow: 0 12px 28px rgba(0,0,0,.04);
}

.hg-dashboard-hero .hg-dashboard-period {
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
    border-color: rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(0,0,0,.12);
    gap: 4px;
    padding: 5px;
    box-shadow: none;
}

.hg-dashboard-hero .hg-period-nav {
    grid-template-columns: 34px minmax(132px, 154px) 34px;
    gap: 4px;
}

.hg-dashboard-hero .hg-period-field span {
    display: none;
}

.hg-dashboard-hero .hg-period-button,
.hg-dashboard-hero .hg-period-refresh {
    height: 36px;
    min-height: 36px;
    border-color: transparent;
    background: transparent;
    color: rgba(255,255,255,.82);
}

.hg-dashboard-hero .hg-period-button {
    width: 34px;
    min-width: 34px;
}

.hg-dashboard-hero .hg-period-refresh {
    min-width: 96px;
    padding-inline: 13px;
}

.hg-dashboard-hero .hg-period-button:hover,
.hg-dashboard-hero .hg-period-refresh:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.hg-dashboard-hero .hg-period-field input {
    height: 36px;
    min-width: 132px;
    border-color: rgba(255,255,255,.2);
    border-radius: 999px;
    background: #fff;
    color: #1f6237;
    font-weight: 850;
}

.hg-period-nav {
    display: grid;
    grid-template-columns: 40px minmax(150px, 190px) 40px;
    gap: 6px;
    align-items: end;
}

.hg-period-button,
.hg-period-refresh {
    height: 40px;
    min-height: 40px;
    border: 1px solid rgba(46,125,50,.22);
    border-radius: 14px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    box-shadow: none;
    font-weight: 850;
    cursor: pointer;
}

.hg-period-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.hg-period-refresh {
    width: auto;
    min-width: 116px;
    padding: 0 18px;
}

.hg-dashboard-period label {
    margin: 0;
}

.hg-period-field {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hg-period-field span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .02em;
    text-align: center;
}

.hg-period-field input {
    width: 100%;
    min-width: 128px;
    height: 40px;
    padding: 0 12px;
    text-align: center;
    border-radius: 14px;
}

:root[data-theme="dark"] .hg-dashboard-period,
:root[data-theme="dark"] .hg-period-nav {
    background: var(--hg-surface);
}

:root[data-theme="dark"] .hg-period-button,
:root[data-theme="dark"] .hg-period-refresh {
    background: color-mix(in srgb, var(--hg-surface) 94%, white 6%);
    color: color-mix(in srgb, var(--hg-primary) 72%, white 28%);
}

.hg-dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 12px;
}

.hg-dashboard-kpi {
    display: grid;
    align-content: start;
    gap: 0;
    min-height: 118px;
    overflow: hidden;
    position: relative;
    padding: 17px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow-soft);
    color: var(--hg-text);
    text-decoration: none;
}

.hg-dashboard-kpi::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: var(--hg-dashboard-accent, var(--hg-primary));
    content: "";
}

.hg-dashboard-kpi span,
.hg-dashboard-web-chip span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.28;
}

.hg-dashboard-kpi strong {
    margin-top: 7px;
    color: var(--hg-text);
    font-size: clamp(23px, 2.15vw, 31px);
    line-height: 1.02;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.hg-dashboard-kpi small {
    margin-top: 8px;
    color: var(--hg-dashboard-accent, var(--hg-primary));
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
}

.hg-dashboard-kpi.hg-kpi-primary {
    border-color: rgba(46, 125, 50, .20);
    background: linear-gradient(180deg, color-mix(in srgb, var(--hg-surface) 88%, #2E7D32 12%), var(--hg-surface));
}

.hg-dashboard-kpi.hg-kpi-green {
    --hg-dashboard-accent: #2f7d47;
}

.hg-dashboard-kpi.hg-kpi-blue {
    --hg-dashboard-accent: #3977a8;
}

.hg-dashboard-kpi.is-own {
    --hg-dashboard-accent: #2f7d47;
}

.hg-dashboard-kpi.is-third-party {
    --hg-dashboard-accent: #3977a8;
}

.hg-dashboard-kpi.hg-kpi-warn {
    border-color: rgba(245, 158, 11, .22);
    background: linear-gradient(180deg, color-mix(in srgb, var(--hg-surface) 86%, #F59E0B 14%), var(--hg-surface));
}

:root[data-theme="dark"] .hg-dashboard-kpi {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] .hg-dashboard-kpi small,
:root[data-theme="dark"] .hg-dashboard-kpi span {
    color: color-mix(in srgb, var(--hg-text-muted) 86%, transparent);
}

:root[data-theme="dark"] .hg-dashboard-kpi.hg-kpi-primary {
    border-color: rgba(74, 222, 128, .18);
    background: linear-gradient(180deg, rgba(47, 143, 70, .18), rgba(29, 30, 34, .88));
}

:root[data-theme="dark"] .hg-dashboard-kpi.hg-kpi-green {
    border-color: var(--hg-border);
    background: var(--hg-surface);
}

:root[data-theme="dark"] .hg-dashboard-kpi.hg-kpi-blue {
    border-color: var(--hg-border);
    background: var(--hg-surface);
}

:root[data-theme="dark"] .hg-dashboard-kpi.hg-kpi-warn {
    border-color: rgba(251, 191, 36, .20);
    background: linear-gradient(180deg, rgba(245, 158, 11, .16), rgba(29, 30, 34, .88));
}

.hg-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hg-dashboard-grid > :only-child {
    grid-column: 1 / -1;
}

.hg-dashboard-panel {
    --hg-dashboard-panel-accent: #2f7d47;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
    box-shadow: var(--hg-shadow-soft);
}

.hg-dashboard-panel::before {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 2;
    width: 4px;
    background: var(--hg-dashboard-panel-accent);
    content: "";
    pointer-events: none;
}

.hg-dashboard-panel.is-products,
.hg-dashboard-panel.is-clients {
    --hg-dashboard-panel-accent: #2f7d47;
}

.hg-dashboard-panel.is-services {
    --hg-dashboard-panel-accent: #3977a8;
}

.hg-dashboard-panel.is-web,
.hg-dashboard-panel.is-new {
    --hg-dashboard-panel-accent: #63a63e;
}

.hg-dashboard-panel.is-warning,
.hg-dashboard-panel.is-alerts {
    --hg-dashboard-panel-accent: #b87b16;
}

.hg-dashboard-panel.is-modules {
    --hg-dashboard-panel-accent: #735aa8;
}

.hg-dashboard-panel .hgl-panel-title {
    display: grid;
    justify-items: start;
    gap: 3px;
    min-height: 0;
    padding: 17px 18px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}

.hg-dashboard-panel .hgl-panel-title strong {
    color: var(--hg-text);
    font-size: 19px;
    line-height: 1.15;
}

.hg-dashboard-panel .hgl-panel-title span {
    order: -1;
    color: var(--hg-dashboard-panel-accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hg-dashboard-progress {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hg-dashboard-progress:last-child {
    border-bottom: 0;
}

.hg-dashboard-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.hg-dashboard-progress strong {
    font-size: 16px;
    font-weight: 900;
}

.hg-dashboard-progress span {
    color: color-mix(in srgb, var(--hg-text-muted) 86%, var(--hg-text) 14%);
    font-size: 15px;
    font-weight: 620;
    line-height: 1.28;
    text-align: right;
}

.hg-dashboard-progress-track {
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--hg-surface) 72%, var(--hg-primary) 28%);
}

.hg-dashboard-progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--hg-primary);
    opacity: .82;
}

.hg-dashboard-web-grid,
.hg-dashboard-module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
}

.hg-dashboard-panel.is-web .hg-dashboard-web-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hg-dashboard-web-chip,
.hg-dashboard-module {
    display: grid;
    gap: 6px;
    overflow: hidden;
    position: relative;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    color: var(--hg-text);
    text-decoration: none;
    background: var(--hg-surface);
}

.hg-dashboard-web-chip strong {
    color: var(--hg-primary);
    font-size: 26px;
    font-weight: 900;
}

.hg-dashboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 12px 18px;
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-text);
    text-decoration: none;
}

.hg-dashboard-row:last-child {
    border-bottom: 0;
}

.hg-dashboard-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-dashboard-row strong {
    color: var(--hg-primary);
    white-space: nowrap;
}

.hg-dashboard-business {
    margin-top: 16px;
}

.hg-dashboard-business-row {
    align-items: flex-start;
}

.hg-dashboard-business-row span {
    display: grid;
    gap: 4px;
    min-width: 0;
    white-space: normal;
}

.hg-dashboard-business-row b {
    font-size: 13px;
    font-weight: 850;
    line-height: 1.32;
}

.hg-dashboard-business-row small {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.35;
}

.hg-dashboard-business-row strong {
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.hg-dashboard-business-note {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--hg-border);
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 760;
}

.hg-dashboard-section-loading {
    margin: 14px;
    padding: 18px 16px;
    border: 1px dashed color-mix(in srgb, var(--hg-border) 74%, var(--hg-primary) 26%);
    border-radius: 12px;
    color: var(--hg-text-muted);
    background: color-mix(in srgb, var(--hg-surface) 82%, var(--hg-bg) 18%);
    font-size: 13px;
    font-weight: 760;
}

.hg-dashboard-alerts {
    display: grid;
}

.hg-dashboard-alert {
    display: grid;
    gap: 4px;
    padding: 12px 16px 12px 18px;
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-text);
    text-decoration: none;
}

.hg-dashboard-alert:last-child {
    border-bottom: 0;
}

.hg-dashboard-alert span {
    color: var(--hg-text-muted);
}

.hg-dashboard-alert.error strong {
    color: #b91c1c;
}

.hg-dashboard-alert.warning strong {
    color: #a16207;
}

.hg-dashboard-module {
    align-items: center;
    min-height: 54px;
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
}

.hg-dashboard-quiet {
    padding: 22px;
}

.hg-dashboard-quiet h2 {
    margin: 0 0 8px;
    font-size: 26px;
}

.hg-dashboard-quiet p {
    margin: 0;
    color: var(--hg-text-muted);
    font-weight: 700;
}

.hg-iva-afip-controls .hg-form-grid {
    padding: 0;
}

.hg-iva-afip-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.hg-iva-afip-actions > button {
    min-height: 42px;
    white-space: nowrap;
}

.hg-iva-afip-kpis {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.hg-iva-afip-files {
    padding: 18px;
}

.hg-iva-afip-note {
    margin: 14px 0 0;
    color: var(--hg-text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.hg-operational-controls {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.hg-operational-controls .hg-tabs,
.hg-operational-controls .hg-search {
    position: static;
    top: auto;
    z-index: auto;
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hg-operational-controls .hg-tabs {
    padding: 0;
}

.hg-operational-controls .hg-tabs button {
    min-height: 42px;
    border-radius: 12px;
}

.hg-operational-controls .hg-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0;
}

.hg-operational-controls .hg-search input {
    min-height: 44px;
}

.hg-operational-controls .hg-search button {
    min-width: 118px;
}

.hg-insumos-page .hg-insumos-search {
    grid-template-columns: minmax(0, 1fr) 180px auto;
}

.hg-insumos-page .hg-insumos-type-select {
    min-height: 44px;
}

.hg-ventas-page .hg-list,
.hg-compras-page .hg-list {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    margin: 0;
    border-radius: 18px;
}

.hg-ventas-page .hg-list-item,
.hg-compras-page .hg-list-item {
    width: 100%;
}

.hg-ventas-page .hg-infinite-sentinel,
.hg-compras-page .hg-infinite-sentinel {
    width: 100%;
    max-width: none;
    justify-self: stretch;
}

.hg-venta-detail-page .hg-venta-detail-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.hg-venta-detail-page .hg-venta-detail-actions a {
    justify-content: center;
    min-height: 42px;
    text-align: center;
}

.hg-venta-detail-page .hg-venta-detail-grid {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.hg-venta-detail-summary,
.hg-venta-detail-secondary,
.hg-venta-detail-items {
    grid-column: 1 / -1;
}

.hg-venta-detail-summary-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hg-venta-detail-summary-fields .hg-field {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    padding: 13px 16px;
    border-right: 1px solid var(--hg-border);
}

.hg-venta-detail-summary-fields .hg-field:nth-child(4n),
.hg-venta-detail-summary-fields .hg-field:last-child {
    border-right: 0;
}

.hg-venta-detail-summary-fields .hg-field label {
    min-width: 0;
}

.hg-venta-detail-summary-fields .hg-field span {
    min-width: 0;
    font-size: 14px;
    font-weight: 750;
}

.hg-venta-detail-summary-fields .hg-badge-row {
    margin-top: 0;
}

.hg-venta-detail-summary-fields .hg-venta-detail-wide {
    grid-column: span 2;
}

.hg-venta-detail-secondary {
    display: grid;
    grid-template-columns: minmax(360px, 2fr) minmax(190px, .75fr) minmax(220px, .9fr);
    gap: 14px;
    align-items: stretch;
}

.hg-venta-detail-secondary > .hg-card {
    min-width: 0;
    margin-bottom: 0;
}

.hg-venta-shipping-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(120px, .65fr) auto;
    align-items: end;
    gap: 14px;
    padding: 14px 16px 16px;
}

.hg-venta-shipping-form > label,
.hg-venta-shipping-current {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.hg-venta-shipping-form > label,
.hg-venta-shipping-current small {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.hg-venta-shipping-current strong {
    overflow: hidden;
    color: var(--hg-primary);
    font-size: 14px;
    font-weight: 850;
    line-height: 40px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-venta-shipping-form .hg-primary-action {
    min-height: 40px;
    white-space: nowrap;
}

.hg-venta-detail-status-card .hg-field {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 56px;
}

.hg-venta-detail-status-card .hg-field label {
    min-width: 0;
}

.hg-venta-detail-status-card .hg-field > span {
    min-width: 0;
}

.hg-venta-detail-status-card .hg-badge {
    white-space: nowrap;
}

.hg-venta-detail-status-card .hg-badge-row {
    margin-top: 0;
}

.hg-venta-total-field {
    padding-bottom: 8px;
}

.hg-venta-total-badges {
    padding: 0 16px 14px;
}

.hg-cliente-detail-page .hg-client-edit-card {
    overflow: hidden;
}

.hg-cliente-detail-page .hg-client-edit-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    align-items: end;
}

.hg-cliente-detail-page .hg-client-edit-grid label {
    min-width: 0;
}

.hg-cliente-detail-page .hg-client-edit-grid .hg-input {
    min-width: 0;
}

.hg-cliente-detail-page .hg-client-edit-wide {
    grid-column: span 1;
}

.hg-cliente-detail-page .hg-client-edit-short {
    max-width: none;
}

.hg-venta-detail-total {
    color: var(--hg-primary);
    font-size: 22px;
    font-weight: 850;
    line-height: 1.1;
    white-space: nowrap;
}

.hg-venta-detail-items td strong,
.hg-venta-detail-items td small {
    display: block;
}

.hg-venta-detail-items td small {
    margin-top: 2px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1050px) and (min-width: 761px) {
    .hg-venta-detail-summary-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hg-venta-detail-summary-fields .hg-field:nth-child(4n) {
        border-right: 1px solid var(--hg-border);
    }

    .hg-venta-detail-summary-fields .hg-field:nth-child(2n),
    .hg-venta-detail-summary-fields .hg-field:last-child {
        border-right: 0;
    }

    .hg-venta-detail-secondary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hg-venta-detail-shipping {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .hg-dashboard-page {
        gap: 12px;
    }

    .hg-dashboard-page .hg-dashboard-period {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 96px;
        align-items: end;
        width: 100%;
        gap: 8px;
        padding: 10px;
        border-radius: 16px;
    }

    .hg-dashboard-page .hg-period-nav {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        min-width: 0;
        width: 100%;
        gap: 5px;
    }

    .hg-dashboard-page .hg-period-field input {
        min-width: 0;
        padding-inline: 4px;
    }

    .hg-dashboard-page .hg-period-refresh {
        width: 96px;
        min-width: 0;
        padding-inline: 8px;
    }

    .hg-dashboard-hero {
        display: grid;
        align-items: start;
        gap: 16px;
        padding: 19px;
        border-radius: 18px;
    }

    .hg-dashboard-hero::after {
        right: -82px;
        bottom: -92px;
    }

    .hg-dashboard-hero h1 {
        font-size: 32px;
        line-height: 1;
    }

    .hg-dashboard-hero .hg-dashboard-greeting {
        font-size: 12px;
        line-height: 1.3;
    }

    .hg-dashboard-hero .hg-dashboard-connection {
        font-size: 9px;
        line-height: 1.25;
    }

    .hg-dashboard-grid,
    .hg-dashboard-web-grid,
    .hg-dashboard-module-grid {
        grid-template-columns: 1fr;
    }

    .hg-dashboard-hero .hg-dashboard-period {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        border-radius: 14px;
        background: rgba(0,0,0,.14);
    }

    .hg-period-nav {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        width: 100%;
        gap: 6px;
        align-items: end;
    }

    .hg-dashboard-hero .hg-period-nav {
        grid-template-columns: 34px minmax(0, 1fr) 34px;
        width: 100%;
    }

    .hg-period-button {
        width: 34px;
        min-width: 34px;
        height: 38px;
        min-height: 38px;
        border-radius: 12px;
        font-size: 19px;
    }

    .hg-period-field input {
        min-width: 0;
        height: 38px;
        padding: 0 8px;
        border-radius: 12px;
        font-size: 13px;
    }

    .hg-period-refresh {
        width: 100%;
        min-width: 0;
        height: 38px;
        min-height: 38px;
        justify-self: stretch;
        border-radius: 12px;
        font-size: 13px;
    }

    .hg-dashboard-kpis {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hg-dashboard-kpi {
        min-height: 96px;
        padding: 14px 15px;
        gap: 0;
        border-radius: 14px;
    }

    .hg-dashboard-kpi strong {
        margin-top: 7px;
        font-size: 22px;
        line-height: 1.08;
    }

    .hg-dashboard-kpi span {
        font-size: 10px;
        letter-spacing: .02em;
        line-height: 1.25;
    }

    .hg-dashboard-kpi small {
        margin-top: 7px;
        font-size: 11px;
        line-height: 1.34;
    }

    .hg-dashboard-panel {
        border-radius: 14px;
    }

    .hg-dashboard-panel .hgl-panel-title {
        padding: 15px 16px 14px 18px;
    }

    .hg-dashboard-panel .hgl-panel-title strong {
        font-size: 17px;
    }

    .hg-dashboard-panel.is-web .hg-dashboard-web-grid {
        grid-template-columns: 1fr;
    }

    .hg-operational-controls {
        gap: 10px;
        padding: 12px;
        border-radius: 14px;
    }

    .hg-operational-controls .hg-tabs {
        gap: 6px;
    }

    .hg-operational-controls .hg-tabs button {
        min-height: 40px;
        padding: 8px 6px;
        font-size: 12px;
    }

    .hg-operational-controls .hg-search {
        grid-template-columns: 1fr;
    }

    .hg-insumos-page .hg-insumos-search {
        grid-template-columns: 1fr;
    }

    .hg-operational-controls .hg-search button {
        width: 100%;
        min-width: 0;
    }

    .hg-venta-detail-page .hg-venta-detail-grid {
        grid-template-columns: 1fr;
    }

    .hg-venta-detail-summary-fields,
    .hg-venta-detail-secondary {
        grid-template-columns: 1fr;
    }

    .hg-venta-detail-summary-fields .hg-venta-detail-wide {
        grid-column: auto;
    }

    .hg-venta-detail-summary-fields .hg-field {
        display: flex;
        border-right: 0;
    }

    .hg-venta-shipping-form {
        grid-template-columns: 1fr;
    }

    .hg-venta-shipping-current strong {
        line-height: 1.3;
        white-space: normal;
    }

    .hg-venta-shipping-form .hg-primary-action {
        width: 100%;
        justify-content: center;
    }

    .hg-venta-detail-page .hg-venta-detail-actions {
        grid-template-columns: 1fr;
    }

    .hg-cliente-detail-page .hg-client-edit-grid {
        grid-template-columns: 1fr;
    }

    .hg-dashboard-progress > div:first-child,
    .hg-dashboard-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hg-dashboard-progress span {
        text-align: left;
    }
}

@media (max-width: 380px) {
    .hg-dashboard-page .hg-dashboard-period {
        grid-template-columns: 1fr;
    }

    .hg-dashboard-page .hg-period-refresh {
        width: 100%;
    }
}

.hg-db-env-page {
    max-width: 1220px;
    margin: 0 auto;
    display: grid;
    gap: 18px;
}

.hg-db-current {
    display: grid;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
}

.hg-db-current span,
.hg-db-env-head span {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hg-text-muted);
    font-weight: 900;
}

.hg-db-current strong {
    color: var(--hg-text);
    font-size: 20px;
    line-height: 1.2;
}

.hg-db-current small {
    color: var(--hg-text-muted);
    font-weight: 700;
}

.hg-db-current-prod {
    border-color: rgba(127, 29, 29, .28);
    background: rgba(127, 29, 29, .07);
}

.hg-db-current-prod strong {
    color: #7F1D1D;
}

.hg-db-config-card {
    display: grid;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.hg-db-config-card .hg-card-title {
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hg-db-config-list {
    display: grid;
    gap: 0;
}

.hg-db-config-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}

.hg-db-config-row:last-child {
    border-bottom: 0;
}

.hg-db-config-row.active {
    background: rgba(46, 125, 50, .06);
}

.hg-db-config-row.prod.active {
    background: rgba(127, 29, 29, .06);
}

.hg-db-config-row.invalid {
    background: rgba(185, 28, 28, .07);
}

.hg-db-config-label {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.hg-db-config-main {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    min-width: 0;
}

.hg-db-config-main strong {
    color: var(--hg-text);
    font-size: 15px;
    line-height: 1.2;
}

.hg-db-config-main small {
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.hg-db-config-state {
    display: flex;
    justify-content: flex-end;
}

.hg-db-config-state span {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(46, 125, 50, .12);
    color: var(--hg-primary);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.hg-db-config-state span.muted {
    background: transparent;
    color: var(--hg-text-muted);
}

.hg-db-env-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.hg-db-env-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .06);
    overflow: visible;
}

.hg-db-env-card-active {
    border-color: color-mix(in srgb, var(--hg-primary) 48%, var(--hg-border));
    box-shadow: 0 12px 30px rgba(46, 125, 50, .12);
}

.hg-db-env-card-prod {
    border-color: rgba(127, 29, 29, .20);
}

.hg-db-env-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.hg-db-env-head span {
    color: var(--hg-text);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.hg-db-env-head strong {
    flex: 0 0 auto;
    color: var(--hg-primary);
    background: color-mix(in srgb, var(--hg-primary) 12%, transparent);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    text-transform: uppercase;
}

.hg-db-env-card p {
    margin: 0;
    color: var(--hg-text-muted);
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
}

.hg-db-env-card dl {
    margin: 0;
    display: grid;
    gap: 10px;
}

.hg-db-env-card dl > div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.hg-db-env-card dt {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--hg-text-muted);
    font-weight: 900;
}

.hg-db-env-card dd {
    margin: 0;
    color: var(--hg-text);
    font-weight: 800;
    font-size: 13px;
    line-height: 1.25;
    word-break: break-word;
}

.hg-db-prod-warning {
    color: #7F1D1D;
    background: rgba(127, 29, 29, .07);
    border: 1px solid rgba(127, 29, 29, .20);
    border-radius: 12px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 900;
}

.hg-db-env-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.hg-db-env-actions button {
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding-inline: 8px;
    font-size: 12px;
    white-space: normal;
}

.hg-db-env-actions .hg-db-site-action:not(.hg-primary-action) {
    border-color: rgba(127, 29, 29, .22);
    color: #7F1D1D;
}

.hg-db-env-card .hg-primary-action {
    width: 100%;
    min-height: 44px;
}

:root[data-theme="dark"] .hg-db-current-prod strong,
:root[data-theme="dark"] .hg-db-prod-warning {
    color: #FCA5A5;
}

:root[data-theme="dark"] .hg-db-current-prod,
:root[data-theme="dark"] .hg-db-prod-warning {
    border-color: rgba(248, 113, 113, .22);
    background: rgba(127, 29, 29, .18);
}

:root[data-theme="dark"] .hg-db-env-actions .hg-db-site-action:not(.hg-primary-action) {
    color: #FCA5A5;
}

@media (max-width: 980px) {
    .hg-db-env-grid {
        grid-template-columns: 1fr;
    }

    .hg-db-config-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .hg-db-config-state {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .hg-db-env-actions {
        grid-template-columns: 1fr;
    }
}


:root[data-theme="dark"] {
    --hg-primary: #2F8F46;
    --hg-primary-light: #3FAE5A;
    --hg-accent: #86EFAC;
    --hg-bg: #101114;
    --hg-surface: rgba(29,30,34,.88);
    --hg-text: #F5F5F7;
    --hg-text-muted: #A1A1AA;
    --hg-border: rgba(255,255,255,.11);
    --hg-input-bg: rgba(255,255,255,.075);
    --hg-input-focus-bg: rgba(255,255,255,.115);
    --hg-input-border: rgba(255,255,255,.13);
    --hg-input-focus-border: rgba(134,239,172,.45);
    --hg-input-focus-shadow: 0 0 0 4px rgba(134,239,172,.15);
    --hg-success: #4ADE80;
    --hg-warning: #FBBF24;
    --hg-danger: #F87171;
    --bs-primary: #2F8F46;
    --bs-primary-rgb: 47, 143, 70;
    --bs-link-color: #86EFAC;
    --bs-link-hover-color: #BBF7D0;
    color-scheme: dark;
}

.btn-primary {
    --bs-btn-bg: var(--hg-primary);
    --bs-btn-border-color: var(--hg-primary);
    --bs-btn-hover-bg: var(--hg-primary-light);
    --bs-btn-hover-border-color: var(--hg-primary-light);
    --bs-btn-active-bg: var(--hg-primary);
    --bs-btn-active-border-color: var(--hg-primary);
    --bs-btn-disabled-bg: var(--hg-primary);
    --bs-btn-disabled-border-color: var(--hg-primary);
}

:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .hg-primary-action,
:root[data-theme="dark"] .hg-action-bar a,
:root[data-theme="dark"] .hg-action-bar button {
    background: #2F8F46;
    border-color: #2F8F46;
    color: #FFFFFF;
}

:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] .hg-primary-action:hover,
:root[data-theme="dark"] .hg-action-bar a:hover,
:root[data-theme="dark"] .hg-action-bar button:hover {
    background: #3FAE5A;
    border-color: #3FAE5A;
    color: #FFFFFF;
}

:root[data-theme="dark"] a:not(.hg-primary-action):not(.hg-secondary-action):not(.hg-row-action):not(.hg-nav-item):not(.hg-list-item):not(.hg-list-main-link) {
    color: #86EFAC;
}

:root[data-theme="dark"] a:not(.hg-primary-action):not(.hg-secondary-action):not(.hg-row-action):not(.hg-nav-item):not(.hg-list-item):not(.hg-list-main-link):hover {
    color: #BBF7D0;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--hg-bg);
    color: var(--hg-text);
    height: 100%;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body,
.hg-header,
.hg-card,
.hg-list,
.hg-search,
.hg-tabs,
.hg-action-bar,
.hg-shell-sidebar,
.hg-bottom-nav,
.hg-input,
.hg-nav-item,
.hg-env-footer {
    transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

:root[data-theme="dark"],
:root[data-theme="dark"] body,
:root[data-theme="dark"] .hg-app,
:root[data-theme="dark"] .hg-shell-content,
:root[data-theme="dark"] .hg-main {
    background-color: #101114;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .hg-header,
:root[data-theme="dark"] .hg-card,
:root[data-theme="dark"] .hg-list,
:root[data-theme="dark"] .hg-search,
:root[data-theme="dark"] .hg-tabs,
:root[data-theme="dark"] .hg-action-bar,
:root[data-theme="dark"] .hg-shell-sidebar,
:root[data-theme="dark"] .hg-bottom-nav,
:root[data-theme="dark"] .hg-input,
:root[data-theme="dark"] .hg-nav-item,
:root[data-theme="dark"] .hg-env-footer {
    transition: none;
}

.hg-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hg-main {
    flex: 1;
    padding-bottom: calc(var(--hg-nav-height) + 8px);
    overflow-y: auto;
}

/* ---- BOTTOM NAV ---- */
.hg-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: var(--hg-nav-height);
    background: var(--hg-surface);
    border-top: 1px solid var(--hg-border);
    display: flex;
    align-items: stretch;
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.hg-bottom-nav::-webkit-scrollbar { display: none; }

.hg-nav-sections {
    display: flex;
    align-items: stretch;
    min-width: max-content;
}

.hg-nav-group {
    display: flex;
    align-items: stretch;
}

.hg-nav-group-title {
    display: none;
}

.hg-nav-item {
    flex: 0 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--hg-text-muted);
    text-decoration: none;
    font-size: 9px;
    font-weight: 500;
    transition: color .15s;
    padding: 8px 3px;
}

.hg-nav-item svg { width: 21px; height: 21px; }

.hg-nav-item.active, .hg-nav-item:hover { color: var(--hg-primary); }

.hg-nav-disabled {
    display: none;
}

.hg-mobile-nav-primary,
.hg-mobile-menu-toggle,
.hg-mobile-menu-backdrop,
.hg-mobile-menu-sheet {
    display: none;
}

/* ---- HEADER ---- */
.hg-header {
    background: var(--hg-primary);
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.hg-header h1 { font-size: 18px; font-weight: 600; }
.hg-header .subtitle { font-size: 12px; opacity: .8; margin-top: 2px; }
.hg-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.hg-page-header-main {
    min-width: 0;
    flex: 1;
    width: 100%;
}
.hg-page-header-title {
    min-width: 0;
    text-align: left;
    width: 100%;
}
.hg-page-header-title h1 {
    overflow-wrap: anywhere;
}
.hg-page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 50%;
}
.hg-page-header-actions .hg-primary-action,
.hg-page-header-actions .hg-secondary-action,
.hg-page-header-actions a,
.hg-page-header-actions button {
    min-height: 36px;
    padding: 8px 12px;
}
.hg-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hg-brand-header img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,.94);
    padding: 4px;
}

/* ---- SEARCH ---- */
.hg-search {
    background: white;
    padding: 10px 16px;
    border-bottom: 1px solid var(--hg-border);
    position: sticky;
    top: 60px;
    z-index: 40;
}
.hg-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--hg-bg);
    outline: none;
}
.hg-search input:focus { border-color: var(--hg-primary-light); }
.hg-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}
.hg-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 750;
}
.hg-check-inline input {
    width: 16px;
    height: 16px;
    accent-color: var(--hg-primary);
}
.hg-alertas-filters {
    justify-content: flex-start;
    flex-wrap: wrap;
}
.hg-check-inline input.hg-small-number,
.hg-small-number {
    width: 76px;
    height: auto;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: var(--hg-bg);
    color: var(--hg-text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}
.hg-lotes-page .hg-filter-row {
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
}
.hg-list-page .hg-filter-row {
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- ACTION BAR ---- */
.hg-action-bar {
    background: white;
    padding: 10px 16px;
    border-bottom: 1px solid var(--hg-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.hg-action-bar a,
.hg-action-bar button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 12px;
    background: var(--hg-primary);
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}
.hg-action-bar button {
    border: 0;
}
.hg-detail-actions {
    gap: 10px;
}
.hg-detail-actions a,
.hg-detail-actions button {
    min-width: 144px;
    justify-content: center;
}
.hg-action-bar .hg-danger-action {
    background: #FFF1F2;
    color: var(--hg-danger);
    border: 1px solid #FECDD3;
}

/* ---- TABS ---- */
.hg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: white;
    padding: 10px 16px 0;
    border-bottom: 1px solid var(--hg-border);
    position: sticky;
    top: 58px;
    z-index: 45;
}
.hg-tabs.hg-tabs-three { grid-template-columns: 1fr 1fr 1fr; }
.hg-tabs button {
    border: 1px solid var(--hg-border);
    background: var(--hg-bg);
    color: var(--hg-text-muted);
    border-radius: 10px 10px 0 0;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.hg-tabs button.active {
    background: var(--hg-primary);
    border-color: var(--hg-primary);
    color: white;
}
.hg-tabs + .hg-search { top: 108px; }

/* ---- LIST ITEMS ---- */
.hg-list { background: var(--hg-surface); }

.hg-list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hg-border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background .1s;
}
.hg-list-item:active { background: var(--hg-bg); }
.hg-list-item-actionable {
    gap: 12px;
}
.hg-list-item-actions {
    cursor: default;
    gap: 10px;
}
.hg-list-main-link {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}
.hg-row-button {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.hg-plain-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.hg-list-side-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hg-list-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--hg-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 14px;
}

.hg-list-body { flex: 1; min-width: 0; }
.hg-list-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-list-sub { font-size: 12px; color: var(--hg-text-muted); margin-top: 2px; }
.hg-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--hg-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    flex-shrink: 0;
    margin-right: 14px;
}
.hg-avatar-danger {
    background: var(--hg-danger);
}
.hg-avatar-warning {
    background: var(--hg-warning);
}
.hg-avatar-muted {
    background: #94A3B8;
}
.hg-avatar-blue {
    background: #2563EB;
}
.hg-avatar-ok {
    background: #16A34A;
}
.hg-list-side {
    flex-shrink: 0;
    margin-left: 12px;
    text-align: right;
    color: var(--hg-text-muted);
}
.hg-list-side strong {
    display: block;
    color: var(--hg-primary);
    font-size: 18px;
    line-height: 1;
}
.hg-list-side span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
}
.hg-list-right { text-align: right; flex-shrink: 0; margin-left: 10px; }
.hg-list-right .amount { font-size: 15px; font-weight: 700; color: var(--hg-primary); }
.hg-list-right .date { font-size: 11px; color: var(--hg-text-muted); }

.hg-list-chevron { color: var(--hg-text-muted); margin-left: 6px; }
.hg-list-side-actions .hg-list-chevron {
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
}

/* Ventas: equivalencia visual con los estados de fila de HGERP. */
.hg-sale-row-pending {
    --hg-sale-row-color: #8B0000;
}

.hg-sale-row-previous-invoice {
    --hg-sale-row-color: #B45309;
}

.hg-sale-row-returned {
    --hg-sale-row-color: #7C3AED;
}

.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-main-link,
.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-title,
.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-sub,
.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-right .amount,
.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-right .date,
.hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-chevron {
    color: var(--hg-sale-row-color);
}

:root[data-theme="dark"] .hg-sale-row-pending {
    --hg-sale-row-color: #FCA5A5;
}

:root[data-theme="dark"] .hg-sale-row-previous-invoice {
    --hg-sale-row-color: #FDBA74;
}

:root[data-theme="dark"] .hg-sale-row-returned {
    --hg-sale-row-color: #C4B5FD;
}

.hg-infinite-sentinel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 12px 30px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
}

.hg-infinite-sentinel .hg-secondary-action {
    min-width: 132px;
    justify-content: center;
}

.hg-infinite-sentinel span {
    color: var(--hg-text-muted);
}

/* ---- DETAIL / CARDS ---- */
.hg-page { padding: 16px; }

.hg-card {
    background: var(--hg-surface);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 14px;
    overflow: hidden;
}
.hg-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hg-text-muted);
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--hg-border);
}
.hg-card-title-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.hg-field {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
    align-items: baseline;
    gap: 8px;
}
.hg-field:last-child { border-bottom: none; }
.hg-field label { font-size: 12px; color: var(--hg-text-muted); min-width: 100px; flex-shrink: 0; }
.hg-field span { font-size: 15px; font-weight: 500; word-break: break-word; }

/* Read-only data: compact, semantic and reusable detail grid. */
.hg-ui-data-grid {
    display: grid;
    grid-template-columns: repeat(var(--hg-data-grid-columns, 4), minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--hg-border);
}

.hg-ui-data-item {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 70px;
    padding: 13px 16px;
    background: var(--hg-surface);
}

.hg-ui-data-item dt {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.2;
    text-transform: uppercase;
}

.hg-ui-data-item dd {
    min-width: 0;
    margin: 0;
    color: var(--hg-text);
    font-size: 15px;
    font-weight: 720;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.hg-ui-data-item-wide {
    grid-column: span 2;
}

.hg-ui-data-item-emphasis dd {
    color: var(--hg-primary);
    font-size: 19px;
    font-weight: 850;
}

.hg-ui-data-item .hg-badge-row {
    margin-top: 0;
}

@media (max-width: 1050px) {
    .hg-ui-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .hg-ui-data-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hg-ui-data-item-wide {
        grid-column: span 1;
    }
}
.hg-inline-link {
    color: var(--hg-primary);
    font-weight: 700;
    text-decoration: none;
}
.hg-inline-link:active,
.hg-inline-link:hover { text-decoration: underline; }

/* ---- BADGES ---- */
.hg-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}
.hg-badge-green { background: #DCFCE7; color: #15803D; }
.hg-badge-yellow { background: #FEF9C3; color: #A16207; }
.hg-badge-gray { background: #F3F4F6; color: #6B7280; }
.hg-badge-blue { background: #DCFCE7; color: #166534; }
.hg-badge-orange { background: #FFEDD5; color: #C2410C; }
.hg-badge-pink { background: #FCE7F3; color: #BE185D; }
.hg-badge-red,
.hg-badge-danger { background: #FEE2E2; color: #B91C1C; }
.hg-badge-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.hg-color-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 16px 14px;
    color: var(--hg-text-muted);
    font-size: 12px;
}

.hg-color-legend strong,
.hg-late-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--hg-border);
    color: var(--hg-text);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.hg-late-chip {
    min-width: 54px;
    min-height: 26px;
}

.hg-late-low {
    background: #FEF08A;
    border-color: #FACC15;
    color: #713F12;
}

.hg-late-mid {
    background: #FDBA74;
    border-color: #FB923C;
    color: #7C2D12;
}

.hg-late-high {
    background: #FCA5A5;
    border-color: #F87171;
    color: #7F1D1D;
}

.rrhh-turnos-page {
    gap: 16px;
}

.rrhh-turnos-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
}

.rrhh-turnos-page .hgl-admin-title h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.rrhh-turnos-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.rrhh-turnos-toolbar .hg-check-inline {
    min-height: 38px;
    padding: 0 8px;
}

.rrhh-turnos-toolbar .hg-secondary-action {
    min-width: 108px;
    min-height: 38px;
    border-radius: 11px;
}

.hg-page.rrhh-turnos-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0;
}

.rrhh-turnos-list-card,
.rrhh-turnos-editor-card {
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}

.rrhh-turnos-list-card .hg-security-users {
    gap: 10px;
}

.rrhh-shift-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    text-align: left;
    cursor: pointer;
}

.rrhh-shift-item:hover {
    border-color: rgba(46,125,50,.28);
    background: rgba(46,125,50,.035);
}

.rrhh-shift-item.active {
    border-color: rgba(46,125,50,.48);
    background: rgba(46,125,50,.08);
    box-shadow: inset 3px 0 0 var(--hg-primary);
}

.rrhh-shift-main {
    min-width: 0;
}

.rrhh-shift-main strong,
.rrhh-shift-main small,
.rrhh-shift-meta span {
    display: block;
}

.rrhh-shift-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.rrhh-shift-main small,
.rrhh-shift-meta {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.rrhh-shift-main small {
    margin-top: 4px;
}

.rrhh-shift-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
    white-space: nowrap;
}

.rrhh-turnos-editor-card .hg-form-grid {
    padding: 18px;
    gap: 14px;
}

.rrhh-turnos-editor-card .hg-input {
    min-height: 44px;
}

.rrhh-turnos-active {
    align-self: center;
    min-height: 44px;
}

.rrhh-turnos-editor-card .hg-actions-bar {
    justify-content: flex-end;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.rrhh-puntualidad-page,
.rrhh-control-diario-page {
    gap: 16px;
}

.rrhh-puntualidad-page .hgl-admin-title,
.rrhh-control-diario-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
}

.rrhh-puntualidad-page .hgl-admin-title h1,
.rrhh-control-diario-page .hgl-admin-title h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.rrhh-puntualidad-toolbar {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.rrhh-period-button {
    width: 40px;
    min-height: 42px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
    cursor: pointer;
}

.rrhh-period-button:disabled {
    opacity: .55;
    cursor: default;
}

.rrhh-period-field {
    display: grid;
    min-width: 170px;
    gap: 4px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.rrhh-period-field .hg-input {
    min-height: 42px;
}

.rrhh-day-field {
    min-width: 220px;
}

.rrhh-puntualidad-toolbar .hg-secondary-action {
    min-height: 42px;
    min-width: 120px;
}

.rrhh-puntualidad-page .hg-color-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-surface);
    color: var(--hg-text-muted);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

.rrhh-puntualidad-page .hg-color-legend > span {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 850;
}

.rrhh-puntualidad-page .hg-color-legend small {
    font-size: 12px;
}

.rrhh-puntualidad-page .hg-late-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--hg-border);
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.rrhh-puntualidad-page .hg-late-low {
    background: #FEF08A;
    border-color: #FACC15;
    color: #713F12;
}

.rrhh-puntualidad-page .hg-late-mid {
    background: #FDBA74;
    border-color: #FB923C;
    color: #7C2D12;
}

.rrhh-puntualidad-page .hg-late-high {
    background: #FCA5A5;
    border-color: #F87171;
    color: #7F1D1D;
}

.rrhh-punctuality-table {
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .055);
}

.rrhh-punctuality-table table {
    min-width: 760px;
}

.rrhh-punctuality-table th {
    height: 42px;
    background: rgba(15, 23, 42, .035);
}

.rrhh-punctuality-table td {
    height: 46px;
    vertical-align: middle;
}

.rrhh-punctuality-table td:first-child strong,
.rrhh-punctuality-table td:first-child span {
    display: block;
}

.rrhh-punctuality-table td:first-child span {
    margin-top: 3px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.rrhh-punctuality-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rrhh-empleados-page {
    gap: 16px;
}

.rrhh-empleados-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
}

.rrhh-empleados-page .hgl-admin-title h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.rrhh-empleados-page .hg-input,
.rrhh-empleados-page .hg-search-input {
    --hg-input-bg: var(--hg-surface);
    --hg-input-border: var(--hg-border);
}

.rrhh-empleados-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.rrhh-empleados-toolbar .hg-search-input {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--hg-input-border);
    border-radius: 12px;
    background: var(--hg-input-bg);
    color: var(--hg-text);
    font: inherit;
}

.rrhh-empleados-toolbar .hg-check-inline {
    min-height: 38px;
    padding: 0 8px;
    white-space: nowrap;
}

.rrhh-empleados-toolbar .hg-secondary-action {
    min-width: 108px;
    min-height: 38px;
    border-radius: 11px;
}

.hg-page.rrhh-empleados-workspace {
    display: grid;
    grid-template-columns: minmax(340px, 460px) minmax(420px, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0;
}

.rrhh-empleados-list-card,
.rrhh-empleados-editor-card {
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}

.rrhh-empleados-list {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.rrhh-employee-item {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    text-align: left;
    cursor: pointer;
}

.rrhh-employee-item:hover {
    border-color: rgba(46,125,50,.28);
    background: rgba(46,125,50,.035);
}

.rrhh-employee-item.active {
    border-color: rgba(46,125,50,.48);
    background: rgba(46,125,50,.08);
    box-shadow: inset 3px 0 0 var(--hg-primary);
}

.rrhh-employee-item.inactive {
    opacity: .72;
}

.rrhh-employee-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(46,125,50,.12);
    color: var(--hg-primary);
    font-weight: 900;
}

.rrhh-employee-main {
    min-width: 0;
}

.rrhh-employee-main strong,
.rrhh-employee-main small,
.rrhh-employee-meta span {
    display: block;
}

.rrhh-employee-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.rrhh-employee-main small,
.rrhh-employee-meta {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.rrhh-employee-main small {
    margin-top: 4px;
}

.rrhh-employee-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
    white-space: nowrap;
}

.rrhh-employee-item.pending-sync .rrhh-employee-meta > span:first-child {
    color: #A16207;
}

.rrhh-empleados-editor-card .hg-form-grid {
    padding: 18px;
    gap: 14px;
}

.rrhh-empleados-editor-card .hg-input {
    min-height: 44px;
}

.rrhh-wide-field {
    grid-column: span 1;
}

.rrhh-empleados-checks {
    flex-wrap: wrap;
    align-content: center;
    min-height: 44px;
}

.rrhh-empleados-editor-card .hg-actions-bar {
    justify-content: flex-end;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.rrhh-reloj-page {
    gap: 16px;
}

.rrhh-reloj-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
}

.rrhh-reloj-page .hgl-admin-title h1 {
    font-size: 32px;
    margin-bottom: 6px;
}

.rrhh-reloj-toolbar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.rrhh-reloj-toolbar .rrhh-period-field {
    min-width: 190px;
}

.rrhh-reloj-toolbar .hg-input,
.rrhh-reloj-toolbar .hg-secondary-action {
    min-height: 42px;
}

.rrhh-reloj-toolbar .hg-secondary-action {
    min-width: 124px;
}

.hg-page.rrhh-reloj-workspace {
    display: grid;
    gap: 18px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
}

.rrhh-reloj-status-card,
.rrhh-reloj-table-card {
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .055);
}

.rrhh-reloj-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.rrhh-reloj-kpi {
    min-height: 116px;
    display: grid;
    align-content: space-between;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--hg-surface), rgba(15, 23, 42, .025));
    color: var(--hg-text);
}

.rrhh-reloj-kpi:nth-child(1) {
    border-color: rgba(46, 125, 50, .22);
    background: linear-gradient(180deg, rgba(46, 125, 50, .09), var(--hg-surface));
}

.rrhh-reloj-kpi:nth-child(2) {
    border-color: rgba(37, 99, 235, .18);
    background: linear-gradient(180deg, rgba(37, 99, 235, .08), var(--hg-surface));
}

.rrhh-reloj-kpi:nth-child(3) {
    border-color: rgba(217, 119, 6, .22);
    background: linear-gradient(180deg, rgba(217, 119, 6, .09), var(--hg-surface));
}

.rrhh-reloj-kpi:nth-child(4) {
    border-color: rgba(71, 85, 105, .18);
    background: linear-gradient(180deg, rgba(71, 85, 105, .07), var(--hg-surface));
}

.rrhh-reloj-kpi span,
.rrhh-reloj-kpi strong,
.rrhh-reloj-kpi small {
    display: block;
    min-width: 0;
}

.rrhh-reloj-kpi span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.rrhh-reloj-kpi strong {
    overflow: hidden;
    color: var(--hg-text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rrhh-reloj-kpi small {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.rrhh-reloj-table-card .hg-table {
    overflow-x: auto;
}

.rrhh-reloj-table-card table {
    min-width: 680px;
}

@media (max-width: 760px) {
    .rrhh-turnos-page .hgl-admin-title {
        padding: 18px;
    }

    .rrhh-turnos-page .hgl-admin-title h1 {
        font-size: 30px;
    }

    .rrhh-turnos-toolbar {
        width: 100%;
    }

    .rrhh-turnos-toolbar .hg-secondary-action {
        flex: 1 1 120px;
    }

    .hg-page.rrhh-turnos-workspace {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rrhh-shift-item {
        grid-template-columns: 1fr;
    }

    .rrhh-shift-meta {
        justify-items: start;
    }

    .rrhh-puntualidad-page .hgl-admin-title,
    .rrhh-control-diario-page .hgl-admin-title {
        padding: 18px;
    }

    .rrhh-puntualidad-page .hgl-admin-title h1,
    .rrhh-control-diario-page .hgl-admin-title h1 {
        font-size: 30px;
    }

    .rrhh-puntualidad-toolbar {
        width: 100%;
    }

    .rrhh-period-field {
        flex: 1 1 180px;
    }

    .rrhh-puntualidad-toolbar .hg-secondary-action {
        flex: 1 1 140px;
    }

    .rrhh-puntualidad-page .hg-color-legend {
        align-items: flex-start;
    }

    .rrhh-empleados-page .hgl-admin-title {
        padding: 18px;
    }

    .rrhh-empleados-page .hgl-admin-title h1 {
        font-size: 30px;
    }

    .rrhh-reloj-page .hgl-admin-title {
        padding: 18px;
    }

    .rrhh-reloj-page .hgl-admin-title h1 {
        font-size: 30px;
    }

    .rrhh-reloj-toolbar {
        width: 100%;
    }

    .rrhh-reloj-toolbar .rrhh-period-field {
        flex: 1 1 180px;
    }

    .rrhh-reloj-toolbar .hg-secondary-action {
        flex: 1 1 140px;
    }

    .rrhh-reloj-kpi-grid {
        grid-template-columns: 1fr;
    }

    .rrhh-empleados-toolbar {
        grid-template-columns: 1fr;
    }

    .rrhh-empleados-toolbar .hg-secondary-action {
        width: 100%;
    }

    .hg-page.rrhh-empleados-workspace {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rrhh-employee-item {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .rrhh-employee-meta {
        grid-column: 2;
        justify-items: start;
    }
}

/* ---- BACK BUTTON ---- */
.hg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: currentColor;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 4px;
    opacity: .9;
}
.hg-back-btn-standard {
    min-height: 28px;
    max-width: 100%;
    line-height: 1.1;
}
.hg-back-btn-standard span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-primary-action,
.hg-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}
.hg-primary-action {
    background: var(--hg-primary);
    color: white;
}
.hg-header .hg-primary-action {
    float: right;
    background: rgba(255,255,255,.18);
    color: white;
    border-color: rgba(255,255,255,.3);
    margin-top: -4px;
}
.hg-secondary-action {
    background: white;
    color: var(--hg-primary);
    border-color: var(--hg-border);
}
.hg-danger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    background: white;
    color: var(--hg-danger);
    border: 1px solid #FECACA;
}
.hg-primary-action:disabled,
.hg-secondary-action:disabled,
.hg-danger-action:disabled {
    opacity: .55;
    cursor: default;
}
.hg-danger-zone {
    border-color: #FECDD3;
    background: linear-gradient(180deg, var(--hg-card), #FFF7F7);
}
.hg-invoice-preview {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hg-invoice-preview .hg-card {
    align-self: start;
}
.hg-invoice-preview .hg-card:has(.hg-table) {
    grid-column: 1 / -1;
}
.hg-invoice-preview-total {
    color: var(--hg-primary);
    font-size: 20px !important;
    font-weight: 800 !important;
}
.hg-lote-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}
.hg-lote-chip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    align-items: center;
    color: var(--hg-text-muted);
    font-size: 12px;
    line-height: 1.35;
}
.hg-lote-chip strong {
    color: var(--hg-primary-dark);
    font-weight: 700;
}
.hg-lote-chip span {
    white-space: nowrap;
}
.hg-lote-warning {
    margin-top: 6px;
    color: var(--hg-danger);
    font-size: 12px;
    font-weight: 700;
}
.hg-lotes-facturacion-modal {
    max-height: min(82vh, 760px);
    overflow: auto;
}
.hg-lote-cantidad-input {
    width: 110px;
    text-align: right;
}
.hg-lotes-editor-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--hg-border);
}
.hg-lotes-editor-summary .hg-actions-bar {
    padding: 0;
    margin: 0;
}
.hg-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 16px 0;
    color: var(--hg-text);
    font-size: 14px;
    line-height: 1.35;
}
.hg-confirm-check input {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
@media (max-width: 780px) {
    .hg-invoice-preview {
        grid-template-columns: 1fr;
    }
    .hg-invoice-preview .hg-card:has(.hg-table) {
        grid-column: auto;
    }
    .hg-lotes-editor-summary {
        align-items: stretch;
        flex-direction: column;
    }
    .hg-lotes-editor-summary .hg-actions-bar {
        justify-content: flex-start;
    }
}
.hg-form-page {
    display: block;
}
.hg-wide-card {
    padding-bottom: 14px;
}
.hg-form-row,
.hg-form-grid {
    padding: 14px 16px 0;
}
.hg-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}
.hg-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}
.hg-form-grid-2,
.hg-form-grid-3,
.hg-form-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hg-form-grid label,
.hg-total-bar label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}
.hg-full-field {
    grid-column: 1 / -1;
}
.hg-form-button-slot {
    align-self: end;
}
.hg-input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--hg-input-border, var(--hg-border));
    border-radius: 12px;
    background: var(--hg-input-bg, var(--hg-surface));
    padding: 10px 12px;
    color: var(--hg-text);
    font: inherit;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.hg-input:focus {
    border-color: var(--hg-input-focus-border, var(--hg-primary-light));
    background: var(--hg-input-focus-bg, var(--hg-surface));
    box-shadow: var(--hg-input-focus-shadow, 0 0 0 3px rgba(46,125,50,.13));
}
textarea.hg-input {
    resize: vertical;
    min-height: 76px;
}
.hg-app :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea):not(.hg-plain-control) {
    background: var(--hg-input-bg, var(--hg-surface));
    border: 1px solid var(--hg-input-border, var(--hg-border));
    border-radius: 12px;
    color: var(--hg-text);
}
.hg-app :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea):not(.hg-plain-control):focus {
    background: var(--hg-input-focus-bg, var(--hg-surface));
    border-color: var(--hg-input-focus-border, var(--hg-primary-light));
    box-shadow: var(--hg-input-focus-shadow, 0 0 0 3px rgba(46,125,50,.13));
    outline: none;
}
.hg-afip-log {
    min-height: 180px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.5;
}
.hg-hint,
.hg-alert {
    margin: 12px 16px 0;
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 13px;
}
.hg-hint {
    background: #EEF6FF;
    color: #1E3A8A;
}
.hg-alert {
    background: #FFF7ED;
    color: #9A3412;
    border: 1px solid #FED7AA;
}
.hg-alert-danger {
    background: #FEF2F2;
    color: var(--hg-danger);
    border-color: #FECACA;
}

.hg-oc-page {
    display: grid;
    gap: 16px;
}
.hg-oc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.hg-oc-client-shell {
    display: grid;
    gap: 14px;
    padding: 14px 16px 16px;
}
.hg-oc-client-search label,
.hg-oc-meta-grid label,
.hg-provider-search label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}
.hg-provider-search {
    padding: 14px 16px 0;
}
.hg-oc-meta-grid {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) minmax(170px, 1fr) 110px minmax(150px, .9fr);
    gap: 12px;
    align-items: end;
}
.hg-oc-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hg-oc-check-card {
    min-height: 42px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--hg-surface);
}
.hg-picker-list {
    margin: 10px 0 0;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--hg-card);
}
.hg-picker-list button {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    color: var(--hg-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.hg-picker-list button:last-child {
    border-bottom: 0;
}
.hg-picker-list button:hover {
    background: rgba(45, 122, 74, .09);
}
.hg-formula-total-heading {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}
.hg-formula-total-heading strong {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
}
.hg-picker-list span,
.hg-selected-strip span,
.hg-quick-entry span,
.hg-oc-items-table td span {
    color: var(--hg-text-muted);
    font-size: 12px;
}
.hg-selected-strip {
    margin: 10px 0 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(45, 122, 74, .22);
    background: rgba(45, 122, 74, .08);
    border-radius: 14px;
    padding: 13px 14px;
}
.hg-selected-strip strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}
.hg-selected-strip span {
    display: block;
    margin-top: 3px;
}
.hg-quick-entry {
    margin: 14px 16px 0;
    border: 1px solid rgba(45, 122, 74, .22);
    background: linear-gradient(180deg, rgba(45, 122, 74, .09), rgba(45, 122, 74, .04));
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 12px;
}
.hg-quick-entry-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}
.hg-inline-ok,
.hg-inline-error {
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 700;
}
.hg-inline-ok {
    background: rgba(34, 197, 94, .12);
    color: #166534;
}
.hg-inline-error {
    background: rgba(239, 68, 68, .11);
    color: #B91C1C;
}
.hg-oc-add-bar {
    margin-top: 10px;
}
.hg-oc-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
}
.hg-oc-summary .hg-primary-action {
    margin: 0;
    min-width: 150px;
}
.hg-oc-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    gap: 6px;
}
.hg-oc-summary-grid div {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.hg-oc-summary-grid label {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.hg-oc-summary-grid strong {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hg-oc-summary-total strong {
    color: var(--hg-primary);
    font-size: 18px;
    font-weight: 950;
}
.hg-empty-compact {
    padding: 18px;
}
.hg-oc-items-table table {
    table-layout: fixed;
}
.hg-oc-items-table {
    max-height: min(52vh, 620px);
    overflow: auto;
}
.hg-oc-items-table th,
.hg-oc-items-table td {
    padding: 7px 10px;
    vertical-align: middle;
}
.hg-oc-items-table th:nth-child(2),
.hg-oc-items-table td:nth-child(2) {
    width: 82px;
}
.hg-oc-items-table th:nth-child(3),
.hg-oc-items-table td:nth-child(3) {
    width: 118px;
}
.hg-oc-items-table th:nth-child(4),
.hg-oc-items-table td:nth-child(4) {
    width: 126px;
}
.hg-oc-items-table th:nth-child(5),
.hg-oc-items-table td:nth-child(5) {
    width: 78px;
}
.hg-oc-items-table .hg-input {
    min-height: 32px;
    max-width: none;
    border-radius: 9px;
    padding: 5px 8px;
    text-align: right;
}
.hg-oc-product-cell {
    min-width: 220px;
}
.hg-oc-product-cell strong,
.hg-oc-product-cell span {
    display: block;
}
.hg-oc-product-cell strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hg-oc-item-total {
    text-align: right;
    font-weight: 800;
    color: var(--hg-primary);
    white-space: nowrap;
}
.hg-oc-remove-cell {
    text-align: right;
}
.hg-oc-remove-cell .hg-plain-button {
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 9px;
    font-size: 12px;
}

:root[data-theme="dark"] .hg-picker-list button:hover,
:root[data-theme="dark"] .hg-selected-strip,
:root[data-theme="dark"] .hg-quick-entry {
    background: rgba(117, 226, 154, .10);
}

:root[data-theme="dark"] .hg-oc-check-card {
    background: rgba(255,255,255,.04);
}

:root[data-theme="dark"] .hg-inline-ok {
    color: #BBF7D0;
}

:root[data-theme="dark"] .hg-inline-error {
    color: #FECACA;
}

.hg-oc-workflow {
    gap: 18px;
}
.hg-oc-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.hg-oc-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}
.hg-oc-client-card,
.hg-oc-product-card,
.hg-oc-items-card {
    overflow: visible;
}
.hg-oc-client-input {
    min-height: 46px;
    font-size: 16px;
    font-weight: 750;
}
.hg-oc-floating-picker {
    position: relative;
    z-index: 20;
}
.hg-ui-selection {
    margin: 12px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(45, 122, 74, .22);
    background: linear-gradient(180deg, rgba(45, 122, 74, .10), rgba(45, 122, 74, .045));
    border-radius: 16px;
    padding: 14px;
}
.hg-ui-selection .hg-compact-action {
    align-self: center;
}
.hg-ui-selection-label {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.hg-ui-selection strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}
.hg-ui-selection-subtitle {
    display: block;
    color: var(--hg-text-muted);
    font-size: 13px;
    margin-top: 3px;
}
.hg-oc-kicker {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.hg-oc-manual-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 10px;
    align-items: end;
    padding: 14px 16px 16px;
}
.hg-oc-manual-entry label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}
.hg-oc-disabled-shell {
    position: relative;
}
.hg-oc-step-empty {
    margin: 14px 16px 0;
    border: 1px dashed rgba(107,114,128,.35);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    gap: 4px;
    background: rgba(107,114,128,.045);
}
.hg-oc-step-empty strong,
.hg-oc-items-empty strong {
    font-size: 15px;
}
.hg-oc-step-empty span,
.hg-oc-items-empty span {
    color: var(--hg-text-muted);
    font-size: 13px;
}
.hg-oc-items-empty {
    min-height: 150px;
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    padding: 22px;
    color: var(--hg-text-muted);
}
.hg-oc-items-empty strong {
    color: var(--hg-text);
}
.hg-oc-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 16px;
}
.hg-oc-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.hg-oc-summary-head span {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.hg-oc-summary-head strong {
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
}
.hg-oc-summary-total {
    display: grid;
    gap: 3px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(45, 122, 74, .08);
}
.hg-oc-summary-total label {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.hg-oc-summary-total strong {
    color: var(--hg-primary);
    font-size: 30px;
    line-height: 1.05;
    font-weight: 950;
    overflow-wrap: anywhere;
}
.hg-oc-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.hg-oc-summary-grid div {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    padding: 10px;
    background: var(--hg-surface);
}
.hg-oc-summary-note {
    border-radius: 12px;
    padding: 10px 11px;
    background: #EEF6FF;
    color: #1E3A8A;
    font-size: 13px;
    font-weight: 800;
}
.hg-oc-summary .hg-primary-action {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}

@media (max-width: 900px) {
    .hg-oc-layout,
    .hg-oc-meta-grid {
        grid-template-columns: 1fr;
    }

    .hg-ui-selection,
    .hg-oc-manual-entry {
        grid-template-columns: 1fr;
    }

    .hg-ui-selection .hg-compact-action {
        width: 100%;
    }

    .hg-oc-manual-entry .hg-secondary-action {
        width: 100%;
    }

    .hg-oc-summary {
        position: static;
        grid-template-columns: 1fr;
        order: 2;
    }

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

    .hg-oc-summary-total {
        grid-column: 1 / -1;
    }

    .hg-oc-summary .hg-primary-action {
        width: 100%;
    }

    .hg-quick-entry-row {
        grid-template-columns: 1fr;
    }

    .hg-oc-items-table table {
        display: block;
    }

    .hg-oc-items-table thead {
        display: none;
    }

    .hg-oc-items-table tbody {
        display: grid;
    }

    .hg-oc-items-table tr {
        display: grid;
        grid-template-columns: 72px 96px minmax(86px, 1fr) auto;
        gap: 7px 8px;
        border-top: 1px solid var(--hg-border);
        padding: 9px 10px;
    }

    .hg-oc-items-table td {
        display: block;
        border-top: 0;
        padding: 0;
    }

    .hg-oc-product-cell {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .hg-oc-qty-cell {
        grid-column: 1;
        grid-row: 2;
    }

    .hg-oc-price-cell {
        grid-column: 2;
        grid-row: 2;
    }

    .hg-oc-item-total {
        grid-column: 3;
        grid-row: 2;
        align-self: center;
        font-size: 13px;
    }

    .hg-oc-remove-cell {
        grid-column: 4;
        grid-row: 2;
        align-self: center;
        text-align: right;
    }

    .hg-oc-items-table .hg-input {
        width: 100%;
        min-height: 32px;
    }
}

/* Seguimiento personal de clientes B2C sin primera compra. */
.hgl-followup-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.hgl-followup-contactado { background: #eff6ff; color: #1d4ed8; }
.hgl-followup-respondio { background: #ecfdf3; color: #166534; }
.hgl-followup-seguimiento { background: #fff7ed; color: #9a3412; }
.hgl-followup-no-interesado { background: #f3f4f6; color: #6b7280; }

.hgl-opportunity-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.hgl-opportunity-cart { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.hgl-opportunity-products { background: #eef2ff; border-color: #a5b4fc; color: #4338ca; }
.hgl-opportunity-profile { background: #fefce8; border-color: #fde047; color: #854d0e; }
.hgl-opportunity-reactivation { background: #fdf4ff; border-color: #e879f9; color: #86198f; }
.hgl-opportunity-general { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.hgl-opportunity-response { background: #ecfdf3; border-color: #86efac; color: #166534; }
.hgl-opportunity-closed { background: #f3f4f6; border-color: #d1d5db; color: #6b7280; }

.hgl-followup-closed {
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 9px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 750;
}

.hgl-first-purchase-panel {
    display: grid;
    gap: 16px;
    margin: 18px 0 22px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 24%, var(--hg-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--hg-primary) 4%, var(--hg-surface));
}

.hgl-first-purchase-panel .hgl-panel-title {
    margin: 0;
    padding: 0;
}

.hgl-first-purchase-panel .hgl-panel-title div,
.hgl-first-purchase-panel .hgl-panel-title small {
    display: block;
}

.hgl-first-purchase-panel .hgl-panel-title small {
    margin-top: 3px;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 500;
}

.hgl-followup-form {
    display: grid;
    grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr);
    gap: 12px;
}

.hgl-followup-form label,
.hgl-contact-editor label {
    display: grid;
    align-content: start;
    gap: 6px;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 750;
}

.hgl-followup-form textarea,
.hgl-contact-editor textarea {
    resize: vertical;
    line-height: 1.5;
}

.hgl-contact-editor {
    display: grid;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--hg-border);
}

.hgl-activity-context {
    display: grid;
    gap: 9px;
    padding: 13px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: var(--hg-surface);
}

.hgl-activity-context > div {
    display: grid;
    gap: 3px;
}

.hgl-activity-context span {
    color: var(--hg-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.hgl-activity-context p {
    margin: 0;
    color: var(--hg-text);
    font-size: 13px;
    line-height: 1.45;
}

.hgl-activity-context .hgl-activity-highlight {
    padding: 9px 10px;
    border-radius: 8px;
    background: #fff7ed;
}

.hgl-activity-context > small,
.hgl-activity-context .hgl-activity-empty {
    color: var(--hg-muted);
    font-size: 12px;
}

.hgl-contact-destination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--hg-muted);
    font-size: 12px;
}

.hgl-contact-history {
    display: grid;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--hg-border);
}

.hgl-contact-history > div {
    display: grid;
    grid-template-columns: minmax(140px, .35fr) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--hg-muted) 7%, transparent);
}

.hgl-contact-history span,
.hgl-contact-history small {
    font-size: 12px;
    line-height: 1.4;
}

.hgl-contact-history span { font-weight: 800; }
.hgl-contact-history small { color: var(--hg-muted); white-space: pre-line; }

@media (max-width: 760px) {
    .hgl-followup-form,
    .hgl-contact-history > div {
        grid-template-columns: 1fr;
    }
}
.hg-choice-list {
    display: grid;
    gap: 8px;
    padding: 12px 16px 0;
}

/* ---- SECURITY ---- */
.hg-security-page {
    gap: 16px;
    max-width: 1220px;
    margin-left: auto;
    margin-right: auto;
}
.hg-security-users {
    display: grid;
    gap: 8px;
    padding: 12px;
}
.hg-security-user {
    width: 100%;
    border: 1px solid var(--hg-border);
    background: #fff;
    color: var(--hg-text);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    cursor: pointer;
}
.hg-security-user strong,
.hg-security-user small {
    display: block;
}
.hg-security-user small {
    color: var(--hg-text-muted);
    margin-top: 3px;
}
.hg-security-user.active {
    border-color: rgba(46,125,50,.36);
    background: rgba(46,125,50,.08);
}
.hg-security-checks {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 40px;
    color: var(--hg-text);
    font-size: 14px;
    font-weight: 700;
}
.hg-security-checks label,
.hg-security-permissions label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hg-password-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.hg-password-field .hg-input {
    min-width: 0;
}
.hg-password-toggle {
    border: 1px solid var(--hg-border);
    background: rgba(46,125,50,.08);
    color: var(--hg-primary);
    border-radius: 12px;
    padding: 0 14px;
    min-width: 78px;
    font-weight: 850;
    cursor: pointer;
}
.hg-password-toggle:hover {
    background: rgba(46,125,50,.14);
}
.hg-field-note {
    display: block;
    margin-top: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    line-height: 1.35;
}
.hg-security-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 16px 0;
    flex-wrap: wrap;
}
.hg-security-toolbar .hg-input {
    max-width: 240px;
}
.hg-security-permissions {
    display: grid;
    gap: 14px;
    padding: 14px 16px;
}
.hg-security-permissions section {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255,255,255,.45);
}
.hg-security-permissions h2 {
    font-size: 12px;
    color: var(--hg-text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.hg-security-permissions label {
    justify-content: flex-start;
    padding: 8px 0;
    color: var(--hg-text);
    font-size: 14px;
}
.hg-security-permissions label + label {
    border-top: 1px solid var(--hg-border);
}
.hg-security-permissions small {
    margin-left: auto;
    color: var(--hg-text-muted);
    font-size: 11px;
}
.hg-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    width: 100%;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: white;
    padding: 11px 12px;
    color: var(--hg-text);
    cursor: pointer;
    text-align: left;
}
.hg-choice span {
    font-weight: 800;
}
.hg-choice small {
    color: var(--hg-text-muted);
}
.hg-choice.selected {
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}
.hg-split-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px 0;
}
.hg-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px !important;
    min-height: 40px;
    color: var(--hg-text) !important;
    font-size: 14px !important;
}
.hg-inline-note {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}
.hg-total-bar {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin: 14px 16px 0;
    padding-top: 12px;
    border-top: 1px solid var(--hg-border);
}
.hg-total-bar span {
    font-size: 18px;
    font-weight: 850;
    color: var(--hg-primary);
}
.hg-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
.hg-form-actions {
    align-items: center;
    gap: 10px;
    padding: 0 16px 16px;
    margin: 14px 0 0;
}
.hg-form-actions .hg-primary-action {
    min-width: 140px;
}
.hg-actions-bar-spaced {
    gap: 10px;
    padding: 0 16px 16px;
    margin: 14px 0 0;
}
.hg-form-stack {
    display: grid;
    gap: 10px;
    padding: 16px;
}
.hg-print-comment-input {
    min-height: 150px;
    resize: vertical;
    line-height: 1.45;
}
.hg-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 16px 0;
}
.hg-section-head.compact {
    padding: 0;
    margin-bottom: 14px;
}
.hg-section-head h2 {
    margin: 0;
    color: var(--hg-text);
    font-size: 19px;
    line-height: 1.2;
    font-weight: 900;
}
.hg-section-head .hg-secondary-action {
    flex: 0 0 auto;
}
.hg-section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.hg-section-actions .hg-secondary-action {
    flex: 0 0 auto;
}
.hg-hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.hg-qr-camera-action {
    border-color: rgba(46,125,50,.32);
    background: color-mix(in srgb, var(--hg-primary) 8%, var(--hg-surface));
    cursor: pointer;
    user-select: none;
}
.hg-qr-live-action {
    border-color: rgba(46,125,50,.48);
    background: var(--hg-primary);
    color: #fff;
}
.hg-qr-camera-hint {
    margin-bottom: 0;
}
.hg-purchase-qr-mobile-capture {
    display: none;
}
.hg-qr-live-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(10, 14, 18, .68);
    min-height: 100vh;
    min-height: 100svh;
}
.hg-qr-live-panel {
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    max-height: calc(100svh - 36px);
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-card);
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    overflow: auto;
}
.hg-qr-live-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}
.hg-qr-live-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.hg-qr-live-head h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.1;
}
.hg-qr-live-status {
    padding: 10px 12px;
    border: 1px solid rgba(30, 64, 175, .25);
    border-radius: 12px;
    background: #eef4ff;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}
.hg-qr-live-reader {
    height: min(470px, 48svh);
    min-height: min(320px, 58svh);
    max-height: 48svh;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: #000;
}
.hg-qr-live-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 12px;
}
.hg-qr-live-actions {
    display: flex;
    justify-content: stretch;
}
.hg-qr-live-actions .hg-secondary-action {
    width: 100%;
}
.hg-qr-vision-action {
    border-color: rgba(30, 64, 175, .35);
    background: #eef4ff;
    color: #1e3a8a;
}
.hg-purchase-page {
    gap: 18px;
}
.hg-purchase-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.hg-purchase-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}
.hg-purchase-main > .hg-card,
.hg-purchase-summary {
    overflow: visible;
}
.hg-purchase-qr-input {
    margin: 14px 16px 16px;
    width: calc(100% - 32px);
    min-height: 74px;
    resize: vertical;
}
.hg-purchase-qr-result {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 16px 16px;
}
.hg-purchase-qr-result div,
.hg-purchase-summary-facts div {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    padding: 10px;
    background: var(--hg-surface);
}
.hg-purchase-qr-result label,
.hg-purchase-summary-facts label {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.hg-purchase-qr-result strong,
.hg-purchase-summary-facts span {
    display: block;
    min-width: 0;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 850;
    overflow-wrap: anywhere;
}
.hg-purchase-provider-search {
    display: grid;
    gap: 6px;
    padding: 14px 16px 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-purchase-provider-input {
    min-height: 46px;
    font-size: 16px;
    font-weight: 750;
}
.hg-purchase-provider-profile {
    margin: 12px 16px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(45, 122, 74, .22);
    background: linear-gradient(180deg, rgba(45, 122, 74, .10), rgba(45, 122, 74, .045));
    border-radius: 16px;
    padding: 14px;
}
.hg-purchase-provider-profile strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}
.hg-purchase-provider-profile span:last-child {
    display: block;
    color: var(--hg-text-muted);
    font-size: 13px;
    margin-top: 3px;
}
.hg-purchase-provider-profile .hg-plain-button {
    min-height: 34px;
    border: 1px solid rgba(45, 122, 74, .18);
    background: var(--hg-surface);
    color: var(--hg-primary);
}
.hg-purchase-empty-action {
    display: grid;
    gap: 12px;
    margin: 14px 16px 0;
    border: 1px dashed rgba(107,114,128,.35);
    border-radius: 16px;
    padding: 14px;
    background: rgba(107,114,128,.045);
}
.hg-purchase-empty-action strong {
    font-size: 14px;
}
.hg-purchase-new-provider {
    margin: 16px;
    padding: 16px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: rgba(45, 122, 74, .045);
}
.hg-purchase-voucher-card > .hg-form-grid {
    padding: 14px 16px 0;
}
.hg-purchase-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px 16px;
}
.hg-purchase-flags .hg-check-inline {
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    padding: 9px 11px;
    background: var(--hg-surface);
}
.hg-purchase-amounts {
    display: grid;
    gap: 16px;
    padding: 16px;
}
.hg-tax-rate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.hg-tax-rate-card {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(46,125,50,.035), rgba(255,255,255,.72));
    padding: 14px;
}
.hg-tax-rate-card.emphasized {
    border-color: rgba(46,125,50,.28);
    background: linear-gradient(180deg, rgba(46,125,50,.09), rgba(255,255,255,.78));
}
.hg-tax-rate-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.hg-tax-rate-head span,
.hg-subsection-title,
.hg-purchase-total-bar small {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hg-tax-rate-head strong {
    color: var(--hg-primary);
    font-size: 20px;
    font-weight: 900;
}
.hg-tax-rate-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.hg-tax-rate-fields label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}
.hg-amount-subsection {
    border-top: 1px solid var(--hg-border);
    padding-top: 14px;
}
.hg-subsection-title {
    margin-bottom: 10px;
}
.hg-purchase-total-bar {
    align-items: center;
    margin-top: 0;
}
.hg-purchase-total-bar > div {
    display: grid;
    gap: 2px;
}
.hg-purchase-total-bar label {
    min-width: min(100%, 260px);
}
.hg-purchase-total-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 14px;
    align-items: end;
    border-top: 1px solid var(--hg-border);
    padding-top: 14px;
}
.hg-purchase-total-input > div {
    display: grid;
    gap: 3px;
    border-radius: 16px;
    padding: 14px;
    background: rgba(45, 122, 74, .08);
}
.hg-purchase-total-input span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.hg-purchase-total-input strong {
    color: var(--hg-primary);
    font-size: 24px;
    font-weight: 950;
}
.hg-purchase-total-input label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-purchase-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    padding: 16px;
}
.hg-purchase-summary-facts {
    display: grid;
    gap: 10px;
}
.hg-purchase-summary .hg-primary-action {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}
.hg-purchase-difference {
    border-radius: 12px;
    padding: 10px 11px;
    font-size: 13px;
    font-weight: 850;
}
.hg-purchase-difference.positive {
    background: #EEF6FF;
    color: #1E3A8A;
}
.hg-purchase-difference.negative {
    background: #FEF2F2;
    color: #991B1B;
}
.hg-product-config-page {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    max-width: none;
}
.hg-product-config-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
}
.hg-product-config-filters label:first-child {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-product-config-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.hg-product-config-list,
.hg-product-config-editor {
    overflow: visible;
}
.hg-product-config-items {
    display: grid;
    max-height: 62vh;
    overflow: auto;
}
.hg-product-config-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 4px 12px;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--hg-border);
    background: var(--hg-surface);
    color: var(--hg-text);
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
}
.hg-product-config-item:hover,
.hg-product-config-item.selected {
    background: rgba(45, 122, 74, .075);
}
.hg-product-config-item.inactive {
    color: var(--hg-text-muted);
}
.hg-product-config-item.inactive .hg-product-config-name {
    color: #991B1B;
}
:root[data-theme="dark"] .hg-product-config-item.inactive .hg-product-config-name {
    color: #FCA5A5;
}
.hg-product-config-item.suggested {
    box-shadow: inset 3px 0 0 #2563EB;
}
.hg-product-config-code {
    grid-row: 1 / span 2;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 900;
    align-self: start;
    overflow-wrap: anywhere;
}
.hg-product-config-name {
    min-width: 0;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hg-product-config-sub {
    color: var(--hg-text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hg-product-config-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 24px;
    text-align: center;
}
.hg-product-config-empty strong {
    font-size: 18px;
}
.hg-product-config-empty span {
    color: var(--hg-text-muted);
}
.hg-product-config-editor {
    display: grid;
    gap: 16px;
    padding: 16px;
}
.hg-product-config-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.hg-product-config-editor-head h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 950;
}
.hg-product-config-editor-head p {
    margin: 5px 0 0;
    color: var(--hg-text-muted);
    font-weight: 800;
}
.hg-product-config-facts {
    display: grid;
    gap: 10px;
}
.hg-product-config-facts div {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    padding: 10px;
    background: var(--hg-surface);
}
.hg-product-config-facts label {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.hg-product-config-facts span {
    font-weight: 850;
    overflow-wrap: anywhere;
}
.hg-product-config-suggestion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(37, 99, 235, .24);
    border-radius: 16px;
    padding: 14px;
    background: #EEF6FF;
    color: #1E3A8A;
}
.hg-product-config-suggestion span {
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hg-product-config-suggestion strong {
    display: block;
    margin-top: 4px;
}
.hg-product-config-form {
    display: grid;
    gap: 12px;
}
.hg-product-config-section-title {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding-top: 4px;
}
.hg-product-config-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}
.hg-product-config-two > label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-product-config-form > label:not(.hg-check-inline) {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-product-config-active {
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    padding: 12px;
    background: var(--hg-surface);
}
.hg-product-config-price-lists {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hg-product-config-price-lists .hg-check-inline {
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    padding: 10px;
    background: var(--hg-surface);
    min-width: 0;
}
.hg-product-config-price-lists .hg-check-inline span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.hg-product-config-muted {
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 800;
}

.hg-product-composition-page > .hg-product-composition-top-actions,
.hg-product-composition-top-actions,
.hg-product-composition-bottom-actions {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    justify-content: flex-start !important;
    text-align: left;
}

.hg-product-composition-add-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 140px 140px auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
}
.hg-product-composition-add-grid label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-product-composition-component-search {
    position: relative;
}
.hg-product-composition-picker {
    position: static;
    margin-top: 2px;
    z-index: 1;
    max-height: 260px;
    overflow: auto;
}
.hg-table-input {
    min-width: 110px;
}
.hgl-store-config-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.hgl-store-config-grid label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}
.hg-product-config-actions {
    display: flex;
    justify-content: flex-start !important;
    gap: 10px;
    flex-wrap: wrap;
    text-align: left;
}

.hg-productive-config-page { display: grid; gap: 16px; width: 100%; }
.hg-productive-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px; }
.hg-productive-hero h2 { margin: 3px 0 0; font-size: 24px; line-height: 1.15; }
.hg-productive-hero p, .hg-productive-summary p { margin: 6px 0 0; color: var(--hg-text-muted); font-weight: 750; }
.hg-productive-hero-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.hg-productive-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 16px; border-left: 4px solid var(--hg-primary); }
.hg-productive-summary .hg-card-title { grid-column: 1 / -1; }
.hg-productive-components, .hg-productive-options, .hg-productive-notes { padding: 16px; }
.hg-productive-role-list { display: grid; gap: 12px; margin-top: 14px; }
.hg-productive-role-card { display: grid; gap: 11px; padding: 14px; border: 1px solid var(--hg-border); border-radius: 16px; background: var(--hg-surface); }
.hg-productive-role-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hg-productive-role-head > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hg-productive-role-name { font-size: 16px; font-weight: 950; }
.hg-productive-status { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.hg-productive-status.success { color: #166534; background: #DCFCE7; }
.hg-productive-status.alternative { color: #1D4ED8; background: #DBEAFE; }
.hg-productive-status.muted { color: var(--hg-text-muted); background: var(--hg-bg); }
.hg-productive-status.danger { color: #991B1B; background: #FEE2E2; }
.hg-productive-picker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.hg-productive-picker-results { position: static; max-height: 240px; overflow: auto; }
.hg-productive-selection { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 12px; background: rgba(45, 122, 74, .08); border: 1px solid rgba(45, 122, 74, .18); }
.hg-productive-selection span { color: var(--hg-text-muted); font-size: 12px; font-weight: 800; }
.hg-productive-selection.empty { background: var(--hg-bg); border-color: var(--hg-border); }
.hg-productive-attributes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 3px; }
.hg-productive-attributes label { display: grid; gap: 6px; color: var(--hg-text-muted); font-size: 12px; font-weight: 850; }
.hg-productive-options { display: grid; gap: 12px; }
.hg-productive-options .hg-check-inline { padding: 12px; border: 1px solid var(--hg-border); border-radius: 12px; }
.hg-productive-notes { display: grid; gap: 10px; }
.hg-productive-notes textarea { width: 100%; resize: vertical; }
.hg-productive-actions { position: sticky; bottom: 0; z-index: 3; padding: 12px; border: 1px solid var(--hg-border); border-radius: 16px; background: color-mix(in srgb, var(--hg-surface) 94%, transparent); backdrop-filter: blur(12px); }
:root[data-theme="dark"] .hg-productive-status.success { color: #86EFAC; background: rgba(22, 101, 52, .42); }
:root[data-theme="dark"] .hg-productive-status.alternative { color: #93C5FD; background: rgba(29, 78, 216, .32); }
:root[data-theme="dark"] .hg-productive-status.danger { color: #FCA5A5; background: rgba(153, 27, 27, .32); }

@media (max-width: 760px) {
    .hg-productive-hero, .hg-productive-summary, .hg-productive-picker-row, .hg-productive-attributes { display: grid; grid-template-columns: 1fr; }
    .hg-productive-hero-badges { justify-content: flex-start; }
    .hg-productive-summary .hg-card-title { grid-column: auto; }
    .hg-productive-role-card { padding: 12px; border-radius: 14px; }
    .hg-productive-role-head { align-items: flex-start; }
    .hg-productive-picker-row .hg-secondary-action { width: 100%; }
    .hg-productive-selection { display: grid; }
    .hg-productive-actions { display: grid; grid-template-columns: 1fr; }
    .hg-productive-actions .hg-primary-action, .hg-productive-actions .hg-secondary-action { width: 100%; }
}
.hg-row-action {
    border: 1px solid var(--hg-border);
    background: #fff;
    color: var(--hg-text);
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hg-row-action:hover {
    border-color: rgba(46,125,50,.28);
    color: var(--hg-primary);
}
.hg-row-action.danger {
    border-color: #FECACA;
    color: var(--hg-danger);
}
.hg-row-menu {
    position: relative;
    flex-shrink: 0;
    align-self: center;
}
.hg-row-menu[open] {
    z-index: 30;
}
.hg-row-menu-button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    background: var(--hg-surface);
    color: var(--hg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    list-style: none;
}
.hg-row-menu-button::-webkit-details-marker {
    display: none;
}
.hg-row-menu-button::marker {
    content: "";
}
.hg-row-menu-button:hover {
    border-color: rgba(46,125,50,.28);
    color: var(--hg-primary);
    background: rgba(46,125,50,.06);
}
.hg-row-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 188px;
    padding: 6px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    box-shadow: 0 16px 42px rgba(15,23,42,.18);
}
.hg-row-menu-item {
    width: 100%;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--hg-text);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 11px;
    text-align: left;
    text-decoration: none;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.hg-row-menu-item:hover {
    background: rgba(46,125,50,.08);
    color: var(--hg-primary);
}
.hg-row-menu-item.danger {
    color: var(--hg-danger);
}
.hg-row-menu-item.danger:hover {
    background: rgba(220,38,38,.08);
    color: var(--hg-danger);
}
.hg-row-action-ready {
    border-color: rgba(22,163,74,.25);
    background: rgba(22,163,74,.10);
    color: #15803D;
}
.hg-row-action-empty {
    border-color: rgba(107,114,128,.18);
    background: rgba(107,114,128,.06);
    color: var(--hg-text-muted);
}
.hg-print-action {
    align-self: center;
    white-space: nowrap;
}
:root[data-theme="dark"] .hg-row-action-ready {
    border-color: rgba(74,222,128,.26);
    background: rgba(74,222,128,.12);
    color: #86EFAC;
}
:root[data-theme="dark"] .hg-row-action-empty {
    border-color: rgba(255,255,255,.09);
    background: rgba(255,255,255,.035);
    color: var(--hg-text-muted);
}
.hg-table-actions {
    text-align: right;
    white-space: nowrap;
}
.hg-row-action.selected {
    border-color: var(--hg-primary);
    color: var(--hg-primary);
    background: rgba(46,125,50,.10);
}
.hg-table-muted {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    margin-top: 4px;
}
.hg-audit-actions {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.hg-audit-missing-trace {
    color: var(--hg-text-muted);
}
.hg-audit-missing-trace td {
    background: rgba(107,114,128,.04);
}
:root[data-theme="dark"] .hg-audit-missing-trace td {
    background: rgba(255,255,255,.025);
}
.hg-protocol-preview {
    padding: 18px 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}
.hg-protocol-title {
    grid-column: 1 / -1;
    font-size: 18px;
    font-weight: 850;
    color: var(--hg-text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hg-border);
}
.hg-protocol-preview strong,
.hg-protocol-preview span {
    display: block;
}
.hg-protocol-preview strong {
    color: var(--hg-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.hg-protocol-preview span {
    font-weight: 700;
}
@media (max-width: 680px) {
    .hg-protocol-preview {
        grid-template-columns: 1fr;
    }
    .hg-pending-selection {
        align-items: stretch;
        flex-direction: column;
    }
    .hg-pending-selection .hg-primary-action {
        width: 100%;
    }
    .hg-mp-status {
        align-items: stretch;
        flex-direction: column;
    }
    .hg-mp-status .hg-primary-action {
        width: 100%;
    }
}

/* ---- LOADING ---- */
.hg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--hg-text-muted);
    gap: 14px;
}
.hg-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--hg-border);
    border-top-color: var(--hg-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- EMPTY ---- */
.hg-empty { text-align: center; padding: 60px 20px; color: var(--hg-text-muted); }
.hg-empty svg { width: 56px; height: 56px; opacity: .3; margin-bottom: 12px; }
.hg-empty p { font-size: 15px; }
.hg-empty-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ---- LOGIN ---- */
.hg-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(46,125,50,.12), transparent 32rem),
        linear-gradient(180deg, #FBFBFD 0%, #F5F5F7 100%);
}
.hg-login-card {
    background: rgba(255,255,255,.84);
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 28px;
    padding: 34px 28px;
    width: 100%;
    max-width: 390px;
    box-shadow: 0 24px 70px rgba(0,0,0,.10);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.hg-login-logo { text-align: center; margin-bottom: 28px; }
.hg-login-logo img {
    width: 82px;
    height: 82px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
    opacity: .96;
}
.hg-login-logo h1 { font-size: 26px; font-weight: 800; color: var(--hg-text); }
.hg-login-logo p { font-size: 13px; color: var(--hg-text-muted); margin-top: 4px; }
.hg-login-field { margin-bottom: 16px; }
.hg-login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--hg-text-muted); margin-bottom: 6px; }
.hg-login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    transition: border-color .15s;
    background: rgba(255,255,255,.9);
    color: #1A1A2E;
    -webkit-text-fill-color: #1A1A2E;
    caret-color: #2E7D32;
    color-scheme: light;
}
.hg-login-field input::placeholder {
    color: #8A8A93;
    opacity: 1;
}
.hg-login-field input:focus {
    border-color: var(--hg-primary-light);
    box-shadow: 0 0 0 4px rgba(46,125,50,.12);
}
.hg-login-field input:-webkit-autofill,
.hg-login-field input:-webkit-autofill:hover,
.hg-login-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1A1A2E;
    box-shadow: 0 0 0 1000px #FFFFFF inset;
    caret-color: #2E7D32;
}
.hg-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 14px;
    cursor: pointer;
    user-select: none;
}
.hg-login-remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--hg-primary);
    cursor: pointer;
}
.hg-login-remember-options {
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px;
    row-gap: 8px;
}
.hg-login-security-note {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    margin: -7px 0 14px 26px;
}
.hg-login-btn {
    width: 100%;
    padding: 14px;
    background: #1D1D1F;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: background .15s;
}
.hg-login-btn:hover { background: #2C2C2E; }
.hg-error-msg { background: #FEE2E2; color: var(--hg-danger); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

.hg-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 12px;
    color: var(--hg-text-muted);
    font-size: 12px;
}
.hg-login-divider::before,
.hg-login-divider::after { content: ""; flex: 1; height: 1px; background: rgba(0,0,0,.10); }
.hg-login-passkey-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    color: #1D1D1F;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
}
.hg-login-passkey-btn:hover { border-color: var(--hg-primary); color: var(--hg-primary); }
.hg-login-passkey-btn:disabled { cursor: default; opacity: .55; }
.hg-login-password-toggle {
    display: none;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--hg-text-muted);
    padding: 7px 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.hg-passkey-preferred .hg-login-password-fallback { display: none; }
.hg-passkey-preferred .hg-login-password-toggle { display: block; }
.hg-passkey-message { min-height: 20px; margin-top: 9px; font-size: 12px; color: var(--hg-text-muted); }
.hg-passkey-message.is-error { color: var(--hg-danger); }
.hg-passkey-message.is-success { color: var(--hg-success); }
.hg-passkey-sync-notice { grid-column:1 / -1; border:1px solid #BFD9C5; border-left:4px solid #2E7D42; border-radius:12px; background:#F1F8F2; padding:16px 18px; color:var(--hg-text); }
.hg-passkey-sync-notice strong { display:block; margin-bottom:4px; color:#246B38; font-size:14px; }
.hg-passkey-sync-notice p { margin:0; color:var(--hg-text-muted); font-size:13px; line-height:1.5; }

.hg-page.hg-passkeys-page {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hg-passkeys-page .hg-page-header-title p,
.hg-passkeys-register p,
.hg-section-head p { margin: 4px 0 0; color: var(--hg-text-muted); }
.hg-passkeys-environment {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    align-items: baseline;
    margin: 0 0 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hg-border);
}
.hg-passkeys-environment span,
.hg-passkeys-environment small { color: var(--hg-text-muted); font-size: 12px; }
.hg-passkeys-environment small { grid-column: 2; }
.hg-passkey-onboarding {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 20px 22px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 35%, var(--hg-border));
    border-left: 4px solid var(--hg-primary);
    border-radius: 8px;
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
}
.hg-passkey-onboarding-label { color: var(--hg-primary); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.hg-passkey-onboarding h2 { margin: 4px 0 0; font-size: 20px; }
.hg-passkey-onboarding p { margin: 5px 0 0; color: var(--hg-text-muted); }
.hg-passkey-onboarding-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.hg-passkeys-register { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; padding: 20px; }
.hg-passkeys-register h2,
.hg-passkeys-list h2 { margin: 0; font-size: 18px; }
.hg-passkeys-register form { min-width: 0; }
.hg-passkeys-register label { display: block; margin-bottom: 6px; color: var(--hg-text-muted); font-size: 12px; font-weight: 700; }
.hg-passkeys-register-controls { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 8px; }
.hg-passkeys-register-controls .hg-primary-action { width: 100%; max-width: 100%; white-space: normal; }
.hg-passkeys-register-controls input {
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--hg-border);
    border-radius: 6px;
    padding: 9px 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
}
.hg-passkeys-list { min-width: 0; margin-top: 0; }
.hg-passkeys-list .hg-section-head { padding: 0 0 10px; }
.hg-passkeys-items { border-top: 1px solid var(--hg-border); }
.hg-passkey-item {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    min-height: 76px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--hg-border);
}
.hg-passkey-item-main { display: grid; gap: 3px; min-width: 0; }
.hg-passkey-item-main span,
.hg-passkey-item-main small { color: var(--hg-text-muted); font-size: 12px; }
.hg-passkey-sync { color: #246B38; background: #E8F5EA; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.hg-passkey-revoke { border: 0; background: transparent; color: var(--hg-danger); font-weight: 750; cursor: pointer; padding: 8px; }
.hg-passkey-revoke:disabled { opacity: .5; }
.hg-passkeys-empty { padding: 34px 12px; border-top: 1px solid var(--hg-border); }

@media (max-width: 900px) {
    .hg-page.hg-passkeys-page { grid-template-columns: minmax(0, 1fr); }
    .hg-passkeys-environment { margin-bottom: 0; }
    .hg-passkey-onboarding { display: grid; gap: 16px; }
}

@media (max-width: 560px) {
    .hg-passkey-onboarding-actions { display: grid; grid-template-columns: 1fr; }
    .hg-passkeys-register-controls { grid-template-columns: 1fr; }
    .hg-passkey-item { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .hg-passkey-item-main { grid-column: 1 / -1; }
}

/* ---- DASHBOARD ---- */
.hg-dashboard { padding: 16px; }
.hg-dashboard-greeting { padding: 16px 0 8px; }
.hg-dashboard-greeting h2 { font-size: 22px; font-weight: 700; }
.hg-dashboard-greeting p { font-size: 13px; color: var(--hg-text-muted); }
.hg-month-picker {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(229,231,235,.95);
    border-radius: 20px;
    padding: 8px;
    margin: 6px 0 12px;
    box-shadow: 0 6px 18px rgba(20,40,80,.07);
}
.hg-month-picker button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 15px;
    background: var(--hg-bg);
    color: var(--hg-primary);
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}
.hg-month-picker div {
    text-align: center;
    min-width: 0;
}
.hg-month-picker span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hg-text-muted);
}
.hg-month-picker strong {
    display: block;
    font-size: 16px;
    margin-top: 2px;
    text-transform: capitalize;
}

:root[data-theme="dark"] .hg-month-picker {
    background: linear-gradient(180deg, rgba(33,35,41,.96), rgba(24,25,30,.96));
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 18px 44px rgba(0,0,0,.26);
}

:root[data-theme="dark"] .hg-month-picker button {
    background: rgba(134,239,172,.14);
    color: var(--hg-primary-light);
}

:root[data-theme="dark"] .hg-month-picker span {
    color: rgba(245,245,247,.58);
}

:root[data-theme="dark"] .hg-month-picker strong {
    color: var(--hg-text);
}

.hg-today-chip {
    width: 100%;
    border: none;
    border-radius: 16px;
    background: #E0F2FE;
    color: #0369A1;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 800;
    margin: -2px 0 12px;
    cursor: pointer;
}
.hg-dashboard-loading {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--hg-text-muted);
    box-shadow: 0 8px 22px rgba(20,40,80,.08);
}
.hg-dashboard-loading .hg-spinner { width: 24px; height: 24px; }
.hg-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.hg-kpi-card {
    min-height: 132px;
    border-radius: 22px;
    padding: 16px;
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 26px rgba(20,40,80,.16);
    position: relative;
    overflow: hidden;
}
.hg-kpi-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    right: -48px;
    top: -48px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
}
.hg-kpi-primary { background: linear-gradient(145deg, #2E7D32, #7CB342); }
.hg-kpi-warn { background: linear-gradient(145deg, #D97706, #EF4444); }
.hg-kpi-green { background: linear-gradient(145deg, #059669, #20B486); }
.hg-kpi-rose { background: linear-gradient(145deg, #7C3AED, #E11D48); }
.hg-kpi-label {
    font-size: 12px;
    font-weight: 700;
    opacity: .86;
    letter-spacing: .02em;
}
.hg-kpi-value {
    font-size: 27px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
    margin-top: 16px;
}
.hg-kpi-sub {
    font-size: 11px;
    line-height: 1.25;
    opacity: .86;
    margin-top: 10px;
}
.hg-insight-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.hg-insight-strip > div {
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(229,231,235,.9);
    border-radius: 18px;
    padding: 13px 14px;
    box-shadow: 0 4px 14px rgba(20,40,80,.06);
}
.hg-insight-strip span,
.hg-insight-strip small {
    display: block;
    font-size: 11px;
    color: var(--hg-text-muted);
}
.hg-insight-strip strong {
    display: block;
    font-size: 18px;
    margin: 3px 0;
    color: var(--hg-text);
}
.hg-mini-panel {
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(229,231,235,.95);
    border-radius: 20px;
    margin-top: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(20,40,80,.07);
}
.hg-mini-title {
    padding: 13px 15px 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--hg-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.hg-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 10px 15px;
    border-top: 1px solid var(--hg-border);
    color: inherit;
    text-decoration: none;
}
.hg-mini-row span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}
.hg-mini-row strong {
    flex-shrink: 0;
    color: var(--hg-primary);
    font-size: 13px;
}
.hg-section-label {
    margin: 20px 2px 10px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.hg-modules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.hg-module-card {
    background: var(--hg-surface);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: box-shadow .15s, transform .1s;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
}
.hg-module-card:active { transform: scale(.97); }
.hg-module-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.hg-module-icon svg { width: 24px; height: 24px; color: white; }
.hg-module-label { font-size: 14px; font-weight: 600; }

/* ---- TABLE (items) ---- */
.hg-table { width: 100%; overflow-x: auto; }
.hg-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hg-table.hg-pack-table { border-collapse: collapse; font-size: 13px; }
.hg-table.hg-pack-table th,
.hg-table.hg-pack-table td { padding: 10px 12px; border-top: 1px solid var(--hg-border); text-align: left; }
.hg-table.hg-pack-table th { background: var(--hg-bg); color: var(--hg-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.hg-table.hg-pack-table td span { display: block; color: var(--hg-text-muted); font-size: 12px; margin-top: 2px; }
.hg-table th { background: var(--hg-bg); color: var(--hg-text-muted); font-weight: 600; padding: 8px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.hg-table td { padding: 10px 12px; border-top: 1px solid var(--hg-border); }
.hg-table tr:last-child td { border-bottom: none; }
.hg-table .num,
.hg-pack-table .num { text-align: right; white-space: nowrap; }
.hg-table-wrap { width: 100%; overflow-x: auto; }
.hg-pending-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 16px 16px;
    padding: 14px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 14px;
    background: rgba(46,125,50,.08);
}
.hg-pending-selection-top {
    margin-top: 0;
    margin-bottom: 12px;
}
.hg-pending-selection div {
    display: grid;
    gap: 3px;
}
.hg-pending-selection strong {
    color: var(--hg-text);
}
.hg-pending-selection span {
    color: var(--hg-text-muted);
    font-size: 13px;
}
.hg-mp-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 15px 16px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-card);
    box-shadow: 0 12px 34px rgba(0,0,0,.06);
}
.hg-mp-status div {
    display: grid;
    gap: 4px;
}
.hg-mp-status strong {
    color: var(--hg-text);
    font-size: 15px;
}
.hg-mp-status span {
    color: var(--hg-text-muted);
    font-size: 13px;
}
.hg-mp-status.required {
    border-color: rgba(46,125,50,.28);
    background: rgba(46,125,50,.08);
}
.hg-mp-status.complete {
    border-color: rgba(46,125,50,.22);
    background: rgba(46,125,50,.06);
}
.hg-caja-input { min-width: 120px; }
.hg-action-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px 16px; justify-content: flex-end; }
.packing-sheet .invoice-letter div { font-size: 20px; }
.packing-items th:first-child,
.packing-items td:first-child { width: 90px; }

/* ---- MODALS ---- */
.hg-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.hg-modal-panel {
    width: min(920px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--hg-border);
    border-radius: 20px;
    background: var(--hg-surface);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}
.hg-modal-panel-wide {
    width: min(1040px, 100%);
}
.hg-modal-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}
.hg-modal-head {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}
.hg-modal-head span {
    display: block;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}
.hg-modal-head h2 {
    margin: 2px 0 0;
    color: var(--hg-text);
    font-size: 20px;
    line-height: 1.2;
}
.hg-modal-head p {
    margin: 5px 0 0;
    color: var(--hg-text-muted);
    font-size: 13px;
}
.hg-modal-header h2 {
    font-size: 20px;
    margin: 0;
}
.hg-modal-header p {
    margin-top: 4px;
    color: var(--hg-text-muted);
    font-size: 13px;
}
.hg-modal-panel .hg-table {
    overflow: auto;
}
.hg-modal-actions,
.hg-modal-panel > .hg-actions-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-surface) 94%, var(--hg-bg));
    box-shadow: 0 -14px 30px rgba(15, 23, 42, .08);
}
.hg-modal-actions span {
    margin-right: auto;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
}
.hg-icon-button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    background: var(--hg-bg);
    color: var(--hg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}
.hg-icon-button:hover {
    border-color: rgba(46,125,50,.28);
    color: var(--hg-primary);
}
.hg-link-button {
    border: 0;
    background: transparent;
    color: var(--hg-primary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0;
}
.hg-link-button:hover {
    color: var(--hg-primary-light);
}

/* ---- BLAZOR ERROR ---- */
#blazor-error-ui {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    bottom: calc(var(--hg-nav-height) + 8px);
    position: fixed;
    left: 8px; right: 8px;
    padding: 12px 40px 12px 16px;
    font-size: 13px;
    display: none;
    z-index: 200;
}
#blazor-error-ui .reload { font-weight: 600; color: var(--hg-primary); margin-left: 8px; }
#blazor-error-ui .dismiss { position: absolute; right: 12px; top: 12px; cursor: pointer; }

/* ---- RESPONSIVE ERP SHELL ---- */
:root {
    --hg-primary: #2E7D32;
    --hg-primary-light: #43A047;
    --hg-accent: #7CB342;
    --hg-bg: #F5F5F7;
    --hg-surface: rgba(255,255,255,.86);
    --hg-text: #1D1D1F;
    --hg-text-muted: #6E6E73;
    --hg-border: rgba(0,0,0,.09);
    --hg-input-bg: color-mix(in srgb, #F2F4F2 88%, var(--hg-primary) 12%);
    --hg-input-focus-bg: #FFFFFF;
    --hg-input-border: color-mix(in srgb, var(--hg-border) 70%, var(--hg-primary) 30%);
    --hg-input-focus-border: color-mix(in srgb, var(--hg-primary-light) 72%, var(--hg-border));
    --hg-input-focus-shadow: 0 0 0 3px rgba(46,125,50,.13);
    --bs-primary: #2E7D32;
    --bs-primary-rgb: 46, 125, 50;
    --bs-link-color: #2E7D32;
    --bs-link-hover-color: #1B5E20;
}

:root[data-theme="dark"] {
    --hg-primary: #2F8F46;
    --hg-primary-light: #3FAE5A;
    --hg-accent: #86EFAC;
    --hg-bg: #101114;
    --hg-surface: rgba(29,30,34,.88);
    --hg-text: #F5F5F7;
    --hg-text-muted: #A1A1AA;
    --hg-border: rgba(255,255,255,.11);
    --hg-input-bg: rgba(255,255,255,.075);
    --hg-input-focus-bg: rgba(255,255,255,.115);
    --hg-input-border: rgba(255,255,255,.13);
    --hg-input-focus-border: rgba(134,239,172,.45);
    --hg-input-focus-shadow: 0 0 0 4px rgba(134,239,172,.15);
    --hg-success: #4ADE80;
    --hg-warning: #FBBF24;
    --hg-danger: #F87171;
    --bs-primary: #2F8F46;
    --bs-primary-rgb: 47, 143, 70;
    --bs-link-color: #86EFAC;
    --bs-link-hover-color: #BBF7D0;
    color-scheme: dark;
}

body {
    background:
        radial-gradient(circle at top left, rgba(46,125,50,.08), transparent 32rem),
        linear-gradient(180deg, #FBFBFD 0%, #F5F5F7 100%);
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(134,239,172,.14), transparent 34rem),
        linear-gradient(180deg, #15161A 0%, #101114 100%);
}

.hg-app {
    min-height: 100vh;
    max-width: none;
    width: 100%;
    margin: 0;
    display: flex;
}

.hg-shell-sidebar {
    display: contents;
}

.hg-shell-brand {
    display: none;
}

.hg-shell-brand img {
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.hg-shell-user {
    display: none;
}

.hg-shell-content {
    width: 100%;
    min-width: 0;
}

.hg-shell-collapse-button,
.hg-shell-open-button {
    display: none;
}

.hg-main {
    width: 100%;
}

.hg-header {
    background: rgba(255,255,255,.78);
    color: var(--hg-text);
    border-bottom: 1px solid var(--hg-border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.hg-header h1 {
    font-size: 22px;
    letter-spacing: 0;
}

.hg-header .subtitle {
    color: var(--hg-text-muted);
    opacity: 1;
}

.hg-brand-header img {
    background: white;
    box-shadow: 0 1px 8px rgba(0,0,0,.08);
}

.hg-search,
.hg-tabs {
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.hg-search input {
    border-radius: 14px;
    background: var(--hg-input-bg, rgba(245,245,247,.95));
    border-color: var(--hg-input-border, transparent);
}

.hg-search input:focus {
    background: var(--hg-input-focus-bg, white);
    border-color: var(--hg-input-focus-border, var(--hg-primary-light));
    box-shadow: var(--hg-input-focus-shadow, 0 0 0 4px rgba(46,125,50,.12));
}

:root[data-theme="dark"] .hg-search input,
:root[data-theme="dark"] .hg-input {
    background: var(--hg-input-bg);
    color: var(--hg-text);
    border-color: var(--hg-input-border);
    box-shadow: none;
}

:root[data-theme="dark"] .hg-search input:focus,
:root[data-theme="dark"] .hg-input:focus {
    background: var(--hg-input-focus-bg);
    border-color: var(--hg-input-focus-border);
    box-shadow: var(--hg-input-focus-shadow);
}

.hg-tabs button {
    border-radius: 14px;
    background: rgba(245,245,247,.9);
    border-color: transparent;
}

.hg-tabs button.active {
    background: #1D1D1F;
    border-color: #1D1D1F;
}

.hg-list,
.hg-card,
.hg-mini-panel,
.hg-module-card,
.hg-insight-strip > div,
.hg-dashboard-loading {
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

:root[data-theme="dark"] .hg-list,
:root[data-theme="dark"] .hg-card,
:root[data-theme="dark"] .hg-mini-panel,
:root[data-theme="dark"] .hg-module-card,
:root[data-theme="dark"] .hg-insight-strip > div,
:root[data-theme="dark"] .hg-dashboard-loading {
    background: rgba(29,30,34,.88);
    border-color: rgba(255,255,255,.10);
    box-shadow: 0 18px 44px rgba(0,0,0,.24);
}

:root[data-theme="dark"] .hg-header,
:root[data-theme="dark"] .hg-search,
:root[data-theme="dark"] .hg-tabs,
:root[data-theme="dark"] .hg-action-bar,
:root[data-theme="dark"] .hg-shell-sidebar {
    background: rgba(24,25,29,.78);
    border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .hg-brand-header img,
:root[data-theme="dark"] .hg-shell-brand img {
    background: rgba(255,255,255,.92);
}

:root[data-theme="dark"] .hg-tabs button,
:root[data-theme="dark"] .hg-choice,
:root[data-theme="dark"] .hg-row-action,
:root[data-theme="dark"] .hg-row-menu-button {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.10);
    color: var(--hg-text);
}

:root[data-theme="dark"] .hg-row-menu-panel {
    background: rgba(29,30,34,.98);
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 18px 50px rgba(0,0,0,.42);
}

:root[data-theme="dark"] .hg-row-menu-item {
    color: var(--hg-text);
}

:root[data-theme="dark"] .hg-row-menu-button:hover,
:root[data-theme="dark"] .hg-row-menu-item:hover {
    background: rgba(134,239,172,.13);
    color: #BBF7D0;
}

:root[data-theme="dark"] .hg-secondary-action,
:root[data-theme="dark"] .hg-security-user,
:root[data-theme="dark"] .hg-security-permissions section {
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.10);
    color: var(--hg-text);
}

:root[data-theme="dark"] .hg-security-user.active {
    background: rgba(134,239,172,.15);
    border-color: rgba(134,239,172,.34);
}

:root[data-theme="dark"] .hg-security-user strong,
:root[data-theme="dark"] .hg-security-user small,
:root[data-theme="dark"] .hg-security-permissions small {
    color: var(--hg-text-muted);
}

:root[data-theme="dark"] .hg-security-user strong {
    color: var(--hg-text);
}

:root[data-theme="dark"] .hg-hint {
    background: rgba(134,239,172,.12);
    border: 1px solid rgba(134,239,172,.20);
    color: #BBF7D0;
}

:root[data-theme="dark"] .hg-alert {
    background: rgba(251,191,36,.12);
    border-color: rgba(251,191,36,.24);
    color: #FDE68A;
}

:root[data-theme="dark"] .hg-tax-rate-card {
    background: linear-gradient(180deg, rgba(134,239,172,.08), rgba(255,255,255,.035));
    border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .hg-tax-rate-card.emphasized {
    background: linear-gradient(180deg, rgba(134,239,172,.14), rgba(255,255,255,.045));
    border-color: rgba(134,239,172,.28);
}

:root[data-theme="dark"] .hg-alert-danger,
:root[data-theme="dark"] .hg-error-msg {
    background: rgba(248,113,113,.13);
    border: 1px solid rgba(248,113,113,.24);
    color: #FCA5A5;
}

:root[data-theme="dark"] .hg-danger-zone {
    background: rgba(248,113,113,.08);
    border-color: rgba(248,113,113,.20);
}

:root[data-theme="dark"] .hg-danger-action,
:root[data-theme="dark"] .hg-row-action.danger {
    background: rgba(248,113,113,.10);
    border-color: rgba(248,113,113,.28);
    color: #FCA5A5;
}

:root[data-theme="dark"] .hg-badge-green { background: rgba(74,222,128,.14); color: #86EFAC; }
:root[data-theme="dark"] .hg-badge-yellow { background: rgba(251,191,36,.15); color: #FDE68A; }
:root[data-theme="dark"] .hg-badge-gray { background: rgba(255,255,255,.08); color: #D4D4D8; }
:root[data-theme="dark"] .hg-badge-blue { background: rgba(134,239,172,.16); color: #BBF7D0; }
:root[data-theme="dark"] .hg-badge-orange { background: rgba(251,146,60,.16); color: #FDBA74; }
:root[data-theme="dark"] .hg-badge-pink { background: rgba(244,114,182,.16); color: #F9A8D4; }
:root[data-theme="dark"] .hg-badge-red,
:root[data-theme="dark"] .hg-badge-danger { background: rgba(248,113,113,.14); color: #FCA5A5; }

:root[data-theme="dark"] .hg-late-chip {
    border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .hg-late-low {
    background: rgba(250,204,21,.22);
    border-color: rgba(250,204,21,.35);
    color: #FDE68A;
}

:root[data-theme="dark"] .hg-late-mid {
    background: rgba(251,146,60,.22);
    border-color: rgba(251,146,60,.35);
    color: #FDBA74;
}

:root[data-theme="dark"] .hg-late-high {
    background: rgba(248,113,113,.22);
    border-color: rgba(248,113,113,.35);
    color: #FCA5A5;
}

:root[data-theme="dark"] .rrhh-shift-item {
    background: var(--hg-surface);
    border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .rrhh-shift-item:hover {
    background: rgba(134,239,172,.06);
    border-color: rgba(134,239,172,.22);
}

:root[data-theme="dark"] .rrhh-shift-item.active {
    background: rgba(134,239,172,.10);
    border-color: rgba(134,239,172,.34);
}

:root[data-theme="dark"] .rrhh-puntualidad-page .hg-color-legend,
:root[data-theme="dark"] .rrhh-punctuality-table,
:root[data-theme="dark"] .rrhh-puntualidad-toolbar,
:root[data-theme="dark"] .rrhh-period-button {
    border-color: rgba(255,255,255,.10);
    background: var(--hg-surface);
}

:root[data-theme="dark"] .rrhh-punctuality-table th {
    background: rgba(255,255,255,.04);
}

:root[data-theme="dark"] .rrhh-empleados-page .hg-input,
:root[data-theme="dark"] .rrhh-empleados-page .hg-search-input {
    --hg-input-bg: rgba(255,255,255,.075);
    --hg-input-border: rgba(255,255,255,.13);
}

:root[data-theme="dark"] .rrhh-empleados-toolbar,
:root[data-theme="dark"] .rrhh-employee-item {
    background: var(--hg-surface);
    border-color: rgba(255,255,255,.10);
}

:root[data-theme="dark"] .rrhh-employee-item:hover {
    background: rgba(134,239,172,.06);
    border-color: rgba(134,239,172,.22);
}

:root[data-theme="dark"] .rrhh-employee-item.active {
    background: rgba(134,239,172,.10);
    border-color: rgba(134,239,172,.34);
}

:root[data-theme="dark"] .rrhh-employee-avatar {
    background: rgba(134,239,172,.12);
    color: #86EFAC;
}

:root[data-theme="dark"] .hg-tabs button.active {
    background: #F5F5F7;
    border-color: #F5F5F7;
    color: #1D1D1F;
}

:root[data-theme="dark"] .hg-list-item:hover,
:root[data-theme="dark"] .hg-nav-item:hover {
    background: rgba(255,255,255,.06);
}

:root[data-theme="dark"] .hg-list-item,
:root[data-theme="dark"] .hg-list-main-link,
:root[data-theme="dark"] .hg-list-item:hover,
:root[data-theme="dark"] .hg-list-main-link:hover,
:root[data-theme="dark"] .hg-list-item:visited,
:root[data-theme="dark"] .hg-list-main-link:visited {
    color: var(--hg-text);
}

:root[data-theme="dark"] .hg-list-item:hover .hg-list-title,
:root[data-theme="dark"] .hg-list-main-link:hover .hg-list-title {
    color: #BBF7D0;
}

.hg-env-footer {
    color: var(--hg-text-muted);
    font-size: 11px;
    padding: 0 16px calc(var(--hg-nav-height) + 12px);
}

.hg-env-footer-inner {
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 0 0;
    border-top: 1px solid var(--hg-border);
}

.hg-env-footer span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-surface) 78%, transparent);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-env-footer strong {
    color: var(--hg-text);
    font-weight: 800;
}

.hg-env-footer span.hg-env-prod {
    border-color: rgba(127, 29, 29, .28);
    background: rgba(127, 29, 29, .08);
    color: #7F1D1D;
}

.hg-env-footer span.hg-env-prod strong {
    color: #7F1D1D;
}

.hg-env-footer span.hg-env-refresh-ok {
    border-color: rgba(43, 127, 55, .28);
    background: rgba(43, 127, 55, .08);
}

.hg-env-footer span.hg-env-refresh-ok strong {
    color: var(--hg-primary);
}

.hg-env-footer span.hg-env-refresh-warning {
    border-color: rgba(217, 119, 6, .35);
    background: rgba(217, 119, 6, .1);
    color: #92400E;
}

.hg-env-footer span.hg-env-refresh-warning strong {
    color: #92400E;
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-prod {
    border-color: rgba(248, 113, 113, .28);
    background: rgba(127, 29, 29, .24);
    color: #FCA5A5;
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-prod strong {
    color: #FCA5A5;
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-refresh-ok {
    border-color: rgba(134, 239, 172, .28);
    background: rgba(34, 197, 94, .12);
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-refresh-ok strong {
    color: #86EFAC;
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-refresh-warning {
    border-color: rgba(251, 191, 36, .32);
    background: rgba(217, 119, 6, .18);
    color: #FCD34D;
}

:root[data-theme="dark"] .hg-env-footer span.hg-env-refresh-warning strong {
    color: #FCD34D;
}

.hg-theme-toggle {
    border: 1px solid var(--hg-border);
    background: var(--hg-surface);
    color: var(--hg-text);
    border-radius: 999px;
    min-height: 30px;
    padding: 6px 10px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    margin-left: auto;
}

.hg-theme-toggle .hg-theme-toggle-dark {
    display: none;
}

:root[data-theme="dark"] .hg-theme-toggle .hg-theme-toggle-light {
    display: none;
}

:root[data-theme="dark"] .hg-theme-toggle .hg-theme-toggle-dark {
    display: inline;
}

.hg-form-page .hg-hint,
.hg-form-page .hg-alert {
    margin: 16px 20px 0;
}

.hg-form-page > .hg-page-message {
    margin: 0;
}

.hg-presentaciones-page {
    gap: 18px;
}

.hg-presentaciones-page > .hg-card,
.hg-presentaciones-page > .hg-presentaciones-grid {
    width: 100%;
}

.hg-presentaciones-page .hg-page-header {
    align-items: center;
}

.hg-presentaciones-page .hg-page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.hg-presentaciones-new-card .hg-form-grid {
    align-items: end;
    grid-template-columns: 150px minmax(180px, 1fr) minmax(130px, .5fr) 150px;
}

.hg-presentaciones-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.hg-presentaciones-picker-grid {
    grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.1fr);
}

.hg-presentaciones-bottom-grid {
    grid-template-columns: minmax(360px, .9fr) minmax(460px, 1.1fr);
}

.hg-presentaciones-page .hg-card {
    overflow: hidden;
}

.hg-presentaciones-page .hg-table-wrap {
    overflow: auto;
}

.hg-presentaciones-picker-grid .hg-table-wrap {
    max-height: 310px;
}

.hg-presentaciones-bottom-grid .hg-table-wrap {
    max-height: 410px;
}

.hg-presentaciones-page .hg-table tr {
    cursor: pointer;
}

.hg-presentaciones-page .hg-table tr.selected td {
    background: rgba(67, 160, 71, .13);
}

.hg-presentaciones-page .hg-table th,
.hg-presentaciones-page .hg-table td {
    vertical-align: middle;
}

.hg-presentaciones-page > .hg-card .hg-total-bar {
    align-items: center;
    gap: 14px;
}

.hg-presentaciones-page .hg-total-bar {
    flex-wrap: wrap;
}

.hg-presentaciones-page .hg-total-bar > span {
    min-width: 220px;
}

.hg-presentaciones-page .hg-split-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .hg-presentaciones-grid,
    .hg-presentaciones-picker-grid,
    .hg-presentaciones-bottom-grid {
        grid-template-columns: 1fr;
    }

    .hg-presentaciones-new-card .hg-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .hg-env-footer {
        padding-bottom: 14px;
    }
}

.hg-card,
.hg-mini-panel,
.hg-module-card,
.hg-insight-strip > div,
.hg-dashboard-loading {
    border-radius: 18px;
}

.hg-list {
    margin: 16px;
    border-radius: 18px;
    overflow: hidden;
}

.hg-list-item:hover {
    background: rgba(46,125,50,.045);
}

.hg-kpi-card {
    border-radius: 20px;
}

.hg-kpi-primary { background: linear-gradient(145deg, #166534, #65A30D); }
.hg-kpi-warn { background: linear-gradient(145deg, #FF9F0A, #FF453A); }
.hg-kpi-green { background: linear-gradient(145deg, #30D158, #34C759); }
.hg-kpi-rose { background: linear-gradient(145deg, #5856D6, #AF52DE); }

@media (min-width: 900px) {
    :root {
        --hg-nav-height: 0px;
    }

    .hg-app {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        transition: grid-template-columns .24s ease;
    }

    .hg-shell-sidebar {
        display: flex;
        position: sticky;
        top: 0;
        height: 100vh;
        flex-direction: column;
        padding: 18px 14px;
        background: rgba(255,255,255,.72);
        border-right: 1px solid var(--hg-border);
        backdrop-filter: blur(28px);
        -webkit-backdrop-filter: blur(28px);
        overflow-y: auto;
        scrollbar-width: thin;
        transition: opacity .18s ease, transform .24s ease;
    }

    .hg-shell-collapse-button {
        display: flex;
        position: fixed;
        z-index: 1006;
        top: 50%;
        left: 300px;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 68px;
        margin: 0;
        border: 1px solid var(--hg-border);
        border-radius: 0 15px 15px 0;
        background: rgba(255,255,255,.94);
        box-shadow: 6px 0 18px rgba(22,52,33,.10);
        color: transparent;
        padding: 0;
        font: inherit;
        font-size: 0;
        cursor: pointer;
        transform: translateY(-50%);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .hg-shell-collapse-button span {
        color: var(--hg-primary);
        font-size: 30px;
        line-height: 1;
    }

    .hg-shell-open-button {
        position: fixed;
        z-index: 1005;
        top: 18px;
        left: 14px;
        align-items: center;
        gap: 7px;
        border: 1px solid rgba(46,125,50,.2);
        border-radius: 999px;
        background: rgba(255,255,255,.92);
        box-shadow: 0 8px 24px rgba(22,52,33,.12);
        color: #26703f;
        padding: 9px 13px;
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    :root[data-theme="dark"] .hg-shell-collapse-button,
    :root[data-theme="dark"] .hg-shell-open-button {
        background: rgba(29,31,35,.9);
        color: #b8e3c3;
    }

    :root.hg-sidebar-collapsed .hg-app {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    :root.hg-sidebar-collapsed .hg-shell-sidebar {
        min-width: 0;
        padding-right: 0;
        padding-left: 0;
        border-right: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transform: translateX(-100%);
    }

    :root.hg-sidebar-collapsed .hg-shell-open-button {
        display: flex;
    }

    :root.hg-sidebar-collapsed .hg-main {
        zoom: 1.06;
    }

    .hg-shell-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        color: var(--hg-text);
        text-decoration: none;
        padding: 10px 10px 18px;
        margin-bottom: 4px;
    }

    .hg-shell-brand img {
        width: 42px;
        height: 42px;
        object-fit: contain;
        border-radius: 12px;
        background: white;
        box-shadow: 0 4px 16px rgba(0,0,0,.08);
        padding: 4px;
    }

    .hg-shell-brand strong,
    .hg-shell-brand small {
        display: block;
        line-height: 1.15;
    }

    .hg-shell-brand strong {
        font-size: 15px;
        letter-spacing: .01em;
    }

    .hg-shell-brand small {
        color: var(--hg-text-muted);
        font-size: 12px;
        margin-top: 2px;
    }

    .hg-shell-user {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: auto;
        padding: 14px 10px 4px;
        border-top: 1px solid var(--hg-border);
    }

    .hg-shell-user strong,
    .hg-shell-user small {
        display: block;
        line-height: 1.2;
    }

    .hg-shell-user strong {
        font-size: 13px;
        color: var(--hg-text);
    }

    .hg-shell-user small {
        margin-top: 2px;
        color: var(--hg-text-muted);
        font-size: 11px;
    }

    .hg-shell-user button {
        border: 1px solid var(--hg-border);
        background: rgba(255,255,255,.58);
        color: var(--hg-text);
        border-radius: 10px;
        padding: 8px 10px;
        font-weight: 800;
        cursor: pointer;
    }

    .hg-bottom-nav {
        position: static;
        transform: none;
        width: 100%;
        max-width: none;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .hg-nav-sections {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .hg-nav-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        padding: 10px 8px;
        border: 1px solid rgba(0,0,0,.045);
        border-radius: 18px;
        background: rgba(255,255,255,.38);
    }

    .hg-nav-group-title {
        display: block;
        padding: 2px 8px 7px;
        color: var(--hg-text-muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .hg-nav-item {
        min-height: 46px;
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 11px 12px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 650;
    }

    .hg-nav-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .hg-nav-item.active {
        color: var(--hg-text);
        background: rgba(46,125,50,.12);
    }

    .hg-nav-item:hover {
        color: var(--hg-text);
        background: rgba(0,0,0,.045);
    }

    .hg-nav-disabled {
        display: flex;
        cursor: default;
        opacity: .42;
    }

    .hg-nav-disabled:hover {
        color: var(--hg-text-muted);
        background: transparent;
    }

    :root[data-theme="dark"] .hg-nav-group {
        background: rgba(255,255,255,.045);
        border-color: rgba(255,255,255,.075);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
    }

    :root[data-theme="dark"] .hg-nav-group-title {
        color: rgba(245,245,247,.52);
    }

    :root[data-theme="dark"] .hg-nav-item {
        color: rgba(245,245,247,.72);
    }

:root[data-theme="dark"] .hg-nav-item.active {
    color: #F8FAFC;
    background: rgba(47,143,70,.42);
}

    :root[data-theme="dark"] .hg-nav-item:hover {
        color: #F8FAFC;
        background: rgba(255,255,255,.07);
    }

    :root[data-theme="dark"] .hg-nav-disabled {
        color: rgba(245,245,247,.46);
        opacity: 1;
    }

    :root[data-theme="dark"] .hg-nav-disabled svg {
        color: rgba(245,245,247,.35);
    }

    :root[data-theme="dark"] .hg-nav-disabled:hover {
        color: rgba(245,245,247,.46);
        background: transparent;
    }

    .hg-shell-content {
        min-height: 100vh;
    }

    .hg-main {
        padding: 28px;
        padding-bottom: 22px;
    }

    .hg-header {
        position: static;
        border: 1px solid rgba(0,0,0,.06);
        border-radius: 24px;
        padding: 24px 28px;
        margin: 0 auto 16px;
        max-width: 1220px;
        box-shadow: 0 12px 36px rgba(0,0,0,.045);
    }

    .hg-header h1 {
        font-size: 30px;
        font-weight: 760;
    }

    .hg-search,
    .hg-tabs,
    .hg-action-bar {
        position: static;
        max-width: 1220px;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid rgba(0,0,0,.06);
        box-shadow: 0 10px 28px rgba(0,0,0,.04);
    }

    .hg-action-bar {
        border-radius: 18px 18px 0 0;
        padding: 12px 14px;
        border-bottom: 0;
    }

    .hg-tabs {
        border-radius: 18px 18px 0 0;
        padding: 12px 14px 0;
    }

    .hg-search {
        border-radius: 0 0 18px 18px;
        padding: 12px 14px;
    }

    .hg-tabs + .hg-search {
        top: auto;
    }

    .hg-list,
    .hg-page,
    .hg-dashboard {
        max-width: 1220px;
        margin-left: auto;
        margin-right: auto;
    }

    .hg-list {
        margin-top: 18px;
    }

    .hg-page {
        padding: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
        align-items: start;
    }

    .hg-security-page {
        grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
        gap: 22px;
    }

    .hg-security-page > .hg-card {
        min-width: 0;
        overflow: hidden;
    }

    .hg-security-page > .hg-card:first-child {
        position: sticky;
        top: 28px;
    }

    .hg-security-page .hg-actions-bar {
        margin: 0;
        justify-content: flex-end;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        box-shadow: none;
    }

    .hg-security-page .hg-security-permissions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hg-list-page,
    .hg-lotes-page {
        display: block;
        max-width: 1220px;
        margin-left: auto;
        margin-right: auto;
    }

    .hg-lotes-page {
        width: 100%;
        max-width: none;
    }

    .hg-list-page .hg-header,
    .hg-list-page .hg-search,
    .hg-list-page .hg-filter-row,
    .hg-list-page .hg-action-bar,
    .hg-list-page .hg-list,
    .hg-lotes-page .hg-header,
    .hg-lotes-page .hg-search,
    .hg-lotes-page .hg-filter-row,
    .hg-lotes-page .hg-action-bar,
    .hg-lotes-page .hg-list {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .hg-list-page .hg-header,
    .hg-lotes-page .hg-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
    }

    .hg-list-page .hg-search,
    .hg-lotes-page .hg-search {
        border-radius: 18px;
        border-bottom: 0;
    }

    .hg-list-page .hg-search:has(+ .hg-filter-row),
    .hg-list-page .hg-search:has(+ .hg-action-bar),
    .hg-lotes-page .hg-search:has(+ .hg-filter-row),
    .hg-lotes-page .hg-search:has(+ .hg-action-bar) {
        border-radius: 18px 18px 0 0;
    }

    .hg-list-page .hg-filter-row,
    .hg-lotes-page .hg-filter-row {
        border: 1px solid rgba(0,0,0,.06);
        border-top: 0;
        border-radius: 0 0 18px 18px;
        box-shadow: 0 10px 28px rgba(0,0,0,.04);
    }

    .hg-list-page .hg-action-bar {
        border-radius: 0;
        border-top: 0;
    }

    .hg-list-page .hg-search + .hg-action-bar {
        border-radius: 0 0 18px 18px;
    }

    .hg-lotes-new-bar {
        border-radius: 18px;
        border-bottom: 1px solid rgba(0,0,0,.06);
        margin-bottom: 12px;
    }

    .hg-list-page .hg-action-bar + .hg-list {
        margin-top: 18px;
    }

    .hg-list-page .hg-list,
    .hg-lotes-page .hg-list {
        margin-top: 18px;
        overflow: hidden;
    }

    .hg-list-page .hg-list-main-link,
    .hg-lotes-page .hg-list-main-link {
        min-width: 280px;
    }

    .hg-list-page .hg-list-side-actions,
    .hg-lotes-page .hg-list-side-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: 520px;
    }

    .hg-list-page 
.production-orders-toolbar {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.production-order-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, .35fr) auto;
    gap: 12px;
    align-items: end;
}

.production-order-filters label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}

.production-order-filters button {
    min-height: 42px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.production-order-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    overflow: hidden;
}

.production-order-stats div {
    padding: 10px 12px;
    border-right: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 55%, var(--hg-surface));
}

.production-order-stats div:last-child {
    border-right: 0;
}

.production-order-stats span,
.production-order-stats strong {
    display: block;
}

.production-order-stats span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.production-order-stats strong {
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 18px;
    font-weight: 850;
}

.production-selection-bar {
    justify-content: flex-start;
}

.production-selection-bar .hg-primary-action {
    background: var(--hg-primary);
    color: #fff;
    border-color: var(--hg-primary);
}

.production-selected-panel {
    display: grid;
    grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid rgba(46,125,50,.20);
    border-radius: 16px;
    background: rgba(46,125,50,.055);
    padding: 12px 14px;
}

.production-selected-panel > div:first-child strong,
.production-selected-panel > div:first-child span {
    display: block;
}

.production-selected-panel > div:first-child strong {
    color: var(--hg-text);
    font-size: 14px;
    font-weight: 850;
}

.production-selected-panel > div:first-child span {
    margin-top: 3px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
}

.production-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.production-selected-list button {
    display: grid;
    gap: 2px;
    max-width: 260px;
    border: 1px solid rgba(46,125,50,.20);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.production-selected-list button strong,
.production-selected-list button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-selected-list button strong {
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
}

.production-selected-list button span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.production-order-row.selected {
    background: rgba(46,125,50,.08);
    box-shadow: inset 4px 0 0 var(--hg-primary);
}

.hg-selection-bar {
        position: static;
        justify-content: flex-end;
        border-radius: 0 0 18px 18px;
        border-top: 0;
    }

    .hg-materia-prima-page .hg-card {
        margin-top: 18px;
        overflow: hidden;
    }

    .hg-materia-prima-page .hg-card .hg-list {
        margin-top: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .hg-page > .hg-card,
    .hg-page > .hg-empty {
        margin-bottom: 0;
    }

    .hg-page > .hg-card:has(.hg-table),
    .hg-page > .hg-empty {
        grid-column: 1 / -1;
    }

    .hg-dashboard {
        padding: 0;
    }

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

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

    .hg-table table {
        font-size: 14px;
    }

    .hg-form-page {
        display: grid;
        grid-template-columns: 1fr;
        gap: 22px;
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .hg-form-page > .hg-page-header {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .hg-form-page > .hg-card,
    .hg-form-page > .hg-actions-bar {
        margin-bottom: 0;
    }

    .hg-form-page .hg-card {
        box-shadow: 0 14px 36px rgba(0,0,0,.06);
    }

    .hg-form-page .hg-card-title {
        padding-top: 16px;
        padding-bottom: 12px;
    }

    .hg-form-page .hg-form-row,
    .hg-form-page .hg-form-grid {
        padding: 18px 20px 0;
    }

.hg-form-page .hg-total-bar {
        margin: 18px 20px 0;
        padding-top: 16px;
    }

    .hg-oc-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        gap: 22px;
        align-items: start;
    }

    .hg-oc-summary {
        position: sticky;
        top: 28px;
    }

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

    .hg-oc-items-table {
        max-height: 46vh;
    }

    .hg-purchase-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
        gap: 22px;
        align-items: start;
    }

    .hg-purchase-summary {
        position: sticky;
        top: 28px;
    }

    .hg-product-config-workspace {
        grid-template-columns: minmax(520px, 1fr) minmax(360px, 460px);
        gap: 22px;
    }

    .hg-product-config-page {
        display: grid;
        grid-template-columns: 1fr;
        max-width: none;
        width: 100%;
    }

    .hg-product-config-filters,
    .hg-product-config-workspace {
        grid-column: 1 / -1;
    }

    .hg-product-config-editor {
        position: sticky;
        top: 28px;
    }

    .hg-env-footer {
        padding: 0 28px 22px;
    }

    .hg-env-footer-inner {
        max-width: 1220px;
        margin: 0 auto;
        padding-top: 14px;
    }

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

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

    .hg-table th,
    .hg-table td {
        padding: 12px 14px;
    }
}

@media (max-width: 899.98px) {
    .hg-app {
        max-width: none;
        width: 100%;
    }

    .hg-app {
        display: flex;
        flex-direction: column;
    }

    .hg-main {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .hg-modal-backdrop {
        z-index: 600;
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
        padding: calc(env(safe-area-inset-top) + 12px) 12px calc(env(safe-area-inset-bottom) + 12px);
        -webkit-overflow-scrolling: touch;
    }

    .hg-modal-panel {
        width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .hg-actions-bar {
        padding-bottom: calc(var(--hg-mobile-bottom-clearance) + 12px);
    }

    .hg-modal-panel > .hg-actions-bar {
        padding-bottom: 16px;
    }

    @supports not (height: 100dvh) {
        .hg-modal-panel {
            max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
        }
    }

    .hg-bottom-nav {
        max-width: none;
        height: calc(72px + env(safe-area-inset-bottom));
        justify-content: center;
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
        overflow: visible;
        background: rgba(255,255,255,.86);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }

    :root[data-theme="dark"] .hg-bottom-nav {
        background: rgba(22,23,26,.86);
    }

    .hg-desktop-home,
    .hg-bottom-nav > .hg-nav-sections {
        display: none;
    }

    .hg-mobile-nav-primary {
        width: min(100%, 520px);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
    }

    .hg-nav-item {
        flex: none;
        min-width: 0;
        width: 100%;
        border-radius: 16px;
        font-size: 10px;
        font-weight: 700;
        padding: 7px 3px;
        line-height: 1.1;
    }

    .hg-nav-home {
        min-width: 0;
    }

    .hg-nav-item svg {
        width: 19px;
        height: 19px;
    }

    .hg-nav-item.active {
        background: rgba(46,125,50,.10);
        color: var(--hg-primary);
    }

    .hg-mobile-more {
        cursor: pointer;
    }

    .hg-bottom-nav:has(.hg-mobile-menu-toggle:checked) {
        z-index: 700;
    }

    .hg-mobile-menu-toggle:checked ~ .hg-mobile-menu-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.26);
        z-index: 140;
    }

    .hg-mobile-menu-sheet {
        display: block;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 14px;
        border: 1px solid var(--hg-border);
        border-radius: 22px;
        background: var(--hg-surface);
        box-shadow: 0 28px 90px rgba(0,0,0,.28);
        transform: translateY(18px);
        opacity: 0;
        pointer-events: none;
        transition: transform .18s ease, opacity .18s ease;
        z-index: 150;
    }

    @supports not (height: 100dvh) {
        .hg-mobile-menu-sheet {
            max-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        }
    }

    .hg-mobile-menu-toggle:checked ~ .hg-mobile-menu-sheet {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .hg-mobile-menu-title {
        position: sticky;
        top: -14px;
        z-index: 2;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: -14px -14px 0;
        padding: 14px 18px 12px;
        border-bottom: 1px solid var(--hg-border);
        background: color-mix(in srgb, var(--hg-surface) 94%, transparent);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .hg-mobile-menu-title strong {
        font-size: 18px;
        font-weight: 850;
    }

    .hg-mobile-menu-title .hg-mobile-menu-close {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border: 1px solid var(--hg-border);
        border-radius: 50%;
        background: var(--hg-bg);
        color: var(--hg-text);
        font-size: 30px;
        font-weight: 500;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .hg-mobile-menu-group {
        padding: 10px 0;
        border-top: 1px solid var(--hg-border);
    }

    .hg-mobile-menu-group .hg-nav-group-title {
        display: block;
        padding: 0 4px 8px;
        color: var(--hg-text-muted);
        font-size: 11px;
        font-weight: 850;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .hg-mobile-menu-group .hg-nav-item {
        width: 100%;
        min-height: 44px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 9px;
        font-size: 14px;
        color: var(--hg-text);
    }

    .hg-mobile-menu-group .hg-nav-item svg {
        width: 20px;
        height: 20px;
        color: var(--hg-text-muted);
        flex-shrink: 0;
    }

    .hg-mobile-menu-user {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 8px;
        padding: 14px 4px 2px;
        border-top: 1px solid var(--hg-border);
    }

    .hg-mobile-menu-user strong,
    .hg-mobile-menu-user small {
        display: block;
        line-height: 1.2;
    }

    .hg-mobile-menu-user strong {
        color: var(--hg-text);
        font-size: 14px;
    }

    .hg-mobile-menu-user small {
        color: var(--hg-text-muted);
        font-size: 12px;
        margin-top: 2px;
    }

    .hg-mobile-menu-user button {
        border: 1px solid var(--hg-border);
        background: var(--hg-primary);
        color: #fff;
        border-radius: 14px;
        padding: 10px 14px;
        font-weight: 850;
        cursor: pointer;
    }

    .hg-mobile-menu-user .hg-mobile-theme-toggle {
        width: auto;
        min-height: 40px;
        margin-left: auto;
        background: var(--hg-bg);
        color: var(--hg-text);
        border-color: var(--hg-border);
    }

    .hg-header {
        top: 0;
        padding: 14px 16px 10px;
        border-bottom: 0;
    }

    .hg-header h1 {
        font-size: 22px;
        line-height: 1.1;
        font-weight: 850;
    }

    .hg-header .subtitle {
        font-size: 12px;
        margin-top: 4px;
    }

    .hg-list-page .hg-header .hg-primary-action,
    .hg-lotes-page .hg-header .hg-primary-action {
        float: none;
        display: inline-flex;
        width: fit-content;
        margin-top: 14px;
        background: var(--hg-primary);
        color: white;
        border-color: transparent;
    }

    .hg-action-bar {
        padding: 8px 16px 10px;
        border-bottom: 0;
        background: rgba(255,255,255,.82);
    }

    .hg-action-bar a,
    .hg-action-bar button {
        min-height: 36px;
        border-radius: 13px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .hg-search {
        top: 48px;
        padding: 8px 16px 12px;
        border-bottom: 0;
    }

    .hg-tabs + .hg-search {
        top: 92px;
    }

    .hg-search input {
        min-height: 42px;
        padding: 9px 13px;
        border-radius: 14px;
        font-size: 14px;
    }

    .hg-list {
        margin: 10px 12px 18px;
        border-radius: 18px;
        border: 0;
        background: transparent;
        box-shadow: none;
        display: grid;
        gap: 10px;
        overflow: visible;
    }

    .hg-list-item {
        border: 1px solid var(--hg-border);
        border-radius: 17px;
        padding: 12px 12px;
        background: var(--hg-surface);
        box-shadow: 0 8px 24px rgba(0,0,0,.045);
    }

    :root[data-theme="dark"] .hg-list-item {
        background: var(--hg-surface);
        box-shadow: none;
    }

    .hg-list-title {
        font-size: 15px;
        line-height: 1.22;
        font-weight: 800;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .hg-list-sub {
        font-size: 12px;
        line-height: 1.35;
    }

    .hg-list-right {
        margin-left: 8px;
        min-width: 86px;
    }

    .hg-list-right .amount {
        font-size: 16px;
        line-height: 1.15;
        font-weight: 850;
    }

    .hg-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .hg-form-row,
    .hg-form-grid,
    .hg-form-grid-2,
    .hg-form-grid-3,
    .hg-form-grid-4 {
        grid-template-columns: 1fr;
    }

    .hg-total-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .hg-tax-rate-grid,
    .hg-tax-rate-fields {
        grid-template-columns: 1fr;
    }

    .hg-section-head,
    .hg-purchase-provider-profile,
    .hg-purchase-total-input {
        grid-template-columns: 1fr;
    }

    .hg-section-head,
    .hg-purchase-provider-profile {
        display: grid;
    }

    .hg-section-head .hg-secondary-action,
    .hg-section-actions,
    .hg-section-actions .hg-secondary-action,
    .hg-purchase-provider-profile .hg-plain-button {
        width: 100%;
    }

    .hg-section-actions {
        justify-content: stretch;
    }

    .hg-purchase-qr-mobile-capture {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 16px 10px;
    }

    .hg-purchase-qr-mobile-capture .hg-secondary-action {
        flex: 1 1 160px;
    }

    .hg-hint.hg-purchase-qr-mobile-capture {
        display: block;
        margin-top: -2px;
        margin-bottom: 12px;
    }

    .hg-purchase-qr-result {
        grid-template-columns: 1fr;
    }

    .hg-product-config-filters,
    .hg-product-config-item,
    .hg-product-config-editor-head,
    .hg-product-config-suggestion,
    .hg-product-config-two,
    .hg-product-config-price-lists,
    .hg-product-composition-add-grid,
    .hgl-store-config-grid {
        grid-template-columns: 1fr;
    }

    .hg-product-config-editor-head {
        display: grid;
    }

    .hg-product-config-items {
        max-height: none;
    }

    .hg-product-config-code {
        grid-row: auto;
    }

    .hg-product-config-name,
    .hg-product-config-sub {
        white-space: normal;
    }

    .hg-product-config-actions .hg-primary-action,
    .hg-product-config-actions .hg-secondary-action,
    .hg-product-config-suggestion .hg-secondary-action {
        width: 100%;
    }

    .hg-purchase-amounts {
        padding: 14px;
        gap: 14px;
    }

    .hg-list-item-actionable {
        align-items: stretch;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .hg-list-main-link {
        align-items: flex-start;
        min-width: 0;
    }

    .hg-list-item-actionable > .hg-list-main-link,
    .hg-list-item-actionable > .hg-list-body {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .hg-list-item-actionable:has(> .hg-select-check),
    .hg-list-item-actionable:has(> .hg-list-check) {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .hg-list-item-actionable:has(> .hg-select-check) > .hg-select-check,
    .hg-list-item-actionable:has(> .hg-list-check) > .hg-list-check {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        justify-self: start;
        margin: 0;
    }

    .hg-list-item-actionable:has(> .hg-select-check) > .hg-list-main-link,
    .hg-list-item-actionable:has(> .hg-list-check) > .hg-list-main-link,
    .hg-list-item-actionable:has(> .hg-select-check) > .hg-list-body,
    .hg-list-item-actionable:has(> .hg-list-check) > .hg-list-body {
        grid-column: 2;
        grid-row: 1;
    }

    .hg-list-item-actionable > .hg-row-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding-top: 2px;
    }

    .hg-list-side-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
    }

    .hg-list-side-actions .hg-list-chevron {
        display: none;
    }

    .hg-list-item-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px 10px;
    }

    .hg-list-item-actions .hg-list-main-link {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .hg-list-item-actions .hg-list-chevron {
        display: none;
    }

    .hg-clientes-page .hg-list-item-actions .hg-list-main-link {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        padding-right: 48px;
    }

    .hg-clientes-page .hg-list-avatar {
        grid-column: 1;
        grid-row: 1;
        margin-right: 0;
    }

    .hg-clientes-page .hg-list-body {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .hg-list-item-actions .hg-row-menu {
        grid-column: 2;
        grid-row: 1;
        align-self: start;
        justify-self: end;
    }

    .hg-row-action {
        border-radius: 999px;
        min-height: 30px;
        padding: 6px 9px;
        font-size: 11px;
    }

    .hg-row-actions .hg-row-action,
    .hg-row-actions .hg-danger-action {
        width: auto;
        min-height: 30px;
        padding: 6px 10px;
        border-radius: 999px;
        font-size: 11px;
        line-height: 1.15;
        white-space: normal;
    }

    .hg-list-side {
        margin-left: 0;
        text-align: left;
    }

    .hg-row-menu-button {
        width: 36px;
        height: 36px;
    }

    .hg-row-menu[open] .hg-row-menu-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: calc(env(safe-area-inset-bottom) + 80px);
        min-width: 0;
        padding: 8px;
        border-radius: 18px;
        box-shadow: 0 24px 70px rgba(0,0,0,.28);
        z-index: 90;
    }

    .hg-row-menu-item {
        min-height: 44px;
        font-size: 15px;
    }

    .hg-env-footer {
        font-size: 10px;
    }

.hg-theme-toggle {
    width: 100%;
    margin-left: 0;
    justify-content: center;
}
}

/* ---- PRINTABLE SALES INVOICE ---- */
.invoice-toolbar {
    max-width: 900px;
    margin: 0 auto 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.invoice-page {
    min-height: 100%;
    padding: 0 16px 32px;
}
.invoice-sheet {
    width: min(100%, 210mm);
    min-height: 297mm;
    margin: 0 auto 18px;
    padding: 14mm;
    background: #fff;
    color: #111827;
    border: 1px solid #D1D5DB;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    font-size: 12px;
    display: flex;
    flex-direction: column;
}
.invoice-page-body {
    flex: 1 1 auto;
}
.invoice-top {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 18px;
    min-height: 148px;
    border: 1px solid #111827;
    padding: 16px;
}
.invoice-brand {
    line-height: 1.45;
}
.invoice-brand-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.invoice-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    flex: 0 0 auto;
}
.invoice-brand-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0;
    margin-bottom: 2px;
}
.invoice-brand-subtitle {
    color: #4B5563;
    font-weight: 700;
}
.invoice-letter {
    justify-self: center;
    align-self: start;
    width: 56px;
    height: 64px;
    border: 2px solid #111827;
    background: #fff;
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 900;
}
.invoice-letter div {
    font-size: 34px;
    line-height: 1;
}
.invoice-letter span {
    font-size: 9px;
    font-weight: 700;
}
.invoice-number {
    text-align: right;
    font-size: 13px;
    line-height: 1.48;
}
.invoice-type {
    font-size: 22px;
    font-weight: 900;
}
.invoice-numero {
    font-size: 17px;
    font-weight: 800;
}
.invoice-registry {
    border-left: 1px solid #111827;
    border-right: 1px solid #111827;
    border-bottom: 1px solid #111827;
    padding: 8px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    font-size: 11px;
}
.invoice-client {
    border: 1px solid #111827;
    border-top: 0;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 24px;
}
.invoice-client div:nth-child(4),
.invoice-client div:nth-child(5) {
    grid-column: 1 / -1;
}
.invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}
.invoice-items th {
    background: #F3F4F6;
    border: 1px solid #111827;
    padding: 8px 7px;
    font-size: 11px;
    text-align: left;
}
.invoice-items td {
    border-left: 1px solid #D1D5DB;
    border-right: 1px solid #D1D5DB;
    border-bottom: 1px solid #E5E7EB;
    padding: 7px;
    vertical-align: top;
}
.invoice-auth {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.invoice-auth div {
    border: 1px solid #111827;
    padding: 10px 12px;
    min-height: 54px;
}
.invoice-auth div:last-child {
    grid-column: 1 / -1;
}
.invoice-auth span {
    display: block;
    color: #4B5563;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.invoice-auth strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    word-break: break-word;
}
.invoice-items .num,
.invoice-totals .num {
    text-align: right;
}
.invoice-summary {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 20px;
    margin-top: 18px;
}
.invoice-notes {
    border: 1px solid #D1D5DB;
    min-height: 120px;
    padding: 12px;
    line-height: 1.45;
}
.invoice-notes p {
    margin: 18px 0 0;
}
.invoice-transport-notes {
    margin-top: 18px;
}
.invoice-transport-notes p {
    margin: 10px 0 0;
}
.invoice-transport-highlight {
    font-size: 1.03rem;
    line-height: 1.35;
}
.invoice-transport-value {
    font-size: 1.03rem;
    margin-top: 28px;
    margin-bottom: 10px;
    white-space: pre-line;
}
.invoice-transport-products {
    font-size: 1.08rem;
    margin-top: 8px;
    margin-bottom: 22px;
}
.invoice-transport-packages {
    font-size: 1.08rem;
    margin-top: 22px;
    margin-bottom: 28px;
    padding: 9px 10px;
    border-top: 1px dashed #111827;
    border-bottom: 1px dashed #111827;
    display: block;
    width: min(100%, 640px);
    white-space: pre-line;
}
.invoice-transport-packages span {
    display: block;
    margin-top: 3px;
}
.invoice-manual-text {
    white-space: pre-line;
}
.invoice-fixed-remito-text {
    margin-top: 22px;
    font-weight: 700;
}
.hg-fixed-remito-text {
    white-space: pre-line;
    border: 1px dashed var(--hg-border);
    border-radius: 12px;
    background: rgba(46, 125, 50, .04);
    color: var(--hg-text-muted);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}
.invoice-qr-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}
.invoice-qr {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
}
.invoice-qr svg {
    display: block;
    width: 100%;
    height: 100%;
}
.invoice-qr-block span {
    display: block;
    margin-top: 4px;
    color: #4B5563;
    font-size: 10.5px;
    line-height: 1.3;
}
.invoice-totals {
    border: 1px solid #111827;
    align-self: start;
}
.invoice-totals div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 12px;
    border-bottom: 1px solid #D1D5DB;
}
.invoice-totals div:last-child {
    border-bottom: 0;
}
.invoice-total {
    background: #F3F4F6;
    font-size: 17px;
    font-weight: 900;
}
.invoice-continues {
    margin-top: 18px;
    border: 1px dashed #9CA3AF;
    padding: 10px 12px;
    color: #4B5563;
    font-weight: 800;
    text-align: right;
}
.invoice-footer {
    margin-top: auto;
    border-top: 2px solid #111827;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.hg-proforma-legal-option {
    align-items: flex-start;
    gap: 10px;
    width: min(100%, 620px);
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
}

.hg-proforma-legal-option input {
    margin-top: 3px;
}

.hg-proforma-legal-option span {
    display: grid;
    gap: 3px;
}

.hg-proforma-legal-option small {
    color: var(--hg-text-muted);
    font-weight: 500;
    line-height: 1.35;
}

.proforma-legal-text {
    margin-top: 18px;
    padding: 11px 2px 0;
    border-top: 1px solid #9CA3AF;
    font-family: Arial, sans-serif;
    font-size: 7.5pt;
    line-height: 1.28;
    text-align: justify;
}

.proforma-signature {
    width: 67%;
    margin-top: 30px;
    padding: 0 2px 8px;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    color: #111827;
    break-inside: avoid;
    page-break-inside: avoid;
}

.proforma-signature-line {
    width: 100%;
    border-top: 1px solid #111827;
}

.proforma-signature-title {
    margin-top: 5px;
}

.proforma-signature-fields {
    display: grid;
    gap: 13px;
    margin-top: 19px;
}

.proforma-signature-fields > div {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.proforma-signature-fields span {
    white-space: nowrap;
}

.proforma-signature-fields i {
    display: block;
    flex: 1 1 auto;
    min-width: 36px;
    border-bottom: 1px solid #111827;
}

.proforma-signature-fields b {
    font-weight: 400;
}

.proforma-signature-date i {
    flex: 0 0 52px;
}

.invoice-page-number {
    margin-left: auto;
    color: #4B5563;
    font-weight: 700;
}

@media (max-width: 700px) {
    .invoice-toolbar {
        position: sticky;
        top: 0;
        z-index: 10;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: calc(env(safe-area-inset-top) + 10px) 10px 10px;
        justify-content: space-between;
        background: rgba(248, 250, 252, .94);
        border-bottom: 1px solid #d1d5db;
        backdrop-filter: blur(12px);
    }

    .invoice-toolbar button,
    .invoice-toolbar .hg-primary-action,
    .invoice-toolbar .hg-secondary-action {
        min-height: 40px;
        padding: 0 14px;
        border-radius: 12px;
        font-size: 13px;
    }

    .invoice-page {
        min-height: 100dvh;
        padding: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--hg-bg);
    }

    .invoice-sheet {
        width: 210mm;
        min-width: 210mm;
        margin: 0 0 14px;
        padding: 12mm;
        box-shadow: 0 16px 46px rgba(0,0,0,.16);
        transform-origin: top left;
    }
}


.production-orders-toolbar {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.production-order-filters {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, .35fr) auto;
    gap: 12px;
    align-items: end;
}

.production-order-filters label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
}

.production-order-filters button {
    min-height: 42px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.production-order-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    overflow: hidden;
}

.production-order-stats div {
    padding: 10px 12px;
    border-right: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 55%, var(--hg-surface));
}

.production-order-stats div:last-child {
    border-right: 0;
}

.production-order-stats span,
.production-order-stats strong {
    display: block;
}

.production-order-stats span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.production-order-stats strong {
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 18px;
    font-weight: 850;
}

.production-selection-bar {
    justify-content: flex-start;
}

.production-selection-bar .hg-primary-action {
    background: var(--hg-primary);
    color: #fff;
    border-color: var(--hg-primary);
}

.production-selected-panel {
    display: grid;
    grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    border: 1px solid rgba(46,125,50,.20);
    border-radius: 16px;
    background: rgba(46,125,50,.055);
    padding: 12px 14px;
}

.production-selected-panel > div:first-child strong,
.production-selected-panel > div:first-child span {
    display: block;
}

.production-selected-panel > div:first-child strong {
    color: var(--hg-text);
    font-size: 14px;
    font-weight: 850;
}

.production-selected-panel > div:first-child span {
    margin-top: 3px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
}

.production-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.production-selected-list button {
    display: grid;
    gap: 2px;
    max-width: 260px;
    border: 1px solid rgba(46,125,50,.20);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}

.production-selected-list button strong,
.production-selected-list button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-selected-list button strong {
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
}

.production-selected-list button span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.production-order-row.selected {
    background: rgba(46,125,50,.08);
    box-shadow: inset 4px 0 0 var(--hg-primary);
}

.hg-selection-bar {
    position: sticky;
    top: 108px;
    z-index: 42;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hg-selection-bar button:disabled {
    cursor: default;
    opacity: .52;
}

.hg-selection-bar .hg-secondary-action {
    background: var(--hg-bg);
    color: var(--hg-text);
    border: 1px solid var(--hg-border);
}

.production-selection-summary {
    color: var(--hg-muted);
    font-size: 13px;
    font-weight: 750;
    margin-left: auto;
}

.hg-select-check {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 44px;
}

.hg-select-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--hg-primary);
}

@media (max-width: 700px) {
    .production-order-stats {
        display: none !important;
    }

    .production-selection-bar {
        position: static;
        display: flex;
        padding: 10px 0;
        background: transparent;
        box-shadow: none;
    }

    .production-selection-bar .hg-primary-action,
    .production-selection-bar .hg-secondary-action {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .production-selected-panel {
        display: none;
    }

    .production-order-row.hg-list-item-actionable {
        grid-template-columns: 28px minmax(0, 1fr);
        align-items: start;
        gap: 8px 10px;
    }

    .production-order-row > .hg-select-check {
        grid-column: 1;
        grid-row: 1;
        width: 24px;
        height: 30px;
        justify-self: start;
        align-self: start;
        margin-top: 1px;
    }

    .production-order-row > .hg-list-main-link {
        grid-column: 2;
        grid-row: 1;
        display: block;
        min-width: 0;
        padding-left: 0;
    }

    .production-order-row > .hg-row-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-left: 38px;
    }

    .production-order-row > .hg-row-menu {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        align-self: end;
        margin-top: 8px;
    }

    .production-order-row .hg-list-title,
    .production-order-row .hg-list-sub {
        min-width: 0;
    }
}

.production-print-page {
    min-height: 100dvh;
    background: var(--hg-bg);
    padding: 18px;
    color: #111827;
    overflow-x: auto;
}

.production-sheet {
    width: min(100%, 920px);
    min-height: min(1180px, calc(100dvh - 36px));
    margin: 0 auto;
    padding: 42px;
    background: #fff;
    border: 1px solid #d1d5db;
    box-shadow: 0 18px 60px rgba(0,0,0,.16);
    display: flex;
    flex-direction: column;
}

.production-print-header {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    align-items: center;
    gap: 28px;
    border-bottom: 2px solid #111827;
    padding-bottom: 26px;
}

.production-print-header img {
    width: 132px;
    height: 56px;
    object-fit: contain;
}

.production-title {
    text-align: center;
}

.production-title h1 {
    font-size: 30px;
    margin: 0 0 12px;
    letter-spacing: 0;
}

.production-title strong,
.production-date {
    font-size: 18px;
    font-weight: 700;
}

.production-date {
    text-align: right;
}

.production-client {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 10px 28px;
    border-bottom: 1px solid #d1d5db;
    padding: 26px 0;
    font-size: 15px;
}

.production-client-name {
    grid-column: 1 / -1;
    font-size: 19px;
    font-weight: 800;
}

.production-batch-summary {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 16px;
    border-bottom: 1px solid #d1d5db;
    padding: 24px 0;
}

.production-batch-summary div {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 14px 16px;
    background: #f9fafb;
}

.production-batch-summary span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.production-batch-summary strong {
    display: block;
    font-size: 16px;
    line-height: 1.35;
}

.production-batch-orders {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    padding: 18px 0 22px;
    border-bottom: 1px solid #d1d5db;
}

.production-batch-orders-title {
    grid-column: 1 / -1;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.production-batch-order {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: baseline;
    font-size: 14px;
}

.production-batch-order strong {
    color: #2E7D32;
}

.production-batch-order span {
    min-width: 0;
}

.production-items {
    width: 100%;
    border-collapse: collapse;
    margin-top: 26px;
    font-size: 15px;
}

.production-items th,
.production-items td {
    border-bottom: 1px solid #d1d5db;
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
}

.production-items th {
    background: #f3f4f6;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .04em;
}

.production-items .num {
    text-align: right;
    width: 110px;
    font-weight: 800;
}

.production-order-id {
    width: 90px;
    font-weight: 800;
    color: #2E7D32;
}

.production-footer {
    margin-top: auto;
    border-top: 2px solid #111827;
    padding-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.production-footer div {
    min-height: 70px;
    border-bottom: 1px solid #111827;
}

.production-footer span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 10px;
}

.production-footer strong {
    font-size: 22px;
}

@media (max-width: 760px) {
    .production-order-filters,
    .production-order-stats,
    .production-selected-panel {
        grid-template-columns: 1fr;
    }

    .production-order-stats div {
        border-right: 0;
        border-bottom: 1px solid var(--hg-border);
    }

    .production-order-stats div:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 700px) {
    .production-print-page {
        padding: 10px;
    }

    .production-sheet {
        width: 920px;
        padding: 36px;
    }

    .production-batch-summary {
        grid-template-columns: 1fr;
    }

    .production-batch-orders {
        grid-template-columns: 1fr;
    }
}

/* ---- HGL.LA WEB ADMIN ---- */
.hgl-admin-page {
    display: grid;
    gap: 22px;
    max-width: 1500px;
    margin: 0 auto;
}

.hgl-admin-page > * {
    min-width: 0;
    max-width: 100%;
}

.hgl-admin-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.hgl-panel {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    box-shadow: 0 3px 14px rgba(0,0,0,.04);
}

.hgl-admin-title,
.hgl-admin-filters {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    box-shadow: 0 18px 44px rgba(0,0,0,.055);
}

.hgl-admin-title {
    min-width: 0;
    border-radius: 24px;
    padding: 28px 32px;
}

.hgl-admin-title span {
    display: block;
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.hgl-admin-title h1 {
    margin: 0 0 8px;
    color: var(--hg-text);
    font-size: 38px;
    font-weight: 850;
    line-height: 1.08;
}

.hgl-admin-title p {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 16px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

/* RRHH empleados y turnos: overrides after generic admin rules */
.rrhh-empleados-page,
.rrhh-turnos-page {
    max-width: 1220px;
    gap: 14px;
}

.rrhh-empleados-page .hgl-admin-top,
.rrhh-turnos-page .hgl-admin-top {
    gap: 14px;
}

.rrhh-empleados-page .hgl-admin-title,
.rrhh-turnos-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.rrhh-empleados-page .hgl-admin-title span,
.rrhh-turnos-page .hgl-admin-title span {
    margin-bottom: 5px;
    font-size: 11px;
}

.rrhh-empleados-page .hgl-admin-title h1,
.rrhh-turnos-page .hgl-admin-title h1 {
    margin-bottom: 6px;
    font-size: 32px;
    line-height: 1.04;
}

.rrhh-empleados-page .hgl-admin-title p,
.rrhh-turnos-page .hgl-admin-title p {
    font-size: 15px;
    line-height: 1.3;
}

.rrhh-empleados-page .rrhh-empleados-toolbar,
.rrhh-turnos-page .rrhh-turnos-toolbar {
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

.rrhh-empleados-page .rrhh-empleados-toolbar {
    grid-template-columns: minmax(260px, 440px) auto auto auto;
}

.rrhh-empleados-page .rrhh-empleados-toolbar .hg-search-input,
.rrhh-empleados-page .rrhh-empleados-toolbar .hg-secondary-action,
.rrhh-turnos-page .rrhh-turnos-toolbar .hg-secondary-action {
    min-height: 38px;
    border-radius: 11px;
}

.rrhh-empleados-page .rrhh-empleados-toolbar .hg-search-input {
    padding: 8px 11px;
}

.rrhh-empleados-page .rrhh-empleados-toolbar .hg-secondary-action,
.rrhh-turnos-page .rrhh-turnos-toolbar .hg-secondary-action {
    min-width: 104px;
    padding: 8px 13px;
}

.rrhh-empleados-page .rrhh-empleados-workspace {
    width: 100%;
    grid-template-columns: minmax(360px, 460px) minmax(520px, 1fr);
    gap: 18px;
    max-width: 1220px;
}

.rrhh-turnos-page .rrhh-turnos-workspace {
    width: 100%;
    grid-template-columns: minmax(360px, 440px) minmax(520px, 1fr);
    gap: 18px;
    max-width: 1120px;
}

.rrhh-empleados-page .rrhh-empleados-list-card,
.rrhh-empleados-page .rrhh-empleados-editor-card,
.rrhh-turnos-page .rrhh-turnos-list-card,
.rrhh-turnos-page .rrhh-turnos-editor-card {
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}

.rrhh-empleados-page .hg-card-title,
.rrhh-turnos-page .hg-card-title {
    padding: 12px 16px;
    font-size: 11px;
}

.rrhh-empleados-page .rrhh-empleados-list,
.rrhh-turnos-page .hg-security-users {
    gap: 8px;
    padding: 10px;
}

.rrhh-empleados-page .rrhh-employee-item {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
}

.rrhh-empleados-page .rrhh-employee-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
}

.rrhh-empleados-page .rrhh-employee-main strong,
.rrhh-turnos-page .rrhh-shift-main strong {
    font-size: 14px;
}

.rrhh-empleados-page .rrhh-employee-main small,
.rrhh-empleados-page .rrhh-employee-meta,
.rrhh-turnos-page .rrhh-shift-main small,
.rrhh-turnos-page .rrhh-shift-meta {
    font-size: 11px;
}

.rrhh-empleados-page .rrhh-employee-meta {
    gap: 5px;
}

.rrhh-turnos-page .rrhh-shift-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
}

.rrhh-turnos-page .rrhh-shift-meta {
    gap: 5px;
}

.rrhh-empleados-page .rrhh-empleados-editor-card .hg-form-grid,
.rrhh-turnos-page .rrhh-turnos-editor-card .hg-form-grid {
    padding: 16px;
    gap: 12px;
}

.rrhh-empleados-page .rrhh-empleados-editor-card .hg-input,
.rrhh-turnos-page .rrhh-turnos-editor-card .hg-input {
    min-height: 40px;
    border-radius: 11px;
}

.rrhh-empleados-page .hg-actions-bar,
.rrhh-turnos-page .hg-actions-bar {
    padding: 12px 16px;
}

.rrhh-excepciones-page .rrhh-excepciones-toolbar label:not(.hg-check-inline) {
    display: grid;
    gap: 4px;
    min-width: 138px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.rrhh-excepciones-page .rrhh-excepciones-toolbar .hg-input {
    min-height: 38px;
    border-radius: 11px;
}

.rrhh-excepciones-page .rrhh-excepciones-workspace {
    max-width: 1160px;
}

.rrhh-excepciones-page .rrhh-exception-item.inactive {
    opacity: .62;
}

.rrhh-excepciones-page .rrhh-shift-meta span:first-child {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* RRHH reloj biometrico: overrides after generic admin rules */
.rrhh-reloj-page {
    max-width: 1180px;
    gap: 14px;
}

.rrhh-reloj-page .hgl-admin-top {
    gap: 14px;
}

.rrhh-reloj-page .hgl-admin-title {
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.rrhh-reloj-page .hgl-admin-title span {
    margin-bottom: 5px;
    font-size: 11px;
}

.rrhh-reloj-page .hgl-admin-title h1 {
    margin-bottom: 6px;
    font-size: 32px;
    line-height: 1.04;
}

.rrhh-reloj-page .hgl-admin-title p {
    font-size: 15px;
    line-height: 1.3;
}

.rrhh-reloj-page .rrhh-reloj-toolbar {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(150px, 190px) minmax(128px, 150px) minmax(148px, 170px);
    align-items: end;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 16px;
}

.rrhh-reloj-page .rrhh-reloj-toolbar .rrhh-period-field {
    min-width: 0;
    gap: 6px;
    font-size: 11px;
}

.rrhh-reloj-page .rrhh-reloj-toolbar .hg-input {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 750;
}

.rrhh-reloj-page .rrhh-reloj-toolbar .hg-secondary-action,
.rrhh-reloj-page .rrhh-reloj-toolbar .hg-primary-action {
    min-width: 0;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 14px;
    justify-content: center;
}

.rrhh-reloj-page .rrhh-reloj-sync-options {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding-top: 2px;
}

.rrhh-reloj-page .rrhh-reloj-sync-options .hg-check-inline {
    min-height: 34px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(42, 126, 51, 0.16);
    border-radius: 12px;
    background: rgba(42, 126, 51, 0.045);
    font-size: 13px;
    font-weight: 750;
}

.rrhh-reloj-page .rrhh-reloj-sync-detail {
    width: 100%;
    max-width: 1040px;
    overflow: hidden;
    border: 1px solid rgba(255, 190, 92, .28);
    border-radius: 12px;
    background: rgba(255, 190, 92, .08);
    color: var(--hg-text);
}

.rrhh-reloj-page .rrhh-reloj-sync-detail summary {
    cursor: pointer;
    padding: 10px 14px;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.rrhh-reloj-page .rrhh-reloj-sync-detail pre {
    max-height: 320px;
    margin: 0;
    overflow: auto;
    padding: 0 14px 14px;
    color: var(--hg-muted);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}

.rrhh-reloj-page .rrhh-reloj-workspace {
    width: 100%;
    max-width: 1040px;
    gap: 14px;
}

.rrhh-reloj-page .rrhh-reloj-status-card,
.rrhh-reloj-page .rrhh-reloj-table-card {
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}

.rrhh-reloj-page .rrhh-reloj-status-card {
    grid-column: 1 / -1;
}

.rrhh-reloj-page .hg-card-title {
    padding: 12px 16px;
    font-size: 11px;
}

.rrhh-reloj-page .rrhh-reloj-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.rrhh-reloj-page .rrhh-reloj-kpi {
    min-height: 96px;
    align-content: start;
    gap: 7px;
    padding: 12px;
    border-radius: 12px;
}

.rrhh-reloj-page .rrhh-reloj-kpi span {
    font-size: 11px;
    line-height: 1.2;
}

.rrhh-reloj-page .rrhh-reloj-kpi strong {
    overflow: visible;
    font-size: 24px;
    line-height: 1.1;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
}

.rrhh-reloj-page .rrhh-reloj-kpi small {
    font-size: 12px;
    line-height: 1.35;
}

.rrhh-reloj-page .rrhh-reloj-kpi:first-child strong {
    font-size: 18px;
}

.rrhh-reloj-page .rrhh-reloj-kpi:first-child small {
    word-break: break-word;
}

.rrhh-reloj-page .rrhh-reloj-kpi:nth-child(4) strong {
    font-size: 18px;
}

@media (max-width: 980px) {
    .rrhh-empleados-page .rrhh-empleados-toolbar,
    .rrhh-turnos-page .rrhh-turnos-toolbar,
    .rrhh-reloj-page .rrhh-reloj-toolbar {
        width: 100%;
    }

    .rrhh-empleados-page .rrhh-empleados-toolbar {
        grid-template-columns: 1fr auto auto auto;
    }

    .rrhh-empleados-page .rrhh-empleados-workspace,
    .rrhh-turnos-page .rrhh-turnos-workspace {
        grid-template-columns: 1fr;
    }

    .rrhh-reloj-page .rrhh-reloj-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rrhh-reloj-page .rrhh-reloj-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rrhh-empleados-page .rrhh-empleados-toolbar,
    .rrhh-turnos-page .rrhh-turnos-toolbar,
    .rrhh-reloj-page .rrhh-reloj-toolbar {
        grid-template-columns: 1fr;
    }

    .rrhh-reloj-page .rrhh-reloj-sync-options {
        gap: 8px;
    }

    .rrhh-reloj-page .rrhh-reloj-sync-options .hg-check-inline {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .rrhh-reloj-page .rrhh-reloj-kpi-grid {
        grid-template-columns: 1fr;
    }

    .rrhh-empleados-page .rrhh-employee-item {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .rrhh-empleados-page .rrhh-employee-meta {
        grid-column: 2;
        justify-items: start;
    }
}

.hg-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hg-title-actions .hg-primary-action,
.hg-title-actions .hg-secondary-action {
    min-width: 150px;
}

.hgl-admin-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 38px;
    margin-top: 16px;
    padding: 8px 14px;
    text-decoration: none;
}

.hgl-admin-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
    align-content: start;
    border-radius: 18px;
    padding: 18px 22px;
}

.hgl-admin-filters button {
    justify-self: start;
    min-width: 140px;
    min-height: 40px;
    border: 1px solid rgba(46,125,50,.24);
    border-radius: 11px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.hgl-admin-filters button:hover {
    background: rgba(46,125,50,.07);
}

.hgl-admin-filters .hg-primary-action {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}

.hgl-admin-filters .hg-primary-action:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--hg-primary) 86%, #000000);
    background: color-mix(in srgb, var(--hg-primary) 86%, #000000);
    color: #fff;
}

.hgl-admin-filters button:disabled {
    cursor: default;
    opacity: .62;
}

.hgl-admin-filters label,
.hgl-editor label:not(.hg-check-inline) {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.hgl-admin-filters .hg-input,
.hgl-admin-filters input,
.hgl-admin-filters select {
    width: 100%;
    min-width: 0;
}

.hgl-workspace {
    display: grid;
    grid-template-columns: minmax(360px, .85fr) minmax(480px, 1.15fr);
    gap: 14px;
    align-items: start;
}

.hgl-panel {
    overflow: hidden;
}

.hgl-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 56%, var(--hg-surface));
}

.hgl-panel-title strong {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 850;
}

.hgl-panel-title span {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
}

.hgl-product-list {
    max-height: calc(100vh - 178px);
    overflow: auto;
}

.hgl-new-product-panel {
    margin-bottom: 14px;
}

.hgl-new-product-grid {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr);
    gap: 18px;
    align-items: start;
}

.hgl-new-product-search,
.hgl-new-product-editor {
    min-width: 0;
}

.hgl-new-product-search {
    display: grid;
    gap: 10px;
}

.hgl-new-product-results {
    max-height: 360px;
    overflow: auto;
}

.hgl-new-product-actions {
    justify-content: flex-end;
}

.hgl-product-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    color: var(--hg-text);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto);
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 8px 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hgl-product-row:hover {
    background: rgba(46,125,50,.045);
}

.hgl-product-row.selected {
    background: rgba(46,125,50,.10);
    box-shadow: inset 3px 0 0 var(--hg-primary);
}

.hgl-row-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.hgl-row-actions button {
    min-height: 30px;
    border: 1px solid rgba(46,125,50,.24);
    border-radius: 999px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-row-actions button:first-child {
    background: var(--hg-primary);
    color: #fff;
}

.hgl-row-actions button:disabled {
    cursor: default;
    opacity: .6;
}

.hgl-product-main {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.hgl-product-id {
    width: 34px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(46,125,50,.11);
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
}

.hgl-product-main strong,
.hgl-product-main span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-product-main strong {
    font-size: 14px;
    font-weight: 760;
    line-height: 1.2;
}

.hgl-product-main span {
    color: var(--hg-text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.hgl-product-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 0;
}

.hgl-product-meta span {
    max-width: 190px;
    color: var(--hg-text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-preview-workspace {
    align-items: start;
}

.hgl-preview-row {
    width: 100%;
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-text);
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 54px;
    padding: 9px 12px;
    cursor: pointer;
}

.hgl-preview-row:hover {
    background: rgba(46,125,50,.045);
}

.hgl-preview-row > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.hgl-preview-product-row {
    grid-template-columns: 24px 46px minmax(180px, 1fr) minmax(120px, auto);
}

.hgl-preview-main {
    min-width: 0;
}

.hgl-preview-main strong,
.hgl-preview-main span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-preview-main strong {
    color: var(--hg-text);
    font-size: 14px;
    font-weight: 760;
    line-height: 1.2;
}

.hgl-preview-main span {
    color: var(--hg-text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.hgl-preview-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 0;
}

.hgl-preview-meta span {
    max-width: 190px;
    color: var(--hg-text-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-status-on,
.hgl-status-off,
.hgl-status-warn {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.hgl-status-on {
    background: rgba(34,197,94,.12);
    color: #166534;
}

.hgl-status-off {
    background: #FEF3C7;
    color: #92400E;
}

.hgl-status-warn {
    background: rgba(59,130,246,.12);
    color: #1D4ED8;
}

.hgl-origin-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
}

.hgl-origin-web {
    background: rgba(46,125,50,.12);
    color: var(--hg-primary);
}

.hgl-origin-legacy {
    background: rgba(100,116,139,.13);
    color: #475569;
}

.hgl-status-pending {
    background: #DBEAFE;
    color: #1D4ED8;
}

.hgl-status-error {
    background: #FEE2E2;
    color: #B91C1C;
}

.hgl-client-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-client-summary div {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--hg-border);
}

.hgl-client-summary div:last-child {
    border-right: 0;
}

.hgl-client-summary span,
.hgl-client-summary strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-client-summary span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.hgl-client-summary strong {
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 760;
}

.hgl-sync-message {
    grid-column: 1 / -1;
    border: 1px solid #FECACA;
    border-radius: 10px;
    background: #FEF2F2;
    color: #991B1B;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
}

.hgl-mapping-workspace {
    grid-template-columns: minmax(430px, .95fr) minmax(520px, 1.05fr);
}

.hgl-mapping-row.mapped:not(.selected) {
    background: rgba(34,197,94,.055);
}

.hgl-filter-check {
    align-self: end;
    min-height: 40px;
}

.hgl-mapping-summary {
    grid-template-columns: 1fr 1fr 1fr 110px;
}

.hgl-erp-selected {
    grid-column: 1 / -1;
    border: 1px solid rgba(46,125,50,.22);
    border-radius: 10px;
    background: rgba(46,125,50,.06);
    padding: 10px 12px;
}

.hgl-erp-selected span,
.hgl-erp-selected strong {
    display: block;
}

.hgl-erp-selected span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.hgl-erp-selected strong {
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 800;
}

.hgl-erp-results {
    margin: 10px 16px 0;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    overflow: hidden;
    max-height: 310px;
    overflow-y: auto;
}

.hgl-erp-row {
    width: 100%;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 46px;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    color: var(--hg-text);
    padding: 8px 10px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.hgl-erp-row:last-child {
    border-bottom: 0;
}

.hgl-erp-row:hover,
.hgl-erp-row.selected {
    background: rgba(46,125,50,.09);
}

.hgl-erp-row > span {
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 850;
}

.hgl-erp-row strong,
.hgl-erp-row small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-erp-row strong {
    font-size: 13px;
    font-weight: 800;
}

.hgl-erp-row small {
    color: var(--hg-text-muted);
    font-size: 12px;
}

.hgl-inline-loading {
    margin: 0;
    padding: 16px;
}

.hgl-empty-compact {
    margin: 0;
    padding: 18px;
}

.hgl-editor-panel {
    position: sticky;
    top: 22px;
}

.hgl-editor-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 58%, var(--hg-surface));
}

.hgl-editor-head span {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.hgl-editor-head h2 {
    margin: 2px 0 0;
    color: var(--hg-text);
    font-size: 18px;
    font-weight: 820;
    line-height: 1.2;
}

.hgl-detail-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.hgl-publish-diagnostic {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}

.hgl-publish-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.hgl-publish-summary strong {
    display: block;
    color: var(--hg-text);
    font-size: 16px;
    line-height: 1.25;
}

.hgl-publish-summary p {
    margin: 4px 0 0;
    color: var(--hg-muted);
    font-size: 13px;
    line-height: 1.4;
}

.hgl-publish-state {
    min-width: 82px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
}

.hgl-publish-checks {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.hgl-publish-check {
    min-height: 78px;
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    background: var(--hg-surface-soft);
}

.hgl-publish-check strong {
    color: var(--hg-text);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
}

.hgl-publish-check span {
    color: var(--hg-muted);
    font-size: 11px;
    line-height: 1.3;
}

.hgl-check-ok {
    border-color: color-mix(in srgb, var(--hg-success) 38%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-success) 10%, var(--hg-surface));
    color: var(--hg-success);
}

.hgl-check-warn {
    border-color: color-mix(in srgb, var(--hg-warning) 42%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-warning) 11%, var(--hg-surface));
    color: color-mix(in srgb, var(--hg-warning) 72%, var(--hg-text));
}

.hgl-check-off {
    border-color: var(--hg-border);
    background: var(--hg-surface-soft);
    color: var(--hg-muted);
}

.hgl-publish-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Liquidacion de comisiones */
.hgl-commission-filters {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, .35fr)) auto;
}

.hgl-commission-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.hgl-commission-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 10px 24px rgba(21, 36, 29, .05);
}

.hgl-commission-card span,
.hgl-commission-card small {
    display: block;
    color: var(--hg-text-muted);
    font-weight: 700;
}

.hgl-commission-card strong {
    display: block;
    margin: 4px 0;
    color: var(--hg-text);
    font-size: 1.55rem;
    line-height: 1.1;
}

.hgl-commission-card.is-pending {
    border-left: 4px solid var(--hg-success);
}

.hgl-commission-card.is-review {
    border-left: 4px solid var(--hg-warning);
}

.hgl-commission-card.is-sales {
    border-left: 4px solid var(--hg-text-muted);
}

.hgl-commission-card.is-void {
    border-left: 4px solid var(--hg-danger);
}

.hgl-commission-toolbar {
    margin-bottom: 12px;
}

.hgl-commission-tabs {
    max-width: 720px;
}

.hgl-commission-row {
    text-align: left;
}

.hgl-commission-detail-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hgl-commission-reason {
    margin: 0 0 12px;
    color: var(--hg-text-muted);
    font-weight: 700;
}

.hgl-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 16px 4px;
}

.hgl-editor > .hgl-editor-wide {
    grid-column: 1 / -1;
}

.hgl-editor label:nth-of-type(3),
.hgl-editor label:nth-of-type(4),
.hgl-editor label:nth-of-type(5),
.hgl-editor label:nth-of-type(6),
.hgl-editor .hg-list-sub {
    grid-column: 1 / -1;
}

.hgl-discount-ranges-editor {
    grid-column: 1 / -1;
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--hg-surface);
}

.hgl-discount-ranges-editor .hgl-subtitle {
    min-height: 40px;
    padding: 8px 10px;
}

.hgl-discount-ranges-editor .hg-secondary-action {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.hgl-range-empty {
    padding: 12px;
}

.hgl-discount-ranges-head,
.hgl-discount-ranges-row {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) minmax(70px, 1fr) minmax(86px, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
}

.hgl-discount-ranges-head {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.hgl-discount-ranges-row {
    border-top: 1px solid var(--hg-border);
}

.hgl-discount-ranges-row .hgl-drawer-close {
    min-width: 64px;
    height: 34px;
    font-size: 12px;
}

.hgl-discount-template-picker {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 10px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: var(--hg-surface-soft);
    padding: 12px;
}

.hgl-discount-template-picker label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.hgl-discount-template-picker small {
    grid-column: 1 / -1;
    color: var(--hg-text-muted);
}

.hgl-discount-template-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.hgl-discount-template-card {
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
}

.hgl-discount-template-fields {
    display: grid;
    grid-template-columns: minmax(180px, .9fr) minmax(260px, 1.5fr) auto auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-discount-template-fields > label:not(.hg-check-inline) {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.hgl-discount-template-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--hg-border);
}

@media (max-width: 760px) {
    .hgl-discount-template-picker,
    .hgl-discount-template-fields {
        grid-template-columns: 1fr;
    }

    .hgl-discount-template-picker button,
    .hgl-discount-template-actions button {
        width: 100%;
    }

    .hgl-discount-template-fields .hg-check-inline {
        justify-content: flex-start;
    }
}

.hgl-textarea {
    line-height: 1.45;
}

.hgl-desc {
    min-height: 132px;
}

.hgl-ai-tools,
.hgl-ai-suggestion {
    grid-column: 1 / -1;
}

.hgl-ai-tools {
    display: grid;
    grid-template-columns: minmax(150px, 220px) auto;
    align-items: end;
    gap: 10px;
}

.hgl-ai-tools label {
    display: grid;
    gap: 5px;
}

.hgl-ai-suggestion {
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    background: var(--hg-surface-soft);
    padding: 12px;
}

.hgl-ai-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.hgl-ai-columns label {
    display: grid;
    gap: 5px;
}

.hgl-ai-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
}

.hgl-ai-actions span {
    margin-right: auto;
    color: var(--hg-muted);
    font-size: 12px;
}

.hgl-product-image-editor {
    display: grid;
    grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    min-width: 0;
}

.hgl-product-image-preview {
    aspect-ratio: 1;
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    background: var(--hg-surface-soft);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--hg-muted);
    font-size: 12px;
}

.hgl-product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hgl-product-image-controls {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
}

.hgl-product-image-controls > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.hgl-brand-editor {
    margin-top: 16px;
}

.hgl-brand-editor-list {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.hgl-brand-editor-row {
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    background: var(--hg-surface);
    display: grid;
    gap: 10px;
    padding: 12px;
}

.hgl-brand-editor-main {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(130px, .8fr) 84px 120px minmax(110px, .7fr) minmax(160px, 1fr);
    gap: 10px;
}

.hgl-brand-editor-row label {
    display: grid;
    gap: 5px;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 800;
}

.hgl-brand-editor-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--hg-muted);
    font-size: 12px;
}

@media (max-width: 720px) {
    .hgl-ai-tools,
    .hgl-ai-columns,
    .hgl-product-image-editor {
        grid-template-columns: 1fr;
    }

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

    .hgl-publish-summary {
        grid-template-columns: 1fr;
    }

    .hgl-commission-filters,
    .hgl-commission-summary,
    .hgl-commission-detail-summary {
        grid-template-columns: 1fr;
    }

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

    .hgl-ai-tools button,
    .hgl-ai-actions button,
    .hgl-product-image-controls button,
    .hgl-publish-links a {
        width: 100%;
    }
}

/* Laboratorio de palabras de Google Ads */
.hg-keyword-lab { display: grid; gap: 16px; }
.hg-keyword-hero p { max-width: 760px; }
.hg-keyword-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hg-keyword-summary article { position: relative; overflow: hidden; min-height: 126px; border: 1px solid var(--hg-border); border-radius: 18px; background: var(--hg-surface); padding: 20px; }
.hg-keyword-summary article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--hg-primary); }
.hg-keyword-summary span, .hg-keyword-summary strong, .hg-keyword-summary small { display: block; }
.hg-keyword-summary span { color: var(--hg-text-muted); font-size: 12px; }
.hg-keyword-summary strong { margin: 10px 0 5px; color: var(--hg-text); font-size: clamp(24px, 3vw, 38px); font-weight: 650; line-height: 1; }
.hg-keyword-summary small { color: var(--hg-primary); font-size: 11px; }
.hg-keyword-tabs { display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; border: 1px solid var(--hg-border); border-radius: 16px; background: var(--hg-surface); }
.hg-keyword-tabs button { border: 0; border-right: 1px solid var(--hg-border); background: transparent; color: var(--hg-text-muted); padding: 15px; font: inherit; font-size: 12px; cursor: pointer; }
.hg-keyword-tabs button:last-child { border-right: 0; }
.hg-keyword-tabs button.is-active { background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-surface)); color: var(--hg-primary); font-weight: 750; }
.hg-keyword-ai, .hg-keyword-create, .hg-keyword-table-panel, .hg-keyword-history { overflow: hidden; }
.hg-keyword-explanation { margin: 0; border-bottom: 1px solid var(--hg-border); padding: 0 20px 18px; color: var(--hg-text-muted); font-size: 12px; }
.hg-keyword-suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.hg-keyword-suggestions article { display: flex; flex-direction: column; min-height: 230px; border: 1px solid var(--hg-border); border-radius: 16px; background: var(--hg-surface); padding: 16px; }
.hg-keyword-suggestions article > div { display: flex; justify-content: space-between; gap: 8px; color: var(--hg-primary); font-size: 10px; text-transform: uppercase; }
.hg-keyword-suggestions h3 { margin: 16px 0 6px; font-size: 16px; font-weight: 700; }
.hg-keyword-suggestions article > strong { font-size: 14px; }
.hg-keyword-suggestions p { flex: 1; color: var(--hg-text-muted); font-size: 12px; line-height: 1.5; }
.hg-keyword-suggestions article > small { margin-bottom: 12px; color: var(--hg-text-muted); font-size: 10px; }
.hg-keyword-suggestions article > button, .hg-keyword-form > button { border: 0; border-radius: 12px; background: var(--hg-primary); color: white; padding: 11px 14px; font: inherit; font-size: 12px; cursor: pointer; }
.hg-keyword-form { display: grid; grid-template-columns: 2fr 1fr 1.5fr auto; align-items: end; gap: 12px; padding: 18px; }
.hg-keyword-form label { display: grid; gap: 6px; color: var(--hg-text-muted); font-size: 10px; text-transform: uppercase; }
.hg-keyword-form input, .hg-keyword-form select, .hg-keyword-inline-edit input, .hg-keyword-inline-edit select { min-height: 42px; border: 1px solid var(--hg-border); border-radius: 10px; background: var(--hg-surface); color: var(--hg-text); padding: 8px 10px; font: inherit; font-size: 12px; }
.hg-keyword-table td strong, .hg-keyword-table td small { display: block; }
.hg-keyword-table td small { margin-top: 4px; color: var(--hg-text-muted); font-size: 9px; }
.hg-keyword-row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 190px; }
.hg-keyword-row-actions button, .hg-keyword-inline-edit button { border: 1px solid color-mix(in srgb, var(--hg-primary) 40%, var(--hg-border)); border-radius: 9px; background: transparent; color: var(--hg-primary); padding: 7px 9px; font: inherit; font-size: 10px; cursor: pointer; }
.hg-keyword-row-actions button.is-negative { border-color: color-mix(in srgb, var(--hg-danger) 45%, var(--hg-border)); color: var(--hg-danger); }
.hg-keyword-inline-edit { display: grid; grid-template-columns: minmax(160px, 1fr) 100px auto auto; gap: 6px; min-width: 460px; }
.hg-keyword-history article { display: grid; grid-template-columns: 130px minmax(180px, .7fr) 1fr auto; gap: 16px; align-items: center; border-top: 1px solid var(--hg-border); padding: 14px 18px; font-size: 11px; }
.hg-keyword-history time, .hg-keyword-history small { color: var(--hg-text-muted); }
.hg-keyword-empty { padding: 20px; color: var(--hg-text-muted); }
@media (max-width: 1050px) { .hg-keyword-summary { grid-template-columns: repeat(2, 1fr); } .hg-keyword-suggestions { grid-template-columns: repeat(2, 1fr); } .hg-keyword-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .hg-keyword-summary, .hg-keyword-suggestions, .hg-keyword-form { grid-template-columns: 1fr; } .hg-keyword-tabs { grid-template-columns: 1fr 1fr; } .hg-keyword-tabs button:nth-child(2) { border-right: 0; } .hg-keyword-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--hg-border); } .hg-keyword-history article { grid-template-columns: 1fr; gap: 5px; } }

/* Inicio: jerarquía por tamaño y color, sin pesos tipográficos fuertes. */
.hg-dashboard-page .hg-dashboard-kpi span {
  font-size: 10.5px;
  font-weight: 820;
}

.hg-dashboard-page .hg-dashboard-kpi strong {
  font-size: clamp(24px, 2.05vw, 32px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.hg-dashboard-page .hg-dashboard-kpi small {
  margin-top: 7px;
  font-size: 10.5px;
  font-weight: 650;
}

.hg-dashboard-page .hg-dashboard-panel .hgl-panel-title strong {
  font-weight: 700 !important;
}

.hg-campaign-structure-button {
  display: grid;
  gap: 2px;
  min-width: 120px;
  border: 0;
  background: transparent;
  color: var(--hg-primary);
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hg-campaign-structure-button strong { font-size: 11px; }
.hg-campaign-structure-button small { color: var(--hg-text-muted); font-size: 9px; }
.hg-marketing-table .hg-campaign-detail-row td {
  border-bottom: 1px solid var(--hg-border);
  background: color-mix(in srgb, var(--hg-primary) 3%, var(--hg-surface));
  padding: 0;
}
.hg-campaign-structure {
  display: grid;
  grid-template-columns: .8fr 1.4fr 1.2fr;
}
.hg-campaign-structure > div {
  display: grid;
  gap: 5px;
  border-right: 1px solid var(--hg-border);
  padding: 14px 16px;
}
.hg-campaign-structure > div:last-child { border-right: 0; }
.hg-campaign-structure span {
  color: var(--hg-text-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hg-campaign-structure strong {
  color: var(--hg-text);
  font-size: 10px;
  line-height: 1.45;
}
.hg-campaign-structure .hg-campaign-diagnosis { border-left: 3px solid #d89b17; }

.hg-marketing-improvement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--hg-border);
}
.hg-marketing-improvement-grid article {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 150px;
  border-right: 1px solid var(--hg-border);
  background: var(--hg-surface);
  padding: 16px;
}
.hg-marketing-improvement-grid article:last-child { border-right: 0; }
.hg-marketing-improvement-grid b {
  color: var(--hg-primary);
  font-size: 10px;
  letter-spacing: .08em;
}
.hg-marketing-improvement-grid span {
  color: var(--hg-text-muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}
.hg-marketing-improvement-grid strong { color: var(--hg-text); font-size: 13px; }
.hg-marketing-improvement-grid p {
  margin: 0;
  color: var(--hg-text-muted);
  font-size: 10px;
  line-height: 1.5;
}
.hg-marketing-improvement-grid article > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.hg-marketing-improvement-grid a {
  border: 1px solid var(--hg-border);
  border-radius: 999px;
  color: var(--hg-primary);
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 720px) {
  .hg-campaign-structure { grid-template-columns: 1fr; }
  .hg-campaign-structure > div { border-right: 0; border-bottom: 1px solid var(--hg-border); }
  .hg-marketing-improvement-grid { grid-template-columns: 1fr; }
  .hg-marketing-improvement-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--hg-border); }
}

@media (max-width: 430px) {
    .hgl-publish-checks {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1120px) {
    .hgl-brand-editor-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .hgl-brand-editor-main {
        grid-template-columns: 1fr;
    }
}

.hgl-active-check {
    justify-content: flex-start;
    min-height: 32px;
    padding: 2px 0;
}

.hgl-editor-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px 16px;
}

.hgl-editor-actions button,
.hgl-editor-action-link {
    align-items: center;
    min-height: 38px;
    border: 1px solid var(--hg-primary);
    border-radius: 10px;
    background: var(--hg-primary);
    color: white;
    display: inline-flex;
    justify-content: center;
    padding: 8px 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.hgl-editor-action-link:hover {
    color: white;
    filter: brightness(.96);
    text-decoration: none;
}

.hgl-editor-actions button:disabled {
    cursor: default;
    opacity: .6;
}

.hgl-coupon-filters {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hgl-coupon-filters button {
    justify-self: start;
    min-width: 140px;
    min-height: 40px;
    border: 1px solid var(--hg-primary);
    border-radius: 10px;
    background: var(--hg-primary);
    color: #fff;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-price-filters {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hgl-price-load-actions {
    display: flex;
}

.hgl-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.hgl-filter-actions button {
    min-height: 40px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 10px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-filter-actions .hg-primary-action {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}

.hgl-filter-actions .hg-danger-soft-action {
    border-color: #FECDD3;
    background: #FFF1F2;
    color: var(--hg-danger);
}

.hgl-filter-actions button:disabled {
    cursor: default;
    opacity: .6;
}

.hgl-price-workspace {
    grid-template-columns: minmax(420px, .95fr) minmax(500px, 1.05fr);
}

.hgl-price-grid-workspace {
    grid-template-columns: minmax(720px, 1fr) minmax(360px, .42fr);
}

.hgl-price-grid-panel {
    max-height: calc(100vh - 178px);
    overflow: hidden;
}

.hgl-price-table-wrap {
    max-height: calc(100vh - 221px);
    overflow: auto;
}

.hgl-price-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.hgl-price-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 36px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 72%, var(--hg-surface));
    color: var(--hg-text-muted);
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.hgl-price-table td {
    height: 42px;
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-text);
    padding: 6px 8px;
    font-size: 12px;
    vertical-align: middle;
}

.hgl-price-table tbody tr {
    cursor: pointer;
}

.hgl-price-table tbody tr:hover {
    background: rgba(46,125,50,.045);
}

.hgl-price-table tbody tr.selected {
    background: rgba(46,125,50,.10);
    box-shadow: inset 3px 0 0 var(--hg-primary);
}

.hgl-price-table tbody tr.publish:not(.selected) {
    background: rgba(34,197,94,.05);
}

.hgl-price-table .check {
    width: 44px;
    text-align: center;
}

.hgl-price-table .id {
    width: 52px;
    color: var(--hg-primary);
    font-weight: 850;
}

.hgl-price-table .producto {
    width: 230px;
}

.hgl-price-table .erp {
    width: 160px;
}

.hgl-price-table .money {
    width: 96px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hgl-price-table .money.edit {
    width: 112px;
}

.hgl-price-table .estado {
    width: 112px;
    text-align: right;
}

.hgl-price-table .positive {
    color: #166534;
}

.hgl-price-table .negative {
    color: #B91C1C;
}

.hgl-price-table strong,
.hgl-price-table span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-price-table strong {
    color: var(--hg-text);
    font-size: 12px;
    font-weight: 800;
}

.hgl-price-table span {
    color: var(--hg-text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.hgl-price-cell-input {
    width: 100%;
    min-height: 30px;
    padding: 4px 7px;
    text-align: right;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.hgl-price-meta span {
    max-width: 250px;
}

.hgl-price-detail .hgl-editor {
    padding-bottom: 10px;
}

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

.hgl-price-actions button:not(:last-child) {
    border-color: rgba(46,125,50,.28);
    background: var(--hg-surface);
    color: var(--hg-primary);
}

.hgl-coupon-row:not(.selected):has(.hgl-status-on) {
    background: rgba(34,197,94,.045);
}

.hgl-coupon-workspace {
    grid-template-columns: minmax(380px, .8fr) minmax(520px, 1.2fr);
}

.hgl-coupon-workspace .hgl-detail-drawer.hgl-editor-panel {
    background: var(--hg-surface);
}

.hgl-coupon-summary {
    grid-template-columns: 120px minmax(0, 1fr) 140px 70px;
}

.hgl-coupon-editor label:nth-of-type(3),
.hgl-coupon-editor label:nth-of-type(4),
.hgl-coupon-editor label:nth-of-type(5),
.hgl-coupon-editor label:nth-of-type(6),
.hgl-coupon-editor label:nth-of-type(7),
.hgl-coupon-editor label:nth-of-type(8) {
    grid-column: auto;
}

.hgl-coupon-editor label:nth-of-type(12),
.hgl-coupon-editor label:nth-of-type(13) {
    grid-column: 1 / -1;
}

.hgl-coupon-new-action {
    justify-self: start;
    min-width: 150px;
}

.hgl-coupon-editor {
    align-items: start;
}

.hgl-coupon-editor .hg-input {
    background: var(--hg-input-bg, var(--hg-surface));
}

.hgl-coupon-pro-selector {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(46,125,50,.16);
    border-radius: 13px;
    background: color-mix(in srgb, var(--hg-surface) 92%, rgba(46,125,50,.08));
}

.hgl-coupon-pro-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.hgl-coupon-pro-head label {
    margin: 0;
}

.hgl-coupon-pro-head button,
.hgl-coupon-pro-selected button {
    width: auto;
    min-width: 124px;
    min-height: 40px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-coupon-pro-head button:hover,
.hgl-coupon-pro-selected button:hover {
    background: rgba(46,125,50,.08);
}

.hgl-coupon-pro-head button:disabled,
.hgl-coupon-pro-selected button:disabled {
    cursor: default;
    opacity: .62;
}

.hgl-coupon-pro-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(46,125,50,.18);
    border-radius: 11px;
    background: var(--hg-surface);
}

.hgl-coupon-pro-selected div {
    min-width: 0;
}

.hgl-coupon-pro-selected span,
.hgl-coupon-pro-selected strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-coupon-pro-selected span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-coupon-pro-selected strong {
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 820;
}

.hgl-coupon-pro-message {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.hgl-coupon-pro-results {
    display: grid;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.hgl-coupon-pro-results button {
    appearance: none;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    min-height: 50px;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    color: var(--hg-text);
    padding: 9px 11px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hgl-coupon-pro-results button:last-child {
    border-bottom: 0;
}

.hgl-coupon-pro-results button:hover {
    background: rgba(46,125,50,.07);
}

.hgl-coupon-pro-results strong,
.hgl-coupon-pro-results span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-coupon-pro-results strong {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 820;
}

.hgl-coupon-pro-results span {
    grid-column: 1 / 2;
    color: var(--hg-text-muted);
    font-size: 12px;
}

.hgl-coupon-pro-results em {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
}

.hgl-coupon-margin {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(190px, .42fr) minmax(240px, 1fr) auto;
    gap: 10px 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(46,125,50,.18);
    border-radius: 12px;
    background: color-mix(in srgb, var(--hg-surface) 92%, rgba(46,125,50,.08));
}

.hgl-coupon-margin > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hgl-coupon-margin span {
    display: block;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-coupon-margin strong {
    color: var(--hg-primary);
    font-size: 18px;
    font-weight: 800;
}

.hgl-coupon-margin button {
    justify-self: end;
    width: auto;
    min-width: 136px;
    min-height: 38px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    font-weight: 800;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.hgl-coupon-editor .hg-check-inline {
    align-self: end;
}

.hgl-coupon-editor .hgl-active-check input {
    width: 18px;
    height: 18px;
}

.hgl-coupon-margin-list {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-coupon-margin-list .hg-input {
    min-height: 38px;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.hgl-coupon-margin p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.hgl-coupon-margin .hgl-coupon-list-warning {
    color: #92400E;
    font-weight: 760;
}

.hgl-coupon-margin-ok {
    border-color: rgba(46,125,50,.32);
    background: rgba(46,125,50,.07);
}

.hgl-coupon-margin-warn {
    border-color: rgba(245,158,11,.5);
    background: rgba(245,158,11,.08);
}

.hgl-coupon-margin-warn strong,
.hgl-coupon-margin-warn p:last-child {
    color: #B45309;
}

.hgl-coupon-workspace .hgl-editor-actions {
    justify-content: flex-start;
    background: var(--hg-surface);
}

.hgl-coupon-workspace .hgl-editor-actions .hg-secondary-action {
    border-color: rgba(46,125,50,.28);
    background: var(--hg-surface);
    color: var(--hg-primary);
}

.hgl-coupon-workspace .hgl-editor-actions .hg-danger-action {
    border-color: #fecaca;
    background: #fff1f2;
    color: var(--hg-danger);
}

@media (max-width: 720px) {
    .hgl-coupon-pro-head,
    .hgl-coupon-margin {
        grid-template-columns: 1fr;
    }

    .hgl-coupon-pro-head button,
    .hgl-coupon-margin button {
        justify-self: stretch;
        width: 100%;
    }

    .hgl-coupon-pro-selected {
        align-items: stretch;
        flex-direction: column;
    }

    .hgl-coupon-pro-selected button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .hgl-coupon-pro-results button {
        grid-template-columns: 1fr;
    }

    .hgl-coupon-pro-results em {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }
}

.hgl-legacy-workspace {
    grid-template-columns: minmax(340px, .52fr) minmax(720px, 1.48fr);
}

.hgl-legacy-list {
    max-height: calc(100vh - 178px);
}

.hgl-legacy-row {
    grid-template-columns: minmax(0, 1fr) 128px;
}

.hgl-legacy-row .hgl-product-id {
    width: 54px;
}

.hgl-drawer-page .hgl-workspace,
.hgl-drawer-page .hgl-legacy-workspace,
.hgl-drawer-page.hgl-orders-page .hgl-legacy-workspace {
    grid-template-columns: 1fr;
}

.hgl-drawer-page .hgl-product-list,
.hgl-drawer-page .hgl-legacy-list,
.hgl-drawer-page.hgl-orders-page .hgl-legacy-list,
.hgl-drawer-page .hgl-price-grid-panel,
.hgl-drawer-page .hgl-price-table-wrap {
    max-height: none;
}

.hgl-drawer-page .hgl-legacy-row,
.hgl-drawer-page.hgl-orders-page .hgl-legacy-row {
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
    min-height: 66px;
}

.hgl-client-final-row {
    min-height: 58px;
    padding-block: 7px;
}

.hgl-client-final-row .hgl-product-main > div {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.hgl-client-final-row .hgl-product-main strong {
    flex: 0 1 auto;
}

.hgl-client-final-row .hgl-product-main span:not(.hgl-product-id) {
    margin-top: 0;
    flex: 1 1 auto;
}

.hgl-client-final-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.hgl-client-final-meta span {
    max-width: none;
    white-space: nowrap;
}

.hgl-detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    border: 0;
    background: rgba(15, 23, 42, .20);
    cursor: default;
}

.hgl-detail-drawer {
    position: fixed;
    top: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 81;
    width: min(860px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

.hgl-detail-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.hgl-drawer-close {
    min-height: 34px;
    border: 1px solid rgba(46,125,50,.28);
    border-radius: 999px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 6px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-legacy-detail {
    min-width: 0;
}

.hgl-legacy-summary {
    grid-template-columns: 150px 120px 80px minmax(0, 1fr);
}

.hgl-legacy-address {
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-legacy-address span,
.hgl-legacy-address strong {
    display: block;
    min-width: 0;
}

.hgl-legacy-address span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.hgl-legacy-address strong {
    margin-top: 4px;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 760;
}

.hgl-subtitle {
    border-top: 0;
}

.hgl-legacy-items {
    overflow-x: auto;
}

.hgl-legacy-items-head,
.hgl-legacy-item {
    display: grid;
    grid-template-columns: 58px minmax(180px, 1.2fr) minmax(150px, .9fr) 100px;
    gap: 10px;
    align-items: center;
    min-width: 640px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-legacy-items-head {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--hg-bg) 60%, var(--hg-surface));
}

.hgl-legacy-item {
    color: var(--hg-text);
    font-size: 13px;
}

.hgl-legacy-item > span:first-child {
    text-align: center;
    color: var(--hg-primary);
    font-weight: 850;
}

.hgl-legacy-item strong,
.hgl-legacy-item small,
.hgl-legacy-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-legacy-item small {
    display: block;
    margin-top: 2px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 700;
}

.hgl-legacy-item > strong:last-child {
    text-align: right;
}

.hgl-legacy-raw {
    padding: 12px 16px 16px;
}

.hgl-legacy-raw summary {
    color: var(--hg-text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
}

.hgl-legacy-raw pre,
.hgl-migration-output {
    margin: 10px 0 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--hg-bg) 72%, var(--hg-surface));
    color: var(--hg-text);
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.hgl-migration-workspace {
    grid-template-columns: minmax(320px, .65fr) minmax(520px, 1.35fr);
}

.hgl-migration-controls {
    grid-template-columns: 1fr 1fr;
}

.hgl-migration-options {
    display: grid;
    gap: 10px;
    padding: 14px 16px 4px;
}

.hgl-migration-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px 16px;
}

.hgl-migration-actions button {
    min-height: 40px;
    border: 1px solid var(--hg-primary);
    border-radius: 10px;
    background: var(--hg-primary);
    color: #fff;
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-migration-actions button:disabled {
    cursor: default;
    opacity: .6;
}

.hgl-migration-output {
    min-height: 300px;
    max-height: calc(100vh - 260px);
    margin: 0;
    border: 0;
    border-radius: 0;
}

.hgl-control-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .05);
    overflow-x: auto;
    scrollbar-width: thin;
}

.hgl-control-tabs button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--hg-text-muted);
    padding: 8px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.hgl-control-tabs button:hover {
    background: color-mix(in srgb, var(--hg-primary) 8%, transparent);
    color: var(--hg-primary);
}

.hgl-control-tabs button.active {
    background: color-mix(in srgb, var(--hg-primary) 88%, #fff 12%);
    border-color: color-mix(in srgb, var(--hg-primary) 82%, #fff 18%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(46, 125, 50, .14);
}

:root[data-theme="dark"] .hgl-control-tabs {
    background: color-mix(in srgb, var(--hg-surface) 86%, #000);
}

:root[data-theme="dark"] .hgl-control-tabs button.active {
    background: color-mix(in srgb, var(--hg-primary) 68%, #111827 32%);
    border-color: rgba(134, 239, 172, .24);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}

.hgl-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.hgl-control-grid-narrow {
    grid-template-columns: minmax(0, 900px);
    max-width: 980px;
}

.hgl-control-card {
    overflow: hidden;
}

.hgl-control-card .hgl-store-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.hgl-control-card .hgl-store-config-grid label {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--hg-bg) 42%, var(--hg-surface));
}

.hgl-control-card .hgl-store-config-grid .hg-input {
    margin-top: 0;
}

.hgl-control-card .hgl-control-actions {
    gap: 12px;
    padding: 0 18px 18px;
}

.hgl-control-card .hgl-control-actions button {
    min-height: 44px;
    border-radius: 12px;
}

.hgl-brand-multiples {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
}

.hgl-brand-multiple-row {
    align-items: center;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(180px, 1fr) 150px 120px;
    padding: 10px 12px;
}

.hgl-brand-multiple-row strong {
    color: var(--hg-text);
    font-size: .95rem;
}

.hgl-brand-multiple-row label {
    display: grid;
    gap: 4px;
    margin: 0;
}

.hgl-brand-multiple-row .hg-input {
    margin: 0;
}

.hgl-brand-multiple-empty {
    color: var(--hg-muted);
    padding: 12px 2px;
}

.hgl-control-card-wide {
    grid-column: 1 / -1;
}

.hgl-control-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px 16px;
}

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

.hgl-control-links-single {
    grid-template-columns: 1fr;
    padding-top: 10px;
}

.hgl-control-link {
    min-height: 88px;
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 20%, var(--hg-border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
    color: var(--hg-text);
    padding: 14px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.hgl-control-link:hover {
    border-color: color-mix(in srgb, var(--hg-primary) 42%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 9%, var(--hg-surface));
}

.hgl-control-link strong {
    display: block;
    color: var(--hg-primary);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
}

.hgl-control-link span {
    display: block;
    margin-top: 6px;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.hgl-control-actions {
    grid-template-columns: repeat(2, minmax(0, 220px));
    justify-content: start;
}

.hgl-control-periods {
    padding: 14px 16px 0;
}

.hgl-control-output-preview {
    max-width: 900px;
}

.hgl-control-output-preview .hgl-migration-output {
    min-height: 120px;
    max-height: 180px;
}


.hgl-order-filters {
    grid-template-columns: minmax(320px, 1fr) minmax(220px, .42fr) auto;
}

.hg-marketing-page {
    gap: 16px;
}

.hg-marketing-workspace-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-border);
    box-shadow: var(--hg-shadow-soft);
}

.hg-marketing-workspace-nav a {
    min-width: 0;
    background: var(--hg-surface);
    color: var(--hg-text);
    padding: 14px 15px;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.hg-marketing-workspace-nav a:hover,
.hg-marketing-workspace-nav a.is-active {
    background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-workspace-nav span,
.hg-marketing-workspace-nav small { display: block; }
.hg-marketing-workspace-nav span { font-size: 12px; font-weight: 800; }
.hg-marketing-workspace-nav small { margin-top: 3px; color: var(--hg-text-muted); font-size: 9px; line-height: 1.25; }

.hg-marketing-local-tabs,
.hg-clarity-tabs,
.hg-builder-mode-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.hg-marketing-local-tabs {
    position: sticky;
    z-index: 5;
    top: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-surface) 94%, transparent);
    padding: 6px;
    box-shadow: 0 8px 24px rgba(20, 45, 29, .08);
    backdrop-filter: blur(12px);
}

.hg-marketing-local-tabs a,
.hg-clarity-tabs a {
    flex: 1 0 auto;
    border-radius: 999px;
    color: var(--hg-text-muted);
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
}

.hg-marketing-local-tabs a:hover,
.hg-clarity-tabs a:hover,
.hg-clarity-tabs a.is-active {
    background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-anchor { scroll-margin-top: 74px; }

.hg-google-keyword-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid color-mix(in srgb, var(--hg-primary) 28%, var(--hg-border));
    border-radius: 16px;
    background: color-mix(in srgb, var(--hg-primary) 6%, var(--hg-surface));
    padding: 16px 18px;
}

.hg-google-keyword-entry span,
.hg-google-keyword-entry strong,
.hg-google-keyword-entry small { display: block; }
.hg-google-keyword-entry span { color: var(--hg-primary); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hg-google-keyword-entry strong { margin-top: 3px; font-size: 16px; }
.hg-google-keyword-entry small { margin-top: 4px; color: var(--hg-text-muted); font-size: 10px; }
.hg-google-keyword-entry > a { flex: 0 0 auto; border-radius: 999px; background: var(--hg-primary); color: #fff; padding: 10px 14px; font-size: 10px; font-weight: 800; text-decoration: none; }

.hg-marketing-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg, #174f2c, #2f7d47 58%, #4e9661);
    color: #fff;
    padding: 24px;
    box-shadow: 0 18px 42px rgba(22, 78, 43, .2);
}

.hg-marketing-hero h1 {
    margin: 3px 0 7px;
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
}

.hg-marketing-hero p {
    margin: 0;
    color: rgba(255,255,255,.78);
    font-size: 14px;
    font-weight: 650;
}

.hg-marketing-eyebrow {
    color: #bff3cb;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hg-ui-tabs {
    --hg-ui-tabs-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--hg-ui-tabs-columns), minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    padding: 7px;
    box-shadow: var(--hg-shadow-soft);
}

.hg-analytics-quality-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--hg-border);
}

.hg-analytics-quality-grid > div {
    min-width: 0;
    background: var(--hg-surface);
    padding: 18px;
}

.hg-analytics-quality-grid span,
.hg-analytics-quality-grid strong,
.hg-analytics-quality-grid small {
    display: block;
}

.hg-analytics-quality-grid span { color: var(--hg-text-muted); font-size: 11px; font-weight: 800; }
.hg-analytics-quality-grid strong { margin-top: 6px; color: var(--hg-text); font-size: 21px; }
.hg-analytics-quality-grid small { margin-top: 5px; color: var(--hg-primary); font-size: 10px; font-weight: 700; }

.hg-analytics-trend {
    display: flex;
    align-items: end;
    gap: 4px;
    height: 150px;
    overflow-x: auto;
    border-top: 1px solid var(--hg-border);
    padding: 18px 18px 8px;
}

.hg-analytics-trend > div {
    display: grid;
    grid-template-rows: 1fr 18px;
    align-items: end;
    flex: 1 0 22px;
    height: 100%;
    min-width: 18px;
}

.hg-analytics-trend i { width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #70bd82, var(--hg-primary)); }
.hg-analytics-trend span { overflow: hidden; color: var(--hg-text-muted); font-size: 8px; text-align: center; white-space: nowrap; }
.hg-analytics-funnel-list { display: grid; gap: 1px; background: var(--hg-border); }
.hg-analytics-funnel-row { display: grid; grid-template-columns: 34px minmax(220px, .9fr) minmax(180px, 1.4fr) 110px; gap: 16px; align-items: center; background: var(--hg-surface); padding: 15px 18px; }
.hg-analytics-funnel-index { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #b9d5c0; border-radius: 999px; color: var(--hg-primary); font-size: 11px; font-weight: 800; }
.hg-analytics-funnel-copy strong, .hg-analytics-funnel-copy small, .hg-analytics-funnel-value strong, .hg-analytics-funnel-value small { display: block; }
.hg-analytics-funnel-copy strong { color: var(--hg-text); font-size: 13px; }
.hg-analytics-funnel-copy small { margin-top: 3px; color: var(--hg-text-muted); font-size: 10px; }
.hg-analytics-funnel-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e9f0eb; }
.hg-analytics-funnel-track i { display: block; min-width: 3px; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hg-primary), #74b783); }
.hg-analytics-funnel-value { text-align: right; }
.hg-analytics-funnel-value strong { color: var(--hg-text); font-size: 18px; }
.hg-analytics-funnel-value small { margin-top: 2px; color: var(--hg-primary); font-size: 9px; font-weight: 750; }
.hg-analytics-funnel-note { margin: 0; border-top: 1px solid var(--hg-border); padding: 12px 18px; color: var(--hg-text-muted); font-size: 10px; }
.hg-analytics-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.hg-analytics-table { min-width: 620px; }
.hg-analytics-table td small { display: block; max-width: 300px; overflow: hidden; margin-top: 3px; color: var(--hg-text-muted); text-overflow: ellipsis; }

.hg-sales-evolution { overflow: hidden; }
.hg-sales-evolution-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--hg-border); }
.hg-sales-evolution-summary > div { background: var(--hg-surface); padding: 15px 18px; }
.hg-sales-evolution-summary span, .hg-sales-evolution-summary strong, .hg-sales-evolution-summary small { display: block; }
.hg-sales-evolution-summary span { color: var(--hg-text-muted); font-size: 11px; font-weight: 850; }
.hg-sales-evolution-summary span i { display: inline-block; width: 18px; height: 3px; margin: 0 7px 3px 0; border-radius: 99px; background: var(--hg-primary); }
.hg-sales-evolution-summary .is-third-party span i { background: #2878c8; }
.hg-sales-evolution-summary strong { margin-top: 5px; color: var(--hg-text); font-size: 22px; }
.hg-sales-evolution-summary small { margin-top: 4px; color: var(--hg-text-muted); font-size: 10px; font-weight: 650; }
.hg-sales-chart { position: relative; height: 290px; padding: 18px 18px 30px; }
.hg-sales-chart svg { width: 100%; height: 240px; overflow: visible; }
.hg-sales-chart line { stroke: var(--hg-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hg-sales-chart polyline { fill: none; stroke: var(--hg-primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hg-sales-chart polyline.is-third-party { stroke: #2878c8; }
.hg-sales-chart circle { fill: var(--hg-surface); stroke: var(--hg-primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hg-sales-chart circle.is-third-party { stroke: #2878c8; }
.hg-sales-chart-labels { position: absolute; right: 18px; bottom: 12px; left: 18px; height: 18px; }
.hg-sales-chart-labels span { position: absolute; color: var(--hg-text-muted); font-size: 9px; font-weight: 700; transform: translateX(-50%); white-space: nowrap; }
.hg-sales-chart-note { margin: 0; border-top: 1px solid var(--hg-border); color: var(--hg-text-muted); padding: 11px 18px 14px; font-size: 10px; }
.hg-sales-chart-empty { color: var(--hg-text-muted); padding: 24px 18px; font-size: 12px; }

.hg-ui-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 60px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--hg-text-muted);
    padding: 10px 14px;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.hg-ui-tab:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--hg-primary) 16%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
    color: var(--hg-primary);
    text-decoration: none;
}

.hg-ui-tab:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--hg-primary) 22%, transparent);
    outline-offset: 2px;
}

.hg-ui-tab.is-active {
    border-color: color-mix(in srgb, var(--hg-primary) 28%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-surface));
    color: var(--hg-primary);
    box-shadow: 0 8px 18px rgba(46, 125, 50, .09);
}

.hg-ui-tab-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hg-ui-tab-copy strong {
    color: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.hg-ui-tab-copy small {
    color: inherit;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.3;
    opacity: .78;
}

.hg-ui-tab-icon,
.hg-ui-tab-trailing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hg-ui-tab-trailing {
    margin-left: auto;
}

.hg-ui-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 10%, transparent);
    padding: 4px 8px;
    color: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.hg-ui-tab:disabled {
    cursor: default;
    opacity: .55;
}

:root[data-theme="dark"] .hg-ui-tab.is-active {
    background: color-mix(in srgb, var(--hg-primary) 17%, var(--hg-surface));
}

.hg-marketing-periods {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    background: rgba(0,0,0,.12);
}

.hg-marketing-periods button {
    min-height: 38px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255,255,255,.76);
    padding: 8px 14px;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.hg-marketing-periods button.is-active {
    background: #fff;
    color: #1f6237;
}

.hg-marketing-periods .hg-secondary-action {
    border-left: 1px solid rgba(255,255,255,.18);
    border-radius: 0 999px 999px 0;
    color: #fff;
}

.hg-marketing-context {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-border);
}

.hg-marketing-context div {
    min-width: 0;
    background: var(--hg-surface);
    padding: 11px 14px;
}

.hg-marketing-context span,
.hg-marketing-context strong {
    display: block;
}

.hg-marketing-context span {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hg-marketing-context strong {
    overflow: hidden;
    margin-top: 3px;
    color: var(--hg-text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-executive-context { margin-top: 2px; }

.hg-executive-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hg-executive-kpi {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: linear-gradient(145deg, var(--hg-surface), color-mix(in srgb, var(--hg-primary) 4%, var(--hg-surface)));
    padding: 19px;
    box-shadow: var(--hg-shadow-soft);
}

.hg-executive-kpi::after {
    position: absolute;
    top: -28px;
    right: -28px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hg-primary) 9%, transparent);
    content: "";
}

.hg-executive-kpi span,
.hg-executive-kpi strong,
.hg-executive-kpi small { position: relative; z-index: 1; display: block; }
.hg-executive-kpi span { color: var(--hg-text-muted); font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.hg-executive-kpi strong { margin-top: 8px; color: var(--hg-text); font-size: clamp(24px, 2.4vw, 34px); line-height: 1; letter-spacing: -.035em; }
.hg-executive-kpi small { margin-top: 8px; color: var(--hg-text-muted); font-size: 10px; font-weight: 700; line-height: 1.45; }
.hg-executive-kpi.is-primary { border-color: transparent; background: linear-gradient(135deg, #174f2c, #2f7d47); box-shadow: 0 14px 30px rgba(22, 78, 43, .18); }
.hg-executive-kpi.is-primary span { color: #bff3cb; }
.hg-executive-kpi.is-primary strong { color: #fff; }
.hg-executive-kpi.is-primary small { color: rgba(255,255,255,.76); }
.hg-executive-kpi.is-primary::after { background: rgba(255,255,255,.08); }

.hg-executive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, .65fr);
    gap: 14px;
    align-items: stretch;
}

.hg-executive-grid .hg-sales-evolution { min-width: 0; }
.hg-executive-grid .hg-sales-chart { height: 260px; }
.hg-executive-grid .hg-sales-chart svg { height: 210px; }

.hg-executive-pulse {
    display: grid;
    grid-template-rows: auto repeat(3, 1fr);
    gap: 9px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--hg-primary) 3%, var(--hg-surface));
    padding: 14px;
    box-shadow: var(--hg-shadow-soft);
}

.hg-executive-pulse-head { padding: 3px 4px 7px; }
.hg-executive-pulse-head span,
.hg-platform-detail-heading span { color: var(--hg-primary); font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.hg-executive-pulse-head h2,
.hg-platform-detail-heading h2 { margin: 3px 0 0; color: var(--hg-text); font-size: 20px; line-height: 1.15; }
.hg-executive-pulse-head p { margin: 6px 0 0; color: var(--hg-text-muted); font-size: 10px; line-height: 1.4; }

.hg-executive-platform {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    align-content: center;
    min-width: 0;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-surface);
    color: var(--hg-text);
    padding: 12px 13px;
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.hg-executive-platform:hover { border-color: color-mix(in srgb, var(--hg-primary) 32%, var(--hg-border)); box-shadow: 0 8px 22px rgba(31, 73, 44, .08); transform: translateY(-1px); }
.hg-executive-platform > span { grid-column: 1 / -1; color: var(--hg-text-muted); font-size: 10px; font-weight: 900; }
.hg-executive-platform > span i { display: inline-block; margin-left: 5px; border-radius: 999px; padding: 2px 6px; font-size: 8px; font-style: normal; }
.hg-executive-platform > span i.is-ready { background: #e3f4e8; color: #246c3c; }
.hg-executive-platform > span i.is-pending { background: #fff0d8; color: #9b5f0a; }
.hg-executive-platform strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.hg-executive-platform small { grid-column: 1 / -1; color: var(--hg-text-muted); font-size: 9px; font-weight: 650; }
.hg-executive-platform b { grid-column: 2; grid-row: 2; align-self: center; color: var(--hg-primary); font-size: 9px; white-space: nowrap; }
.hg-executive-platform.is-meta b { color: #bd3678; }
.hg-executive-platform.is-analytics b { color: #cc6d18; }

.hg-platform-detail-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 12px 2px -2px;
    padding-top: 7px;
}
.hg-platform-detail-heading small { max-width: 410px; color: var(--hg-text-muted); font-size: 10px; font-weight: 650; text-align: right; }
.hg-platform-drafts { margin-top: 0; }

.hg-marketing-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hg-marketing-kpis > div {
    min-width: 0;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: var(--hg-surface);
    padding: 17px;
    box-shadow: var(--hg-shadow-soft);
}

.hg-marketing-kpis span,
.hg-marketing-kpis strong,
.hg-marketing-kpis small {
    display: block;
}

.hg-marketing-kpis span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
}

.hg-marketing-kpis strong {
    margin-top: 7px;
    color: var(--hg-text);
    font-size: clamp(20px, 2.4vw, 29px);
    line-height: 1.05;
}

.hg-marketing-kpis small {
    margin-top: 8px;
    color: var(--hg-primary);
    font-size: 11px;
    font-weight: 750;
}

.hg-marketing-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr);
    gap: 14px;
    align-items: start;
}

.hg-marketing-campaigns,
.hg-marketing-reading,
.hg-marketing-contacts,
.hg-marketing-outcomes {
    overflow: hidden;
    padding: 0;
}

.hg-marketing-section-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--hg-border);
}

.hg-marketing-section-head span {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hg-marketing-section-head h2 {
    margin: 3px 0 0;
    color: var(--hg-text);
    font-size: 19px;
}

.hg-marketing-section-head small {
    max-width: 420px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
    text-align: right;
}

.hg-marketing-section-head > strong {
    color: var(--hg-text);
    font-size: 13px;
}

.hg-marketing-table-wrap {
    overflow-x: auto;
}

.hg-marketing-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.hg-marketing-table th,
.hg-marketing-table td {
    border-bottom: 1px solid var(--hg-border);
    padding: 11px 13px;
    text-align: left;
    white-space: nowrap;
}

.hg-marketing-table th {
    background: color-mix(in srgb, var(--hg-bg) 72%, var(--hg-surface));
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hg-marketing-table td {
    color: var(--hg-text);
    font-size: 12px;
}

.hg-marketing-table tbody tr:last-child td {
    border-bottom: 0;
}

.hg-marketing-focus {
    display: inline-flex;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 11%, var(--hg-surface));
    color: var(--hg-primary);
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 850;
}

.hg-marketing-action-message {
    border: 1px solid;
    border-radius: 14px;
    padding: 12px 15px;
    font-size: 12px;
    font-weight: 800;
}

.hg-marketing-action-message.is-ok {
    border-color: color-mix(in srgb, #27843b 35%, var(--hg-border));
    background: color-mix(in srgb, #27843b 9%, var(--hg-surface));
    color: #237335;
}

.hg-marketing-action-message.is-error {
    border-color: color-mix(in srgb, #d73535 35%, var(--hg-border));
    background: color-mix(in srgb, #d73535 8%, var(--hg-surface));
    color: #c52d2d;
}

.hg-marketing-campaign-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 850;
}

.hg-marketing-campaign-state::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.hg-marketing-campaign-state.is-active {
    background: color-mix(in srgb, #27843b 11%, var(--hg-surface));
    color: #27843b;
}

.hg-marketing-campaign-state.is-paused {
    background: color-mix(in srgb, #a06b00 12%, var(--hg-surface));
    color: #916100;
}

.hg-marketing-campaign-state.is-other {
    background: color-mix(in srgb, var(--hg-text-muted) 10%, var(--hg-surface));
    color: var(--hg-text-muted);
}

.hg-campaign-row-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hg-campaign-row-actions button,
.hg-campaign-row-actions a {
    min-height: 32px;
    border-radius: 9px;
    padding: 7px 10px;
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.hg-campaign-row-actions button {
    border: 1px solid;
}

.hg-campaign-row-actions button.is-pause {
    border-color: color-mix(in srgb, #b67700 35%, var(--hg-border));
    background: color-mix(in srgb, #b67700 8%, var(--hg-surface));
    color: #8b5d00;
}

.hg-campaign-row-actions button.is-activate {
    border-color: color-mix(in srgb, #27843b 35%, var(--hg-border));
    background: #2d8135;
    color: #fff;
}

.hg-campaign-row-actions button.is-optimize {
    border-color: color-mix(in srgb, var(--hg-primary) 38%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 8%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-campaign-row-actions button:disabled {
    cursor: wait;
    opacity: .55;
}

.hg-campaign-row-actions a {
    border: 1px solid var(--hg-border);
    background: var(--hg-surface);
    color: var(--hg-primary);
}

.hg-campaign-row-actions .is-readonly {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 750;
}

.hg-marketing-insight {
    display: grid;
    gap: 4px;
    margin: 12px;
    border-left: 4px solid var(--hg-primary);
    border-radius: 10px;
    background: color-mix(in srgb, var(--hg-primary) 7%, var(--hg-surface));
    padding: 13px;
}

.hg-marketing-insight.is-neutral {
    border-left-color: var(--hg-text-muted);
    background: color-mix(in srgb, var(--hg-bg) 72%, var(--hg-surface));
}

.hg-marketing-insight span,
.hg-marketing-insight small {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 750;
}

.hg-marketing-insight strong {
    color: var(--hg-text);
    font-size: 14px;
}

.hg-marketing-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.hg-marketing-contact-bars {
    display: grid;
    gap: 11px;
    padding: 17px 18px 10px;
}

.hg-marketing-contact-bars > div {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(120px, 1fr) 54px;
    align-items: center;
    gap: 10px;
}

.hg-marketing-contact-bars span,
.hg-marketing-contact-bars strong {
    color: var(--hg-text);
    font-size: 11px;
}

.hg-marketing-contact-bars strong {
    text-align: right;
}

.hg-marketing-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-bg));
}

.hg-marketing-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hg-primary), #70bd82);
}

.hg-marketing-contacts > p,
.hg-marketing-outcomes > p {
    margin: 0;
    border-top: 1px solid var(--hg-border);
    color: var(--hg-text-muted);
    padding: 13px 18px 16px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.5;
}

.hg-marketing-outcome-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--hg-border);
}

.hg-marketing-outcome-grid > div {
    min-width: 0;
    background: var(--hg-surface);
    padding: 17px 18px;
}

.hg-marketing-outcome-grid span,
.hg-marketing-outcome-grid strong {
    display: block;
}

.hg-marketing-outcome-grid span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 750;
}

.hg-marketing-outcome-grid strong {
    margin-top: 6px;
    color: var(--hg-text);
    font-size: 20px;
}

.hg-marketing-balance {
    overflow: hidden;
    border-left: 4px solid #64748b;
}

.hg-marketing-balance.is-bien {
    border-left-color: var(--hg-primary);
}

.hg-marketing-balance.is-atencion {
    border-left-color: #d49b25;
}

.hg-marketing-balance.is-critico {
    border-left-color: var(--hg-danger);
}

.hg-marketing-balance-head,
.hg-marketing-balance-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
}

.hg-marketing-balance-head > div > span {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hg-marketing-balance-head h2 {
    margin: 4px 0 0;
    color: var(--hg-text);
    font-size: 17px;
}

.hg-marketing-balance-status {
    border-radius: 999px;
    background: color-mix(in srgb, #64748b 12%, var(--hg-surface));
    color: var(--hg-text-muted);
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.hg-marketing-balance.is-bien .hg-marketing-balance-status {
    background: color-mix(in srgb, var(--hg-primary) 12%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-balance.is-atencion .hg-marketing-balance-status {
    background: color-mix(in srgb, #d49b25 13%, var(--hg-surface));
    color: #9a6700;
}

.hg-marketing-balance.is-critico .hg-marketing-balance-status {
    background: color-mix(in srgb, var(--hg-danger) 11%, var(--hg-surface));
    color: var(--hg-danger);
}

.hg-marketing-balance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--hg-border);
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-border);
}

.hg-marketing-balance-grid > div {
    min-width: 0;
    background: var(--hg-surface);
    padding: 14px 18px;
}

.hg-marketing-balance-grid span,
.hg-marketing-balance-grid strong {
    display: block;
}

.hg-marketing-balance-grid span {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 750;
}

.hg-marketing-balance-grid strong {
    margin-top: 5px;
    color: var(--hg-text);
    font-size: 17px;
}

.hg-marketing-balance-footer p {
    max-width: 720px;
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.hg-marketing-balance-editor {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    align-items: end;
    gap: 12px;
    border-top: 1px solid var(--hg-border);
    padding: 16px 18px;
}

.hg-marketing-balance-editor label {
    display: grid;
    gap: 6px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 750;
}

.hg-marketing-balance-editor input {
    width: 100%;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: var(--hg-surface);
    color: var(--hg-text);
    padding: 10px 11px;
    font: inherit;
    font-size: 14px;
}

.hg-marketing-balance-editor > div {
    display: flex;
    gap: 8px;
}

.hg-marketing-balance-error {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--hg-danger);
    font-size: 11px;
    font-weight: 750;
}

.hg-marketing-meta-payments {
    overflow: hidden;
    border-left: 4px solid #d49b25;
}

.hg-marketing-meta-payments.is-ready {
    border-left-color: var(--hg-primary);
}

.hg-marketing-meta-payments.is-ready .hg-marketing-balance-status {
    background: color-mix(in srgb, var(--hg-primary) 12%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-meta-payment-grid,
.hg-marketing-meta-payment-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--hg-border);
    background: var(--hg-border);
}

.hg-marketing-meta-payment-grid > div,
.hg-marketing-meta-payment-details > div {
    min-width: 0;
    background: var(--hg-surface);
    padding: 15px 18px;
}

.hg-marketing-meta-payment-grid span,
.hg-marketing-meta-payment-grid strong,
.hg-marketing-meta-payment-grid small,
.hg-marketing-meta-payment-details span,
.hg-marketing-meta-payment-details strong {
    display: block;
}

.hg-marketing-meta-payment-grid span,
.hg-marketing-meta-payment-details span {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 750;
}

.hg-marketing-meta-payment-grid strong {
    margin-top: 6px;
    color: var(--hg-text);
    font-size: 20px;
}

.hg-marketing-meta-payment-grid small {
    margin-top: 5px;
    color: var(--hg-text-muted);
    font-size: 9px;
    font-weight: 650;
    line-height: 1.35;
}

.hg-marketing-meta-payment-details {
    border-bottom: 1px solid var(--hg-border);
}

.hg-marketing-meta-payment-details strong {
    overflow: hidden;
    margin-top: 5px;
    color: var(--hg-text);
    font-size: 12px;
    text-overflow: ellipsis;
}

.hg-marketing-payment-check {
    border-radius: 999px;
    background: color-mix(in srgb, #d49b25 13%, var(--hg-surface));
    color: #9a6700;
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 850;
    white-space: nowrap;
}

.hg-marketing-payment-check.is-ready {
    background: color-mix(in srgb, var(--hg-primary) 12%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-connection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
}

.hg-marketing-connection h2 {
    margin: 8px 0 4px;
    color: var(--hg-text);
    font-size: 18px;
}

.hg-marketing-connection p,
.hg-marketing-connection-actions span {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.hg-marketing-connection-state {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    background: color-mix(in srgb, #d49b25 13%, var(--hg-surface));
    color: #9a6700;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.hg-marketing-connection-state.is-ready {
    background: color-mix(in srgb, var(--hg-primary) 12%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-marketing-connection-actions {
    display: grid;
    justify-items: end;
    gap: 9px;
    max-width: 360px;
    text-align: right;
}

.hg-marketing-connection-actions > strong {
    border: 1px solid color-mix(in srgb, var(--hg-primary) 28%, var(--hg-border));
    border-radius: 10px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 8px 11px;
    font-size: 11px;
    font-weight: 800;
}

.hg-meta-remarketing { overflow: hidden; }
.hg-meta-remarketing-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 26px; align-items: center; padding: 22px; }
.hg-meta-remarketing-lead { max-width: 760px; margin: 0; color: var(--hg-text); font-size: 14px; line-height: 1.55; }
.hg-meta-remarketing-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.hg-meta-remarketing-rules > span { min-height: 62px; border: 1px solid var(--hg-border); border-radius: 14px; padding: 11px 13px; color: var(--hg-text); font-size: 12px; }
.hg-meta-remarketing-rules small { display: block; margin-bottom: 5px; color: var(--hg-primary); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hg-meta-remarketing-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 18px; }
.hg-meta-remarketing-actions > label { display: grid; gap: 6px; min-width: 210px; }
.hg-meta-remarketing-actions > label > span:first-child { color: var(--hg-text-muted); font-size: 10px; }
.hg-meta-remarketing-budget { display: grid; grid-template-columns: auto minmax(0, 1fr); overflow: hidden; border: 1px solid var(--hg-border); border-radius: 12px; background: var(--hg-surface); }
.hg-meta-remarketing-budget i { display: grid; place-items: center; border-right: 1px solid var(--hg-border); padding: 0 12px; color: var(--hg-primary); font-size: 10px; font-style: normal; font-weight: 800; }
.hg-meta-remarketing-budget input { width: 100%; min-height: 42px; border: 0; background: transparent; padding: 8px 12px; color: var(--hg-text); font: inherit; }
.hg-meta-remarketing-actions :is(.hg-primary-action, .hg-secondary-action) { min-height: 44px; text-decoration: none; }
.hg-meta-remarketing-live { display: grid; min-width: 220px; }
.hg-meta-remarketing-live span, .hg-meta-remarketing-live small { color: var(--hg-text-muted); font-size: 9px; }
.hg-meta-remarketing-live strong { margin: 2px 0; color: var(--hg-text); font-size: 15px; }
.hg-meta-remarketing-creatives { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--hg-border); border-radius: 18px; background: var(--hg-border); gap: 1px; }
.hg-meta-remarketing-creatives img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--hg-surface); }
.hg-meta-remarketing-creatives.is-single { grid-template-columns: minmax(0, 1fr); justify-self: end; width: min(100%, 430px); background: var(--hg-surface); }

.hg-instagram-organic-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.hg-instagram-profile { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hg-instagram-profile > img { width: 56px; height: 56px; flex: 0 0 56px; border: 1px solid var(--hg-border); border-radius: 50%; object-fit: cover; }
.hg-instagram-profile h2 { margin: 5px 0 3px; color: var(--hg-text); font-size: 20px; font-weight: 500; }
.hg-instagram-profile p { margin: 0; color: var(--hg-text-muted); font-size: 11px; }
.hg-instagram-profile-numbers { display: grid; grid-template-columns: repeat(3, minmax(72px, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--hg-border); border-radius: 12px; background: var(--hg-border); }
.hg-instagram-profile-numbers > span { display: grid; gap: 2px; padding: 8px 10px; background: var(--hg-surface); text-align: center; }
.hg-instagram-profile-numbers strong { color: var(--hg-text); font-size: 16px; font-weight: 500; }
.hg-instagram-profile-numbers small { color: var(--hg-text-muted); font-size: 9px; }
.hg-instagram-permissions { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.7fr) auto; align-items: center; gap: 16px; padding: 15px 18px; }
.hg-instagram-permissions.is-attention { border-left: 4px solid #d99a1b; }
.hg-instagram-permissions > div:first-child > span { color: var(--hg-primary); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.hg-instagram-permissions h2 { margin: 4px 0 2px; color: var(--hg-text); font-size: 16px; font-weight: 500; }
.hg-instagram-permissions p { margin: 0; color: var(--hg-text-muted); font-size: 10px; line-height: 1.4; }
.hg-instagram-permission-list,
.hg-instagram-capabilities { display: flex; flex-wrap: wrap; gap: 7px; }
.hg-instagram-permission-list span,
.hg-instagram-capabilities span { border: 1px solid var(--hg-border); border-radius: 999px; padding: 5px 8px; color: var(--hg-text-muted); font-size: 8px; }
.hg-instagram-capabilities span.is-ready { border-color: #b9d7c0; background: #edf7ef; color: var(--hg-primary); }
.hg-instagram-capabilities span.is-pending { border-color: #ead6a7; background: #fff8e8; color: #936400; }
.hg-instagram-feed { overflow: hidden; }
.hg-instagram-feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0 18px 20px; }
.hg-instagram-post { overflow: hidden; border: 1px solid var(--hg-border); border-radius: 12px; background: var(--hg-surface); }
.hg-instagram-post-media { display: block; position: relative; overflow: hidden; aspect-ratio: 1; background: #edf2ee; }
.hg-instagram-post-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.hg-instagram-post:hover .hg-instagram-post-media img { transform: scale(1.018); }
.hg-instagram-post-media > span { position: absolute; top: 7px; left: 7px; border-radius: 999px; background: rgba(18,52,30,.86); padding: 4px 7px; color: #fff; font-size: 7px; letter-spacing: .06em; text-transform: uppercase; }
.hg-instagram-post-copy { display: grid; gap: 8px; padding: 12px; }
.hg-instagram-post-copy time { color: var(--hg-text-muted); font-size: 9px; }
.hg-instagram-post-copy > p { display: -webkit-box; min-height: 48px; overflow: hidden; margin: 0; color: var(--hg-text); font-size: 11px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.hg-instagram-post-copy > a { color: var(--hg-primary); font-size: 10px; font-weight: 600; text-decoration: none; }
.hg-instagram-post-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.hg-instagram-post-metrics span { display: grid; gap: 1px; border: 1px solid var(--hg-border); border-radius: 8px; padding: 6px 7px; }
.hg-instagram-post-metrics small { color: var(--hg-text-muted); font-size: 8px; }
.hg-instagram-post-metrics strong { color: var(--hg-text); font-size: 12px; font-weight: 500; }
.hg-instagram-content-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--hg-border); border-radius: 16px; background: var(--hg-surface); }
.hg-instagram-content-tabs button { display: grid; gap: 3px; border: 0; border-right: 1px solid var(--hg-border); background: transparent; padding: 15px 18px; color: var(--hg-text-muted); text-align: left; cursor: pointer; }
.hg-instagram-content-tabs button:last-child { border-right: 0; }
.hg-instagram-content-tabs button.is-active { background: #edf6ef; color: var(--hg-primary); }
.hg-instagram-content-tabs span { font-size: 13px; font-weight: 650; }
.hg-instagram-content-tabs small { font-size: 9px; }
.hg-instagram-drafts { overflow: hidden; }
.hg-instagram-draft-grid { padding: 0 18px 20px; }
.hg-instagram-draft-card { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); overflow: hidden; border: 1px solid var(--hg-border); border-radius: 18px; background: var(--hg-surface); }
.hg-instagram-draft-preview { position: relative; min-height: 520px; background: #102f1d; }
.hg-instagram-draft-preview video,
.hg-instagram-draft-preview > img { display: block; width: 100%; height: 100%; max-height: 660px; object-fit: contain; background: #102f1d; }
.hg-instagram-draft-preview > span { position: absolute; top: 14px; left: 14px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(15,53,30,.88); padding: 6px 10px; color: #fff; font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hg-instagram-draft-copy { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.hg-instagram-draft-title { display: flex; justify-content: space-between; gap: 18px; }
.hg-instagram-draft-title small { color: var(--hg-primary); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hg-instagram-draft-title h3 { margin: 5px 0 0; color: var(--hg-text); font-size: 24px; font-weight: 500; }
.hg-instagram-draft-title time { color: var(--hg-text-muted); font-size: 9px; white-space: nowrap; }
.hg-instagram-draft-concept { margin: 0; color: var(--hg-text-muted); font-size: 13px; line-height: 1.55; }
.hg-instagram-draft-caption { display: grid; gap: 8px; border: 1px solid var(--hg-border); border-radius: 14px; background: var(--hg-surface-soft); padding: 14px; }
.hg-instagram-draft-caption small { color: var(--hg-primary); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hg-instagram-draft-caption p { margin: 0; color: var(--hg-text); font-size: 12px; line-height: 1.55; white-space: pre-line; }
.hg-instagram-draft-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.hg-instagram-draft-badges span { border: 1px solid #b9d7c0; border-radius: 999px; background: #edf7ef; padding: 6px 9px; color: var(--hg-primary); font-size: 8px; }
.hg-instagram-draft-family { display: grid; gap: 8px; }
.hg-instagram-draft-family > small { color: var(--hg-primary); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.hg-instagram-draft-family > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.hg-instagram-draft-family figure { overflow: hidden; margin: 0; border: 1px solid var(--hg-border); border-radius: 10px; background: var(--hg-surface-soft); }
.hg-instagram-draft-family img { display: block; width: 100%; aspect-ratio: 9 / 12; object-fit: cover; }
.hg-instagram-draft-family figcaption { padding: 6px; color: var(--hg-text); font-size: 7px; text-align: center; }
.hg-instagram-draft-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; }
.hg-instagram-draft-actions a { text-decoration: none; }
.hg-instagram-draft-actions span { color: var(--hg-text-muted); font-size: 9px; text-align: right; }
.hg-instagram-audit { overflow: hidden; }
.hg-instagram-audit-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; margin: 0 18px 16px; overflow: hidden; border: 1px solid var(--hg-border); border-radius: 14px; background: var(--hg-border); }
.hg-instagram-audit-kpis button { display: grid; gap: 2px; border: 0; background: var(--hg-surface); padding: 11px 8px; color: var(--hg-text-muted); text-align: center; cursor: pointer; }
.hg-instagram-audit-kpis button.is-active { background: #edf6ef; color: var(--hg-primary); }
.hg-instagram-audit-kpis strong { font-size: 17px; font-weight: 550; }
.hg-instagram-audit-kpis small { font-size: 8px; }
.hg-instagram-audit-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; margin: 0 18px 18px; }
.hg-instagram-audit-toolbar label { display: grid; gap: 5px; }
.hg-instagram-audit-toolbar label span { color: var(--hg-text-muted); font-size: 9px; }
.hg-instagram-audit-toolbar input { min-height: 42px; border: 1px solid var(--hg-border); border-radius: 12px; background: var(--hg-surface); padding: 8px 12px; color: var(--hg-text); font: inherit; font-size: 11px; }
.hg-instagram-audit-toolbar > div { display: grid; min-width: 145px; gap: 2px; padding: 7px 0; text-align: right; }
.hg-instagram-audit-toolbar > div strong { color: var(--hg-text); font-size: 15px; font-weight: 550; }
.hg-instagram-audit-toolbar > div small { color: var(--hg-text-muted); font-size: 8px; }
.hg-instagram-audit .hg-inline-message { margin: 0 18px 16px; border: 1px solid #b9d7c0; border-radius: 12px; background: #edf7ef; padding: 10px 12px; color: var(--hg-primary); font-size: 10px; }
.hg-instagram-audit .hg-inline-message.is-error { border-color: #e6b8b5; background: #fff0ef; color: #b62f29; }
.hg-instagram-bulk-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin: 0 18px 18px; border: 1px solid var(--hg-border); border-radius: 14px; background: var(--hg-surface-soft); padding: 10px; }
.hg-instagram-bulk-select, .hg-instagram-bulk-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.hg-instagram-bulk-select .is-active { border-color: var(--hg-primary); background: #e8f3ea; color: var(--hg-primary); }
.hg-instagram-bulk-summary { display: grid; min-width: 72px; text-align: center; }
.hg-instagram-bulk-summary strong { color: var(--hg-text); font-size: 16px; font-weight: 600; }
.hg-instagram-bulk-summary small { color: var(--hg-text-muted); font-size: 8px; }
.hg-instagram-bulk-actions button { min-height: 36px; border: 1px solid #a6caaa; border-radius: 10px; background: var(--hg-surface); padding: 7px 10px; color: var(--hg-primary); font-size: 9px; cursor: pointer; }
.hg-instagram-bulk-actions button.is-archive { border-color: #e1b8b5; color: #b62f29; }
.hg-instagram-bulk-actions button:disabled { opacity: .45; cursor: default; }
.hg-instagram-audit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0 18px 20px; }
.hg-instagram-audit-card { position: relative; overflow: hidden; border: 1px solid var(--hg-border); border-top: 3px solid #9098a7; border-radius: 14px; background: var(--hg-surface); }
.hg-instagram-audit-card.is-selected { box-shadow: 0 0 0 3px rgba(45,133,55,.18); }
.hg-instagram-audit-check { position: absolute; z-index: 2; top: 9px; right: 9px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(20,35,26,.18); cursor: pointer; }
.hg-instagram-audit-check input { width: 16px; height: 16px; accent-color: var(--hg-primary); }
.hg-instagram-audit-card.is-conservar { border-top-color: #2d8537; }
.hg-instagram-audit-card.is-archivar { border-top-color: #cb3a34; }
.hg-instagram-audit-card.is-rehacer { border-top-color: #d99a1b; }
.hg-instagram-audit-card.is-referencia { border-top-color: #3978ad; }
.hg-instagram-audit-card.is-archivada { opacity: .68; border-top-color: #737984; }
.hg-instagram-audit-media { display: block; position: relative; overflow: hidden; aspect-ratio: 1.32; background: #edf2ee; }
.hg-instagram-audit-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-instagram-audit-media span { position: absolute; top: 9px; left: 9px; border-radius: 999px; background: rgba(18,52,30,.88); padding: 5px 9px; color: #fff; font-size: 8px; text-transform: uppercase; }
.hg-instagram-audit-copy { display: grid; gap: 10px; padding: 12px; }
.hg-instagram-audit-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--hg-text-muted); font-size: 8px; }
.hg-instagram-audit-copy > p { display: -webkit-box; min-height: 46px; overflow: hidden; margin: 0; color: var(--hg-text); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.hg-instagram-rescue-badge { justify-self: start; border-radius: 999px; background: #eaf1f8; padding: 5px 8px; color: #2e6899; font-size: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hg-instagram-audit-reason { display: grid; gap: 4px; border-radius: 10px; background: var(--hg-surface-soft); padding: 9px 10px; }
.hg-instagram-audit-reason small { color: var(--hg-primary); font-size: 7px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.hg-instagram-audit-reason strong { color: var(--hg-text); font-size: 9px; font-weight: 500; line-height: 1.4; }
.hg-instagram-audit-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hg-instagram-audit-actions button,
.hg-instagram-archive-step button { min-height: 34px; border: 1px solid var(--hg-border); border-radius: 9px; background: var(--hg-surface); padding: 6px 7px; color: var(--hg-text); font: inherit; font-size: 8px; cursor: pointer; }
.hg-instagram-audit-actions button:hover { border-color: #93bf9a; color: var(--hg-primary); }
.hg-instagram-audit-actions button.is-archive:hover { border-color: #dcaaa7; color: #b62f29; }
.hg-instagram-archive-step { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; border-top: 1px solid var(--hg-border); padding-top: 9px; }
.hg-instagram-archive-step a { color: var(--hg-primary); font-size: 9px; font-weight: 650; text-decoration: none; }
.hg-instagram-archive-step button { background: #f3f5f3; }
.hg-instagram-audit-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; border-top: 1px solid var(--hg-border); padding: 16px 18px 18px; }
.hg-instagram-audit-pagination span { color: var(--hg-text-muted); font-size: 9px; }

@media (max-width: 900px) {
    .hg-meta-remarketing-layout { grid-template-columns: 1fr; }
    .hg-instagram-permissions { grid-template-columns: 1fr; }
    .hg-instagram-audit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hg-instagram-draft-card { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); }
}

@media (max-width: 700px) {
    .hg-instagram-organic-head { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
    .hg-meta-remarketing-layout { gap: 18px; padding: 16px; }
    .hg-meta-remarketing-rules { grid-template-columns: 1fr; }
    .hg-meta-remarketing-actions { display: grid; }
    .hg-meta-remarketing-actions > label,
    .hg-meta-remarketing-actions :is(.hg-primary-action, .hg-secondary-action) { width: 100%; }
    .hg-meta-remarketing-creatives { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hg-instagram-profile-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hg-instagram-profile-numbers > span { min-width: 0; padding: 8px 6px; }
    .hg-instagram-feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 10px 14px; }
    .hg-instagram-post-copy { padding: 8px; }
    .hg-instagram-content-tabs { grid-template-columns: 1fr; }
    .hg-instagram-content-tabs button { border-right: 0; border-bottom: 1px solid var(--hg-border); }
    .hg-instagram-content-tabs button:last-child { border-bottom: 0; }
    .hg-instagram-draft-grid { padding: 0 10px 14px; }
    .hg-instagram-draft-card { grid-template-columns: 1fr; }
    .hg-instagram-draft-preview { min-height: 0; aspect-ratio: 9 / 12; }
    .hg-instagram-draft-copy { padding: 16px; }
    .hg-instagram-draft-title h3 { font-size: 20px; }
    .hg-instagram-draft-actions { align-items: stretch; flex-direction: column; }
    .hg-instagram-draft-actions span { text-align: left; }
    .hg-instagram-draft-family > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hg-instagram-audit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 10px 14px; }
    .hg-instagram-audit-toolbar { grid-template-columns: 1fr auto; margin: 0 10px 14px; }
    .hg-instagram-audit-toolbar > div { grid-column: 1 / -1; text-align: left; }
    .hg-instagram-bulk-bar { grid-template-columns: 1fr; margin: 0 10px 14px; }
    .hg-instagram-bulk-summary { text-align: left; }
    .hg-instagram-audit-grid { grid-template-columns: 1fr; padding: 0 10px 14px; }
}

.hg-marketing-actions {
    overflow: hidden;
}

.hg-marketing-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.hg-marketing-action-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--hg-border);
    border-top: 3px solid var(--hg-primary);
    border-radius: 13px;
    background: color-mix(in srgb, var(--hg-bg) 40%, var(--hg-surface));
    padding: 15px;
}

.hg-marketing-action-card.is-revision {
    border-top-color: #d49b25;
}

.hg-marketing-action-card.is-medicion {
    border-top-color: #64748b;
}

.hg-marketing-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hg-marketing-action-top span {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.hg-marketing-action-top small {
    color: var(--hg-text-muted);
    font-size: 10px;
    font-weight: 700;
}

.hg-marketing-action-card h3 {
    margin: 11px 0 6px;
    color: var(--hg-text);
    font-size: 15px;
}

.hg-marketing-action-card p {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.5;
}

.hg-marketing-action-card > div:not(.hg-marketing-action-top) {
    margin-top: 14px;
    border-radius: 10px;
    background: var(--hg-surface);
    padding: 11px;
}

.hg-marketing-action-card > div strong {
    display: block;
    margin-bottom: 4px;
    color: var(--hg-text);
    font-size: 10px;
    text-transform: uppercase;
}

.hg-marketing-action-card button {
    margin-top: auto;
    border: 0;
    border-radius: 10px;
    background: var(--hg-primary);
    color: #fff;
    padding: 9px 11px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}

.hg-marketing-action-card button:disabled {
    background: color-mix(in srgb, var(--hg-text-muted) 16%, var(--hg-surface));
    color: var(--hg-text-muted);
    cursor: not-allowed;
}

.hg-marketing-footnote {
    border: 1px solid color-mix(in srgb, #d49b25 28%, var(--hg-border));
    border-radius: 14px;
    background: color-mix(in srgb, #f2b949 8%, var(--hg-surface));
    padding: 14px 16px;
}

.hg-marketing-footnote strong {
    color: var(--hg-text);
    font-size: 12px;
}

.hg-marketing-footnote p {
    margin: 4px 0 0;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.5;
}

.hgl-orders-page .hgl-legacy-workspace {
    grid-template-columns: minmax(320px, .46fr) minmax(780px, 1.54fr);
    align-items: start;
}

.hgl-orders-page .hgl-legacy-list {
    max-height: calc(100vh - 184px);
}

.hgl-orders-page .hgl-legacy-row {
    grid-template-columns: minmax(0, 1fr) 122px;
    border-left: 4px solid transparent;
}

.hgl-orders-page .hgl-legacy-row.selected {
    border-left-color: var(--hg-primary);
}

.hgl-orders-page .hgl-legacy-row .hgl-product-id {
    width: auto;
    min-width: 54px;
    justify-content: center;
}

.hgl-orders-page .hgl-legacy-detail {
    overflow: hidden;
}

.hgl-orders-page .hgl-legacy-detail.hgl-detail-drawer,
.hgl-legacy-detail.hgl-detail-drawer {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.hgl-orders-page .hgl-editor-head {
    gap: 16px;
    padding: 18px 20px;
}

.hgl-orders-page .hgl-editor-head h2 {
    margin-top: 4px;
    font-size: 20px;
    line-height: 1.2;
}

.hgl-order-status-summary {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1fr);
}

.hgl-orders-page .hgl-order-status-summary {
    border-top: 1px solid var(--hg-border);
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hgl-orders-page .hgl-order-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hgl-orders-page .hgl-order-editor {
    padding: 16px 20px;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 58%, var(--hg-surface));
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hgl-order-actions {
    justify-content: flex-start;
}

.hgl-orders-page .hgl-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 18px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 58%, var(--hg-surface));
}

.hgl-order-actions .hg-secondary-action,
.hgl-order-actions .hgl-editor-action-link.hg-secondary-action {
    border-color: rgba(46,125,50,.28);
    background: var(--hg-surface);
    color: var(--hg-primary);
}

.hgl-order-actions .hg-primary-action {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}

.hgl-orders-page .hgl-order-actions .hg-danger-action {
    margin-left: auto;
    border-color: #fecaca;
    background: #fff1f2;
    color: var(--hg-danger);
}

.hgl-order-editor label:nth-of-type(3),
.hgl-order-editor label:nth-of-type(4) {
    grid-column: 1 / -1;
}

.hgl-orders-page .hgl-legacy-address {
    padding: 14px 20px;
}

.hgl-orders-page .hgl-legacy-items-head,
.hgl-orders-page .hgl-legacy-item {
    grid-template-columns: 64px minmax(220px, 1.4fr) minmax(150px, .75fr) 112px;
    padding-left: 16px;
    padding-right: 16px;
}

.hg-guardias-panel {
    overflow: hidden;
}

.hg-guardias-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 224px);
}

.hg-guardias-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.hg-guardias-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 72%, var(--hg-surface));
    color: var(--hg-text-muted);
    padding: 9px 10px;
    font-size: 11px;
    font-weight: 850;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.hg-guardias-table td {
    border-bottom: 1px solid var(--hg-border);
    color: var(--hg-text);
    padding: 10px;
    font-size: 12px;
    vertical-align: top;
}

.hg-guardias-table tr.fail {
    background: rgba(239, 68, 68, .055);
}

.hg-guardias-table strong,
.hg-guardias-table span,
.hg-guardias-table small {
    display: block;
}

.hg-guardias-table span,
.hg-guardias-table small {
    color: var(--hg-text-muted);
    margin-top: 2px;
}

.hg-guardias-table code {
    font-size: 11px;
}

.hg-guardias-audit-table {
    min-width: 1120px;
}

.hg-consultas-page .hgl-admin-filters {
    align-items: end;
}

.hg-consultas-filters label {
    min-width: min(100%, 420px);
}

.hg-consultas-summary {
    overflow: hidden;
}

.hg-consultas-summary p {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--hg-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.hg-consultas-warning {
    margin: 0 18px 18px;
    border: 1px solid rgba(245, 158, 11, .34);
    border-radius: 14px;
    background: rgba(245, 158, 11, .10);
    color: #92400E;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.hg-consultas-script-panel {
    overflow: hidden;
}

.hg-consultas-sql {
    display: block;
    width: 100%;
    min-height: 460px;
    border: 0;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-surface) 92%, var(--hg-bg));
    color: var(--hg-text);
    padding: 18px;
    resize: vertical;
    font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre;
}

.hg-consultas-table {
    min-width: 1040px;
}

:root[data-theme="dark"] .hg-consultas-warning {
    background: rgba(245, 158, 11, .13);
    border-color: rgba(245, 158, 11, .28);
    color: #FCD34D;
}

:root[data-theme="dark"] .hg-consultas-sql {
    background: rgba(255, 255, 255, .025);
}

:root[data-theme="dark"] .hgl-product-row.selected {
    background: rgba(134, 239, 172, .10);
}

:root[data-theme="dark"] .hgl-status-on {
    color: #BBF7D0;
}

:root[data-theme="dark"] .hgl-status-off {
    background: rgba(251, 191, 36, .14);
    color: #FBBF24;
}

:root[data-theme="dark"] .hgl-status-pending {
    background: rgba(96, 165, 250, .15);
    color: #BFDBFE;
}

:root[data-theme="dark"] .hgl-status-error,
:root[data-theme="dark"] .hgl-sync-message {
    background: rgba(248, 113, 113, .14);
    color: #FECACA;
    border-color: rgba(248, 113, 113, .22);
}

:root[data-theme="dark"] .hgl-mapping-row.mapped:not(.selected),
:root[data-theme="dark"] .hgl-erp-selected {
    background: rgba(134,239,172,.08);
}

:root[data-theme="dark"] .hgl-erp-row:hover,
:root[data-theme="dark"] .hgl-erp-row.selected {
    background: rgba(134,239,172,.10);
}

.hg-clipboard-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .34);
}

.hg-clipboard-dialog.open {
    display: flex;
}

.hg-clipboard-card {
    width: min(680px, 100%);
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 26px 70px rgba(0,0,0,.22);
    padding: 22px;
}

.hg-clipboard-card strong,
.hg-clipboard-card span {
    display: block;
}

.hg-clipboard-card strong {
    color: var(--hg-text);
    font-size: 22px;
    font-weight: 850;
}

.hg-clipboard-card span {
    margin-top: 5px;
    color: var(--hg-text-muted);
    font-size: 14px;
    line-height: 1.42;
}

.hg-clipboard-text {
    width: 100%;
    min-height: 260px;
    margin-top: 18px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--hg-bg) 58%, var(--hg-surface));
    color: var(--hg-text);
    padding: 14px 16px;
    font: 700 17px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    resize: vertical;
}

.hg-clipboard-actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hg-clipboard-actions button {
    min-height: 42px;
    border: 1px solid rgba(46,125,50,.24);
    border-radius: 999px;
    background: var(--hg-primary);
    color: #fff;
    padding: 9px 16px;
    font: inherit;
    font-weight: 850;
}

.hg-clipboard-actions .hg-clipboard-close {
    background: var(--hg-surface);
    color: var(--hg-text-muted);
    border-color: var(--hg-border);
}

@media (max-width: 1100px) {
    .hgl-admin-top,
    .hgl-workspace {
        grid-template-columns: 1fr;
    }

    .hgl-product-list {
        max-height: none;
    }

    .hgl-editor-panel {
        position: static;
    }

    .hgl-detail-drawer.hgl-editor-panel {
        position: fixed;
    }

    .hgl-orders-page .hgl-legacy-workspace {
        grid-template-columns: 1fr;
    }

    .hgl-orders-page .hgl-legacy-list {
        max-height: none;
    }

    .hg-marketing-main-grid,
    .hg-marketing-secondary-grid,
    .hg-marketing-action-grid,
    .hg-analytics-report-grid,
    .hg-executive-grid {
        grid-template-columns: 1fr;
    }

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

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

    .hg-analytics-quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hg-analytics-funnel-row { grid-template-columns: 34px minmax(180px, .9fr) minmax(140px, 1.2fr) 90px; gap: 11px; }
    .hg-sales-evolution-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .hg-marketing-meta-payment-grid,
    .hg-marketing-meta-payment-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 640px) {
    .hgl-admin-page {
        padding: 12px;
        gap: 10px;
    }

    .hgl-admin-top,
    .hgl-admin-filters,
    .hgl-workspace,
    .hgl-editor {
        grid-template-columns: 1fr;
    }

    .hg-marketing-hero {
        display: grid;
        align-items: start;
        padding: 19px;
    }

    .hg-marketing-workspace-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 14px;
    }

    .hg-marketing-local-tabs { top: 4px; border-radius: 14px; }
    .hg-google-keyword-entry { align-items: stretch; flex-direction: column; }
    .hg-google-keyword-entry > a { text-align: center; }

    .hg-marketing-periods {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 14px;
    }

    .hg-marketing-periods button {
        width: 100%;
    }

    .hg-marketing-periods .hg-secondary-action {
        grid-column: 1 / -1;
        border: 0;
        border-top: 1px solid rgba(255,255,255,.18);
        border-radius: 0;
    }

    .hg-marketing-context,
    .hg-marketing-kpis,
    .hg-executive-kpis,
    .hg-marketing-outcome-grid,
    .hg-marketing-balance-grid,
    .hg-marketing-meta-payment-grid,
    .hg-marketing-meta-payment-details,
    .hg-analytics-quality-grid {
        grid-template-columns: 1fr;
    }

    .hg-platform-detail-heading { display: grid; }
    .hg-platform-detail-heading small { max-width: none; text-align: left; }

    .hg-sales-evolution-summary { grid-template-columns: 1fr; }
    .hg-analytics-funnel-row { grid-template-columns: 28px minmax(0, 1fr) 76px; padding: 13px 14px; }
    .hg-analytics-funnel-track { grid-column: 2 / -1; grid-row: 2; }
    .hg-analytics-funnel-value { grid-column: 3; grid-row: 1; }
    .hg-sales-chart { height: 240px; padding-inline: 10px; }
    .hg-sales-chart svg { height: 190px; }

    .hg-ui-tabs {
        grid-template-columns: repeat(var(--hg-ui-tabs-columns), minmax(180px, 1fr));
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .hg-ui-tab {
        scroll-snap-align: start;
    }

    .hg-ui-tabs-stack-mobile {
        grid-template-columns: 1fr;
        overflow-x: visible;
    }

    .hg-marketing-section-head {
        display: grid;
    }

    .hg-marketing-section-head small {
        max-width: none;
        text-align: left;
    }

    .hg-marketing-connection {
        display: grid;
    }

    .hg-marketing-connection-actions {
        justify-items: start;
        max-width: none;
        text-align: left;
    }

    .hg-marketing-balance-head,
    .hg-marketing-balance-footer {
        display: grid;
        align-items: start;
    }

    .hg-marketing-balance-editor {
        grid-template-columns: 1fr;
    }

    .hg-marketing-contact-bars > div {
        grid-template-columns: minmax(120px, 1fr) 48px;
    }

    .hg-marketing-bar {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .hgl-price-load-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .hgl-admin-filters .hgl-price-load-actions button {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 8px 6px;
        font-size: 11px;
        line-height: 1.12;
        text-align: center;
    }

    .hgl-admin-top {
        padding: 0;
        gap: 12px;
    }

    .hgl-admin-title h1 {
        font-size: 30px;
    }

    .hg-title-actions .hg-primary-action,
    .hg-title-actions .hg-secondary-action {
        width: 100%;
    }

    .hgl-detail-backdrop {
        background: rgba(15, 23, 42, .28);
    }

    .hgl-detail-drawer {
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        height: auto;
        max-height: calc(100dvh - 16px);
        max-width: none;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }

    .hgl-detail-head-actions {
        justify-content: flex-start;
    }

    .hg-clipboard-card {
        padding: 18px;
    }

    .hg-clipboard-card strong {
        font-size: 20px;
    }

    .hg-clipboard-text {
        min-height: 310px;
        font-size: 15px;
    }

    .hgl-product-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .hgl-preview-row {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 10px;
        min-height: 50px;
        padding: 10px;
    }

    .hgl-preview-product-row {
        grid-template-columns: 24px 44px minmax(0, 1fr);
        grid-template-areas:
            "check id main"
            "check id meta";
        align-items: center;
    }

    .hgl-preview-product-row > input[type="checkbox"] {
        grid-area: check;
    }

    .hgl-preview-product-row .hgl-product-id {
        grid-area: id;
    }

    .hgl-preview-product-row .hgl-preview-main {
        grid-area: main;
    }

    .hgl-preview-product-row .hgl-preview-meta {
        grid-area: meta;
        display: flex;
        justify-content: space-between;
        justify-items: start;
        gap: 8px;
        padding-top: 2px;
    }

    .hgl-preview-meta span {
        max-width: none;
    }

    .hgl-orders-page .hgl-order-row {
        grid-template-columns: 64px minmax(0, 1fr);
        grid-template-areas:
            "id main"
            "id meta";
        align-items: center;
        min-height: 0;
        padding: 14px 12px;
        gap: 8px 10px;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-main {
        display: contents;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-id {
        grid-area: id;
        width: 64px;
        min-width: 64px;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-main > div {
        grid-area: main;
        min-width: 0;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-main strong {
        display: block;
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.12;
        font-size: 16px;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-main span:not(.hgl-product-id) {
        display: none;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-meta {
        grid-area: meta;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-width: 0;
        max-width: none;
        padding-left: 0;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-meta em {
        flex: 0 1 auto;
        max-width: 148px;
        text-align: center;
        white-space: normal;
        line-height: 1.15;
        font-size: 11px;
        padding: 6px 9px;
    }

    .hgl-orders-page .hgl-order-row .hgl-product-meta span {
        min-width: 0;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hgl-product-meta {
        justify-items: start;
        padding-left: 52px;
    }

    .hgl-client-final-row .hgl-product-main > div {
        display: block;
    }

    .hgl-drawer-page .hgl-client-final-row {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 8px;
        min-height: 0;
        padding: 12px 10px;
    }

    .hgl-client-final-row .hgl-product-main {
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: start;
    }

    .hgl-client-final-row .hgl-product-id {
        width: 56px;
        min-width: 56px;
    }

    .hgl-client-final-row .hgl-product-main strong {
        display: block;
        max-width: 100%;
        font-size: 14px;
        line-height: 1.18;
    }

    .hgl-client-final-row .hgl-product-main span:not(.hgl-product-id) {
        display: block;
        margin-top: 3px;
        max-width: 100%;
    }

    .hgl-client-final-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
        padding-left: 66px;
    }

    .hgl-client-final-meta span {
        max-width: 100%;
        font-size: 11px;
    }

    .hgl-row-actions {
        justify-content: stretch;
        padding-left: 52px;
    }

    .hgl-row-actions button {
        flex: 1 1 calc(50% - 8px);
    }

    .hgl-mapping-summary {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-erp-row {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .hgl-erp-row em {
        grid-column: 2;
        justify-self: start;
    }

    .hgl-client-summary {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-legacy-summary {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-migration-actions,
    .hgl-migration-controls {
        grid-template-columns: 1fr;
    }

    .hgl-control-grid,
    .hgl-control-grid-narrow,
    .hgl-control-links,
    .hgl-control-links-three,
    .hgl-control-actions {
        grid-template-columns: 1fr;
    }

    .hgl-control-tabs button {
        flex: 0 0 auto;
        min-width: min(170px, calc(50% - 8px));
    }

    .hgl-control-card .hgl-store-config-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .hgl-brand-multiple-row {
        grid-template-columns: 1fr;
    }

    .hgl-control-card .hgl-control-actions {
        padding: 0 12px 12px;
    }

    .hgl-client-summary div:nth-child(2n) {
        border-right: 0;
    }

    .hgl-client-summary div:nth-child(n+3) {
        border-top: 1px solid var(--hg-border);
    }

    .hgl-editor-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hgl-detail-drawer .hgl-editor-actions {
        position: sticky;
        bottom: 0;
        z-index: 4;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-top: 1px solid var(--hg-border);
        background: color-mix(in srgb, var(--hg-surface) 94%, var(--hg-bg));
        box-shadow: 0 -14px 30px rgba(15, 23, 42, .08);
    }

    .hgl-orders-page .hgl-order-status-summary,
    .hgl-orders-page .hgl-order-facts,
    .hgl-orders-page .hgl-order-editor {
        grid-template-columns: 1fr;
    }

    .hgl-orders-page .hgl-order-actions {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 14px 16px;
    }

    .hgl-orders-page .hgl-order-actions .hg-danger-action {
        margin-left: 0;
    }

    .hgl-orders-page .hgl-legacy-row {
        grid-template-columns: 1fr;
    }

    .hgl-orders-page .hgl-legacy-items-head,
.hgl-orders-page .hgl-legacy-item {
    grid-template-columns: 48px minmax(190px, 1fr) 110px 96px;
    min-width: 520px;
}
}

.hgl-orders-page .hgl-b2c-order-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--hg-border);
    background: transparent;
    color: var(--hg-text);
    display: grid;
    grid-template-columns: 86px minmax(220px, 1fr) minmax(210px, 260px);
    grid-template-areas:
        "id name state"
        "id sub state";
    gap: 4px 18px;
    align-items: center;
    min-height: 72px;
    padding: 12px 18px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hgl-orders-page .hgl-b2c-order-row:hover {
    background: rgba(46,125,50,.045);
}

.hgl-orders-page .hgl-b2c-order-row.selected {
    background: rgba(46,125,50,.10);
    box-shadow: inset 3px 0 0 var(--hg-primary);
}

.hgl-b2c-order-id {
    grid-area: id;
    width: 78px;
    min-width: 78px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(46,125,50,.11);
    color: var(--hg-primary);
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.hgl-b2c-order-body {
    display: contents;
}

.hgl-b2c-order-name {
    grid-area: name;
    min-width: 0;
    color: var(--hg-text);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.16;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-b2c-order-sub {
    grid-area: sub;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-b2c-order-state {
    grid-area: state;
    display: grid;
    justify-items: end;
    gap: 5px;
    min-width: 0;
}

.hgl-b2c-order-total {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.hgl-b2c-order-state em {
    max-width: 190px;
    text-align: center;
    line-height: 1.15;
}

@media (max-width: 760px) {
    .hgl-orders-page .hgl-b2c-order-row {
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-areas:
            "id name"
            "id state";
        gap: 9px;
        min-height: 74px;
        padding: 12px 12px;
        align-items: start;
    }

    .hgl-b2c-order-id {
        width: 56px;
        min-width: 56px;
        min-height: 30px;
        border-radius: 10px;
        font-size: 12px;
        margin-top: 2px;
    }

    .hgl-b2c-order-body {
        display: contents;
    }

    .hgl-b2c-order-name {
        font-size: 15px;
        line-height: 1.12;
        white-space: normal;
        text-align: left;
    }

    .hgl-b2c-order-sub {
        display: none;
    }

    .hgl-b2c-order-state {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        width: 100%;
    }

    .hgl-b2c-order-total {
        min-width: 0;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hgl-b2c-order-state em {
        flex: 0 0 auto;
        max-width: 142px;
        padding: 5px 8px;
        font-size: 10.5px;
        white-space: normal;
    }
}

@media print {
    @page {
        size: A4;
        margin: 8mm;
    }

    html,
    body {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
        color-scheme: light !important;
    }

    body {
        position: static !important;
    }

    html,
    body,
    .hg-app,
    .hg-main {
        background: #fff !important;
    }

    .hg-sidebar,
    .hg-shell-sidebar,
    .hg-shell-collapse-button,
    .hg-shell-open-button,
    .hg-bottom-nav,
    .hg-env-footer,
    .hg-theme-toggle,
    .print-hidden {
        display: none !important;
    }

    .hg-app {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
    }

    .hg-shell-content {
        display: block !important;
        width: auto !important;
        max-width: none !important;
    }

    .hg-main {
        padding: 0 !important;
        overflow: visible !important;
        width: auto !important;
    }

    .invoice-page {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .production-print-page {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        background: #fff !important;
        padding: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .production-sheet {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        transform: none !important;
    }

    .invoice-sheet {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 252mm !important;
        max-height: none !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        overflow: visible !important;
        transform: none !important;
        font-size: 10.5px;
        break-after: page;
        page-break-after: always;
    }

    .hg-label-page,
    .batch-sheet {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
    }

    .invoice-sheet:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .invoice-top,
    .invoice-registry,
    .invoice-client,
    .invoice-auth,
    .invoice-summary,
    .proforma-legal-text,
    .proforma-signature,
    .invoice-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .invoice-items {
        page-break-inside: auto;
    }

    .invoice-items thead {
        display: table-header-group;
    }

    .invoice-items tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .invoice-items th,
    .invoice-items td {
        padding: 4px 5px;
    }

    .invoice-footer {
        font-size: 9.5px;
    }
}

@media (max-width: 640px) {
    .hgl-drawer-page .hgl-detail-drawer {
        padding-bottom: var(--hg-mobile-bottom-clearance);
        scroll-padding-bottom: var(--hg-mobile-bottom-clearance);
    }

    .hgl-drawer-page .hgl-detail-drawer .hgl-editor-actions {
        position: static;
        bottom: auto;
        box-shadow: none;
    }
}


/* ---- LISTADO DE PRECIOS ---- */
.hg-precios-page .hgl-admin-top {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    grid-template-columns: 1fr;
    gap: 18px;
}

.hg-precios-page .hgl-admin-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 0;
}

.hg-precios-page .hgl-admin-title h1 {
    max-width: none;
}

.hg-precios-filters {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 12px;
}

.hg-precios-filter-fields {
    display: grid;
    grid-template-columns: minmax(200px, .72fr) minmax(320px, 1fr);
    gap: 12px;
    align-items: end;
}

.hg-precios-search-field {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.hg-precios-search-field label {
    min-width: 0;
}

.hg-precios-solo-activos {
    grid-column: 1 / -1;
    align-self: end;
    min-height: 42px;
    justify-content: flex-start;
}

.hg-precios-filter-actions {
    justify-content: flex-start;
    align-items: center;
}

.hg-precios-filter-actions button {
    min-width: 130px;
}

.hg-precios-workspace {
    grid-template-columns: minmax(720px, 1fr) minmax(360px, .42fr);
}

.hg-precios-table-wrap {
    max-height: calc(100vh - 221px);
}

.hg-precios-table,
.hg-precios-add-table {
    min-width: 920px;
}

.hg-precios-table .code,
.hg-precios-add-table .code {
    width: 110px;
}

.hg-precios-table .presentacion,
.hg-precios-add-table .presentacion {
    width: 150px;
}

.hg-precios-table tr.inactive,
.hg-precios-add-table tr.inactive {
    opacity: .68;
}

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

.hg-precios-modal {
    width: min(1120px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
}

.hg-precios-add-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto auto;
    gap: 10px;
    align-items: end;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hg-precios-add-toolbar label:not(.hg-check-inline) {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.hg-precios-add-wrap {
    max-height: min(56vh, 560px);
}

@media (max-width: 1280px) {
    .hg-precios-workspace {
        grid-template-columns: 1fr;
    }

    .hg-precios-grid-panel,
    .hg-precios-table-wrap {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .hg-precios-page .hgl-admin-top,
    .hg-precios-workspace,
    .hg-precios-filters,
    .hg-precios-filter-fields,
    .hg-precios-add-toolbar {
        grid-template-columns: 1fr;
    }

    .hg-precios-grid-panel,
    .hg-precios-table-wrap {
        max-height: none;
    }

    .hg-precios-modal {
        inset: 8px;
        width: auto;
    }
}


.hg-product-config-detail-page > .hg-product-config-top-actions,
.hg-product-config-top-actions {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    justify-content: flex-start !important;
    text-align: left;
}

.hg-product-config-top-actions .hg-danger-action {
    background: #FFF1F2;
    border-color: #FECDD3;
    color: var(--hg-danger);
}

.hg-product-config-top-actions .hg-danger-action:hover {
    background: #FFE4E6;
    color: #B91C1C;
}

.hgl-pro-dashboard-page .hgl-admin-top {
    grid-template-columns: 1fr;
}

.hgl-wholesale-page {
    width: 100%;
    max-width: 1220px;
    margin: 18px auto 0;
    gap: 0;
    justify-items: stretch;
}

.hgl-wholesale-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.hgl-wholesale-search button {
    min-height: 44px;
    border: 1px solid rgba(46, 125, 50, .28);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 9px 18px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.hgl-wholesale-search button:hover {
    background: rgba(46, 125, 50, .08);
}

.hgl-wholesale-search button:disabled {
    cursor: default;
    opacity: .6;
}

.hgl-wholesale-row {
    border-left: 4px solid transparent;
    min-height: 84px;
    padding: 14px 16px;
}

.hgl-wholesale-row.selected {
    border-left-color: var(--hg-primary);
    background: rgba(46, 125, 50, .08);
}

.hgl-wholesale-list {
    width: 100%;
    max-width: none;
    margin: 0;
}

.hgl-wholesale-row .hg-list-main-link {
    width: 100%;
}

.hgl-wholesale-row .hg-badge-row {
    margin-top: 7px;
}

.hgl-wholesale-ops {
    display: grid;
    gap: 12px;
}

.hgl-wholesale-ops label {
    display: block;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
}

.hgl-wholesale-ops textarea,
.hgl-wholesale-ops input {
    width: 100%;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-input-bg, var(--hg-surface));
    color: var(--hg-text);
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
}

.hgl-wholesale-ops textarea {
    min-height: 82px;
    resize: vertical;
}

.hgl-wholesale-erp-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.hgl-wholesale-erp-row small {
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 700;
    padding-bottom: 12px;
}

.hgl-pro-detail-actions.hgl-wholesale-state-actions {
    padding: 0;
    border-bottom: 0;
    gap: 8px;
}

.hgl-pro-detail-actions.hgl-wholesale-state-actions button {
    border-radius: 999px;
    padding: 9px 13px;
    font-size: 12px;
}

.hgl-pro-detail-actions.hgl-wholesale-state-actions .hg-secondary-action {
    background: var(--hg-surface);
    color: var(--hg-text);
    border-color: var(--hg-border);
}

.hgl-pro-detail-actions.hgl-wholesale-state-actions .hg-danger-action {
    background: #fff5f5;
    color: #b3261e;
    border-color: #ffc7c7;
}

.hgl-pro-detail-actions.hgl-wholesale-state-actions button:disabled {
    opacity: .55;
    cursor: default;
}

.hgl-pro-dashboard-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, .45fr) auto;
    align-items: end;
    gap: 14px;
}

.hgl-pro-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.hgl-pro-kpis > div {
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow);
    padding: 16px;
}

.hgl-pro-kpis span {
    display: block;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-pro-kpis strong {
    display: block;
    margin-top: 7px;
    color: var(--hg-text);
    font-size: 24px;
    line-height: 1.05;
}

.hgl-pro-list {
    overflow: hidden;
}

.hgl-pro-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, .9fr) minmax(220px, .7fr);
    gap: 14px;
    align-items: center;
    border: 0;
    border-top: 1px solid var(--hg-border);
    background: transparent;
    padding: 16px 18px;
    text-align: left;
    color: var(--hg-text);
    cursor: pointer;
}

.hgl-pro-row:hover,
.hgl-pro-row.selected {
    background: rgba(46, 125, 50, .08);
}

.hgl-pro-row.selected {
    box-shadow: inset 4px 0 0 var(--hg-primary);
}

.hgl-pro-main strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
}

.hgl-pro-main small,
.hgl-pro-metrics span {
    display: block;
    color: var(--hg-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.hgl-pro-metrics {
    display: grid;
    gap: 3px;
}

.hgl-pro-badges {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.hgl-pro-detail {
    max-height: calc(100vh - 88px);
    overflow-y: auto;
}

.hgl-pro-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-pro-detail-actions button {
    border: 1px solid rgba(46, 125, 50, .24);
    border-radius: 999px;
    background: var(--hg-primary);
    color: #fff;
    padding: 10px 14px;
    font-weight: 900;
}

.hgl-wholesale-head-total {
    display: grid;
    gap: 2px;
    justify-items: end;
}

.hgl-wholesale-head-total span {
    color: var(--hg-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-pro-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--hg-border);
}

.hgl-pro-detail-grid > div {
    border-right: 1px solid var(--hg-border);
    border-bottom: 1px solid var(--hg-border);
    padding: 14px 16px;
}

.hgl-pro-detail-grid span {
    display: block;
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-pro-detail-grid strong {
    display: block;
    margin-top: 6px;
}

.hgl-pro-detail-section {
    padding: 16px;
    border-bottom: 1px solid var(--hg-border);
}

.hgl-wholesale-order-primary {
    background: color-mix(in srgb, var(--hg-primary) 5%, var(--hg-surface));
}

.hgl-wholesale-tax-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.hgl-wholesale-tax-summary > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(46, 125, 50, .16);
    border-radius: 12px;
    background: var(--hg-surface);
}

.hgl-wholesale-tax-summary span {
    color: var(--hg-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-wholesale-tax-summary strong {
    font-size: 18px;
}

.hgl-pro-mini-row {
    display: grid;
    gap: 3px;
    padding: 12px 0;
    border-top: 1px solid var(--hg-border);
}

.hgl-pro-mini-row:first-of-type {
    border-top: 0;
}

.hgl-pro-mini-row span,
.hgl-pro-mini-row small,
.hgl-muted {
    color: var(--hg-muted);
    font-weight: 700;
}

.hgl-pro-order-card {
    border-top: 1px solid var(--hg-border);
    padding: 0;
}

.hgl-pro-order-card:first-of-type {
    border-top: 0;
}

.hgl-pro-order-card summary {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    cursor: pointer;
    list-style: none;
}

.hgl-pro-order-card summary::-webkit-details-marker {
    display: none;
}

.hgl-pro-order-card summary::before {
    content: "+";
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(46, 125, 50, .22);
    border-radius: 999px;
    color: var(--hg-primary);
    font-weight: 900;
    grid-column: 1;
    grid-row: 1;
}

.hgl-pro-order-card[open] summary::before {
    content: "-";
}

.hgl-pro-order-card summary > span:first-child {
    display: grid;
    gap: 2px;
    grid-column: 2;
}

.hgl-pro-order-card summary small,
.hgl-pro-order-note,
.hgl-pro-order-line small {
    color: var(--hg-muted);
    font-weight: 700;
}

.hgl-pro-order-total {
    display: grid;
    gap: 2px;
    justify-items: end;
    grid-column: 3;
}

.hgl-pro-order-note {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(46, 125, 50, .14);
    border-radius: 12px;
    background: rgba(46, 125, 50, .06);
}

.hgl-pro-order-lines {
    display: grid;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.hgl-pro-order-line {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(110px, auto);
    gap: 12px;
    align-items: start;
    padding: 11px 12px;
    border-top: 1px solid var(--hg-border);
    background: var(--hg-surface);
}

.hgl-pro-order-line:first-child {
    border-top: 0;
}

.hgl-pro-order-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    border-radius: 999px;
    background: rgba(46, 125, 50, .12);
    color: var(--hg-primary);
    font-weight: 900;
}

.hgl-pro-order-line > span:nth-child(2) {
    display: grid;
    gap: 2px;
}

.hgl-pro-order-money {
    display: grid;
    gap: 2px;
    justify-items: end;
    text-align: right;
}

.hgl-pro-web-account {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hgl-pro-web-account > div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-right: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 56%, var(--hg-surface));
}

.hgl-pro-web-account > div:last-child {
    border-right: 0;
}

.hgl-pro-web-account span {
    color: var(--hg-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hgl-pro-web-account strong {
    color: var(--hg-text);
    font-weight: 850;
}

@media (max-width: 1180px) {
    .hgl-pro-dashboard-page .hgl-admin-top,
    .hgl-pro-dashboard-filters {
        grid-template-columns: 1fr;
    }

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

    .hgl-pro-row {
        grid-template-columns: minmax(220px, 1fr) minmax(180px, .8fr);
    }

    .hgl-pro-badges {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .hgl-wholesale-search {
        grid-template-columns: 1fr;
    }

    .hgl-wholesale-search button {
        width: 100%;
    }

    .hgl-wholesale-page {
        margin-top: 12px;
        padding: 0 12px;
    }

    .hgl-wholesale-list {
        margin: 0;
    }

    .hgl-wholesale-row {
        padding: 12px;
        min-height: 0;
    }

    .hgl-wholesale-row .hg-list-main-link {
        align-items: flex-start;
    }

    .hgl-wholesale-row .hg-list-right {
        min-width: 88px;
    }

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

    .hgl-pro-kpis > div {
        padding: 12px;
    }

    .hgl-pro-kpis strong {
        font-size: 18px;
    }

    .hgl-pro-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
    }

    .hgl-pro-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-pro-metrics span:last-child {
        grid-column: 1 / -1;
    }

    .hgl-pro-detail {
        inset: 10px;
        width: auto;
        max-height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .hgl-pro-detail-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-wholesale-tax-summary {
        grid-template-columns: 1fr;
    }

    .hgl-wholesale-head-total {
        justify-items: start;
    }

    .hgl-pro-detail-actions button {
        flex: 1 1 100%;
    }

    .hgl-pro-order-card summary {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 4px;
    }

    .hgl-pro-order-total {
        grid-column: 2;
        justify-items: start;
    }

    .hgl-pro-order-line {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .hgl-pro-order-money {
        grid-column: 2;
        justify-items: start;
        text-align: left;
    }

    .hgl-pro-web-account {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-pro-web-account > div {
        border-right: 0;
        border-bottom: 1px solid var(--hg-border);
    }
}

/* HGMobile API/WASM polish: cupones y compras mayoristas */
.hgl-coupon-workspace {
    align-items: start;
}

.hgl-coupon-workspace .hgl-detail-drawer.hgl-editor-panel,
.hgl-wholesale-page .hgl-detail-drawer.hgl-editor-panel {
    max-height: calc(100vh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
}

.hgl-coupon-workspace .hgl-detail-drawer.hgl-editor-panel {
    width: min(1120px, calc(100vw - 36px));
}

.hgl-coupon-summary {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 132px 84px;
    gap: 0;
}

.hgl-coupon-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}

.hgl-coupon-editor label,
.hgl-coupon-margin-list {
    min-width: 0;
}

.hgl-coupon-pro-selector,
.hgl-coupon-margin,
.hgl-coupon-workspace .hgl-editor-actions {
    grid-column: 1 / -1;
}

.hgl-coupon-pro-head button,
.hgl-coupon-pro-selected button,
.hgl-coupon-margin button,
.hgl-coupon-workspace .hgl-editor-actions button {
    appearance: none;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
}

.hgl-coupon-pro-selector,
.hgl-coupon-margin {
    box-shadow: none;
}

.hgl-coupon-pro-results button {
    border-radius: 0;
}

.hgl-coupon-pro-results .hg-status-pill,
.hgl-coupon-summary .hg-status-pill {
    justify-self: end;
}

.hgl-coupon-workspace .hgl-editor-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--hg-border);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .06);
}

.hgl-wholesale-page {
    width: 100%;
    max-width: none;
    margin: 0;
    justify-items: stretch;
}

.hgl-wholesale-list {
    border: 1px solid var(--hg-border);
    border-radius: 20px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow);
    overflow: hidden;
}

.hgl-wholesale-row {
    display: block;
    min-height: 0;
    padding: 0;
    border-left-width: 0;
    border-top: 1px solid var(--hg-border);
}

.hgl-wholesale-row:first-child {
    border-top: 0;
}

.hgl-wholesale-row.selected {
    border-left: 0;
    box-shadow: inset 4px 0 0 var(--hg-primary);
}

.hgl-wholesale-row .hg-list-main-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, auto) 22px;
    align-items: center;
    gap: 18px;
    min-height: 82px;
    padding: 16px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
}

.hgl-wholesale-row .hg-list-main-link:hover {
    background: rgba(46, 125, 50, .055);
}

.hgl-wholesale-row .hg-list-body {
    min-width: 0;
}

.hgl-wholesale-row .hg-list-body h3,
.hgl-wholesale-row .hg-list-body p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hgl-wholesale-row .hg-list-right {
    display: grid;
    justify-items: end;
    gap: 5px;
    min-width: 0;
}

.hgl-wholesale-row .hg-list-right .amount {
    color: var(--hg-primary);
    font-size: 20px;
    font-weight: 850;
    line-height: 1.1;
}

.hgl-wholesale-row .hg-list-right .date {
    color: var(--hg-muted);
    font-size: 12px;
    font-weight: 760;
    text-align: right;
}

.hgl-wholesale-row .hg-list-chevron {
    color: var(--hg-muted);
    font-size: 28px;
    line-height: 1;
}

.hgl-wholesale-row .hg-badge-row {
    gap: 6px;
    margin-top: 8px;
}

.hgl-pro-detail-actions button {
    cursor: pointer;
}

@media (max-width: 760px) {
    .hgl-coupon-workspace {
        grid-template-columns: 1fr;
    }

    .hgl-coupon-workspace .hgl-detail-drawer.hgl-editor-panel,
    .hgl-wholesale-page .hgl-detail-drawer.hgl-editor-panel {
        inset: 10px;
        width: auto;
        max-height: calc(100dvh - 20px);
        border-radius: 20px;
    }

    .hgl-coupon-summary {
        grid-template-columns: 1fr 1fr;
    }

    .hgl-coupon-editor {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .hgl-coupon-margin {
        padding: 12px;
    }

    .hgl-wholesale-row .hg-list-main-link {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 92px;
        padding: 14px;
    }

    .hgl-wholesale-row .hg-list-chevron {
        display: none;
    }

    .hgl-wholesale-row .hg-list-right {
        align-self: start;
        max-width: 132px;
    }

    .hgl-wholesale-row .hg-list-right .amount {
        font-size: 17px;
    }

    .hgl-wholesale-row .hg-list-right .date {
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .hgl-coupon-summary {
        grid-template-columns: 1fr;
    }

    .hgl-coupon-workspace .hgl-editor-actions button {
        flex: 1 1 100%;
    }

    .hgl-wholesale-row .hg-list-body h3 {
        max-width: 180px;
    }

    .hgl-wholesale-row .hg-badge-row .hg-status-pill:nth-child(n+3) {
        display: none;
    }
}

/* Compras mayoristas: controles y estado vacio sin SignalR */
.hgl-wholesale-page .hgl-wholesale-controls {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 22px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow);
}

.hgl-wholesale-page .hgl-wholesale-tabs,
.hgl-wholesale-page .hgl-wholesale-search {
    position: static;
    top: auto;
    z-index: auto;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hgl-wholesale-page .hgl-wholesale-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
}

.hgl-wholesale-page .hgl-wholesale-tabs button {
    min-height: 42px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: rgba(46, 125, 50, .04);
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0;
}

.hgl-wholesale-page .hgl-wholesale-tabs button.active {
    border-color: var(--hg-text);
    background: var(--hg-text);
    color: var(--hg-surface);
}

.hgl-wholesale-page .hgl-wholesale-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 0;
}

.hgl-wholesale-page .hgl-wholesale-search input {
    min-height: 44px;
}

.hgl-wholesale-page .hgl-wholesale-empty {
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 28px 0 44px;
}

.hgl-wholesale-empty-card {
    width: 100%;
    display: grid;
    gap: 10px;
    padding: 28px;
    border: 1px solid rgba(46, 125, 50, .16);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(46, 125, 50, .08), rgba(255, 255, 255, .92)),
        var(--hg-surface);
    box-shadow: var(--hg-shadow);
}

.hgl-wholesale-empty-card span {
    color: var(--hg-primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.hgl-wholesale-empty-card h2 {
    margin: 0;
    color: var(--hg-text);
    font-size: 24px;
    line-height: 1.1;
}

.hgl-wholesale-empty-card p {
    max-width: 520px;
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
}

.hgl-wholesale-empty-card .hg-secondary-action {
    width: max-content;
    margin-top: 8px;
}

.hgl-wholesale-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.hgl-wholesale-empty-actions .hg-secondary-action {
    margin-top: 0;
}

:root[data-theme="dark"] .hgl-wholesale-page .hgl-wholesale-tabs button {
    background: rgba(255, 255, 255, .03);
}

:root[data-theme="dark"] .hgl-wholesale-page .hgl-wholesale-tabs button.active {
    border-color: #f4f4f5;
    background: #f4f4f5;
    color: #171717;
}

:root[data-theme="dark"] .hgl-wholesale-empty-card {
    border-color: rgba(70, 160, 85, .25);
    background:
        linear-gradient(135deg, rgba(46, 125, 50, .14), rgba(20, 20, 24, .96)),
        var(--hg-surface);
}

@media (max-width: 720px) {
    .hgl-wholesale-page .hgl-wholesale-controls {
        padding: 12px;
        border-radius: 18px;
    }

    .hgl-wholesale-page .hgl-wholesale-tabs {
        gap: 6px;
    }

    .hgl-wholesale-page .hgl-wholesale-tabs button {
        min-height: 40px;
        padding: 8px 6px;
        font-size: 12px;
    }

    .hgl-wholesale-page .hgl-wholesale-search {
        grid-template-columns: 1fr;
    }

    .hgl-wholesale-page .hgl-wholesale-search button {
        width: 100%;
    }

    .hgl-wholesale-page .hgl-wholesale-empty {
        min-height: 0;
        padding: 18px 0 30px;
    }

    .hgl-wholesale-empty-card {
        padding: 20px;
        border-radius: 20px;
    }

    .hgl-wholesale-empty-card h2 {
        font-size: 21px;
    }

    .hgl-wholesale-empty-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hgl-wholesale-empty-actions .hg-secondary-action {
        width: 100%;
    }

    .hgl-new-product-grid {
        grid-template-columns: 1fr;
    }

    .hgl-new-product-results {
        max-height: 260px;
    }
}

/* Exclusiones remito: listado admin compacto */
.hgl-remito-config-page {
    width: 100%;
    max-width: none;
    margin: 0;
    justify-items: stretch;
}

.hgl-remito-config-page .hgl-admin-top {
    margin-bottom: 20px;
}

.hgl-remito-config-controls {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--hg-border);
    border-radius: 22px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow);
}

.hgl-remito-config-search {
    position: static;
    top: auto;
    z-index: auto;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hgl-remito-config-search input {
    min-height: 44px;
}

.hgl-remito-config-search button {
    min-height: 42px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    padding: 0 16px;
    font-size: 13px;
    font-weight: 850;
}

.hgl-remito-config-search button.hg-primary-action {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}

.hgl-remito-config-search button:disabled {
    opacity: .62;
}

.hgl-remito-config-list {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow);
}

.hgl-remito-config-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 130px minmax(280px, 420px);
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--hg-border);
    background: var(--hg-surface);
}

.hgl-remito-config-row:last-child {
    border-bottom: 0;
}

.hgl-remito-config-row.excluded {
    background: rgba(46, 125, 50, .045);
}

.hgl-remito-config-row .hg-list-title {
    font-size: 15px;
    font-weight: 850;
}

.hgl-remito-config-row .hg-list-sub {
    margin-top: 4px;
}

.hgl-remito-product .hg-badge-row {
    margin-top: 10px;
}

.hgl-remito-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--hg-border);
    border-radius: 999px;
    background: var(--hg-bg);
    color: var(--hg-text);
    font-weight: 850;
}

.hgl-remito-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--hg-primary);
}

.hgl-remito-observation {
    display: grid;
    gap: 6px;
}

.hgl-remito-observation span {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.hgl-remito-observation input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    font-weight: 750;
}

.hgl-remito-observation input:focus {
    outline: none;
    border-color: rgba(46, 125, 50, .55);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, .12);
}

:root[data-theme="dark"] .hgl-remito-config-row.excluded {
    background: rgba(74, 222, 128, .06);
}

@media (max-width: 900px) {
    .hgl-remito-config-search {
        grid-template-columns: 1fr;
    }

    .hgl-remito-config-search button {
        width: 100%;
    }

    .hgl-remito-config-row {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }

    .hgl-remito-toggle {
        justify-content: flex-start;
        width: fit-content;
    }
}
/* Fallback visible mientras una pantalla interactiva todavía no pudo iniciar. */
.hg-client-startup-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: min(440px, 58vh);
    padding: 32px 20px;
    color: var(--hg-text-muted);
    text-align: center;
}

.hg-client-startup-fallback[hidden] {
    display: none;
}

/*
 * El layout del host y la pantalla interactiva se hidratan por separado.
 * Durante algunas navegaciones internas el evento JS de finalizacion puede no
 * llegar, aunque el contenido cliente ya este renderizado. En ese estado el
 * fallback deja de ser el ultimo elemento de <main>; ocultarlo por estructura
 * evita que quede un loader fantasma encima de una pantalla operativa.
 */
.hg-client-startup-fallback:not(:last-child) {
    display: none;
}

/* Administrador de atributos productivos de insumos. */
.hg-insumo-attributes-heading { align-items: end; }

.hg-insumo-attributes-layout {
    display: grid;
    grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.55fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.hg-insumo-attributes-detail { display: grid; gap: 18px; }
.hg-insumo-attributes-master { position: sticky; top: 18px; }

.hg-insumo-attributes-page .hg-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.hg-insumo-attributes-page .hg-card-title-row p {
    margin: 4px 0 0;
    color: var(--hg-text-muted);
    font-size: 12px;
}

.hg-insumo-quick-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
}

.hg-insumo-attribute-list,
.hg-insumo-value-list { display: grid; gap: 8px; }

.hg-insumo-attribute-row,
.hg-insumo-value-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    border: 1px solid var(--hg-border);
    border-radius: 11px;
    background: var(--hg-surface-soft);
    color: var(--hg-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.hg-insumo-attribute-row:hover,
.hg-insumo-value-row:hover {
    border-color: color-mix(in srgb, var(--hg-primary) 45%, var(--hg-border));
    transform: translateY(-1px);
}

.hg-insumo-attribute-row.is-selected,
.hg-insumo-value-row.is-selected {
    border-color: var(--hg-primary);
    background: color-mix(in srgb, var(--hg-primary) 10%, var(--hg-surface));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--hg-primary) 12%, transparent);
}

.hg-insumo-attribute-row.is-inactive,
.hg-insumo-value-row.is-inactive { opacity: .62; }

.hg-insumo-attribute-row > span:first-child,
.hg-insumo-value-row > span:first-child { display: grid; min-width: 0; gap: 3px; }

.hg-insumo-attribute-row small,
.hg-insumo-value-row small {
    overflow: hidden;
    color: var(--hg-text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-insumo-attribute-badges,
.hg-insumo-value-row > span:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.hg-insumo-attribute-row em,
.hg-insumo-value-row em {
    padding: 3px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 13%, var(--hg-surface));
    color: var(--hg-primary);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.hg-insumo-attribute-editor { margin-bottom: 12px; }

.hg-insumo-check-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 13px 0;
    color: var(--hg-text);
    font-size: 12px;
}

.hg-insumo-check-grid label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hg-insumo-value-editor { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hg-border); }

.hg-insumo-attributes-page .hg-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.hg-insumo-attributes-placeholder { min-height: 200px; display: grid; place-items: center; }
.hg-insumo-attributes-empty { min-height: 110px; }

@media (max-width: 980px) {
    .hg-insumo-attributes-layout { grid-template-columns: 1fr; }
    .hg-insumo-attributes-master { position: static; }
}

@media (max-width: 560px) {
    .hg-insumo-quick-add { grid-template-columns: 1fr; }
    .hg-insumo-quick-add button,
    .hg-insumo-attributes-page .hg-card-actions button { width: 100%; justify-content: center; }
    .hg-insumo-attribute-row,
    .hg-insumo-value-row { align-items: flex-start; flex-direction: column; }
    .hg-insumo-attribute-badges,
    .hg-insumo-value-row > span:last-child { justify-content: flex-start; }
}

.hg-client-startup-fallback strong {
    color: var(--hg-text);
    font-size: 16px;
}

.hg-client-startup-fallback span {
    max-width: 420px;
    font-size: 12px;
    line-height: 1.45;
}

.hg-client-startup-fallback [data-hg-client-startup-retry] {
    display: none;
    margin-top: 8px;
}

.hg-client-startup-fallback.hg-client-startup-delayed [data-hg-client-startup-retry] {
    display: inline-flex;
}

/* Resultado visible de acciones dentro de paneles laterales. */
.hg-success-msg,
.hg-warning-msg,
.hg-info-msg {
    padding: 12px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.hg-success-msg {
    border-color: rgba(22, 101, 52, .25);
    background: #ecfdf3;
    color: #166534;
}

.hg-warning-msg {
    border-color: rgba(161, 98, 7, .28);
    background: #fffbeb;
    color: #92400e;
}

.hg-info-msg {
    border-color: rgba(30, 64, 175, .24);
    background: #eff6ff;
    color: #1e3a8a;
}

.hgl-action-feedback {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 18px;
    border: 0;
    border-top: 1px solid var(--hg-border);
    border-bottom: 1px solid var(--hg-border);
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}

.hgl-action-feedback.is-loading {
    grid-template-columns: auto minmax(0, 1fr);
    background: color-mix(in srgb, var(--hg-primary) 8%, var(--hg-surface));
    color: var(--hg-text);
}

.hgl-action-feedback .hg-spinner {
    width: 24px;
    height: 24px;
}

.hgl-action-feedback-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 900;
}

.hgl-action-feedback strong,
.hgl-action-feedback span {
    display: block;
}

.hgl-action-feedback strong {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 900;
}

.hgl-action-feedback span {
    font-size: 13px;
    line-height: 1.4;
}

.hgl-action-feedback > button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: currentColor;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.hgl-action-feedback > button:hover {
    background: rgba(15, 23, 42, .08);
}

:root[data-theme="dark"] .hg-success-msg {
    border-color: rgba(74, 222, 128, .3);
    background: rgba(22, 101, 52, .28);
    color: #bbf7d0;
}

:root[data-theme="dark"] .hg-warning-msg {
    background: rgba(146, 64, 14, .25);
    color: #fde68a;
}

:root[data-theme="dark"] .hg-info-msg {
    background: rgba(30, 58, 138, .28);
    color: #bfdbfe;
}

/* Los mensajes existentes de otras pantallas con drawer quedan por encima del panel. */
.hgl-drawer-page:has(.hgl-detail-drawer) > :is(.hg-success-msg, .hg-error-msg, .hg-warning-msg, .hg-info-msg, .hg-info, .hg-alert) {
    position: fixed;
    top: 106px;
    right: 42px;
    z-index: 90;
    width: min(824px, calc(100vw - 84px));
    margin: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

@media (max-width: 900px) {
    .hgl-drawer-page:has(.hgl-detail-drawer) > :is(.hg-success-msg, .hg-error-msg, .hg-warning-msg, .hg-info-msg, .hg-info, .hg-alert) {
        top: 88px;
        right: 18px;
        width: calc(100vw - 36px);
    }
}
/* Campañas guardadas de HGMobile Marketing */
.hg-marketing-drafts {
  overflow: hidden;
}

.hg-marketing-drafts-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--hg-border);
  padding: 16px 18px;
}

.hg-marketing-drafts-head span {
  color: var(--hg-primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hg-marketing-drafts-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.hg-marketing-drafts-head small {
  max-width: 390px;
  color: var(--hg-text-muted);
  font-size: 10px;
  line-height: 1.45;
}

.hg-marketing-drafts-list {
  display: grid;
}

.hg-marketing-draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid var(--hg-border);
}

.hg-marketing-draft-row:last-child {
  border-bottom: 0;
}

.hg-marketing-draft-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  color: var(--hg-text);
  padding: 12px 17px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.hg-marketing-draft-open:hover {
  background: color-mix(in srgb, var(--hg-primary) 6%, var(--hg-surface));
}

.hg-marketing-draft-discard {
  align-self: center;
  margin-right: 14px;
  border: 0;
  background: transparent;
  color: var(--hg-danger);
  padding: 8px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.hg-marketing-draft-discard:hover {
  text-decoration: underline;
}

.hg-marketing-drafts-list span,
.hg-marketing-drafts-list small,
.hg-marketing-drafts-list strong,
.hg-marketing-drafts-list em,
.hg-marketing-drafts-list b {
  display: block;
}

.hg-marketing-drafts-list small {
  color: var(--hg-primary);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.hg-marketing-drafts-list strong {
  margin-top: 2px;
  font-size: 12px;
}

.hg-marketing-drafts-list em {
  margin-top: 4px;
  color: var(--hg-text-muted);
  font-size: 9px;
  font-style: normal;
}

.hg-marketing-draft-open > span:nth-child(2) {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.hg-marketing-drafts-list b {
  border-radius: 999px;
  background: color-mix(in srgb, var(--hg-text-muted) 10%, var(--hg-surface));
  color: var(--hg-text-muted);
  padding: 4px 7px;
  font-size: 8px;
}

.hg-marketing-drafts-list b.is-pausada {
  color: #9a6900;
}

.hg-marketing-drafts-list b.is-publicada {
  color: var(--hg-primary);
}

.hg-marketing-drafts-list b.is-error {
  color: var(--hg-danger);
}

.hg-marketing-drafts-list i {
  color: var(--hg-primary);
  font-size: 20px;
  font-style: normal;
}

@media (max-width: 720px) {
  .hg-marketing-drafts-head {
    display: grid;
  }

  .hg-marketing-draft-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hg-marketing-draft-open {
    grid-template-columns: minmax(0, 1fr) 18px;
  }

  .hg-marketing-draft-open > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-items: start;
  }

  .hg-marketing-draft-discard {
    justify-self: start;
    margin: 0 0 10px 10px;
  }
}

/* Subtle color only on navigation group titles */
.hg-nav-tone-green-a { --hg-nav-tone: 209 238 216; --hg-nav-accent: 54 108 70; }
.hg-nav-tone-green-b { --hg-nav-tone: 226 240 211; --hg-nav-accent: 76 108 59; }

.hg-nav-group[class*="hg-nav-tone-"] .hg-nav-group-title,
.hg-mobile-menu-group[class*="hg-nav-tone-"] .hg-nav-group-title {
    color: rgb(var(--hg-nav-accent));
}

:root[data-theme="dark"] .hg-nav-group[class*="hg-nav-tone-"] .hg-nav-group-title,
:root[data-theme="dark"] .hg-mobile-menu-group[class*="hg-nav-tone-"] .hg-nav-group-title {
    color: rgb(var(--hg-nav-tone) / .78);
}

/* ---- UNIFIED UI PRIMITIVES ---- */
.hg-ui-page-header {
    margin-bottom: 0;
}

/* Los encabezados de pantalla comparten una escala compacta: la información
   principal queda visible sin desplazar el espacio de trabajo hacia abajo. */
.hg-ui-page-header > .hgl-admin-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    padding: 18px 22px;
    border-radius: 18px;
}

.hg-ui-page-header > .hgl-admin-title > span,
.hg-ui-page-header > .hgl-admin-title > h1,
.hg-ui-page-header > .hgl-admin-title > p {
    grid-column: 1;
    min-width: 0;
}

.hg-ui-page-header > .hgl-admin-title > span {
    margin-bottom: 4px;
    font-size: 10px;
}

.hg-ui-page-header > .hgl-admin-title > h1 {
    margin-bottom: 5px;
    font-size: clamp(28px, 2.5vw, 34px);
}

.hg-ui-page-header > .hgl-admin-title > p {
    font-size: 14px;
}

.hg-ui-page-header > .hgl-admin-title > .hg-title-actions {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    justify-content: flex-end;
    margin-top: 0;
}

.hg-ui-page-header > :not(.hgl-admin-title) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.hg-ui-page-header > .hg-search,
.hg-ui-page-header > .hg-filter-row {
    position: static;
    top: auto;
    z-index: auto;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.hg-ui-page-header > .hg-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px;
}

.hg-ui-page-header > .hg-filter-row {
    border-bottom: 1px solid var(--hg-border);
}

.hg-ui-section-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.hg-ui-section-host,
.hg-ui-section-host > .hg-ui-section-toolbar {
    width: 100%;
}

.hg-ui-section-back,
.hg-ui-section-tabs :is(a, button) {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--hg-text-muted);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.hg-ui-section-back {
    gap: 8px;
    padding: 0 13px;
    color: var(--hg-primary);
}

.hg-ui-section-back > span:first-child {
    font-size: 17px;
    line-height: 1;
}

.hg-ui-section-back:hover,
.hg-ui-section-tabs :is(a, button):hover {
    background: color-mix(in srgb, var(--hg-primary) 7%, var(--hg-surface));
    color: var(--hg-primary);
}

.hg-ui-section-tabs {
    min-width: 0;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--hg-border) 46%, transparent);
}

.hg-ui-section-tabs :is(a, button) {
    flex: 1 1 140px;
    padding: 0 16px;
    white-space: nowrap;
}

.hg-ui-section-tabs :is(a, button).active {
    color: var(--hg-text);
    background: var(--hg-surface);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.hg-ui-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.hg-ui-section-toolbar.no-tabs .hg-ui-section-actions {
    grid-column: 3;
}

.hg-ui-section-toolbar.no-back.has-tabs {
    grid-template-columns: minmax(0, 1fr) auto;
}

.hg-ui-section-toolbar.no-back.has-tabs .hg-ui-section-actions {
    grid-column: 2;
}

.hg-ui-context-menu {
    position: relative;
}

.hg-ui-context-menu[open] {
    z-index: 40;
}

.hg-ui-context-menu-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    color: var(--hg-text);
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1px;
    list-style: none;
}

.hg-ui-context-menu-button::-webkit-details-marker {
    display: none;
}

.hg-ui-context-menu-button::marker {
    content: "";
}

.hg-ui-context-menu-button:hover {
    border-color: color-mix(in srgb, var(--hg-primary) 35%, var(--hg-border));
    color: var(--hg-primary);
    background: color-mix(in srgb, var(--hg-primary) 7%, var(--hg-surface));
}

.hg-ui-context-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--hg-border);
    border-radius: 12px;
    background: var(--hg-surface);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
}

.hg-ui-context-menu-panel .hg-file-action {
    position: relative;
    overflow: hidden;
}

.hg-ui-context-menu-panel .hg-file-action input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.hg-ui-context-menu-panel .hg-file-action.disabled {
    opacity: .45;
    pointer-events: none;
}

.hg-ui-section-tabs button span {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    margin-left: 7px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 11%, transparent);
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 900;
}

@media (max-width: 720px) {
    .hg-ui-page-header > .hgl-admin-title {
        grid-template-columns: minmax(0, 1fr);
        padding: 17px 18px;
    }

    .hg-ui-page-header > .hgl-admin-title > h1 {
        font-size: 27px;
    }

    .hg-ui-page-header > .hgl-admin-title > .hg-title-actions {
        grid-column: 1;
        grid-row: auto;
        justify-content: flex-start;
        margin-top: 12px;
    }

    .hg-ui-section-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .hg-ui-section-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .hg-ui-section-toolbar.no-back.has-tabs .hg-ui-section-tabs {
        grid-row: 1;
    }

    .hg-ui-section-tabs::-webkit-scrollbar {
        display: none;
    }

    .hg-ui-section-tabs :is(a, button) {
        flex: 1 0 auto;
        min-width: max-content;
    }

    .hg-ui-section-back {
        justify-self: start;
    }

    .hg-ui-section-toolbar.no-tabs .hg-ui-section-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .hg-ui-context-menu-panel {
        min-width: min(260px, calc(100vw - 40px));
    }
}

.hg-ui-modal {
    isolation: isolate;
}

/* Los modales globales deben quedar por encima de drawers y sus backdrops. */
.hg-ui-modal-backdrop {
    z-index: 2200;
}

.hg-ui-modal-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--hg-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.hg-ui-modal :is(.hg-modal-header, .hg-modal-head) > .hg-icon-button {
    flex: 0 0 auto;
}

.hg-ui-confirm {
    width: min(520px, 100%);
}

.hg-ui-confirm-content {
    padding: 20px;
}

.hg-ui-confirm-content p {
    margin: 0;
    color: var(--hg-text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.55;
    white-space: pre-line;
}

.hg-ui-confirm-actions {
    padding: 14px 20px 20px;
}

.hg-ui-toast-region {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2400;
    display: grid;
    gap: 10px;
    width: min(390px, calc(100vw - 36px));
    pointer-events: none;
}

.hg-ui-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 11px;
    align-items: start;
    padding: 13px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--hg-surface) 96%, var(--hg-bg));
    color: var(--hg-text);
    box-shadow: 0 18px 48px rgba(15, 23, 42, .20);
    pointer-events: auto;
}

.hg-ui-toast-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-weight: 900;
}

.hg-ui-toast strong,
.hg-ui-toast p {
    display: block;
    margin: 0;
}

.hg-ui-toast strong {
    font-size: 13px;
}

.hg-ui-toast p {
    margin-top: 2px;
    color: var(--hg-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.hg-ui-toast > button {
    border: 0;
    background: transparent;
    color: var(--hg-text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.hg-ui-toast-info { border-left: 4px solid #2563EB; }
.hg-ui-toast-success { border-left: 4px solid var(--hg-success); }
.hg-ui-toast-warning { border-left: 4px solid var(--hg-warning); }
.hg-ui-toast-error { border-left: 4px solid var(--hg-danger); }

.hg-ui-drawer-backdrop {
    z-index: 440;
    background: rgba(15, 23, 42, .36);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.hg-ui-drawer {
    top: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 441;
    width: min(820px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    border-radius: 20px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

.hg-ui-drawer > .hgl-editor-head {
    position: sticky;
    top: 0;
    z-index: 8;
    background: color-mix(in srgb, var(--hg-surface) 96%, var(--hg-bg));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hg-ui-drawer > .hgl-editor-head .hgl-drawer-close {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
}

.hg-ui-drawer > .hgl-editor-head .hgl-drawer-close::before {
    content: "×";
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 720px) {
    .hg-ui-toast-region {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .hg-ui-drawer {
        top: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }
}

.hg-ui-feedback {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border: 1px solid var(--hg-border);
    border-radius: 10px;
    background: var(--hg-surface);
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}

.hg-ui-feedback-icon {
    display: inline-grid;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 12px;
    font-weight: 900;
}

.hg-ui-feedback-info {
    border-color: color-mix(in srgb, #2563EB 28%, var(--hg-border));
    background: color-mix(in srgb, #2563EB 7%, var(--hg-surface));
    color: color-mix(in srgb, #2563EB 78%, var(--hg-text));
}

.hg-ui-feedback-success {
    border-color: color-mix(in srgb, var(--hg-success) 30%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-success) 8%, var(--hg-surface));
    color: color-mix(in srgb, var(--hg-success) 78%, var(--hg-text));
}

.hg-ui-feedback-warning {
    border-color: color-mix(in srgb, var(--hg-warning) 34%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-warning) 9%, var(--hg-surface));
    color: color-mix(in srgb, var(--hg-warning) 82%, var(--hg-text));
}

.hg-ui-feedback-error {
    border-color: color-mix(in srgb, var(--hg-danger) 32%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-danger) 8%, var(--hg-surface));
    color: color-mix(in srgb, var(--hg-danger) 82%, var(--hg-text));
}

.hg-ui-feedback-content {
    min-width: 0;
}

.hg-ui-feedback-content > :first-child {
    margin-top: 0;
}

.hg-ui-feedback-content > :last-child {
    margin-bottom: 0;
}

.hg-ui-empty > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--hg-text);
    font-size: 16px;
}

.hg-ui-action-bar {
    width: 100%;
}

.hg-ui-action-bar-sticky {
    position: sticky;
    bottom: calc(var(--hg-mobile-bottom-clearance) - 12px);
    z-index: 20;
}

/* Compact secondary actions used inside cards, summaries and selected items. */
.hg-app .hg-compact-action {
    min-height: 34px;
    border-radius: 10px;
    padding: 7px 12px;
    background: var(--hg-surface);
    color: var(--hg-primary);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.hg-app .hg-compact-action:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--hg-primary) 42%, var(--hg-border));
    background: color-mix(in srgb, var(--hg-primary) 8%, var(--hg-surface));
    color: var(--hg-primary);
    box-shadow: 0 5px 12px rgba(46, 125, 50, .10);
    transform: translateY(-1px);
}

.hg-app .hg-compact-action:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(0);
}

/* Primary actions keep their contrast when rendered as links. */
.hg-app :is(a, button).hg-primary-action {
    color: #FFFFFF;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.hg-app :is(a, button).hg-primary-action:hover:not(:disabled):not(.disabled) {
    border-color: color-mix(in srgb, var(--hg-primary) 86%, #000000);
    background: color-mix(in srgb, var(--hg-primary) 86%, #000000);
    color: #FFFFFF;
    box-shadow: 0 7px 16px rgba(46, 125, 50, .20);
    text-decoration: none;
    transform: translateY(-1px);
}

.hg-app :is(a, button).hg-primary-action:active:not(:disabled):not(.disabled) {
    box-shadow: 0 3px 8px rgba(46, 125, 50, .16);
    transform: translateY(0);
}

:root[data-theme="dark"] .hg-app :is(a, button).hg-primary-action:hover:not(:disabled):not(.disabled) {
    border-color: var(--hg-primary-light);
    background: var(--hg-primary-light);
    color: #FFFFFF;
}

/* ---- UNIFIED CONTENT, FORMS AND TABLE ACTIONS ---- */
.hgl-admin-page :is(.hg-card, .hgl-panel) {
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.hgl-admin-page .hg-card-title,
.hgl-admin-page .hgl-panel-title {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 48%, var(--hg-surface));
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .065em;
    line-height: 1.25;
    text-transform: uppercase;
}

.hgl-admin-page .hg-card-title :is(strong, span),
.hgl-admin-page .hgl-panel-title :is(strong, span) {
    min-width: 0;
}

.hgl-admin-page .hg-card-title > :last-child:not(:first-child),
.hgl-admin-page .hgl-panel-title > :last-child:not(:first-child) {
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

/* ---- REUSABLE SECTION CARDS ---- */
.hgl-admin-page .hg-ui-section-card-header {
    align-items: center;
}

/* ---- REUSABLE FILTER BARS ---- */
.hg-ui-filter-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.hg-ui-filter-search,
.hg-ui-filter-options,
.hg-ui-filter-actions {
    min-width: 0;
}

.hg-ui-filter-search .hg-input {
    min-height: 44px;
}

.hg-ui-filter-options,
.hg-ui-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hg-ui-filter-options {
    flex-wrap: wrap;
}

.hg-ui-filter-options :is(select, .hg-input) {
    min-width: 160px;
    min-height: 44px;
}

.hg-ui-filter-actions {
    justify-content: flex-end;
}

.hg-ui-filter-actions > :is(a, button) {
    min-height: 42px;
    white-space: nowrap;
}

.hg-ui-filter-actions > button:last-child {
    min-width: 112px;
}

/* ---- REUSABLE LIST PANELS ---- */
.hg-ui-list-panel {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hg-border);
    border-radius: 18px;
    background: var(--hg-surface);
    box-shadow: var(--hg-shadow, 0 10px 30px rgba(15, 23, 42, .05));
}

.hg-ui-list-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 38%, var(--hg-surface));
}

.hg-ui-list-panel-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.hg-ui-list-panel-heading > span {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hg-ui-list-panel-heading > strong {
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.hg-ui-list-panel-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    color: var(--hg-text-muted);
    font-size: 11px;
    font-weight: 800;
}

.hg-ui-list-panel > .hg-list,
.hgl-admin-page .hg-ui-list-panel > .hg-list {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.hg-ui-list-panel > .hg-ui-loading,
.hg-ui-list-panel > .hg-ui-empty {
    margin: 0;
    min-height: 190px;
}

.hg-ui-list-panel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 16px;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 28%, var(--hg-surface));
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 750;
}

@media (max-width: 760px) {
    .hg-ui-filter-bar {
        grid-template-columns: 1fr;
    }

    .hg-ui-filter-options,
    .hg-ui-filter-actions {
        width: 100%;
    }

    .hg-ui-filter-options > *,
    .hg-ui-filter-actions > * {
        flex: 1 1 auto;
    }

    .hg-ui-filter-options :is(select, .hg-input),
    .hg-ui-filter-actions > :is(a, button) {
        width: 100%;
    }

    .hg-ui-list-panel-header {
        min-height: 48px;
        padding: 11px 13px;
    }

    .hg-ui-list-panel-footer {
        flex-direction: column;
    }

    .hg-ui-list-panel-footer .hg-secondary-action {
        width: 100%;
        justify-content: center;
    }
}

.hg-ui-section-card-heading {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.hgl-admin-page .hg-ui-section-card-eyebrow {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.hgl-admin-page .hg-ui-section-card-title {
    overflow-wrap: anywhere;
}

.hgl-admin-page .hg-ui-section-card-subtitle {
    margin: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

.hg-ui-section-card-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.hgl-admin-page .hg-ui-section-card-meta {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--hg-primary) 9%, var(--hg-surface));
    color: var(--hg-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
}

.hg-ui-section-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--hg-border);
    background: color-mix(in srgb, var(--hg-bg) 35%, var(--hg-surface));
}

.hg-ui-section-card-compact .hg-ui-section-card-header {
    min-height: 40px;
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (max-width: 640px) {
    .hgl-admin-page .hg-ui-section-card-header {
        align-items: flex-start;
    }

    .hg-ui-section-card-tools {
        max-width: 48%;
        flex-wrap: wrap;
    }

    .hg-ui-section-card-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .hg-ui-section-card-footer :is(a, button) {
        width: 100%;
        justify-content: center;
    }
}

.hgl-admin-page .hg-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    align-items: end;
}

.hgl-admin-page .hg-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hgl-admin-page .hg-form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hgl-admin-page .hg-form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hgl-admin-page :is(.hg-form-grid, .hgl-editor) label:not(.hg-check-inline) {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--hg-text-muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.hg-app .hg-input {
    min-height: 44px;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.hg-app .hg-input:disabled,
.hg-app .hg-input[readonly] {
    border-color: color-mix(in srgb, var(--hg-border) 78%, transparent);
    background: color-mix(in srgb, var(--hg-bg) 68%, var(--hg-surface));
    color: var(--hg-text-muted);
    cursor: not-allowed;
    opacity: 1;
}

.hg-app .hg-check-inline {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--hg-text);
    font-size: 13px;
    font-weight: 750;
}

.hg-app .hg-check-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--hg-primary);
}

.hgl-admin-page .hg-actions-bar {
    min-height: 72px;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 16px 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--hg-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--hg-surface) 96%, var(--hg-bg));
    box-shadow: 0 10px 28px rgba(15, 23, 42, .045);
}

.hgl-admin-page .hg-card > .hg-actions-bar,
.hgl-admin-page .hgl-panel > .hg-actions-bar {
    margin: 14px 16px 16px;
}

.hgl-admin-page .hg-actions-bar :is(.hg-primary-action, .hg-secondary-action, .hg-danger-action) {
    min-height: 42px;
}

.hg-table :is(th, td).hg-table-actions,
.hg-table :is(th, td):has(> .hg-ui-row-menu) {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.hg-table td > .hg-ui-row-menu {
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 1100px) {
    .hgl-admin-page :is(.hg-form-grid-3, .hg-form-grid-4) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .hgl-admin-page :is(.hg-form-grid, .hg-form-grid-2, .hg-form-grid-3, .hg-form-grid-4) {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    .hgl-admin-page .hg-actions-bar {
        align-items: stretch;
        flex-direction: column-reverse;
        padding: 12px;
    }

    .hgl-admin-page .hg-actions-bar :is(a, button) {
        width: 100%;
    }
}

/* Formula detail is a single editing flow, never a two-column dashboard. */
.hg-formula-detail-page .hg-page {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-inline: 0;
}

.hg-formula-detail-page .hg-page > :is(.hg-card, .hg-actions-bar) {
    width: 100%;
    min-width: 0;
    grid-column: 1;
}

/* Every standard single-line form control has the same visual height. */
.hg-app :where(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    select
):not(.hg-plain-control) {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 10px 12px;
    line-height: 1.2;
    font-family: inherit;
    font-size: inherit;
}

.hg-app select:not(.hg-plain-control) {
    padding-right: 38px;
}

.hg-app textarea:not(.hg-plain-control) {
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
    line-height: 1.45;
    font-family: inherit;
    font-size: inherit;
}

.hg-search-select {
    position: relative;
    min-width: 0;
}

.hg-search-select-options {
    position: absolute;
    z-index: 80;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    max-height: min(360px, 48vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid var(--hg-border);
    border-radius: 14px;
    background: var(--hg-surface);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .20);
}

.hg-search-select-options button {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--hg-text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.hg-search-select-options button:hover,
.hg-search-select-options button.is-active {
    background: color-mix(in srgb, var(--hg-primary) 9%, var(--hg-surface));
}

.hg-search-select-options button strong {
    font-size: 14px;
    line-height: 1.3;
}

.hg-search-select-options button span,
.hg-search-select-status {
    color: var(--hg-text-muted);
    font-size: 12px;
}

.hg-search-select-options .hg-search-select-tertiary {
    color: var(--hg-primary);
    font-weight: 750;
}

.hg-search-select-status.is-error {
    color: var(--hg-danger, #b42318);
}

.hg-search-select-status {
    padding: 14px 12px;
    font-weight: 750;
}

:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-main-link,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-main-link:hover,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-title,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-sub,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-right .amount,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-right .date,
:root[data-theme="dark"] .hg-sale-row:not(.hg-sale-row-invoiced) .hg-list-chevron {
    color: var(--hg-sale-row-color);
}

@media (max-width: 899.98px) {
    /* Safari iOS zooms the page when a focused editable control is below 16px. */
    .hg-app :where(
        input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
        select,
        textarea
    ):not(.hg-plain-control) {
        font-size: 16px;
    }

    .hg-search-select-options {
        max-height: min(310px, 42vh);
    }
}
