/* ===== RESET I OSNOVA ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8ecf1 100%);
    margin: 0;
    padding: 10px;
    min-height: 100vh;
}
body.login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0047AB 0%, #001f5b 100%);
}
.app-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 14px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 720px;
    width: 95%;
    box-sizing: border-box;
    text-align: center;
    margin: 20px auto;
}
h1 { font-size: 1.4em; margin-bottom: 15px; color: #1a1a2e; }
h2 { font-size: 1.1em; margin: 10px 0 15px; color: #2c3e50; }

/* ===== FORME I DUGMAD ===== */
select, button, input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
}
button {
    background-color: #0047AB;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,71,171,0.25);
}
button:hover {
    background-color: #003380;
    box-shadow: 0 4px 14px rgba(0,71,171,0.35);
    transform: translateY(-1px);
}
.zatvori-btn {
    background-color: #f0f0f0;
    color: #333;
    font-weight: 700;
    border: 1px solid #ccc;
    box-shadow: none;
}
.zatvori-btn:hover {
    background-color: #e0e0e0;
    transform: none;
    box-shadow: none;
}

/* ===== LAYOUT ELEMENTI ===== */
hr { border: none; border-top: 1px solid #eee; margin: 15px 0; }
.unos-red { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.unos-red label { text-align: left; flex: 1; margin-right: 10px; font-size: .9em; }
.unos-red select, .unos-red input { flex: 2; margin-bottom: 0; }
.hidden { display: none !important; }

/* ===== SPINNER I MODAL ===== */
.spinner-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255,255,255,.85); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.spinner {
    width: 50px; height: 50px; border-radius: 50%;
    border: 5px solid rgba(0,0,0,.1); border-top-color: #0047AB;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0) } 100% { transform: rotate(360deg) } }
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,.5); display: none;
    z-index: 10000; overflow: hidden;
    justify-content: center; align-items: center;
}
.modal-content {
    background-color: #fff; padding: 20px; border-radius: 10px;
    text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.2);
    width: 90%; max-width: 600px; border: 3px solid transparent;
    max-height: 85vh; overflow-y: auto;
}

/* ===== HELP DUGME ===== */
.help-button {
    position: fixed; bottom: 20px; right: 20px;
    width: 56px; height: 56px;
    background-color: #28a745; color: white;
    border-radius: 50%; display: flex;
    justify-content: center; align-items: center;
    font-size: 26px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer; z-index: 9000; border: 2px solid white;
    transition: transform 0.3s;
}
.help-button:hover { transform: scale(1.1); background-color: #218838; }
.help-section { text-align: left; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.help-section h3 { color: #0047AB; margin-top: 0; font-size: 1.1em; display: flex; align-items: center; gap: 8px; }
.help-section p { font-size: 0.9em; color: #555; line-height: 1.4; margin: 5px 0; }

/* ===== BOJE ZA GRID ===== */
.boja-go { background-color: #fff2cc !important; }
.boja-bo { background-color: #f4cccc !important; }
.boja-po { background-color: #d0d0d0 !important; }
.boja-dp { background-color: #b8c9f5 !important; }
.boja-sp { background-color: #e6d9f1 !important; }
.vikend { background-color: #f0f0f0; }
.vikend .select-wrapper { background-color: #f0f0f0; }
.vikend .unos-select { font-weight: bold; }

/* ===== KOMENTAR INDIKATOR ===== */
.komentar-indikator {
    display: block; width: 16px; height: 12px;
    margin: 2px auto 4px auto; cursor: pointer;
    position: relative; background-color: #e0e0e0;
    border-radius: 3px; transition: background-color 0.2s ease-in-out;
}
.komentar-indikator::after {
    content: ''; position: absolute; width: 0; height: 0;
    bottom: -4px; left: 50%; transform: translateX(-50%);
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid #e0e0e0; transition: border-top-color 0.2s ease-in-out;
}
.komentar-indikator.aktivan { background-color: #007bff; }
.komentar-indikator.aktivan::after { border-top-color: #007bff; }
.komentar-indikator:hover { background-color: #b0b0b0; }
.komentar-indikator:hover::after { border-top-color: #b0b0b0; }
.komentar-indikator.aktivan:hover { background-color: #0056b3; }
.komentar-indikator.aktivan:hover::after { border-top-color: #0056b3; }

/* ===== GRID TABELA ===== */
.grid-tabela { border-collapse: collapse; table-layout: fixed; }
.grid-tabela th, .grid-tabela td {
    border: 1px solid #a0a0a0; padding: 0;
    text-align: center; vertical-align: middle; height: 30px; width: 40px;
}
.grid-tabela thead th { background-color: #f5f5f5; font-weight: bold; padding: 8px 4px; }
.grid-tabela th:first-child {
    position: sticky; left: 0; z-index: 2;
    background-color: #eeeeee; width: 160px;
}
.grid-tabela td:first-child {
    background-color: #ffffff; text-align: left; font-weight: bold;
    position: sticky; left: 0; z-index: 1; padding: 4px 8px;
    font-size: 0.75em; white-space: nowrap; width: 160px;
}
.select-wrapper { position: relative; width: 100%; height: 100%; }
.select-wrapper::after {
    content: ''; position: absolute; top: 50%; right: 5px;
    transform: translateY(-50%); width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 4px solid #888; pointer-events: none;
}
.unos-select {
    width: 100%; height: 100%; border: none; font-size: 0.75em;
    text-align: center; background-color: transparent;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding: 0 15px 0 4px; cursor: pointer;
}

/* ===== HEADER BAR ===== */
#appHeader {
    background: linear-gradient(90deg, #0047AB, #003380);
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    margin: 0 auto 12px auto;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0,71,171,0.3);
    max-width: 720px;
    width: 95%;
    box-sizing: border-box;
}
#appHeader .header-title {
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#appHeader .header-user {
    font-size: 0.82em;
    opacity: 0.92;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ===== PERIOD SELEKTOR ===== */
#period-selektor {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    background: #f8f9fc;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #eaecf0;
}
#period-selektor select {
    margin-bottom: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.9em;
    background: white;
    font-weight: 600;
    color: #333;
}
#period-selektor select:first-child { flex: 2; }
#period-selektor select:last-child { flex: 1; }

/* ===== GLAVNI MENI ===== */
#glavniMeni {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 4px 0;
}
#glavniMeni a:nth-last-child(2):nth-child(3n+1) {
    grid-column: 1;
}
.meni-footer {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 66.5%;
    margin: 0 auto;
}
.menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #2c3e50;
    font-size: 0.82em;
    font-weight: 600;
    padding: 16px 8px;
    border-radius: 12px;
    transition: all 0.22s ease;
    background-color: #f8f9fc;
    min-height: 105px;
    cursor: pointer;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    text-align: center;
}
.menu-link:hover {
    background-color: #fff;
    color: #0047AB;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,71,171,0.13);
    border-color: #c5d5f5;
}
.menu-link:hover .icon-circle {
    transform: scale(1.1) rotate(8deg);
    background-color: #003380;
}
.menu-link .icon-circle {
    background-color: #0047AB;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 9px;
    font-size: 26px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,71,171,0.22);
}
.menu-link.odjava {
    background-color: #fff5f5;
    border-color: #fde0e0;
}
.menu-link.odjava:hover {
    color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 8px 20px rgba(220,53,69,0.12);
}
.menu-link.odjava .icon-circle {
    background-color: #dc3545;
    box-shadow: 0 4px 10px rgba(220,53,69,0.25);
}
.menu-link.odjava:hover .icon-circle {
    background-color: #a71d2a;
    transform: scale(1.15) rotate(-6deg);
}

/* ===== STATUS PERIODA ===== */
#statusPerioda {
    font-size: 0.8em;
    color: #28a745;
    background: #f0fff4;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 10px;
    display: none;
}

/* ===== NOTIFIKACIJE ===== */
#notifikacijeBar {
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #ffc107;
    background: #fffbf0;
    padding: 10px 14px;
}
/* ===== ACCORDION ZA GODIŠNJE ODMORE ===== */
.accordion-wrapper {
    width: 100%;
}

.accordion-radnik {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.accordion-radnik-header {
    background: linear-gradient(90deg, #f0f4f8 0%, #e8ecf1 100%);
    border-bottom: 1px solid #e0e0e0;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-radnik-header:hover {
    background: linear-gradient(90deg, #e8ecf1 0%, #dde5ed 100%);
}

.accordion-chevron {
    display: inline-block;
    font-size: 0.9em;
    transition: transform 0.2s ease;
    color: #0047AB;
}

.accordion-radnik-body {
    padding: 10px 0;
    background-color: #fff;
}

.accordion-godina {
    margin: 8px 12px;
    border: 1px solid #e8ecf0;
    border-radius: 4px;
    background-color: #f8f9fc;
    overflow: hidden;
}

.accordion-godina-header {
    background-color: #fff;
    border-bottom: 1px solid #e8ecf0;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-godina-header:hover {
    background-color: #f8f9fc;
}

.accordion-chevron-nested {
    display: inline-block;
    font-size: 0.85em;
    transition: transform 0.2s ease;
    color: #0047AB;
    margin-right: 5px;
}

.accordion-godina-body {
    padding: 16px 14px;
    background-color: #fff;
}

.detaljit-section {
    background-color: #f8f9fc;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e8ecf0;
}

.pdf-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.goPDFVerzije-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.akcije-section button {
    transition: all 0.2s ease;
}

.akcije-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
/* ===== KORIŠĆENI GODIŠNJI ODMOR ===== */
.koristeni-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e8ecf0;
}

.koristeni-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #e3f2fd;
    border-radius: 4px;
    font-weight: 600;
    color: #0047AB;
    border-left: 4px solid #0047AB;
}

.koristeni-tabela {
    margin-bottom: 15px;
}

.koristeni-tabela h5 {
    margin: 0 0 10px 0;
}

.koristeni-tabela div {
    background-color: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 4px;
}

.koristeni-tabela-red {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr auto;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    font-size: 0.85em;
}

.koristeni-tabela-red:last-child {
    border-bottom: none;
}

.koristeni-tabela-red strong {
    color: #0047AB;
}

.koristeni-tabela-red button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    white-space: nowrap;
}

.koristeni-tabela-red button:hover {
    background-color: #c82333;
}

.koristeni-forma {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e8ecf0;
}

.koristeni-forma h5 {
    margin: 0 0 10px 0;
}

.koristeni-forma input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    width: 100%;
    box-sizing: border-box;
}

.koristeni-forma button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.koristeni-forma button:hover {
    background-color: #218838;
}
/* ===== MEDIA QUERY ===== */
@media (max-width: 600px) {
    body { padding: 5px; }
    .app-container { max-width: 100%; width: 100%; margin-top: 5px; padding: 10px; }
    select, button, input { padding: 12px 8px; font-size: 1em; }
    h1 { font-size: 1.3em; }
    #appHeader { border-radius: 10px; }

    .accordion-radnik-header {
        padding: 12px 12px;
        font-size: 0.95em;
    }

    .accordion-godina-header {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .accordion-godina-body {
        padding: 12px;
    }
}
