.inv-page {
    max-width: 1080px;
    margin: 0 auto;
}

.inv-page.inv-dashboard {
    max-width: none;
    width: 100%;
    margin: 0;
}

.inv-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.inv-page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.inv-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.inv-import-summary {
    margin: -0.4rem 0 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #0f766e;
    font-size: 0.85rem;
    line-height: 1.4;
}

.inv-import-overlay {
    z-index: 2000 !important;
}

.inv-import-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-width: min(22rem, calc(100vw - 2rem));
    max-width: 26rem;
    padding: 1.4rem 1.5rem;
    border-radius: 0.85rem;
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 39, 68, 0.22);
    text-align: center;
}

.inv-import-overlay-title {
    margin-top: 0.15rem;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f2a37;
}

.inv-import-overlay-sub {
    color: #6b7280;
    font-size: 0.88rem;
    line-height: 1.4;
}

.inv-page-header-text h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1f2a37;
    font-family: "Manrope", system-ui, sans-serif;
}

.inv-page-header-text p {
    margin: 0.4rem 0 0;
    max-width: 40rem;
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.45;
}

.inv-primary-btn.mud-button-filled-primary,
.inv-primary-btn {
    background: #00bfa5 !important;
    color: #fff !important;
    text-transform: none !important;
    font-weight: 700 !important;
    border-radius: 0.55rem !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
    padding-inline: 1rem !important;
}

.inv-primary-btn:hover {
    background: #00a892 !important;
}

.inv-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.inv-card-toolbar {
    padding: 0.85rem 1rem 0.35rem;
}

.inv-filter {
    max-width: 14rem;
    min-width: 10rem;
}

.inv-filter .mud-input-outlined .mud-input-outlined-border {
    border-color: #e5e7eb !important;
}

.inv-table {
    background: transparent;
}

.inv-table .mud-table-head .mud-table-cell {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    border-bottom: 1px solid #eef0f2;
    background: #fff;
}

.inv-table .mud-table-cell {
    border-bottom: 1px solid #f1f3f5;
    color: #374151;
    vertical-align: middle;
}

.inv-table .mud-table-row:hover .mud-table-cell {
    background: #fafbfc;
}

.inv-th-actions,
.inv-td-actions {
    width: 8.5rem;
    text-align: right !important;
    white-space: nowrap;
}

.inv-cell-alert {
    display: block;
    font-weight: 700;
    color: #dc2626;
}

.inv-cell-strong {
    display: block;
    font-weight: 700;
    color: #1f2a37;
}

.inv-cell-meta {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.inv-cell-muted {
    color: #6b7280;
    font-size: 0.92rem;
}

.inv-action-btn {
    color: #9ca3af !important;
}

.inv-action-btn:hover {
    color: #00bfa5 !important;
    background: #e6faf6 !important;
}

.inv-action-danger:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

.inv-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.inv-empty p {
    margin: 0;
}

.inv-dialog .mud-dialog-title {
    padding-bottom: 0.25rem;
}

.inv-dialog-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.inv-dialog-title-icon {
    color: #00bfa5;
    margin-top: 0.15rem;
}

.inv-dialog-heading {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1f2a37;
    letter-spacing: -0.01em;
}

.inv-dialog-sub {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.35;
}

/* Layout de formulario: definido en app.css (.mv-form / .inv-dialog-form) */

.inv-line-row {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch;
    padding: 0.5rem 0.6rem;
    border: 1px solid #eef0f2;
    border-radius: 0.55rem;
    background: #fafbfc;
}

.inv-line-qty {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: start;
}

.inv-line-qty:has(> :nth-child(3)) {
    grid-template-columns: 1fr 1fr auto;
}

.inv-switch-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    min-height: 2.85rem;
    justify-content: center;
    background: #fff;
}

.inv-switch-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.inv-dialog-cancel {
    text-transform: none !important;
    font-weight: 600 !important;
}

.inv-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.inv-kpi {
    --kpi-accent: var(--shell-teal, #00bfa5);
    background: var(--shell-white, #fff);
    border: 1px solid var(--shell-line, #e5e7eb);
    border-radius: 0.6rem;
    border-left: 3px solid var(--kpi-accent);
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    box-shadow: 0 1px 0 rgba(15, 39, 68, 0.03);
}

.inv-kpi-teal { --kpi-accent: #00bfa5; background: linear-gradient(180deg, #f3fffc 0%, #fff 55%); }
.inv-kpi-navy { --kpi-accent: #0f2744; background: linear-gradient(180deg, #f4f7fb 0%, #fff 55%); }
.inv-kpi-warn { --kpi-accent: #f59e0b; background: linear-gradient(180deg, #fffbeb 0%, #fff 55%); }
.inv-kpi-danger { --kpi-accent: #ef4444; background: linear-gradient(180deg, #fef2f2 0%, #fff 55%); }

.inv-kpi-label {
    color: var(--shell-muted, #6b7280);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inv-kpi-value {
    color: var(--shell-ink, #1f2a37);
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
    font-weight: 800;
    font-family: "Manrope", system-ui, sans-serif;
    line-height: 1.1;
    word-break: break-word;
}

.inv-kpi-value-sm {
    font-size: clamp(0.92rem, 1.15vw, 1.1rem);
}

.inv-kpi-warn .inv-kpi-value { color: #d97706; }
.inv-kpi-danger .inv-kpi-value { color: #dc2626; }
.inv-kpi-teal .inv-kpi-value { color: #0f766e; }
.inv-kpi-navy .inv-kpi-value { color: #0f2744; }

.inv-cell-warn {
    font-weight: 700;
    color: #d97706;
}

.inv-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    padding: 0.85rem 1rem;
}

.inv-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.inv-filter-grow {
    flex: 1 1 14rem;
    max-width: none;
    min-width: 0;
}

.inv-card-pad {
    padding: 1rem;
}

/* —— SiteMap admin (árbol) —— */
.sm-hint {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.sm-empty-tree {
    padding: 2rem 1rem;
    text-align: center;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.sm-tree {
    border: 1px solid #eef0f2;
    border-radius: 0.65rem;
    background: #fafbfc;
    padding: 0.35rem 0;
    max-height: min(70vh, 640px);
    overflow: auto;
}

.sm-node-row {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
    gap: 0.25rem;
    align-items: center;
    padding: 0.35rem 0.65rem 0.35rem calc(0.65rem + var(--sm-depth, 0) * 1.1rem);
    min-height: 2.5rem;
}

.sm-node.is-selected > .sm-node-row {
    background: #ecfdf5;
    box-shadow: inset 3px 0 0 #00bfa5;
}

.sm-node-row:hover {
    background: #f3f4f6;
}

.sm-node.is-selected > .sm-node-row:hover {
    background: #ecfdf5;
}

.sm-check {
    margin: 0 !important;
}

.sm-toggle {
    border: 0;
    background: transparent;
    padding: 0.15rem;
    cursor: pointer;
    color: #6b7280;
    display: inline-flex;
    border-radius: 0.35rem;
}

.sm-toggle:hover {
    background: #e5e7eb;
    color: #1f2a37;
}

.sm-toggle-spacer {
    width: 1.5rem;
    height: 1.5rem;
}

.sm-icon {
    color: #0f766e;
}

.sm-node-text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    min-width: 0;
    cursor: pointer;
}

.sm-title {
    font-weight: 700;
    color: #1f2a37;
    font-size: 0.9rem;
}

.sm-route {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: ui-monospace, monospace;
}

.sm-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0f766e;
    background: #ccfbf1;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
}

.sm-badge-off {
    color: #991b1b;
    background: #fee2e2;
}

.sm-node-actions {
    display: flex;
    gap: 0.05rem;
    opacity: 0.55;
}

.sm-node-row:hover .sm-node-actions,
.sm-node.is-selected > .sm-node-row .sm-node-actions {
    opacity: 1;
}

.sm-modal-context {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    background: #f8fafc;
}

.sm-modal-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.15rem;
}

.sm-modal-value {
    font-weight: 700;
    color: #1f2a37;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .sm-modal-context {
        grid-template-columns: 1fr;
    }

    .sm-node-row {
        grid-template-columns: auto auto auto minmax(0, 1fr);
        grid-template-rows: auto auto;
    }

    .sm-node-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        opacity: 1;
        padding-left: 2rem;
    }
}

.inv-report-title {
    margin: 1rem 0 0.65rem;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f2a37;
}

.inv-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cash-denom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.5rem 5.5rem;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.cash-denom-label {
    font-weight: 650;
    min-width: 0;
}

.cash-denom-qty {
    min-width: 0;
}

.cash-denom-total {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

@media (max-width: 420px) {
    .cash-denom-row {
        grid-template-columns: 1fr 1fr;
    }

    .cash-denom-label {
        grid-column: 1 / -1;
    }

    .cash-denom-total {
        text-align: left;
    }
}

.inv-btn-short {
    display: none;
}

.inv-action-outline {
    text-transform: none !important;
    font-weight: 650 !important;
    border-radius: 0.55rem !important;
}

.inv-lines-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.inv-dashboard {
    width: 100%;
}

.inv-dash-section {
    margin-bottom: 0.75rem;
}

.inv-dash-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 0.35rem 0.05rem;
}

.inv-dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    width: 100%;
}

.inv-dash-main,
.inv-dash-aside {
    min-width: 0;
    width: 100%;
}

.inv-dash-cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
}

.inv-chart-card,
.inv-timeline-card {
    padding: 0.7rem 0.85rem 0.55rem;
    min-width: 0;
    overflow: hidden;
}

.inv-chart-head {
    margin-bottom: 0.25rem;
}

.inv-chart-head h2 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--shell-ink, #1f2a37);
    font-family: "Manrope", system-ui, sans-serif;
}

.inv-chart-head p {
    margin: 0.1rem 0 0;
    color: var(--shell-muted, #6b7280);
    font-size: 0.75rem;
    line-height: 1.3;
}

.inv-chart-frame {
    width: 100%;
    min-width: 0;
    height: 220px;
    overflow: hidden;
}

.inv-chart-frame-lg {
    width: 100%;
    height: 320px;
}

.inv-chart {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    display: block;
}

.inv-chart.mud-chart,
.inv-chart-frame .mud-chart {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

.inv-chart-frame .mud-chart text,
.inv-chart svg text {
    font-size: 10px !important;
}

.inv-timeline {
    list-style: none;
    margin: 0.45rem 0 0;
    padding: 0 0 0 0.3rem;
    border-left: 2px solid #d1fae5;
    max-height: min(58vh, 560px);
    overflow-y: auto;
}

.inv-timeline-item {
    position: relative;
    padding: 0 0 0.65rem 1rem;
}

.inv-timeline-item:last-child {
    padding-bottom: 0.15rem;
}

.inv-timeline-marker {
    position: absolute;
    left: -0.42rem;
    top: 0.2rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: #00bfa5;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #99f6e4;
}

.inv-timeline-item.is-out .inv-timeline-marker { background: #ef4444; box-shadow: 0 0 0 1px #fecaca; }
.inv-timeline-item.is-adjust .inv-timeline-marker { background: #f59e0b; box-shadow: 0 0 0 1px #fde68a; }
.inv-timeline-item.is-in .inv-timeline-marker { background: #00bfa5; }

.inv-timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    align-items: baseline;
    margin-bottom: 0.15rem;
}

.inv-timeline-type {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0f766e;
}

.inv-timeline-item.is-out .inv-timeline-type { color: #dc2626; }
.inv-timeline-item.is-adjust .inv-timeline-type { color: #d97706; }

.inv-timeline-meta time {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.inv-timeline-title {
    font-weight: 700;
    color: var(--shell-ink, #1f2a37);
    font-size: 0.88rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.inv-timeline-desc {
    margin-top: 0.1rem;
    color: var(--shell-muted, #6b7280);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (min-width: 640px) {
    .inv-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .inv-dash-cards-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .inv-dash-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 1rem;
    }

    .inv-dash-section-sticky {
        position: sticky;
        top: 0.85rem;
    }
}

@media (min-width: 1100px) {
    .inv-dash-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 1.15rem;
    }
}

@media (min-width: 1400px) {
    .inv-dash-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .inv-dash-cards-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1600px) {
    .inv-dash-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
    }
}

@media (max-width: 960px) {
    .inv-page {
        max-width: none;
        padding-inline: 0.15rem;
    }

    .inv-page-header-text h1 {
        font-size: 1.4rem;
    }

    .inv-page-header-text p {
        font-size: 0.86rem;
    }

    .inv-chart-frame {
        height: 200px;
    }

    .inv-chart-frame-lg {
        height: 240px;
    }

    /* MudTable stacked card layout */
    .inv-table.mud-table-small .mud-table-row {
        border: 1px solid #eef0f2;
        border-radius: 0.6rem;
        margin: 0.55rem 0.65rem;
        padding: 0.35rem 0.2rem;
        background: #fff;
        overflow: hidden;
    }

    .inv-table.mud-table-small .mud-table-cell {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        text-align: right !important;
        border-bottom: 1px solid #f3f4f6 !important;
        padding: 0.55rem 0.75rem !important;
    }

    .inv-table.mud-table-small .mud-table-cell:last-child {
        border-bottom: none !important;
    }

    .inv-table.mud-table-small .mud-table-cell:before {
        content: attr(data-label);
        flex: 0 0 auto;
        text-align: left;
        color: #6b7280;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        padding-right: 0.5rem;
    }

    .inv-table.mud-table-small .inv-td-actions {
        justify-content: flex-end;
    }

    .inv-table.mud-table-small .mud-table-pagination {
        margin: 0.35rem 0.5rem 0.75rem;
    }
}

@media (max-width: 720px) {
    .inv-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .inv-page-header > .mud-button,
    .inv-page-header-actions {
        width: 100%;
    }

    .inv-page-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .inv-page-header-actions .inv-primary-btn {
        grid-column: 1 / -1;
    }

    .inv-page-header > .mud-button,
    .inv-page-header-actions .mud-button {
        width: 100%;
        min-height: 2.6rem;
    }

    .inv-btn-full {
        display: none;
    }

    .inv-btn-short {
        display: inline;
    }

    .inv-dialog-row,
    .inv-dialog-row:has(> :nth-child(3)) {
        grid-template-columns: 1fr !important;
    }

    .inv-line-qty,
    .inv-line-qty:has(> :nth-child(3)) {
        grid-template-columns: 1fr auto;
    }

    .inv-line-qty:has(> :nth-child(3)) > .inv-field:nth-child(2) {
        grid-column: 1 / 2;
    }

    .inv-dialog .mud-dialog {
        margin: 0.5rem;
        max-height: calc(100dvh - 1rem);
    }

    .inv-dialog .mud-dialog-content {
        max-height: min(70dvh, 560px);
        overflow-y: auto;
        padding-right: 0.25rem;
    }

    .inv-dialog .mud-dialog-actions {
        flex-wrap: wrap;
        gap: 0.45rem;
        justify-content: stretch !important;
    }

    .inv-dialog .mud-dialog-actions .mud-button {
        flex: 1 1 auto;
        min-width: 0;
    }

    .inv-filter,
    .inv-filter-grow {
        max-width: none;
        width: 100%;
        flex: 1 1 100%;
    }

    .inv-toolbar-filters {
        padding: 0.75rem;
    }

    .inv-toolbar-actions {
        width: 100%;
    }

    .inv-toolbar-actions .mud-button {
        flex: 1 1 auto;
    }

    .inv-card-toolbar {
        padding: 0.75rem;
    }

    .inv-th-actions,
    .inv-td-actions {
        width: auto;
        text-align: left !important;
    }

    .inv-import-summary {
        font-size: 0.8rem;
        word-break: break-word;
    }

    .inv-timeline {
        max-height: none;
    }

    .inv-timeline-meta {
        flex-direction: column;
        gap: 0.12rem;
        align-items: flex-start;
    }

    .inv-chart-frame {
        height: 180px;
    }

    .inv-chart-frame-lg {
        height: 210px;
    }

    .inv-kpi-value {
        font-size: 1.05rem;
    }
}

@media (max-width: 420px) {
    .inv-kpi-grid {
        grid-template-columns: 1fr;
    }

    .inv-page-header-actions {
        grid-template-columns: 1fr;
    }

    .inv-page-header-text h1 {
        font-size: 1.25rem;
    }
}


/* Ventas (Factura / POS / Detail): estilos en css/sales.css — no duplicar aquí */
