html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #0a7c5f;
}

.btn-primary {
    color: #fff;
    background-color: #0f8a68;
    border-color: #0c7256;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #25c3a0;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

code {
    overflow-wrap: anywhere;
}

/* ===== Dijalozi bez JS-a ============================================================ */
.fr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.fr-dijalog {
    background: white;
    border-radius: 0.5rem;
    padding: 1.25rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
}

.fr-dijalog-siroki {
    max-width: 44rem;
}

/* ===== Ekran kase (touch) ============================================================ */
.kasa-ekran {
    display: grid;
    grid-template-columns: 9rem 1fr 24rem;
    grid-template-rows: auto 1fr;
    gap: 0.5rem;
    height: calc(100vh - 5.5rem);
    min-height: 30rem;
}

.kasa-traka {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.kasa-grupe {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

    .kasa-grupe .btn {
        min-height: 3.2rem;
        white-space: normal;
        font-size: 0.9rem;
    }

.kasa-artikli {
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    grid-auto-rows: 5.2rem;
    gap: 0.4rem;
    align-content: start;
}

.kasa-plocica {
    border: 1px solid #cfd8d3;
    border-radius: 0.5rem;
    background: #f4faf7;
    padding: 0.35rem 0.45rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

    .kasa-plocica:active {
        background: #cdeee1;
    }

    .kasa-plocica .naziv {
        font-size: 0.85rem;
        line-height: 1.1;
        max-height: 3.3rem;
        overflow: hidden;
    }

    .kasa-plocica .cijena {
        font-weight: 600;
        text-align: right;
    }

.kasa-racun {
    display: flex;
    flex-direction: column;
    border: 1px solid #cfd8d3;
    border-radius: 0.5rem;
    background: white;
    min-height: 0;
}

.kasa-stavke {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.kasa-stavka {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem;
    border-bottom: 1px solid #eee;
    padding: 0.3rem 0;
}

    .kasa-stavka .naziv {
        font-weight: 500;
    }

    .kasa-stavka .kontrole {
        display: flex;
        gap: 0.25rem;
        align-items: center;
    }

    .kasa-stavka.odabrana {
        background: #eef8f4;
    }

.kasa-podnozje {
    border-top: 2px solid #0f8a68;
    padding: 0.5rem;
}

.kasa-ukupno {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: right;
}

.kasa-tipke {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

    .kasa-tipke .btn {
        min-height: 3.2rem;
        font-size: 1.05rem;
    }

.kasa-sredstva {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.5rem;
}

    .kasa-sredstva .btn {
        min-height: 4rem;
        font-size: 1.1rem;
    }

@media (max-width: 991.98px) {
    .kasa-ekran {
        grid-template-columns: 7rem 1fr;
        grid-template-rows: auto 1fr 40vh;
        height: auto;
    }

    .kasa-racun {
        grid-column: 1 / -1;
    }
}

/* ===== Ispis računa ================================================================== */
.ispis-stranica {
    padding: 0.5rem;
}

.racun-tekst {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.25;
    white-space: pre;
    margin: 0;
}

.racun-80 {
    width: 72mm;
}

.racun-58 {
    width: 48mm;
}

.racun-qr {
    margin: 4mm 0;
}

@media print {
    .ispis-stranica {
        padding: 0;
    }

    .bez-ispisa {
        display: none !important;
    }

    @page {
        margin: 3mm;
    }
}

/* ===== Mobitel (do 767px) ============================================================ */
@media (max-width: 767.98px) {
    .content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        overflow-x: hidden;
    }

    h1 {
        font-size: 1.5rem;
    }

    .content table:not(.tablica-kartice) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Poruka o ishodu radnje, pričvršćena na dno ekrana (Dijelovi/Poruka.razor) ===== */
.poruka-dno {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(40rem, calc(100% - 2rem));
    max-height: 40vh;
    overflow-y: auto;
    z-index: 1100;
}

.poruka-dno .alert {
    margin-bottom: 0.5rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.2);
}

/* Uz bočni izbornik (250px, MainLayout.razor.css) poruka se centrira na sadržaj, ne preko izbornika. */
@media (min-width: 641px) {
    .poruka-dno {
        left: calc(50% + 125px);
        width: min(40rem, calc(100% - 250px - 2rem));
    }
}
