﻿:root {
    --navy: #16265c;
    --navy-dark: #0d2247;
    --navy-light: #1a3a6e;
    --blue-light: #0d2247;
    --gold: #c9a14a;
    --gold-light: #e8d4a8;
    --bg: #f4f6fb;
    --border: #e3e7f0;
    --text: #1e2536;
    --text-muted: #6b7280;
    --green: #1e8e5a;
    --green-bg: #eaf7f0;
    --red: #c0392b;
    --red-bg: #fdecea;
}

.div_interest {
    background: #fff;
    padding: 10px 20px;
}

.div_interest_input {
    margin-top: 5px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 22px 24px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 18px;
}

    .card-title svg {
        width: 17px;
        height: 17px;
        stroke: var(--blue-light);
        stroke-width: 2;
        fill: none;
    }



.form-row {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 210px;
    flex-shrink: 0;
    gap: 7px;
}
.form-group2,
.form-group3 {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 7px;
}

.form-group2 {
    width: 165px;
}

.form-group3 {
    width: 260px;
}

    .form-group label,
    .form-group2 label,
    .form-group3 label {
        margin-bottom: 2px;
        font-size: 13px;
        font-weight: 600;
        color: #29476b;
    }
/* DATUM */
.input-icon {
    position: relative;
    width: 100%;
}
    .input-icon i {
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 16px;
        color: #174a7e;
        z-index: 2;
        pointer-events: none;
    }
    .input-icon .form-control {
        width: 100%;
        height: 40px;
        box-sizing: border-box;
        border: 1px solid #d8e0e9;
        border-radius: 8px;
        background: #fff;
        padding: 0 12px 0 40px;
        font-family: "Segoe UI", sans-serif;
        font-size: 14px;
        color: #30445c;
        outline: none;
        transition: border-color .2s, box-shadow .2s;
    }
        .input-icon .form-control:focus {
            border-color: #3d79b5;
            box-shadow: 0 0 0 3px rgba(61, 121, 181, 0.10);
        }
/* GLAVNICA */
.amount-input {
    display: flex;
    width: 100%;
    height: 40px;
    border: 1px solid #d8e0e9;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

    .amount-input:focus-within {
        border-color: #3d79b5;
        box-shadow: 0 0 0 3px rgba(61, 121, 181, 0.10);
    }

.currency {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0 10px;
    background: #f6f8fa;
    border-right: 1px solid #d8e0e9;
    color: #536579;
    font-size: 13px;
    font-weight: 600;
}

.amount-field {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    padding: 0 12px;
    font-family: "Segoe UI", sans-serif;
    font-size: 14px;
    color: #30445c;
}

    .amount-field::placeholder {
        color: #9aa7b5;
    }

.summary-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.summary-card {
    flex: 1;
    min-width: 230px;
    background: #fff;
    border: 1px solid #e4e9f1;
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .summary-card .icon {
        width: 34px;
        height: 34px;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
    }

        .summary-card .icon svg {
            width: 17px;
            height: 17px;
        }

    .summary-card.muted .icon {
        background: #eef1f6;
        color: #5a6b8c;
    }

    .summary-card .label {
        font-size: 10.5px;
        font-weight: 700;
        color: #7c8aa3;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        margin-bottom: 2px;
    }

    .summary-card .value {
        font-size: 17px;
        font-weight: 700;
        color: #1e2a3a;
    }

        .summary-card .value .unit {
            font-size: 11px;
            font-weight: 600;
            color: #9aa5ba;
            margin-left: 3px;
        }

    .summary-card.primary {
        background: #183b73;
        border-color: #183b73;
    }

        .summary-card.primary .icon {
            background: rgba(255,255,255,0.12);
            color: #fff;
        }

        .summary-card.primary .label {
            color: #a9bde0;
        }

        .summary-card.primary .value {
            color: #fff;
        }

            .summary-card.primary .value .unit {
                color: #a9bde0;
            }
.div_res {
    display:flex;
    margin-top:5px;
}
.summary-res {
    font-size:22px;
    font-weight:600;
    color:black;
}
.pdf_xlsx {
    margin-top:23px;    
}

/* ================================================
   MOBILNI PRIKAZ — ZATEZNA KAMATA
   ================================================ */
@media (max-width: 900px) {

    /* --- Osnovno --- */
    .div_interest {
        padding: 10px 12px;
    }

    .div_interest_input {
        margin-top: 8px;
    }

    .card-title {
        font-size: 12.5px;
        gap: 6px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

        .card-title svg {
            width: 15px;
            height: 15px;
            flex-shrink: 0;
        }

    /* --- Forma u kolonu --- */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .form-group,
    .form-group2,
    .form-group3 {
        width: 100% !important;
        max-width: 100%;
    }

    /* --- Inputi --- */
    .input-icon .form-control,
    .amount-input {
        height: 44px;
    }

    .input-icon .form-control,
    .amount-field {
        font-size: 16px;
    }

    /* --- Dugmići --- */
    .btn-dodaj,
    .btn-izracunaj,
    .btn-restart {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
        justify-content: center;
    }

    /* --- Summary kartice u kolonu --- */
    .div_res {
        flex-direction: column;
        gap: 10px;
    }

    .summary-row {
        flex-direction: column;
        gap: 8px;
    }

    .summary-card {
        min-width: 0 !important;
        width: 100%;
        padding: 12px 14px;
    }

        .summary-card .value {
            font-size: 16px;
        }

    .pdf_xlsx {
        margin-top: 0;
        width: 100%;
    }

    .btn-export {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        font-size: 14px;
    }

    /* ================================================
       GRIDVIEW — STANE U EKRAN (bez skrola, wrap + sitan font)
       ================================================ */

    .grid-section-title {
        font-size: 13px;
        padding: 8px 4px 6px;
    }

    /* 1. Tabela — fiksni layout, sve kolone jednake širine */
    .grid-kamata {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed; /* sve kolone jednake širine */
        border-collapse: collapse;
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        font-size: 10px;
        margin-bottom: 12px;
    }

        /* 2. Ćelije — wrap, sitan font, mali padding */
        .grid-kamata th,
        .grid-kamata td {
            padding: 5px 3px !important;
            font-size: 10px !important;
            line-height: 1.25 !important;
            white-space: normal !important; /* dozvoli prelamanje */
            word-wrap: break-word !important;
            overflow-wrap: anywhere !important;
            text-align: center !important;
            vertical-align: middle;
            border-bottom: 1px solid #eef1f6 !important;
            font-weight: 500;
        }

        /* 3. Header — tamno plava, sitnija slova */
        .grid-kamata th,
        .grid-kamata .grid-head th,
        .grid-kamata tr.grid-head th {
            background: #16265c !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-size: 9px !important;
            text-transform: uppercase;
            letter-spacing: 0;
            padding: 6px 3px !important;
            line-height: 1.15 !important;
            border-bottom: none !important;
        }

        /* 4. Zebra redovi za čitljivost */
        .grid-kamata tr:nth-child(even) td {
            background: #f9fafc;
        }

        /* 5. Numeričke kolone — desno poravnate, tabularni brojevi */
        .grid-kamata td.col-num,
        .grid-kamata td[style*="text-align:Right"],
        .grid-kamata td[style*="text-align:right"] {
            text-align: right !important;
            padding-right: 5px !important;
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            color: #16265c;
        }

        /* 6. Delete dugme — malo, centrirano */
        .grid-kamata td a img,
        .grid-kamata td input[type="image"] {
            width: 18px !important;
            height: 18px !important;
            vertical-align: middle;
        }

        /* 7. Footer red (ShowFooter=True) */
        .grid-kamata tfoot td,
        .grid-kamata tr.footer td {
            background: #f4f6fb !important;
            font-weight: 700 !important;
            color: #16265c !important;
            border-top: 2px solid #16265c !important;
        }

    /* --- Info sekcija (nastavak) --- */
    .card2, .info-card2 {
        padding: 14px !important;
    }

    .info-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .info-sub {
        font-size: 13.5px;
    }

    .info-section h3 {
        font-size: 14.5px;
    }

    .info-section p {
        font-size: 13.5px;
        line-height: 1.55;
    }

    .formula-box {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        padding: 12px 8px;
        font-size: 12px;
    }

    .two-col {
        flex-direction: column;
        gap: 10px;
    }

    .example-box {
        padding: 12px;
    }

    .ex-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        padding: 8px 0;
    }

        .ex-row .k {
            font-size: 12px;
        }

        .ex-row .v {
            font-size: 14px;
            font-weight: 700;
        }

    .disclaimer {
        font-size: 12px;
        line-height: 1.5;
    }

    body, html {
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
    }
}

/* ================================================
   MALI TELEFONI (≤ 480px) — još sitnije
   ================================================ */
@media (max-width: 480px) {
    .card-title {
        font-size: 11.5px;
    }

    .summary-card .value {
        font-size: 15px;
    }

    .info-title {
        font-size: 15px;
    }

    .formula-box .part {
        font-size: 11px;
        padding: 3px 6px;
    }

    .grid-kamata {
        font-size: 9px !important;
    }

        .grid-kamata th,
        .grid-kamata td {
            font-size: 9px !important;
            padding: 4px 2px !important;
            line-height: 1.2 !important;
        }

        .grid-kamata th,
        .grid-kamata .grid-head th {
            font-size: 8.5px !important;
            padding: 5px 2px !important;
        }
}
/* ================================================
   DINAMIČKI FONT PO TABELI (unutar mobilnog prikaza)
   ================================================ */
@media (max-width: 900px) {

    /* --- Grid 1: DODATE STAVKE (4 kolone) — može veći font --- */
    .grid-stavke {
        font-size: 12px !important;
    }

        .grid-stavke th,
        .grid-stavke td {
            font-size: 12px !important;
            padding: 9px 6px !important;
            line-height: 1.3 !important;
        }

        .grid-stavke th,
        .grid-stavke .grid-head th {
            font-size: 10.5px !important;
            padding: 8px 6px !important;
        }

        .grid-stavke td a img,
        .grid-stavke td input[type="image"] {
            width: 20px !important;
            height: 20px !important;
        }

    /* --- Grid 2: SVE STAVKE (7 kolona) — mora manji font --- */
    .grid-sve {
        font-size: 10px !important;
    }

        .grid-sve th,
        .grid-sve td {
            font-size: 10px !important;
            padding: 5px 3px !important;
            line-height: 1.25 !important;
        }

        .grid-sve th,
        .grid-sve .grid-head th {
            font-size: 9px !important;
            padding: 6px 3px !important;
        }
}

/* --- Još manji telefoni (≤ 480px) --- */
@media (max-width: 480px) {
    /* Grid 1: 4 kolone — i dalje može pristojan font */
    .grid-stavke th,
    .grid-stavke td {
        font-size: 11.5px !important;
        padding: 8px 5px !important;
    }

    .grid-stavke th,
    .grid-stavke .grid-head th {
        font-size: 10px !important;
    }

    /* Grid 2: 7 kolona — sitno */
    .grid-sve th,
    .grid-sve td {
        font-size: 9px !important;
        padding: 4px 2px !important;
    }

    .grid-sve th,
    .grid-sve .grid-head th {
        font-size: 8.5px !important;
    }
}