﻿body {
}

.mini-toggle-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    white-space: nowrap;
}
/* Ovaj blok ima svoju širinu, ne nasleđuje 150px od form-group3 */
.form-group-kvadrat2 {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 7px;
    width: 240px; /* dovoljno za dva mala polja u redu */
}

/* Red sa dva mala polja */
.kvadrat-fields {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Manja amount-input polja */
.amount-input.small {
    height: 40px;
    flex: 1 1 0;
    min-width: 0;
}

    .amount-input.small .currency {
        min-width: 36px; /* bilo 50px → uže */
        padding: 0 6px;
        font-size: 14px;
    }

    .amount-input.small .amount-field {
        padding: 0 8px;
        font-size: 14px;
    }

/* Toggle i kvadratFields u istom redu */
/* Red: label + toggle */
.label-with-toggle2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

    .label-with-toggle2 > label:first-child {
        margin-bottom: 0;
        font-size: 13px;
        font-weight: 600;
        color: #29476b;
    }

/* Manji toggle */
.mini-toggle-wrap2 {
    position: relative;
    display: inline-block;
    width: 30px; /* bilo 40px → sad 30px */
    height: 16px; /* bilo 22px → sad 16px */
    cursor: pointer;
    flex-shrink: 0;
}

    .mini-toggle-wrap2 input[type="checkbox"] {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

.mini-slider2 {
    position: absolute;
    inset: 0;
    background: #cfd6e0;
    border-radius: 16px;
    transition: background .2s;
}

    .mini-slider2::before {
        content: "";
        position: absolute;
        width: 12px; /* bilo 16px → sad 12px */
        height: 12px;
        left: 2px;
        top: 2px;
        background: #fff;
        border-radius: 50%;
        transition: transform .2s;
    }

.mini-toggle-wrap2 input[type="checkbox"]:checked + .mini-slider2 {
    background: #183b73;
}

    .mini-toggle-wrap2 input[type="checkbox"]:checked + .mini-slider2::before {
        transform: translateX(14px); /* 30 - 12 - 4 = 14 */
    }

.split-bar2 {
    display: flex;
    height: 8px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

    .split-bar2 > div {
        height: 100%;
    }

.split-bar-wrap2 {
    background: #fff;
    border: 1px solid #e4e9f1;
    border-radius: 10px;
    padding: 14px 16px;
}

.split-bar-title2 {
    font-size: 10.5px;
    font-weight: 700;
    color: #7c8aa3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 10px;
}

.split-bar2 {
    display: flex;
    height: 8px;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.split-legend2 {
    display: flex;   
    gap: 7px;
}

.split-legend-item2 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #445068;
}

    .split-legend-item2 .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        flex-shrink: 0;
    }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 80, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 440px;
    max-width: 92vw;
    box-shadow: 0 12px 40px rgba(15,35,80,0.25);
    overflow: hidden;
}

.modal-header {
    background: #183b73;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .modal-header .title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 14px;
        font-weight: 700;
    }

    .modal-header .close-btn {
        background: none;
        border: none;
        color: #cdd8ee;
        cursor: pointer;
        font-size: 18px;
        width: 26px;
        height: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 5px;
    }

        .modal-header .close-btn:hover {
            background: rgba(255,255,255,0.12);
            color: #fff;
        }

.modal-body {
    padding: 20px;
}

.modal-hint {
    font-size: 11.5px;
    color: #9aa5ba;
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

    .modal-form-group label {
        font-size: 12px;
        font-weight: 600;
        color: #445068;
    }

.modal-unit-input {
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid #cdd6e4;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

    .modal-unit-input input {
        border: none;
        padding: 0 12px;
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

        .modal-unit-input input:disabled {
            background: #f5f8fc;
            color: #7c8aa3;
        }

    .modal-unit-input .unit {
        background: #f5f8fc;
        color: #445068;
        font-size: 11.5px;
        font-weight: 600;
        padding: 0 12px;
        height: 100%;
        display: flex;
        align-items: center;
        border-left: 1px solid #cdd6e4;
    }

.modal-stepper {
    display: flex;
    align-items: center;
    height: 40px;
    border: 1px solid #cdd6e4;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

    .modal-stepper button {
        border: none;
        background: #f5f8fc;
        width: 36px;
        height: 100%;
        font-size: 16px;
        color: #445068;
        cursor: pointer;
    }

    .modal-stepper input {
        border: none;
        border-left: 1px solid #cdd6e4;
        border-right: 1px solid #cdd6e4;
        text-align: center;
        width: 100%;
        font-size: 14px;
    }

.modal-result {
    margin-top: 18px;
    background: #eef3fa;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .modal-result .icon {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: #183b73;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        flex-shrink: 0;
    }

    .modal-result .label {
        font-size: 10.5px;
        font-weight: 700;
        color: #7c8aa3;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .modal-result .value {
        font-size: 20px;
        font-weight: 700;
        color: #183b73;
    }

        .modal-result .value .unit {
            font-size: 12px;
            font-weight: 600;
            color: #6b84ab;
            margin-left: 3px;
        }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eef1f6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ================================================
   MOBILNI PRIKAZ — STAMBENI KREDIT
   ================================================ */
@media (max-width: 900px) {

    /* ================================================
       1. FORMA — sve u kolonu
       ================================================ */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .form-group,
    .form-group2,
    .form-group3,
    .form-group-kvadrat2 {
        width: 100% !important;
        max-width: 100%;
    }

    /* Kvadrat polja (dva inputa jedan pored drugog) — ostaju u redu */
    .kvadrat-fields {
        width: 100%;
    }

    /* Stepper i segmented kontrole — full width */
    .stepper-input,
    .segmented {
        width: 100% !important;
    }

        .segmented button {
            flex: 1;
        }

    /* Inputi — veći za prst, spreči iOS zoom */
    .input-icon .form-control,
    .amount-input,
    .stepper-input,
    .stepper-field,
    .amount-field {
        height: 44px;
        font-size: 16px !important;
    }

    /* Dugmići — full width */
    .btn-dodaj,
    .btn-izracunaj,
    .btn-restart {
        width: 100% !important;
        min-height: 44px;
        font-size: 14px;
        justify-content: center;
    }

    /* Label sa toggle (cena po m²) */
    .label-with-toggle2 {
        width: 100%;
    }


    /* ================================================
       2. REZULTATI — summary kartice u kolonu
       ================================================ */
    #div_res_kred,
    .div_res_kred {
        width: 100%;
    }

        #div_res_kred .summary-row,
        .summary-row {
            flex-direction: column;
            gap: 10px;
        }

        #div_res_kred .summary-card,
        .summary-card {
            width: 100%;
            min-width: 0 !important;
            padding: 12px 14px;
        }

            .summary-card .value {
                font-size: 16px;
            }


    /* ================================================
       3. SPLIT BAR — full width
       ================================================ */
    .split-bar-wrap2 {
        width: 100%;
        padding: 12px 14px;
    }

    .split-legend2 {
        flex-direction: column;
        gap: 8px;
    }


    /* ================================================
       4. GRIDVIEW — 6 kolona, fit u ekran
       ================================================ */
    .plan-otplate-wrapper2 {
        width: 100%;
        overflow-x: hidden;
    }

    .grid-kamata2 {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: 9.5px !important;
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
    }

        .grid-kamata2 th,
        .grid-kamata2 td {
            padding: 5px 2px !important;
            font-size: 9.5px !important;
            line-height: 1.2 !important;
            white-space: normal !important;
            word-wrap: break-word !important;
            overflow-wrap: anywhere !important;
            text-align: center !important;
            vertical-align: middle;
            border-bottom: 1px solid #eef1f6 !important;
        }

        /* Header — tamno plav */
        .grid-kamata2 th,
        .grid-kamata2 thead th {
            background: #16265c !important;
            color: #fff !important;
            font-weight: 700 !important;
            font-size: 8.5px !important;
            text-transform: uppercase;
            letter-spacing: 0;
            padding: 6px 2px !important;
            line-height: 1.15 !important;
            border-bottom: none !important;
        }

        /* Zebra redovi */
        .grid-kamata2 tr:nth-child(even) td {
            background: #f9fafc;
        }

        /* Numeričke kolone — desno poravnate */
        .grid-kamata2 td.col-iznos,
        .grid-kamata2 td.col-muted,
        .grid-kamata2 td[style*="text-align:Right"],
        .grid-kamata2 td[style*="text-align:right"],
        .grid-kamata2 td[align="right"] {
            text-align: right !important;
            padding-right: 4px !important;
            font-variant-numeric: tabular-nums;
        }

        .grid-kamata2 td.col-iznos {
            font-weight: 700;
            color: #063b82;
        }

        .grid-kamata2 td.col-muted {
            color: #445068;
        }

        /* Prva kolona (Rata br.) — centar, uska */
        .grid-kamata2 th:first-child,
        .grid-kamata2 td:first-child {
            width: 10%;
            text-align: center !important;
        }

        /* Druga kolona (Datum) — malo šira */
        .grid-kamata2 th:nth-child(2),
        .grid-kamata2 td:nth-child(2) {
            width: 20%;
            text-align: center !important;
            padding: 5px 1px !important;
        }

        /* Ostale numeričke kolone — ravnomerno */
        .grid-kamata2 th:nth-child(3),
        .grid-kamata2 th:nth-child(4),
        .grid-kamata2 th:nth-child(5),
        .grid-kamata2 th:nth-child(6),
        .grid-kamata2 td:nth-child(3),
        .grid-kamata2 td:nth-child(4),
        .grid-kamata2 td:nth-child(5),
        .grid-kamata2 td:nth-child(6) {
            width: 17.5%;
        }

        /* Footer red (ukupno) */
        .grid-kamata2 tfoot td,
        .grid-kamata2 tr.footer td {
            background: #f4f6fb !important;
            font-weight: 700 !important;
            color: #16265c !important;
            border-top: 2px solid #16265c !important;
            font-size: 10px !important;
        }


    /* ================================================
       5. MODAL — fit u ekran
       ================================================ */
    .modal-box {
        width: 94vw !important;
        max-width: 94vw !important;
        border-radius: 10px;
    }

    .modal-header {
        padding: 12px 14px;
    }

        .modal-header .title {
            font-size: 13px;
            gap: 8px;
        }

    .modal-body {
        padding: 14px;
    }

    .modal-form-group {
        margin-bottom: 12px;
    }

        .modal-form-group label {
            font-size: 12px;
        }

    .modal-unit-input,
    .modal-stepper {
        height: 44px;
    }

        .modal-unit-input input,
        .modal-stepper input {
            font-size: 16px;
        }

    .modal-result {
        padding: 12px 14px;
        gap: 10px;
    }

        .modal-result .value {
            font-size: 18px;
        }

    .modal-footer {
        padding: 12px 14px;
    }

        .modal-footer .btn {
            width: 100%;
            min-height: 44px;
        }

    .stepper-input2 {
        width: 100%;
        display: flex;
    }

        .stepper-input2 input,
        .stepper-field2 {
            height: 44px;
            font-size: 16px;
        }
}

/* ================================================
   MALI TELEFONI (≤ 480px) — još sitniji grid
   ================================================ */
@media (max-width: 480px) {

    .grid-kamata2 {
        font-size: 9px !important;
    }

        .grid-kamata2 th,
        .grid-kamata2 td {
            font-size: 9px !important;
            padding: 4px 2px !important;
        }

        .grid-kamata2 th,
        .grid-kamata2 thead th {
            font-size: 8px !important;
            padding: 5px 2px !important;
        }

        .grid-kamata2 tfoot td {
            font-size: 9.5px !important;
        }

    .modal-box {
        width: 96vw !important;
        max-width: 96vw !important;
    }
}
