/* Approved visual refresh. Existing control IDs and print layout are preserved. */
@font-face {
    font-family: "Manrope Local";
    src: url("/static/central-manrope-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Manrope Local";
    src: url("/static/central-manrope-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Manrope Local";
    src: url("/static/central-manrope-700.woff2") format("woff2");
    font-weight: 700 800;
    font-display: swap;
}

:root {
    --text: #182c3e;
    --text-soft: #41566a;
    --text-muted: #526679;
    --line: #d8e1e9;
    --primary: #0d5f9f;
    --shadow-soft: 0 2px 5px rgb(24 44 62 / 4%);
}

body {
    font-family: "Manrope Local", "Manrope", sans-serif;
    background: #f3f6f9;
    padding-bottom: 28px;
}
.bg-orb { display: none; }
.container { width: min(1440px, calc(100% - 40px)); }
.app-header { padding: 12px 0; backdrop-filter: none; }
.header-inner {
    min-height: 86px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: none;
}
.brand-block { min-width: 0; gap: 20px; flex-wrap: wrap; }
.brand-logo { width: 126px; height: auto; object-fit: contain; }
.brand-title { border-left: 1px solid var(--line); padding-left: 20px; }
.brand-block h1, .card-header h2 { font-family: inherit; }
.brand-block h1 { font-size: 1.35rem; }
.brand-title p { margin-top: 4px; font-size: .82rem; color: var(--text-soft); }
.header-actions { gap: 8px; }
.btn { min-height: 44px; box-shadow: none; border-radius: 9px; }
.btn:hover { transform: none; }
.btn-primary { background: var(--primary); box-shadow: none; }
.btn-primary:hover { background: #094a7d; box-shadow: none; }
.btn-ghost { background: #fff; border-color: #cbd7e2; }
.btn-ghost:hover { background: #f1f6fa; }
.btn:disabled { opacity: 1; background: #edf1f5; color: #596d7f; border-color: #d6dfe8; box-shadow: none; }
.workspace { gap: 16px; min-width: 0; align-items: start; }
.card {
    min-width: 0;
    border-color: var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    animation: none;
    opacity: 1;
    transform: none;
}
.card::before { display: none; }
.card-header { padding: 14px 18px; background: #fff; border-radius: 14px 14px 0 0; }
.card-header h2 { font-size: 1rem; font-weight: 700; }
.card-content { padding: 16px 18px 18px; background: #fff; border-radius: 0 0 14px 14px; }
.field label, .modal-body label { color: var(--text-soft); font-size: .875rem; line-height: 1.4; font-weight: 600; }
input, select, textarea { background: #fff; color: var(--text); border-color: #b9c9d7; font-family: inherit; }
input, select { min-height: 44px; }
input::placeholder, textarea::placeholder { color: #596e80; opacity: 1; }
input:disabled { background: #f0f3f6; color: #526679; opacity: 1; }
.search-helper, .empty-inline, .product-meta, .payment-breakdown-item small { color: var(--text-soft); }
.search-helper { font-size: .82rem; line-height: 1.5; }
.product-search-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.product-search-field { grid-column: 1 / -1; min-width: 0; }
.product-table-field { min-width: 0; }
.product-table-field select { width: 100%; }
.price-table-caption { display: none; }
.product-btn-field { min-width: 190px; }
.product-manual-btn { justify-content: center; min-height: 44px; background: #fff; color: var(--primary); border: 1px solid #a9c5dc; }
.product-manual-btn:hover { color: #094a7d; background: #eef5fb; }
.empty-state {
    min-height: 86px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px 12px;
    align-content: center;
    text-align: left;
    background: #f8fafc;
    border: 1px dashed #bfcedb;
    border-radius: 10px;
}
.empty-state > .icon { grid-column: 1; grid-row: 1 / 3; align-self: center; font-size: 1.35rem; color: #617e94; margin: 0; }
.empty-state p { grid-column: 2; font-size: .92rem; font-weight: 600; color: var(--text); }
.empty-state small { grid-column: 2; font-size: .82rem; color: var(--text-soft); }
.product-item { box-shadow: none; grid-template-columns: 18px minmax(0, 1fr); }
.product-item:hover { box-shadow: none; }
.product-controls { grid-column: 2; width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(110px, 1.3fr) 32px; }
.payment-group { border: 0; min-width: 0; padding: 0; margin: 0 0 20px; }
.payment-group legend { width: 100%; margin-bottom: 12px; color: var(--text); font-weight: 700; font-size: .875rem; }
.payment-config-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-details-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.payment-details-row .payment-col-forma { grid-column: span 2; }
.payment-discounts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payment-group .field, .payment-group .field input, .payment-group .field select { min-width: 0; max-width: none; width: 100%; }
.payment-group .field label { white-space: normal; }
.validity-date { color: var(--text-soft); font-size: .8rem; font-weight: 400; }
.extra-payments-wrap { border-top: 1px solid var(--line); padding-top: 16px; }
.extra-payments-wrap.sem-valor { opacity: 1; }
.extra-payments-head strong { font-size: .9rem; }
.empty-inline { font-size: .82rem; font-style: normal; }
.payment-kpis { gap: 8px; }
.payment-kpi { border-color: #d8e1e9; }
.tip-box { background: #f4f8fc; border-color: #d5e2ee; color: var(--text-soft); }
.payment-breakdown-item { background: #fff; }
.card-resumo { border: 1px solid #bed0e0; background: #fff; }
.card-resumo .card-header { background: #fff; }
.card-resumo .card-header h2 { font-size: 1rem; }
.card-resumo .summary-inline { display: grid; grid-template-columns: 1fr; gap: 0; }
.card-resumo .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid #e5ebf1;
    border-radius: 0;
    padding: 12px 0;
    background: transparent;
}
.card-resumo .summary-row span { font-size: .875rem; color: var(--text-soft); }
.card-resumo .summary-row strong { font-size: 1rem; color: var(--text); white-space: nowrap; }
.card-resumo .summary-row.total-row {
    display: grid;
    gap: 4px;
    margin: 14px 0 0;
    padding: 16px;
    border: 1px solid #d3e4f2;
    border-radius: 10px;
    background: #eff6fc;
}
.card-resumo .total-row strong { color: #0a4d83; font-size: 2rem; letter-spacing: -.04em; }
.summary-guidance { margin: 16px 0 0; color: var(--text-soft); font-size: .82rem; line-height: 1.6; }
.card-resumo .action-stack-inline { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; padding: 0; border: 0; box-shadow: none; background: transparent; position: static; }
.card-resumo .action-stack-inline .btn { width: 100%; justify-content: center; min-height: 46px; }
.modal { border-radius: 14px; border-color: #cad7e2; max-height: calc(100dvh - 32px); }
.modal-body { padding: 20px; }
.modal-body label { display: block; margin-bottom: 6px; }
.modal-grid { gap: 16px; }
.manual-item-subtotal { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 14px; gap: 16px; background: #eff6fc; border: 1px solid #d3e4f2; border-radius: 9px; font-size: .875rem; }
.manual-item-subtotal output { font-weight: 700; color: #0a4d83; font-size: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media screen and (min-width: 1100px) {
    .workspace { grid-template-columns: minmax(0, 1fr) 320px; }
    .workspace > .card { grid-column: 1; }
    .workspace > .card-resumo { grid-column: 2; grid-row: 1 / span 5; align-self: start; position: sticky; top: 110px; }
}
@media screen and (max-width: 1099px) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .card-resumo { position: static; }
    .card-resumo .summary-inline { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .card-resumo .summary-row { display: grid; align-content: start; gap: 6px; }
    .card-resumo .total-row { grid-column: 1 / -1; }
    .card-resumo .action-stack-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 760px) {
    .container { width: calc(100% - 24px); }
    .app-header { position: static; padding: 12px 0; }
    .header-inner { align-items: stretch; gap: 12px; padding: 12px; }
    .brand-block { gap: 14px; flex-wrap: wrap; }
    .brand-logo { width: 104px; }
    .brand-title { padding-left: 14px; }
    .brand-block h1 { font-size: 1.1rem; }
    .brand-title p { font-size: .75rem; }
    .header-actions { width: 100%; display: grid; grid-template-columns: 1fr .7fr 1.2fr; gap: 6px; }
    .header-actions .btn { padding: 8px 6px; justify-content: center; font-size: .75rem; gap: 4px; line-height: 1.3; }
    .header-actions .btn .icon { display: none; }
    .card-header { padding: 13px 14px; }
    .card-content { padding: 14px; }
    .product-btn-field { min-width: 0; }
    .product-manual-btn { min-height: 44px; font-size: .8rem; }
    .field label { font-size: .875rem; }
    input, select, textarea { font-size: 16px; }
    .product-table-field { grid-column: 1 / -1; }
    .price-table-caption { display: block; color: var(--text-soft); font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
    .product-btn-field { grid-column: 1 / -1; }
    .product-btn-label { display: none; }
    .payment-details-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-group { margin-bottom: 18px; }
    .payment-kpis { grid-template-columns: 1fr; }
    .extra-payments-head { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
    .card-resumo .summary-row strong { font-size: .92rem; }
    .card-resumo .total-row strong { font-size: 2rem; }
    .card-resumo .summary-row { min-width: 0; }
    .card-resumo .summary-row span { font-size: .8rem; }
    .modal-body { padding: 16px; max-height: calc(100dvh - 200px); }
    .modal-footer { padding: 12px 16px; }
    .action-stack-inline.share-actions { position: static; }
}
@media print {
    body { background: #fff; }
    .workspace { display: block; }
}
