﻿/* =========================================================
   KALKULATOR PDV-a — CSS
   ========================================================= */

/* =========================================================
   GRID + SUMMARY — jedan pored drugog (desktop)
   ========================================================= */
.div_kalk_rezultat {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 24px;
    width: 100%;
}

.div_grid_wrap {
    flex: 0 1 auto;
    max-width: calc(100% - 330px);
    min-width: 0;
}

.card-summary {
    width: 320px;
    flex-shrink: 0;
}

:root {
    --navy-800: #ffffff;
    --navy-900: #16264d;
    --blue-600: #2451a3;
    --blue-500: #3062bd;
    --blue-50: #eaf1fc;
    --bg: #f2f4f8;
    --paper: #ffffff;
    --ink: #1b2436;
    --ink-soft: #5b6478;
    --line: #e1e5ee;
}

.card {
    width: 350px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: #183b73;
    border-bottom: 1px solid var(--line);
}

    .card-head svg {
        color: #FFF;
    }

    .card-head h2 {
        font-size: 12.5px;
        font-weight: 700;
        letter-spacing: .02em;
        margin: 0;
        color: #FFF;
        text-transform: uppercase;
    }

.card-body {
    padding: 8px 20px 6px;
}

.s-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

    .s-row .k {
        font-size: 12.5px;
        color: var(--ink-soft);
    }

    .s-row .v {
        font-size: 13.5px;
        font-weight: 600;
        color: var(--ink);
    }

.s-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 8px;
    margin-top: 2px;
}

    .s-total .k {
        font-size: 12px;
        font-weight: 700;
        color: var(--navy-800);
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .s-total .v {
        font-size: 15.5px;
        font-weight: 700;
        color: var(--blue-600);
        background: var(--blue-50);
        padding: 6px 14px;
        border-radius: 20px;
    }

.card-actions {
    display: flex;
    gap: 8px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
}

.s-row .v .sub {
    font-size: 11.5px;
    font-weight: 500;
    color: #8b95a8;
    margin-left: 4px;
}

.grid-section-title2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gst-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gst-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'IBM Plex Sans', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    transition: all .2s ease;
}

    .btn-export:hover {
        background: #f7f8fb;
        border-color: #c8cede;
        color: var(--blue-600);
    }

.btn-excel:hover {
    color: #217346;
    border-color: #217346;
}

/* ---------- OSNOVA GRIDA (desktop) ---------- */
.grid-kamata4 {
    border-collapse: separate;
    border-spacing: 0;
    font-family: "Segoe UI", sans-serif;
    font-size: 13.5px;
    background: #ffffff;
    border: none;
    border-radius: 0;
}

    .grid-kamata4 td {
        padding: 11px 16px;
        color: #1e2a3a;
        border-top: 1px solid #eef1f6;
    }

/* =========================================================
   HEADER - STICKY (desktop)
   ========================================================= */
.grid-sve4 th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #183b73;
    color: #ffffff;
    text-align: left;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #183b73;
}

/* =========================================================
   REDOVI (desktop)
   ========================================================= */
.grid-sve4 tr:nth-child(even) td {
    background: #f7f9fc;
}

.grid-sve4 tr:nth-child(even):hover td {
    background: #eef3fa;
}

.grid-sve4 tr:hover td {
    background: #f3f6fb;
}


/* =========================================================
   MOBILNI PRIKAZ — PDV
   ========================================================= */
@media (max-width: 900px) {

    /* ---------- FORMA ---------- */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .form-group,
    .form-group2,
    .form-group3 {
        width: 100% !important;
        max-width: 100%;
    }

    .input-icon .form-control,
    .amount-input,
    .amount-field,
    .form-control {
        height: 44px;
        font-size: 16px !important;
    }

    .btn-dodaj,
    .btn-izracunaj,
    .btn-restart {
        width: 100% !important;
        min-height: 44px;
        font-size: 14px;
        justify-content: center;
    }

    /* ---------- REZULTAT vertikalno ---------- */
    .div_kalk_rezultat {
        flex-direction: column;
        gap: 14px;
    }

    .div_grid_wrap {
        max-width: 100% !important;
        width: 100%;
        flex: 1 1 auto;
    }

    .card-summary,
    .card.card-summary {
        width: 100% !important;
        max-width: 100%;
    }

    /* ---------- NASLOV + DUGMIĆI ZA IZVOZ ---------- */
    .grid-section-title2 {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 4px;
    }

    .gst-title {
        font-size: 13px;
    }

    .gst-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

        .gst-actions .btn-export {
            width: calc(50% - 4px) !important;
            flex: none !important;
            height: 44px !important;
            min-height: 44px !important;
            padding: 0 !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            box-sizing: border-box !important;
        }

    /* ---------- TABELA DODATE STAVKE ---------- */
    .grid-kamata5, .grid-sve5,
    .grid-kamata4, .grid-sve4 {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        background: #fff !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

        .grid-kamata5 th, .grid-kamata5 td,
        .grid-sve5 th, .grid-sve5 td,
        .grid-kamata4 th, .grid-kamata4 td,
        .grid-sve4 th, .grid-sve4 td {
            padding: 8px 4px !important;
            font-size: 11px !important;
            line-height: 1.25 !important;
            white-space: normal !important;
            word-wrap: break-word !important;
            overflow-wrap: anywhere !important;
            text-align: center !important;
            vertical-align: middle !important;
            border-bottom: 1px solid #eef1f6 !important;
        }

        .grid-kamata5 th, .grid-sve5 th,
        .grid-kamata4 th, .grid-sve4 th {
            background: #16265c !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-size: 10px !important;
            text-transform: uppercase !important;
            padding: 10px 4px !important;
            line-height: 1.2 !important;
            border-bottom: none !important;
            position: static !important;
        }

        .grid-kamata5 tr:nth-child(even) td,
        .grid-sve5 tr:nth-child(even) td,
        .grid-kamata4 tr:nth-child(even) td,
        .grid-sve4 tr:nth-child(even) td {
            background: #f9fafc !important;
        }

        /* Numeričke kolone — desno */
        .grid-kamata5 td.col-num, .grid-kamata5 td.col-ukupno,
        .grid-sve5 td.col-num, .grid-sve5 td.col-ukupno,
        .grid-kamata4 td.col-num, .grid-kamata4 td.col-ukupno,
        .grid-sve4 td.col-num, .grid-sve4 td.col-ukupno {
            text-align: right !important;
            padding-right: 5px !important;
            font-variant-numeric: tabular-nums !important;
            font-weight: 600 !important;
            color: #16265c !important;
        }

        .grid-kamata5 td.col-ukupno,
        .grid-sve5 td.col-ukupno,
        .grid-kamata4 td.col-ukupno,
        .grid-sve4 td.col-ukupno {
            font-weight: 700 !important;
        }

        /* Širine kolona */
        .grid-kamata5 th:nth-child(1), .grid-kamata5 td:nth-child(1),
        .grid-sve5 th:nth-child(1), .grid-sve5 td:nth-child(1),
        .grid-kamata4 th:nth-child(1), .grid-kamata4 td:nth-child(1),
        .grid-sve4 th:nth-child(1), .grid-sve4 td:nth-child(1) {
            width: 17% !important;
        }

        .grid-kamata5 th:nth-child(2), .grid-kamata5 td:nth-child(2),
        .grid-sve5 th:nth-child(2), .grid-sve5 td:nth-child(2),
        .grid-kamata4 th:nth-child(2), .grid-kamata4 td:nth-child(2),
        .grid-sve4 th:nth-child(2), .grid-sve4 td:nth-child(2) {
            width: 25% !important;
            text-align: left !important;
            padding-left: 5px !important;
        }

        .grid-kamata5 th:nth-child(3), .grid-kamata5 td:nth-child(3),
        .grid-sve5 th:nth-child(3), .grid-sve5 td:nth-child(3),
        .grid-kamata4 th:nth-child(3), .grid-kamata4 td:nth-child(3),
        .grid-sve4 th:nth-child(3), .grid-sve4 td:nth-child(3) {
            width: 10% !important;
        }

        .grid-kamata5 th:nth-child(4), .grid-kamata5 td:nth-child(4),
        .grid-sve5 th:nth-child(4), .grid-sve5 td:nth-child(4),
        .grid-kamata4 th:nth-child(4), .grid-kamata4 td:nth-child(4),
        .grid-sve4 th:nth-child(4), .grid-sve4 td:nth-child(4) {
            width: 16% !important;
        }

        .grid-kamata5 th:nth-child(5), .grid-kamata5 td:nth-child(5),
        .grid-sve5 th:nth-child(5), .grid-sve5 td:nth-child(5),
        .grid-kamata4 th:nth-child(5), .grid-kamata4 td:nth-child(5),
        .grid-sve4 th:nth-child(5), .grid-sve4 td:nth-child(5) {
            width: 17% !important;
        }

        .grid-kamata5 th:nth-child(6), .grid-kamata5 td:nth-child(6),
        .grid-sve5 th:nth-child(6), .grid-sve5 td:nth-child(6),
        .grid-kamata4 th:nth-child(6), .grid-kamata4 td:nth-child(6),
        .grid-sve4 th:nth-child(6), .grid-sve4 td:nth-child(6) {
            width: 15% !important;
            text-align: center !important;
        }

        /* Delete ikonica */
        .grid-kamata5 td a img, .grid-kamata5 td input[type="image"],
        .grid-sve5 td a img, .grid-sve5 td input[type="image"],
        .grid-kamata4 td a img, .grid-kamata4 td input[type="image"],
        .grid-sve4 td a img, .grid-sve4 td input[type="image"] {
            width: 20px !important;
            height: 20px !important;
            vertical-align: middle;
        }

        /* Rate pill */
        .grid-kamata5 .rate-pill, .grid-sve5 .rate-pill,
        .grid-kamata4 .rate-pill, .grid-sve4 .rate-pill {
            font-size: 10px !important;
            padding: 3px 6px !important;
        }

    /* ---------- SUMMARY CARD ---------- */
    .card-summary .card-head {
        padding: 12px 14px;
    }

        .card-summary .card-head h2 {
            font-size: 12px;
        }

    .card-summary .card-body {
        padding: 6px 14px 4px;
    }

    .s-row {
        padding: 11px 0;
        gap: 10px;
    }

        .s-row .k {
            font-size: 12.5px;
            flex: 1 1 auto;
            min-width: 0;
        }

        .s-row .v {
            font-size: 13px;
            flex: 0 0 auto;
            text-align: right;
            white-space: nowrap;
        }

            .s-row .v .sub {
                font-size: 11px;
                display: block;
                margin-left: 0;
                margin-top: 2px;
            }

    .s-total {
        padding: 14px 0 8px;
        flex-wrap: wrap;
        gap: 8px;
    }

        .s-total .k {
            font-size: 11.5px;
        }

        .s-total .v {
            font-size: 14.5px;
            padding: 5px 12px;
        }
}


/* =========================================================
   MALI TELEFONI (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {

    .grid-kamata5 th, .grid-kamata5 td,
    .grid-sve5 th, .grid-sve5 td,
    .grid-kamata4 th, .grid-kamata4 td,
    .grid-sve4 th, .grid-sve4 td {
        font-size: 10.5px !important;
        padding: 7px 3px !important;
    }

    .grid-kamata5 th, .grid-sve5 th,
    .grid-kamata4 th, .grid-sve4 th {
        font-size: 9.5px !important;
        padding: 8px 3px !important;
    }

        .grid-kamata5 th:nth-child(2), .grid-kamata5 td:nth-child(2),
        .grid-sve5 th:nth-child(2), .grid-sve5 td:nth-child(2),
        .grid-kamata4 th:nth-child(2), .grid-kamata4 td:nth-child(2),
        .grid-sve4 th:nth-child(2), .grid-sve4 td:nth-child(2) {
            width: 27% !important;
        }

    .s-row .v {
        font-size: 12.5px;
    }

    .s-total .v {
        font-size: 14px;
    }

    .btn-export {
        font-size: 11.5px !important;
        padding: 0 8px !important;
        height: 44px !important;
    }
}
