/* =========================================================
   PONUDA.CSS
   Dodatni stilovi samo za ponudu.
   Faktura i predračun ostaju netaknuti u faktura.css.
========================================================= */

.offer-template-section {
    margin-bottom: 72px;
}

.offer-template-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.offer-template-card {
    min-height: 210px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.offer-template-card:hover {
    transform: translateY(-2px);
    border-color: #b9c8c3;
    box-shadow: 0 16px 34px rgba(9,35,40,.07);
}

.offer-template-card.active {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(42,131,95,.11);
}

.offer-template-card strong,
.offer-template-card small {
    display: block;
}

.offer-template-card strong {
    margin-top: 16px;
    margin-bottom: 7px;
    font-size: 14px;
}

.offer-template-card small {
    color: var(--soft);
    font-size: 10px;
    line-height: 1.55;
}

.template-preview {
    position: relative;
    display: block;
    height: 92px;
    overflow: hidden;
    border: 1px solid #e5ebe8;
    border-radius: 10px;
    background: #fbfcfb;
}

.template-preview::before,
.template-preview::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
}

.template-preview-grouped::before {
    top: 13px;
    height: 7px;
    width: 42%;
    background: #263a3d;
    border-radius: 4px;
    box-shadow: 0 22px 0 #d7dfdc, 0 39px 0 #d7dfdc, 0 56px 0 #263a3d;
}

.template-preview-grouped::after {
    top: 35px;
    left: 50px;
    border-top: 1px dotted #8a9793;
    box-shadow: 0 17px 0 #fff, 0 17px 0 0 #fff;
}

.template-preview-simple::before {
    top: 18px;
    height: 1px;
    background: #879591;
    box-shadow: 0 20px 0 #879591, 0 40px 0 #879591;
}

.template-preview-simple::after {
    top: 13px;
    left: auto;
    right: 12px;
    width: 25%;
    height: 9px;
    background: #263a3d;
    border-radius: 3px;
    box-shadow: 0 20px 0 #263a3d, 0 40px 0 #263a3d;
}

.template-preview-classic {
    background-image:
        linear-gradient(#dfe5e3 1px, transparent 1px),
        linear-gradient(90deg, #dfe5e3 1px, transparent 1px);
    background-size: 100% 23px, 25% 100%;
}

.template-preview-classic::before {
    top: 0;
    left: 0;
    right: 0;
    height: 23px;
    background: rgba(18,84,79,.08);
}

.template-preview-service::before {
    top: 13px;
    left: 12px;
    right: 12px;
    height: 20px;
    border: 1px solid #dfe5e3;
    border-radius: 6px;
    box-shadow: 0 27px 0 -1px #fff, 0 27px 0 0 #dfe5e3, 0 54px 0 -1px #fff, 0 54px 0 0 #dfe5e3;
}

.offer-display-options {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 24px;
    align-items: end;
}

.offer-display-options select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.template-help {
    padding-bottom: 6px;
    color: var(--soft);
    font-size: 11px;
    line-height: 1.6;
}

/* Stavke u editoru */
.invoice-item .item-group-field {
    grid-column: 1 / -1;
}

.item-group-field label span {
    color: #95a09d;
    font-weight: 400;
}

.item-group-field input {
    background: #fffef8 !important;
}

/* =========================================================
   PREVIEW ZAJEDNIČKO
========================================================= */

.invoice-page-sheet[class*="offer-template-"] {
    color: #182729;
}

.invoice-page-sheet[class*="offer-template-"] .preview-buyer-section {
    padding: 30px 0 34px;
}

.offer-simple-list,
.offer-grouped-list,
.offer-service-list {
    margin-top: 14px;
}

.offer-list-row {
    display: grid;
    grid-template-columns: 28px minmax(0, auto) 1fr auto;
    gap: 8px;
    align-items: end;
    min-height: 34px;
    padding: 7px 0;
    break-inside: avoid;
}

.offer-list-number {
    color: #526164;
    font-size: 11px;
}

.offer-list-main {
    min-width: 0;
}

.offer-list-main strong {
    display: block;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.offer-list-main small {
    display: block;
    margin-top: 2px;
    color: #768386;
    font-size: 8.5px;
    line-height: 1.35;
}

.offer-list-dots {
    min-width: 20px;
    height: 1em;
    border-bottom: 1px dotted #7b8885;
    transform: translateY(-3px);
}

.offer-list-price {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
}

/* =========================================================
   ŠABLON 1: GRUPISANA
========================================================= */

.offer-template-grouped .preview-header {
    border-bottom-width: 1px;
}

.offer-group-title {
    margin-top: 26px;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -.2px;
    text-transform: uppercase;
    break-after: avoid;
}

.offer-group-title:first-child {
    margin-top: 4px;
}

.offer-group-total {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 4px;
    padding: 8px 0 11px;
    border-top: 1px solid #cfd7d4;
    break-inside: avoid;
}

.offer-group-total span,
.offer-group-total strong {
    font-size: 11px;
    font-weight: 700;
}

.offer-group-total span {
    text-transform: uppercase;
}

/* =========================================================
   ŠABLON 2: ČISTA LISTA
========================================================= */

.offer-template-simple .preview-header {
    border-bottom: 1px solid #d8dfdc;
}

.offer-template-simple .preview-buyer-section {
    max-width: 100%;
    margin-left: 0;
    text-align: left;
    border-bottom: 1px solid #edf0ef;
}

.offer-template-simple .offer-list-row {
    padding: 11px 0;
    border-bottom: 1px solid #edf0ef;
}

.offer-template-simple .offer-list-dots {
    border-bottom-style: solid;
    border-bottom-color: #dfe5e3;
}

/* =========================================================
   ŠABLON 3: KLASIČNA TABELA
========================================================= */

.offer-template-classic .preview-table {
    table-layout: auto;
}

.offer-template-classic .preview-table th,
.offer-template-classic .preview-table td {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 8px;
}

.offer-template-classic .preview-table th:nth-child(2),
.offer-template-classic .preview-table td:nth-child(2) {
    min-width: 145px;
}

/* =========================================================
   ŠABLON 4: USLUGE
========================================================= */

.offer-template-service .preview-buyer-section {
    max-width: 100%;
    margin-left: 0;
    text-align: left;
}

.offer-service-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid #e2e7e5;
    break-inside: avoid;
}

.offer-service-row:last-child {
    border-bottom: 1px solid #e2e7e5;
}

.service-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5d1;
    border-radius: 50%;
    color: #667477;
    font-size: 10px;
    font-weight: 600;
}

.service-group {
    display: block;
    margin-bottom: 4px;
    color: var(--green);
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.service-copy h3 {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.service-copy p {
    margin-top: 5px;
    color: #758184;
    font-size: 9px;
    line-height: 1.45;
}

.service-price {
    padding-top: 4px;
    white-space: nowrap;
    font-size: 12px;
}

/* =========================================================
   UKUPNO: ponuda ima malo mirniji završetak od fakture
========================================================= */

.invoice-page-sheet[class*="offer-template-"] .preview-total-section {
    margin-top: 36px;
}

.invoice-page-sheet[class*="offer-template-"] .preview-total-row:last-of-type {
    padding-top: 12px;
    border-top: 1px solid #cdd6d2;
}

/* =========================================================
   MOBILE EDITOR
========================================================= */

@media (max-width: 900px) {
    .offer-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .offer-template-grid {
        grid-template-columns: 1fr;
    }

    .offer-template-card {
        min-height: auto;
    }

    .offer-display-options {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .invoice-item .item-group-field {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   FIX - KUPAC UVEK DESNO
========================================================= */

.invoice-page-sheet .preview-buyer-section,
.invoice-page-sheet.offer-template-simple .preview-buyer-section,
.invoice-page-sheet.offer-template-services .preview-buyer-section,
.invoice-page-sheet.offer-template-grouped .preview-buyer-section,
.invoice-page-sheet.offer-template-classic .preview-buyer-section {
    width: 100%;
    max-width: 420px;

    margin-left: auto !important;
    margin-right: 0 !important;

    padding: 32px 0 38px;

    text-align: right !important;
}

.invoice-page-sheet .preview-buyer-section h3,
.invoice-page-sheet .preview-buyer-section p,
.invoice-page-sheet .preview-buyer-section .preview-label {
    text-align: right !important;
}


/* =========================================================
   FIX - ZAVRŠNI DEO I POTPIS
========================================================= */

.invoice-page-sheet {
    position: relative;

    display: flex;
    flex-direction: column;

    min-height: 297mm;
    height: 297mm;

    overflow: hidden;
}


/* završni blok mora ostati u normalnom toku stranice */

.invoice-page-sheet .preview-total-section {
    position: static !important;

    width: 100%;

    margin-top: 42px;

    flex-shrink: 0;
}


/* donji deo */

.invoice-page-sheet .preview-total-bottom {
    position: static !important;

    width: 100%;

    margin-top: 32px;

    display: block;
}


/* potpis */

.invoice-page-sheet .preview-signature-right {
    position: static !important;

    width: 250px;

    margin-top: 42px;
    margin-left: auto !important;
    margin-right: 0;

    padding: 0;

    text-align: center !important;

    break-inside: avoid;
    page-break-inside: avoid;

    flex-shrink: 0;
}


/* ne treba ogromna praznina */

.invoice-page-sheet .signature-space {
    height: 34px;
}


/* linija */

.invoice-page-sheet .signature-line-right {
    width: 100%;
    height: 1px;

    margin-bottom: 8px;

    background: #162527;
}


/* tekst ispod potpisa */

.invoice-page-sheet .preview-signature-right span {
    display: block;

    font-size: 10px;
    line-height: 1.4;

    color: #59676a;
}


/* ukupna suma + potpis ne smeju da se lome čudno */

.invoice-page-sheet .preview-grand-total,
.invoice-page-sheet .preview-signature-right {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* =========================================================
   SERVICES - stabilan rendering
========================================================= */

.offer-template-services .offer-service-card {
    break-inside: avoid;
    page-break-inside: avoid;

    flex-shrink: 0;
}

.offer-template-services .offer-services-list {
    width: 100%;
}

.offer-template-services .offer-service-content {
    min-width: 0;
}

.offer-template-services .offer-service-content h3,
.offer-template-services .offer-service-content p {
    overflow-wrap: anywhere;
}

/* =========================================================
   GROUPED - grupa da se ne raspada
========================================================= */

.offer-template-grouped .offer-list-row,
.offer-template-grouped .offer-group-total {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* =========================================================
   NAPOMENA U PONUDI
========================================================= */

.preview-offer-note-block {
    width: 100%;

    margin-top: 30px;

    padding-top: 20px;

    border-top: 1px solid #dfe5e3;

    color: #536164;

    font-size: 11px;

    line-height: 1.7;
}


.preview-offer-note-block h4 {
    margin-bottom: 10px;

    color: #162527;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 0.4px;
}


.preview-offer-note-block p {
    margin-bottom: 5px;
}


.preview-offer-note-block strong {
    color: #162527;

    font-weight: 600;
}


/* =========================================================
   ŠABLONI - BOLJA HIJERARHIJA
========================================================= */

.offer-template-card {
    padding: 22px 20px;
}


.offer-template-card h3 {
    margin-bottom: 8px;

    font-size: 16px;
    line-height: 1.3;

    font-weight: 700;

    color: #162527;
}


.offer-template-card p {
    font-size: 13px;

    line-height: 1.55;

    color: #637073;
}


/* =========================================================
   OBJAŠNJENJE SEKCIJE
========================================================= */

.template-section-help {
    margin-top: 22px;
    margin-bottom: 34px;

    padding: 16px 18px;

    border-left: 3px solid var(--green);

    background: #f7faf8;

    border-radius: 0 12px 12px 0;
}


.template-section-help strong {
    display: block;

    margin-bottom: 5px;

    font-size: 12px;

    color: #162527;
}


.template-section-help p {
    max-width: 680px;

    font-size: 12px;
    line-height: 1.6;

    color: #637073;
}


/* =========================================================
   STAVKA - RAZMAK I RASPORED
========================================================= */

.invoice-item {
    row-gap: 18px;
}


.item-group-field {
    grid-column: 1 / -1;

    margin-bottom: 4px;
}


.item-group-field input {
    max-width: 520px;
}


/* PDV i ostala finansijska polja neka budu niže */

.invoice-item .item-name {
    margin-top: 4px;
}


.invoice-item .item-vat {
    margin-top: 0;
}


/* =========================================================
   ŠABLONI - BOLJA HIJERARHIJA
========================================================= */

.offer-template-card {
    padding: 22px 20px;
}


.offer-template-card h3 {
    margin-bottom: 8px;

    font-size: 16px;
    line-height: 1.3;

    font-weight: 700;

    color: #162527;
}


.offer-template-card p {
    font-size: 13px;

    line-height: 1.55;

    color: #637073;
}


/* =========================================================
   OBJAŠNJENJE SEKCIJE
========================================================= */

.template-section-help {
    margin-top: 22px;
    margin-bottom: 34px;

    padding: 16px 18px;

    border-left: 3px solid var(--green);

    background: #f7faf8;

    border-radius: 0 12px 12px 0;
}


.template-section-help strong {
    display: block;

    margin-bottom: 5px;

    font-size: 12px;

    color: #162527;
}


.template-section-help p {
    max-width: 680px;

    font-size: 12px;
    line-height: 1.6;

    color: #637073;
}


/* =========================================================
   STAVKA - RAZMAK I RASPORED
========================================================= */

.invoice-item {
    row-gap: 18px;
}


.item-group-field {
    grid-column: 1 / -1;

    margin-bottom: 4px;
}


.item-group-field input {
    max-width: 520px;
}


/* PDV i ostala finansijska polja neka budu niže */

.invoice-item .item-name {
    margin-top: 4px;
}


.invoice-item .item-vat {
    margin-top: 0;
}


/* =========================================================
   FINAL FIX - KARTICE ŠABLONA
========================================================= */

.offer-template-card strong {
    display: block;

    margin-top: 18px;
    margin-bottom: 9px;

    font-size: 17px !important;
    line-height: 1.3;

    font-weight: 700;

    color: #162527;
}


.offer-template-card small {
    display: block;

    font-size: 13px !important;
    line-height: 1.6;

    color: #637073;
}


/* =========================================================
   FIX - ČISTA LISTA
   opis levo, cena uvek desno
========================================================= */

.offer-template-simple .offer-simple-row {
    display: grid;

    grid-template-columns:
        28px
        minmax(0, 1fr)
        minmax(40px, 1fr)
        auto;

    gap: 10px;

    align-items: end;

    width: 100%;

    padding: 11px 0;

    border-bottom: 1px solid #edf0ef;
}


.offer-template-simple .offer-list-description {
    min-width: 0;

    font-size: 11px;
    line-height: 1.45;

    overflow-wrap: anywhere;
}


.offer-template-simple .offer-list-dots {
    width: 100%;
    min-width: 40px;

    border-bottom: 1px dotted #9aa5a2;

    transform: translateY(-3px);
}


.offer-template-simple .offer-simple-row > strong {
    white-space: nowrap;

    text-align: right;

    font-size: 11px;
    font-weight: 600;

    padding-left: 6px;
}

@media (max-width: 760px) {

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

    input,
    textarea,
    select {
        -webkit-text-size-adjust: 100%;
    }

}
/* =========================================================
   FINAL OFFER POLISH 2026
========================================================= */

.invoice-page-sheet[class*="offer-template-"] .preview-total-section {
    margin-top: 22px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-total-bottom {
    margin-top: 16px !important;
    padding-top: 12px !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-signature-right {
    width: 215px !important;
    margin-top: 20px !important;
}

.invoice-page-sheet[class*="offer-template-"] .signature-space {
    height: 22px !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-signature-right span {
    font-size: 8.5px !important;
}

.preview-offer-note-block {
    margin-top: 18px !important;
    padding-top: 12px !important;
    font-size: 9px !important;
    line-height: 1.45 !important;
}

.preview-offer-note-block h4 {
    margin-bottom: 6px !important;
    font-size: 8px !important;
}

.preview-offer-note-block p {
    margin-bottom: 4px !important;
    white-space: pre-line;
}

.offer-template-classic .offer-classic-table {
    width: 100% !important;
    table-layout: fixed !important;
}

.offer-template-classic .offer-classic-table th,
.offer-template-classic .offer-classic-table td {
    width: auto !important;
}

.offer-template-classic .offer-classic-table th {
    padding: 7px 4px !important;
    font-size: 7.5px !important;
    line-height: 1.15 !important;
}

.offer-template-classic .offer-classic-table td {
    padding: 9px 4px !important;
    font-size: 8.4px !important;
    line-height: 1.3 !important;
}

.offer-template-classic .offer-classic-table .numeric-cell,
.offer-template-classic .offer-classic-table .table-percent,
.offer-template-classic .offer-classic-table .col-rb,
.offer-template-classic .offer-classic-table .col-unit {
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}

.offer-template-classic .offer-classic-table .col-description {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.offer-template-classic .offer-classic-table.is-vat col.offer-col-rb { width: 5%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-description { width: 36%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-unit { width: 7%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-quantity { width: 8%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-price { width: 12%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-discount { width: 8%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-vat { width: 8%; }
.offer-template-classic .offer-classic-table.is-vat col.offer-col-total { width: 16%; }

.offer-template-classic .offer-classic-table.no-vat col.offer-col-rb { width: 5%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-description { width: 42%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-unit { width: 8%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-quantity { width: 9%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-price { width: 13%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-discount { width: 9%; }
.offer-template-classic .offer-classic-table.no-vat col.offer-col-total { width: 14%; }

.offer-group-block,
.offer-list-row,
.offer-group-total,
.offer-simple-row,
.offer-service-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.offer-template-grouped .offer-list-row,
.offer-template-simple .offer-simple-row {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.offer-template-services .offer-service-card {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
}

.offer-template-services .offer-service-content h3 {
    font-size: 11.5px !important;
    line-height: 1.3 !important;
}

.offer-template-services .offer-service-content p {
    margin-top: 3px !important;
    font-size: 8.5px !important;
    line-height: 1.35 !important;
}

/* Kompaktniji kupac na ponudi da ne pojede pola prve strane */
.invoice-page-sheet[class*="offer-template-"] .preview-buyer-section {
    max-width: 390px !important;
    padding: 18px 0 20px !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-buyer-section h3 {
    margin-bottom: 6px !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-buyer-section p {
    margin-bottom: 2px !important;
    font-size: 8.5px !important;
    line-height: 1.3 !important;
}

.invoice-page-sheet[class*="offer-template-"] .preview-label {
    margin-bottom: 5px !important;
    font-size: 8px !important;
}

/* =========================================================
   PDV U PONUDI
========================================================= */

.offer-vat-option {
    min-width: 0;
}

.offer-vat-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.offer-vat-choice .mode-button {
    min-height: 48px;
    padding: 0 16px;
}

.offer-vat-help {
    display: block;
    margin-top: 8px;
    max-width: 520px;
    color: var(--soft);
    font-size: 10.5px;
    line-height: 1.45;
}

.offer-vat-field.is-hidden {
    display: none !important;
}

@media (max-width: 760px) {
    .offer-vat-choice {
        width: 100%;
    }

    .offer-vat-choice .mode-button {
        flex: 1 1 0;
        min-width: 0;
        min-height: 46px;
        font-size: 13px;
    }

    .offer-vat-help {
        font-size: 11px;
    }
}

/* =========================================================
   IZGLED PONUDE - CLEAN CONFIG V4
========================================================= */

.offer-config-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;

    margin-bottom: 34px;
}

.offer-config-block {
    width: 100%;
    padding: 0 0 24px;
}

.offer-config-block + .offer-config-block {
    padding-top: 4px;
}

.offer-config-title {
    display: block;
    margin-bottom: 10px;

    color: #162527;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
}

/* PDV više nije generički mode-button. Ovo je čista tab selekcija. */
.offer-vat-choice {
    display: inline-flex;
    align-items: center;
    gap: 24px;

    width: auto;

    border-bottom: 1px solid #dfe5e3;
}

.offer-vat-button {
    position: relative;

    min-height: 0;
    padding: 8px 0 10px;

    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    color: #7a8784;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;

    cursor: pointer;

    transition: color .18s ease;
}

.offer-vat-button::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;

    height: 2px;

    background: transparent;

    transition: background .18s ease;
}

.offer-vat-button:hover {
    color: #2A835F;
}

.offer-vat-button.active {
    color: #12544F;
}

.offer-vat-button.active::after {
    background: #2A835F;
}

.offer-vat-help {
    display: block;

    margin-top: 9px;
    max-width: 620px;

    color: #7a8784;
    font-size: 10.5px;
    line-height: 1.5;
}

/* Valuta ide odmah ispod PDV-a. */
.offer-currency-option {
    max-width: 240px;
}

.offer-currency-option select {
    width: 100%;
    height: 46px;

    padding: 0 14px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: #fff;
    color: var(--text);

    font-family: inherit;
    font-size: 14px;

    outline: none;

    transition: border-color .18s ease, box-shadow .18s ease;
}

.offer-currency-option select:focus {
    border-color: rgba(42, 131, 95, .55);
    box-shadow: 0 0 0 3px rgba(42, 131, 95, .08);
}

/* Sekcija/grupa je sada obična informacija, bez AI kartice. */
.template-section-help {
    width: 100%;

    margin: 0 !important;
    padding: 2px 0 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
}

.template-section-help strong {
    display: block;

    margin: 0 0 6px !important;

    color: #162527;
    font-size: 13px !important;
    font-weight: 650;
}

.template-section-help p {
    max-width: 680px;

    margin: 0 !important;

    color: #6c7976;
    font-size: 11.5px !important;
    line-height: 1.55 !important;
}

.offer-template-heading {
    margin: 0 0 14px;
}

.offer-template-heading strong {
    display: block;

    margin-bottom: 4px;

    color: #162527;
    font-size: 13px;
    font-weight: 650;
}

.offer-template-heading span {
    color: #7a8784;
    font-size: 11px;
    line-height: 1.45;
}

/* Stari raspored više nije potreban, ali ga eksplicitno neutrališemo. */
.offer-display-options {
    display: block;
    margin-top: 0;
}

@media (max-width: 760px) {

    .offer-config-panel {
        margin-bottom: 28px;
    }

    .offer-config-block {
        padding-bottom: 22px;
    }

    .offer-vat-choice {
        gap: 22px;
    }

    .offer-vat-button {
        font-size: 16px !important;
        padding: 7px 0 9px;
    }

    .offer-vat-help {
        max-width: 100%;
        font-size: 11px;
    }

    .offer-currency-option {
        width: 100%;
        max-width: 100%;
    }

    .offer-currency-option select {
        height: 48px;
        font-size: 16px;
    }

    .template-section-help strong,
    .offer-config-title,
    .offer-template-heading strong {
        font-size: 14px !important;
    }

    .template-section-help p,
    .offer-template-heading span {
        font-size: 12px !important;
    }
}

/* =========================================================
   MOBILE NO AUTO-ZOOM - FINAL OVERRIDE
========================================================= */
@media screen and (max-width: 760px) {
    html body input:not([type="checkbox"]):not([type="radio"]),
    html body textarea,
    html body select,
    html body .invoice-item .field input,
    html body .invoice-item .field select,
    html body .item-group-field input,
    html body .offer-display-options select,
    html body .offer-currency-option select {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
    }
}


/* ===== Dokument: datum i potpis 2026-10 ===== */
.document-date-input {
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.signature-choice-block {
    margin-top: 22px;
}
.signature-choice-title {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 650;
    color: #162527;
}
.signature-choice {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #dfe5e3;
    border-radius: 12px;
    background: #f7faf8;
}
.signature-choice-button {
    border: 0;
    border-radius: 9px;
    padding: 9px 13px;
    background: transparent;
    color: #586669;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.signature-choice-button.active {
    background: #ffffff;
    color: #092328;
    box-shadow: 0 1px 4px rgba(9,35,40,.12);
}
.document-valid-without-signature {
    width: 100%;
    margin-top: 24px;
    text-align: center;
    font-size: 8.5px;
    font-weight: 600;
    color: #667477;
}
.continuation-header-full {
    align-items: flex-start !important;
}
.continuation-company {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.continuation-company > span,
.continuation-company-details {
    display: block;
    font-size: 7.5px !important;
    line-height: 1.25;
    color: #667477;
}

/* kompaktnije A4 strane */
.invoice-page-sheet .preview-buyer-section { padding-top:12px !important; padding-bottom:14px !important; }
.invoice-page-sheet .continuation-header { margin-bottom:12px !important; padding-bottom:8px !important; }
.invoice-page-sheet .preview-total-section { margin-top:16px !important; }
.invoice-page-sheet .preview-total-bottom { margin-top:12px !important; padding-top:10px !important; }

/* ===== Zavrsni blok ponude: iznos gore, napomena ispod, potpis pri dnu ===== */
.invoice-page-sheet.invoice-page-last {
    padding-bottom: 42mm !important;
}

.invoice-page-sheet .preview-final-layout {
    position: static !important;
    display: block !important;
    width: 100% !important;
    margin-top: 14px !important;
}

.invoice-page-sheet .preview-final-layout .preview-total-bottom {
    width: 100% !important;
    margin: 0 !important;
    padding-top: 10px !important;
    border-top: 1.5px solid #162527 !important;
}

.invoice-page-sheet .offer-note-under-total {
    width: 100% !important;
    max-width: none !important;
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px solid #dfe5e3;
    text-align: left !important;
}

.invoice-page-sheet .offer-note-under-total .preview-offer-note-block {
    margin: 0 !important;
    max-width: none !important;
}

.invoice-page-sheet.invoice-page-last .preview-signature-right {
    position: absolute !important;
    right: 17mm !important;
    bottom: 17mm !important;
    width: 52mm !important;
    margin: 0 !important;
    text-align: center !important;
}

.invoice-page-sheet.invoice-page-last .signature-space {
    height: 8mm !important;
}

.invoice-page-sheet.invoice-page-last .document-valid-without-signature {
    position: absolute !important;
    left: 17mm !important;
    right: 17mm !important;
    bottom: 17mm !important;
    width: auto !important;
    margin: 0 !important;
    text-align: center !important;
}

/* ===== 2026-10-01 korekcija: napomena LEVO, ukupan iznos DESNO ===== */
.invoice-page-sheet .preview-final-top-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) !important;
    align-items: start !important;
    gap: 24px !important;
    padding-top: 10px !important;
    border-top: 1.5px solid #162527 !important;
}
.invoice-page-sheet .preview-final-left {
    min-width: 0 !important;
    text-align: left !important;
}
.invoice-page-sheet .preview-final-layout .preview-final-top-row .preview-total-bottom {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
    justify-self: end !important;
}
.invoice-page-sheet .offer-note-under-total {
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
    text-align: left !important;
}

/* ===== 2026-10-01 balans A4 završnog dela ===== */
.invoice-page-sheet.invoice-page-last .preview-final-layout {
    margin-top: var(--final-gap, 14mm) !important;
}
.invoice-page-sheet .preview-final-top-row {
    gap: 12mm !important;
    padding-top: 4mm !important;
}
.invoice-page-sheet .preview-final-layout .preview-total-bottom {
    min-width: 72mm !important;
}
.invoice-page-sheet .preview-grand-total {
    margin-top: 2.2mm !important;
    padding-top: 1.8mm !important;
    border-top: 1px solid #dfe5e3 !important;
}
.invoice-page-sheet .preview-header {
    margin-bottom: 5mm !important;
}
.invoice-page-sheet .preview-buyer-section {
    margin-bottom: 4mm !important;
}
.invoice-page-sheet .preview-items-section {
    margin-top: 2mm !important;
}


/* ===== FINAL POLISH 2026-10-01: čitljivija ponuda ===== */
.invoice-page-sheet[class*="offer-template-"] .preview-offer-note-block,
.invoice-page-sheet[class*="offer-template-"] .preview-total-row,
.invoice-page-sheet[class*="offer-template-"] .preview-total-bottom,
.invoice-page-sheet[class*="offer-template-"] .preview-grand-total { font-size: calc(1em + 1px); }
.invoice-page-sheet.invoice-page-last .preview-signature-right { z-index:20 !important; background:#fff !important; }

/* Measured pagination uses the full printable area. */
.invoice-page-sheet, .spec-page-sheet { padding-bottom: 15mm !important; }
.invoice-page-sheet.invoice-page-last, .spec-page-sheet.spec-page-last { padding-bottom: 38mm !important; }
.spec-page-sheet .spec-bottom { max-height: none !important; }
.spec-page-sheet.spec-page-last .spec-signature { left:50% !important; right:auto !important; transform:translateX(-50%); }
