:root {
    --bg: #f3f7f2;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --line: #d8e4d3;
    --line-strong: #b9cdaf;

    --text: #1f2b24;
    --text-soft: #536458;
    --text-muted: #66766b;

    --primary: #0f5f73;
    --primary-strong: #0a4553;
    --primary-light: #8fc0cb;
    --secondary: #b96f19;
    --accent: #2e9354;
    --danger: #bf3f3f;

    --shadow-soft: 0 12px 30px rgba(22, 50, 34, 0.08);
    --shadow-strong: 0 24px 45px rgba(16, 32, 24, 0.15);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

html,
body {
    min-height: 100%;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 5% 10%, rgba(185, 111, 25, 0.08), transparent 35%),
        radial-gradient(circle at 95% 5%, rgba(15, 95, 115, 0.14), transparent 40%),
        linear-gradient(160deg, #f5f8f1 0%, #edf4ea 60%, #f9faf7 100%);
    padding-bottom: 32px;
}

.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.15em;
}

.icon.spin {
    animation: iconSpin 1s linear infinite;
}

@keyframes iconSpin {
    to {
        transform: rotate(360deg);
    }
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(50px);
    opacity: 0.45;
    pointer-events: none;
    animation: floatOrb 12s ease-in-out infinite;
}

.orb-1 {
    width: 220px;
    height: 220px;
    background: rgba(15, 95, 115, 0.25);
    top: -60px;
    right: 5%;
}

.orb-2 {
    width: 240px;
    height: 240px;
    background: rgba(185, 111, 25, 0.25);
    bottom: 5%;
    left: -70px;
    animation-delay: 1.5s;
}

.orb-3 {
    width: 180px;
    height: 180px;
    background: rgba(46, 147, 84, 0.2);
    bottom: 20%;
    right: -60px;
    animation-delay: 3s;
}

@keyframes floatOrb {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.app-header {
    padding: 20px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-size: 1.25rem;
}

.brand-icon .icon {
    width: 1.2em;
    height: 1.2em;
}

.brand-block h1 {
    font-family: "Sora", sans-serif;
    font-size: 1.35rem;
    line-height: 1.2;
}

.brand-block p {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(125deg, var(--primary), #167086);
    color: #fff;
    box-shadow: 0 12px 20px rgba(15, 95, 115, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 16px 26px rgba(15, 95, 115, 0.3);
}

.btn-ghost {
    background: #f7faf6;
    color: var(--text);
    border-color: var(--line);
}

.btn-ghost:hover {
    background: #f0f6ed;
}

.btn-sm {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    gap: 6px;
    min-height: 36px;
}

.btn-remove {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e6c5c5;
    background: #fff3f3;
    color: var(--danger);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.btn-remove:hover {
    background: #fce4e4;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.workspace {
    display: grid;
    gap: 14px;
}

.card {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    overflow: visible;
    position: relative;
    z-index: 0;
    animation: riseIn 0.45s ease forwards;
    opacity: 0;
    transform: translateY(14px);
}

.card:focus-within {
    z-index: 100;
}

.card.card-search-open {
    z-index: 260;
}

.workspace .card:nth-child(1) {
    animation-delay: 0.05s;
}

.workspace .card:nth-child(2) {
    animation-delay: 0.12s;
}

.workspace .card:nth-child(3) {
    animation-delay: 0.19s;
}

.workspace .card:nth-child(4) {
    animation-delay: 0.26s;
}

.workspace .card:nth-child(5) {
    animation-delay: 0.33s;
}

@keyframes riseIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    background: linear-gradient(180deg, #fdfefd 0%, #f7fbf5 100%);
}

.card-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-family: "Sora", sans-serif;
    color: var(--text);
}

.card-header .icon {
    color: var(--primary);
}

.card-content {
    padding: 14px 16px 16px;
}

.field {
    display: grid;
    gap: 6px;
    position: relative;
}

.field:focus-within {
    z-index: 100;
}

.field.field-search {
    z-index: 10;
    isolation: isolate;
}

.field label {
    font-size: 0.85rem;
    color: var(--text-soft);
    font-weight: 700;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ── Product search toolbar ── */
.product-search-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.product-search-field {
    flex: 1 1 220px;
    min-width: 160px;
}

.product-table-field {
    flex: 0 0 168px;
}

.product-btn-field {
    flex: 0 0 auto;
}

.product-btn-label {
    visibility: hidden;
    pointer-events: none;
    user-select: none;
}

.product-manual-btn {
    white-space: nowrap;
    width: 100%;
}

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

.field-row.four-col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-row.five-col {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field-row.six-col {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.field-row.seven-col {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.field-row.payment-main-row,
.field-row.payment-values-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.field-row.payment-main-row > .field {
    min-height: 0;
    align-content: start;
}

/* Valor row: result display */

.field-row.payment-main-row > .field.payment-col-vendor {
    flex: 1 1 120px;
    max-width: 175px;
}

.field-row.payment-main-row > .field.payment-col-forma {
    flex: 1 1 140px;
    max-width: 210px;
}

.field-row.payment-main-row > .field.payment-col-parc {
    flex: 0 0 62px;
}

.field-row.payment-main-row > .field.payment-col-entrada {
    flex: 0 0 108px;
}

.field-row.payment-main-row > .field.payment-col-val {
    flex: 0 0 68px;
}

.field-row.payment-main-row > .field.payment-col-desc-pct {
    flex: 0 0 72px;
}

.field-row.payment-main-row > .field.payment-col-desc-rs {
    flex: 0 0 82px;
}

.field-row.payment-main-row > .field.payment-col-valor {
    flex: 0 0 96px;
}

.field-row.payment-main-row > .field.payment-col-md {
    flex: 0 1 180px;
    max-width: 210px;
}

/* Labels no row de pagamento não devem quebrar */
.field-row.payment-main-row label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-row.payment-main-row input,
.field-row.payment-main-row select {
    height: 38px;
    padding: 8px 10px;
}

.field.field-compact {
    max-width: none;
    min-width: 0;
}

.field.field-compact input,
.field.field-compact select {
    max-width: none;
    padding: 8px 10px;
    font-size: 0.9rem;
}


.field.field-inline-compact {
    gap: 5px;
}




/* Valor input: prominent result display */

/* Valor label */

.field-money-highlight {
    background: linear-gradient(180deg, #f6fcfb 0%, #eef9f7 100%);
    border: 1px solid #d2ece7;
    border-radius: var(--radius-sm);
    padding: 10px;
}

.field-money-highlight label {
    color: #0f5f73;
}





/* Valor input: subtle highlight */
.field-row.payment-main-row .payment-col-valor input {
    background: linear-gradient(90deg, #f4fafb 0%, #eaf5f8 100%);
    border-color: #9ecfdb;
    font-weight: 700;
    text-align: right;
    color: var(--primary-strong);
}

.extra-payments-wrap {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.extra-payments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.extra-payments-list {
    display: grid;
    gap: 10px;
}

.extra-payment-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfefd;
}

.extra-payment-item .field {
    min-height: 76px;
    align-content: start;
}

.extra-payment-item .field.extra-field-forma {
    flex: 1 1 230px;
    max-width: 320px;
}

.extra-payment-item .field.extra-field-valor {
    flex: 0 1 145px;
    max-width: 165px;
}

.extra-payment-item .field.extra-field-parcelas {
    flex: 0 1 96px;
    max-width: 110px;
}

.extra-payment-item .field.extra-field-valor-parcela {
    flex: 0 1 185px;
    max-width: 220px;
}

.extra-payment-item .field input,
.extra-payment-item .field select {
    height: 38px;
    padding: 8px 10px;
}

.extra-payment-item .btn-remove {
    margin-bottom: 1px;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text);
    background: #fcfefd;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 95, 115, 0.12);
}

textarea {
    resize: vertical;
}

.input-search {
    position: relative;
}

.input-search input {
    padding-right: 52px;
}

.btn-search {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #e7f2f5;
    color: var(--primary);
    cursor: pointer;
}

.btn-search:hover {
    background: #d4e9ef;
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-strong);
    z-index: 1200;
    display: none;
    overscroll-behavior: contain;
}

#produtoResults.search-results {
    max-height: 340px;
}

.search-results.show {
    display: block;
    animation: dropdownIn 0.16s ease;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-item {
    padding: 12px 12px;
    border-bottom: 1px solid #edf2ea;
    display: grid;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
}

.search-item.active {
    background: linear-gradient(120deg, #eef8fb 0%, #f5fbf4 100%);
    border-left: 3px solid var(--primary);
}

.search-item-loading {
    cursor: default;
    color: var(--text-soft);
}

.search-item-loading:hover {
    background: #ffffff;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: #f4f8f2;
}

.search-item-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: start;
}

.search-item-title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.28;
}

.search-item-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary-strong);
    background: #ebf5f7;
    border: 1px solid #c9dde3;
    border-radius: 8px;
    padding: 2px 8px;
    white-space: nowrap;
}

.search-item-meta {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.search-item-subline {
    font-size: 0.77rem;
    color: var(--text-muted);
}

.tag-pill {
    font-size: 0.74rem;
    font-weight: 700;
    color: #27473b;
    background: #e8f5ea;
    border: 1px solid #bfdcc4;
    border-radius: 999px;
    display: inline-block;
    padding: 2px 8px;
    width: fit-content;
}

.search-mark {
    background: #fff2bf;
    color: #5f4500;
    border-radius: 4px;
    padding: 0 3px;
}

.search-helper {
    font-size: 0.77rem;
    color: var(--text-muted);
    display: none;
}

.search-helper.visible {
    display: block;
}

.field-client-search .input-search input {
    padding: 12px 52px 12px 12px;
    font-size: 0.98rem;
}

.field-client-search .btn-search {
    width: 36px;
    height: 36px;
}

.search-item h4 {
    font-size: 0.92rem;
}

.search-item p {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.search-item small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.selected-item {
    border: 1px solid #c7dbc4;
    background: #f5fbf4;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 8px;
}

.selected-item h3 {
    font-size: 0.98rem;
    margin-bottom: 4px;
}

.selected-item p {
    font-size: 0.84rem;
    color: var(--text-soft);
}

.selected-client-card {
    align-items: center;
}

.selected-client-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-client-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #e8f5ea;
    color: #1f7a45;
    display: grid;
    place-items: center;
    border: 1px solid #bfe0c8;
}

.selected-client-tag {
    display: inline-block;
    font-size: 0.7rem;
    color: #2a6544;
    background: #e8f5ea;
    border: 1px solid #bfe0c8;
    border-radius: 999px;
    padding: 2px 8px;
    margin-bottom: 4px;
    font-weight: 700;
}

.product-list {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
}

.empty-state {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 26px 14px;
    text-align: center;
    color: var(--text-muted);
    display: grid;
    gap: 6px;
}

.empty-state .icon {
    font-size: 1.6rem;
    color: #9db5a0;
}

.product-item {
    border: 1px solid var(--line);
    border-left: 3px solid var(--primary-light);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    transition: border-color 0.2s ease, box-shadow 0.15s ease;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-muted);
    opacity: 0.35;
    transition: opacity 0.15s;
    user-select: none;
    touch-action: none;
    padding: 4px 0;
}

.drag-handle:hover {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.product-item.dragging {
    opacity: 0.45;
    border-style: dashed;
}

.product-item.drag-over {
    border-color: var(--primary);
    border-left-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 95, 115, 0.15);
}

.product-item:hover {
    border-color: var(--line-strong);
    border-left-color: var(--primary);
    box-shadow: 0 4px 14px rgba(15, 95, 115, 0.08);
}

.product-item-warning {
    border-color: #edc2a3;
    border-left-color: var(--secondary);
    background: #fff8f2;
}

.product-item-warning:hover {
    border-left-color: #c45c00;
}

.product-main {
    display: grid;
    gap: 2px;
}

.product-main strong {
    font-size: 0.94rem;
}

.product-meta {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.stock-warning {
    margin-top: 4px;
    color: #a25017;
    font-size: 0.76rem;
    font-weight: 700;
}

.product-controls {
    display: grid;
    grid-template-columns: repeat(5, 86px) 30px;
    gap: 8px;
    align-items: end;
}

.product-edit-btn {
    display: none;
    margin-top: 8px;
    width: fit-content;
}

.product-controls label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 3px;
}

.mini-field input {
    padding: 7px 8px;
    font-size: 0.86rem;
}

.product-total-field label {
    color: var(--primary) !important;
}

.product-total-field input {
    font-weight: 800;
    color: var(--primary-strong);
    background: linear-gradient(180deg, #f6fcfb 0%, #eef9f7 100%);
    border-color: #c9dde3;
    text-align: right;
    cursor: default;
}

.tip-box {
    margin-top: 10px;
    border: 1px solid #e0d0b8;
    background: #fff9ef;
    border-radius: 10px;
    padding: 9px 10px;
    display: grid;
    gap: 4px;
}

.tip-box strong {
    color: #8a5311;
    font-size: 0.86rem;
}

.tip-box p {
    font-size: 0.82rem;
    color: #8a6a43;
}

#pagamentoRestanteInfo {
    border-color: #d6e5d1;
    background: #f7fbf6;
    color: var(--text-soft);
}

.payment-rateio-panel {
    display: grid;
    gap: 10px;
}

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

.payment-kpi {
    border: 1px solid #dce9d8;
    border-radius: 10px;
    padding: 8px 10px;
    background: #ffffff;
    display: grid;
    gap: 2px;
}

.payment-kpi span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.payment-kpi strong {
    font-family: "Sora", sans-serif;
    font-size: 0.92rem;
    color: var(--text);
}

.payment-kpi.payment-kpi-alert {
    border-color: #ebc8a5;
    background: #fff7ef;
}

.payment-kpi.payment-kpi-alert strong {
    color: #9f5714;
}

.payment-kpi.payment-kpi-ok {
    border-color: #c6e3cf;
    background: #eff8f1;
}

.payment-kpi.payment-kpi-ok strong {
    color: #247345;
}

.payment-principal-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.payment-principal-note strong {
    color: var(--text);
}

.payment-breakdown {
    display: grid;
    gap: 7px;
}

.payment-breakdown-item {
    border: 1px solid #dde9d9;
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.payment-breakdown-item.principal {
    border-color: #bfd7de;
    background: #f2f9fb;
}

.payment-breakdown-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.payment-breakdown-main strong {
    font-size: 0.84rem;
    color: var(--text);
}

.payment-breakdown-main small {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.payment-breakdown-total {
    flex-shrink: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.88rem;
    color: var(--primary-strong);
}

.card-resumo {
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f4e8 100%);
    border-color: var(--primary-light);
}

.card-resumo .card-header {
    background: linear-gradient(180deg, #eaf4ea 0%, #dff0df 100%);
}

.summary-inline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 16px;
}

.summary-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: none;
}

.summary-row span {
    color: var(--text-soft);
    font-size: 0.8rem;
}

.summary-row strong {
    font-family: "Sora", sans-serif;
    color: var(--text);
    font-size: 1rem;
}

.summary-row.total-row {
    border-bottom: none;
    border-left: 2px solid var(--primary);
    padding-left: 12px;
    margin-left: 4px;
}

.summary-row.total-row strong {
    color: var(--primary-strong);
    font-size: 1.25rem;
}

.action-stack {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.action-stack-inline {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-stack-inline .btn {
    flex: none;
    justify-content: center;
}

.preview-panel {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 16px;
}

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

.preview-head h2 {
    font-family: "Sora", sans-serif;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.preview-head .icon {
    color: var(--secondary);
}

.preview-actions {
    display: flex;
    gap: 8px;
}

.preview-share-card {
    margin-top: 16px;
    border: 1px solid #d9e8db;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfefb 0%, #f5faf4 100%);
    padding: 16px;
}

.preview-share-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
}

.preview-share-head h3 {
    font-family: "Sora", sans-serif;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.preview-share-head p {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.preview-share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.share-save-field {
    align-content: end;
}

.share-save-field .btn {
    width: 100%;
    justify-content: center;
}

.share-status-box {
    grid-column: 1 / -1;
    margin: 0;
}

.share-message-field {
    grid-column: 1 / -1;
}

.share-actions {
    margin-top: 14px;
}

.share-status-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.share-status-badge.status-open,
.share-status-badge.status-connected {
    background: #e8f5ea;
    color: #1f7a45;
}

.share-status-badge.status-error,
.share-status-badge.status-close,
.share-status-badge.status-closed {
    background: #fde9e8;
    color: #b42318;
}

.share-status-badge.status-unknown,
.share-status-badge.status-not_found {
    background: #f1f4f8;
    color: #475467;
}

.share-status-error {
    display: block;
    margin-top: 6px;
    color: #b42318;
    font-size: 0.8rem;
}

.preview-a4 {
    background: #fff;
    border: 1px solid #e5ebe2;
    border-radius: 14px;
    padding: 28px;
    color: #1f2b24;
}

.preview-grid-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid #dce7d8;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.preview-grid-head h1 {
    font-family: "Sora", sans-serif;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.preview-card {
    border: 1px solid #e6ece2;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    background: #fbfdfb;
}

.preview-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.preview-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.preview-table th,
.preview-table td {
    border-bottom: 1px solid #e7ede4;
    text-align: left;
    padding: 8px;
    font-size: 0.86rem;
}

.preview-table th {
    background: #f3f8f1;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #466150;
}

.preview-table .text-right {
    text-align: right;
}

.preview-total-box {
    width: 290px;
    display: grid;
    gap: 6px;
}

.preview-total-line {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e7ede4;
    padding-bottom: 4px;
}

.preview-total-line.final {
    border-bottom: 2px solid #93b4a1;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary-strong);
}

.loading-overlay {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: min(460px, calc(100vw - 28px));
    display: none;
    z-index: 999;
    pointer-events: none;
}

.loader-box .icon {
    width: 1.12em;
    height: 1.12em;
}

.loader-box {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #d9e5d5;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
    align-items: center;
    box-shadow: var(--shadow-strong);
    color: var(--primary-strong);
    pointer-events: auto;
}

.loading-copy {
    display: grid;
    gap: 2px;
}

.loading-copy span {
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.4;
}

.loading-retry,
.loading-central {
    display: none;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.82rem;
    text-decoration: none;
}

.loading-overlay[data-state="error"] .spin {
    animation: none;
    color: var(--danger, #b42318);
}

.loading-overlay[data-state="error"] .loading-retry,
.loading-overlay[data-state="error"] .loading-central {
    display: inline-flex;
}

.loading-overlay[data-state="error"] .loading-retry {
    grid-column: 1 / 2;
}

.loading-overlay[data-state="error"] .loading-central {
    grid-column: 2 / 3;
}

.toast-container {
    position: fixed;
    right: 14px;
    bottom: 14px;
    display: grid;
    gap: 8px;
    z-index: 999;
}

.toast {
    min-width: 240px;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #d5e3d0;
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    border-left: 4px solid var(--accent);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--secondary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 20, 17, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal {
    width: min(640px, 100%);
    background: #fff;
    border: 1px solid #d8e4d3;
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
}

.modal-header,
.modal-footer {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modal-footer {
    border-bottom: none;
    border-top: 1px solid #edf2ea;
    justify-content: end;
}

.modal-body {
    padding: 14px;
    max-height: 62vh;
    overflow: auto;
}

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

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

.saved-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    background: #fbfdfa;
}

.saved-main {
    min-width: 0;
}

.saved-meta {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 0.8rem;
    white-space: normal;
}

.saved-actions {
    display: inline-flex;
    gap: 6px;
}

.empty-inline {
    color: var(--text-muted);
    font-size: 0.84rem;
    text-align: center;
    padding: 10px 0 4px;
    font-style: italic;
}

/* ── Card: destaque sutil ao receber foco ── */
.card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:focus-within {
    border-color: rgba(15, 95, 115, 0.35);
    box-shadow: var(--shadow-soft), 0 0 0 3px rgba(15, 95, 115, 0.06);
}

/* ── Modal: animação de entrada/saída ── */
.modal-overlay {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.modal-open {
    opacity: 1;
}

.modal {
    transform: translateY(16px) scale(0.98);
    transition: transform 0.22s ease, opacity 0.22s ease;
    opacity: 0;
}

.modal-overlay.modal-open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Toast: animação slideIn + botão fechar ── */
@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(24px); }
}

.toast {
    animation: toastIn 0.22s ease forwards;
    justify-content: space-between;
}

.toast.removing {
    animation: toastOut 0.2s ease forwards;
}

.toast-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.toast-inner .icon {
    width: 1.05em;
    height: 1.05em;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0 0 8px;
    font-size: 0.82rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

.btn:focus-visible,
.btn-remove:focus-visible,
.btn-search:focus-visible,
.toast-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Preview A4: zebra striping ── */
.preview-table tbody tr:nth-child(even) td {
    background: #f8fbf7;
}

.preview-table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Seção rateio: desabilitada sem valor ── */
.extra-payments-wrap.sem-valor {
    opacity: 0.45;
    pointer-events: none;
    user-select: none;
}

/* ── Empty state produtos: CTA mais claro ── */
.empty-state .empty-cta {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
}

/* ── Header: badge do orçamento em edição ── */
.edicao-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    background: #fff8ef;
    border: 1px solid #f0d5b0;
    border-radius: 999px;
    padding: 3px 10px;
    margin-left: 10px;
}

/* ── Spinners nativos dos inputs numéricos ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* ── Campos condicionais do pagamento com animação suave ── */
#grupoParcelasPagamento,
#grupoEntradaPagamento,
#grupoValorParcelaCrediario {
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#grupoParcelasPagamento.campo-oculto,
#grupoEntradaPagamento.campo-oculto,
#grupoValorParcelaCrediario.campo-oculto {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

/* ── Lista de produtos com scroll após 4 itens ── */
.product-list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.product-list::-webkit-scrollbar {
    width: 5px;
}

.product-list::-webkit-scrollbar-track {
    background: transparent;
}

.product-list::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
}

/* ── Destaque do campo Total nos controles de produto ── */
.product-total-field input {
    font-weight: 800;
    color: var(--primary-strong);
    background: linear-gradient(180deg, #f6fcfb 0%, #eef9f7 100%);
    border-color: #c9dde3;
    text-align: right;
}

/* ── Botões do resumo desabilitados ── */
.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .header-actions .btn {
        flex: 1 1 180px;
        justify-content: center;
    }

    .summary-inline {
        grid-template-columns: 1fr 1fr;
    }

    .field-row,
    .field-row.three-col,
    .field-row.four-col,
    .field-row.five-col,
    .field-row.six-col,
    .field-row.seven-col {
        grid-template-columns: 1fr;
    }

    .product-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .product-table-field {
        flex: none;
    }

    .product-btn-field {
        flex: none;
    }

    .product-manual-btn {
        width: 100%;
        justify-content: center;
    }

    .field-row.payment-main-row,
    .field-row.payment-values-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .field.field-compact,
    .field.field-compact input,
    .field.field-compact select {
        max-width: none;
    }

    .extra-payment-item {
        flex-direction: column;
        align-items: stretch;
    }

    .extra-payment-item .field,
    .extra-payment-item .field.extra-field-forma,
    .extra-payment-item .field.extra-field-valor,
    .extra-payment-item .field.extra-field-parcelas,
    .extra-payment-item .field.extra-field-valor-parcela {
        max-width: none;
        min-height: 0;
        flex: 1 1 auto;
    }

    .extra-payment-item .btn-remove {
        align-self: flex-end;
    }

    .product-item {
        grid-template-columns: 18px 1fr;
    }

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

    .preview-head {
        flex-direction: column;
        align-items: start;
    }

    .preview-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .preview-actions .btn {
        flex: 1 1 160px;
        justify-content: center;
    }

    .preview-total-box {
        width: 100%;
    }

    .preview-a4 {
        padding: 16px;
    }
}

@media (max-width: 720px) {
    .preview-share-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .bg-orb {
        display: none;
    }

    .container {
        width: min(100%, calc(100% - 20px));
    }

    .app-header {
        position: sticky;
        top: 0;
        z-index: 350;
        padding: 10px 0;
    }

    .header-inner {
        gap: 12px;
        padding: 12px;
        border-radius: 14px;
        backdrop-filter: none;
        box-shadow: 0 8px 18px rgba(16, 32, 24, 0.08);
    }

    .brand-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 1.05rem;
    }

    .brand-block h1 {
        font-size: 1.12rem;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-content {
        padding: 12px 14px 14px;
    }

    .card {
        box-shadow: 0 8px 18px rgba(16, 32, 24, 0.08);
    }

    .search-results {
        max-height: min(52vh, 320px);
    }

    .card.card-search-open {
        z-index: 900;
    }

    .payment-kpis {
        grid-template-columns: 1fr;
    }

    .payment-breakdown-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-breakdown-total {
        align-self: flex-end;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    #produtoResults.search-results {
        max-height: min(56vh, 360px);
    }

    .product-list {
        max-height: none;
        overflow: visible;
    }

    .product-item {
        padding: 10px;
        gap: 10px;
    }

    .product-main strong {
        font-size: 0.9rem;
        line-height: 1.28;
    }

    .product-meta {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .product-controls {
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-controls {
        display: none;
    }

    .product-edit-btn {
        display: inline-flex;
    }

    .mini-field input {
        min-height: 38px;
    }

    .product-controls .product-total-field {
        grid-column: 1 / -1;
    }

    .product-controls .btn-remove {
        justify-self: end;
    }

    .summary-inline {
        gap: 6px 10px;
    }

    .summary-row {
        padding: 8px 0;
    }

    .summary-row.total-row {
        grid-column: 1 / -1;
        border-left: none;
        border-top: 2px solid var(--primary);
        margin-left: 0;
        padding-left: 0;
        padding-top: 8px;
    }

    .action-stack-inline {
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 8px;
        box-shadow: 0 10px 24px rgba(16, 32, 24, 0.15);
        z-index: 40;
    }

    .action-stack-inline .btn {
        flex: 1 1 calc(50% - 5px);
    }

    .loading-overlay {
        backdrop-filter: none;
    }

    .preview-panel {
        padding: 12px;
    }

    .preview-grid-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .toast {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .header-actions .btn,
    .action-stack-inline .btn,
    .preview-actions .btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 420px) {
    .container {
        width: min(100%, calc(100% - 16px));
    }

    .header-inner {
        padding: 10px;
    }

    .brand-block {
        gap: 10px;
    }

    .brand-icon {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .field label {
        font-size: 0.8rem;
    }

    .product-controls {
        grid-template-columns: 1fr;
    }

    .product-controls .product-total-field {
        grid-column: auto;
    }

    .product-controls .btn-remove {
        justify-self: end;
    }
}

@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .btn-remove,
    .btn-search {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .bg-orb {
        animation: none !important;
    }
}

/* =======================================================================
   Modern UI Overhaul (2026-03-25)
   Non-breaking visual overrides only (IDs/classes preserved for app.js)
   ======================================================================= */
:root {
    --bg: #f4f7fb;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: #ffffff;
    --line: #d9e3ef;
    --line-strong: #b8c9de;
    --text: #1f2a37;
    --text-soft: #556375;
    --text-muted: #6d7b8c;
    --primary: #0d5f9f;
    --primary-strong: #09477a;
    --primary-light: #9ec7ea;
    --secondary: #d98922;
    --accent: #1f8d60;
    --danger: #c23e3e;
    --shadow-soft: 0 14px 34px rgba(18, 39, 62, 0.08);
    --shadow-strong: 0 30px 60px rgba(18, 39, 62, 0.18);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at 8% 8%, rgba(13, 95, 159, 0.13), transparent 35%),
        radial-gradient(circle at 88% 12%, rgba(217, 137, 34, 0.1), transparent 32%),
        radial-gradient(circle at 50% 95%, rgba(31, 141, 96, 0.11), transparent 38%),
        linear-gradient(160deg, #eef3fa 0%, #f4f8fc 48%, #f7fafd 100%);
}

.container {
    width: min(1380px, calc(100% - 36px));
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 340;
    padding: 14px 0 12px;
    backdrop-filter: blur(8px);
}

.header-inner {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(247, 251, 255, 0.86));
    border-color: rgba(176, 196, 220, 0.72);
    box-shadow: 0 16px 34px rgba(18, 39, 62, 0.12);
}

.brand-icon {
    box-shadow: 0 10px 22px rgba(13, 95, 159, 0.34);
}

.brand-block h1 {
    letter-spacing: -0.02em;
}

.brand-block p {
    margin-top: 2px;
}

.brand-meta-badges {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.brand-meta-badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d3e1f0;
    background: #f8fbff;
    color: #35536f;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.btn {
    border-radius: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, #0d5f9f, #0a4d83);
}

.btn-ghost {
    background: linear-gradient(180deg, #ffffff, #f6f9fd);
}

.card {
    border-color: rgba(177, 196, 219, 0.72);
    box-shadow: 0 14px 35px rgba(18, 39, 62, 0.08);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 18px 0 0 18px;
    background: linear-gradient(180deg, rgba(13, 95, 159, 0.4), rgba(13, 95, 159, 0.06));
    pointer-events: none;
}

.card-header {
    border-bottom-color: #e2eaf4;
    background: linear-gradient(180deg, #fcfeff 0%, #f5f9fd 100%);
}

.card-header h2 {
    letter-spacing: -0.01em;
}

.card-content {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

input,
select,
textarea {
    border-color: #d4e0ed;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2c84c6;
    box-shadow: 0 0 0 4px rgba(44, 132, 198, 0.12);
}

.search-results {
    border-color: #bccfe5;
    box-shadow: 0 22px 36px rgba(18, 39, 62, 0.2);
}

.search-item.active {
    background: linear-gradient(120deg, #edf5fd 0%, #f4fbf8 100%);
    border-left-color: #0d5f9f;
}

.product-item {
    border-left-width: 4px;
    border-left-color: #96bfe2;
    box-shadow: 0 7px 16px rgba(18, 39, 62, 0.04);
}

.product-item:hover {
    box-shadow: 0 12px 22px rgba(18, 39, 62, 0.09);
}

.tip-box {
    border-color: #e7d4ba;
    background: linear-gradient(180deg, #fffaf2 0%, #fff6ea 100%);
}

.card-resumo {
    position: sticky;
    top: 104px;
    border-color: #aac8e6;
    background: linear-gradient(135deg, #ecf6ff 0%, #f3fbf8 100%);
}

.card-resumo .card-header {
    background: linear-gradient(180deg, #e7f3ff 0%, #ddf1e8 100%);
}

.summary-inline {
    gap: 8px 16px;
}

.summary-row {
    border: 1px solid #dce8f5;
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.summary-row.total-row {
    border-left: 1px solid #dce8f5;
    border: 2px solid #9ec7ea;
    margin-left: 0;
    padding-left: 12px;
    background: linear-gradient(160deg, #eaf5ff 0%, #f3fbf8 100%);
}

.action-stack-inline {
    margin-top: 14px;
}

.preview-panel {
    border-color: #c2d5ea;
    box-shadow: 0 16px 38px rgba(18, 39, 62, 0.09);
}

.preview-a4 {
    border-color: #d7e4f2;
    box-shadow: 0 12px 26px rgba(18, 39, 62, 0.05);
}

.modal {
    border-color: #c5d8ec;
}

.saved-item {
    border-color: #d2dfec;
}

/* Ajuste fino: dar mais espaço para valores altos nos itens */
.product-controls {
    grid-template-columns: 64px 86px 76px 84px 132px 30px;
}

.product-controls .mini-field:first-child input {
    text-align: center;
}

.product-controls .product-total-field input {
    font-size: 0.82rem;
    padding: 7px 6px;
}

/* Pente fino A11y/UX */
.field-row.payment-main-row label {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    line-height: 1.2;
}

.product-controls label {
    font-size: 0.78rem;
}

.search-helper {
    font-size: 0.82rem;
}

.mini-field input {
    font-size: 0.88rem;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.search-item:focus-visible,
.product-item:focus-visible,
.drag-handle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.extra-payments-wrap.sem-valor {
    opacity: 0.68;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.62;
}

@media (max-width: 1024px) {
    .card-resumo {
        position: static;
        top: auto;
    }
}

@media (max-width: 760px) {
    .app-header {
        position: sticky;
        top: 0;
    }

    .brand-meta-badges {
        margin-top: 6px;
    }

    .summary-row {
        padding: 8px 10px;
    }
}

@media print {
    body {
        background: #fff;
        padding: 0;
    }

    .app-header,
    .grid-layout,
    .preview-head,
    .preview-share-card,
    .toast-container,
    .modal-overlay,
    .loading-overlay {
        display: none !important;
    }

    .preview-panel {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .preview-a4 {
        border: none;
        border-radius: 0;
        padding: 0;
    }

    .preview-table-wrap {
        overflow: visible;
    }

    .preview-table {
        min-width: 0;
    }
}
