﻿/* ===== NAV ===== */
.app-nav {
    background: #1a3a5c;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 50px;
    gap: 32px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.app-nav-brand {
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: .5px;
    color: #fff;
    white-space: nowrap;
}
.app-nav-links { display: flex; gap: 4px; }
.app-nav-links a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: .92em;
    transition: background .15s, color .15s;
}
.app-nav-links a:hover { background: rgba(255,255,255,.12); color: #fff; }
.app-nav-links a.aktivan { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }
.app-nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .86em;
    white-space: nowrap;
}
.app-nav-user span { color: rgba(255,255,255,.75); }
.app-nav-user a {
    color: #ffb3a7;
    text-decoration: none;
    font-weight: 600;
    padding: 5px 12px;
    border: 1px solid rgba(255,179,167,.4);
    border-radius: 5px;
    transition: background .15s, color .15s;
}
.app-nav-user a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    background: #f0f2f5;
    color: #222;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== CONTAINER ===== */
.container {
    max-width: 1300px;
    margin: 30px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    padding: 28px 32px;
}

/* ===== HEADER BAR ===== */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 14px;
}
.header-bar h2 { font-size: 20px; font-weight: 600; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.btn-danger { border-color: #ef4444; color: #ef4444; }
.btn-danger:hover { background: #fef2f2; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

button[type="submit"] {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 9px 24px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
button[type="submit"]:hover { background: #1d4ed8; }

/* ===== FILTERI ===== */
.filteri {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 12px; color: #6b7280; font-weight: 500; }
.filter-group select,
.filter-group input[type="date"] {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}
.filteri > button {
    padding: 6px 16px;
    border-radius: 5px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    align-self: flex-end;
}
.filteri > button:last-child {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.filteri > button:hover { opacity: .9; }

/* ===== UKUPNO BAR ===== */
#ukupno-bar {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    padding: 6px 0;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead tr { background: #1e3a5f; color: #fff; }
thead th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid #e5e7eb; }
tbody tr:hover { background: #f0f7ff; }
tbody td { padding: 9px 12px; vertical-align: middle; }
tbody td.akcije { white-space: nowrap; display: flex; gap: 6px; }
tfoot tr { background: #f8fafc; font-weight: 600; }
tfoot tr:last-child { background: #eef6ff; color: #1e3a5f; }
tfoot td { padding: 9px 12px; border-top: 1px solid #e5e7eb; }

/* ===== STATUS BADGE ===== */
.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.status-0 { background: #fef3c7; color: #92400e; }   /* U obradi */
.status-1 { background: #d1fae5; color: #065f46; }   /* Odobreno */
.status-2 { background: #dbeafe; color: #1e40af; }   /* Korisnik informisan */
.status-3 { background: #e2e8f0; color: #334155; }   /* Završeno */

/* ===== FORM ===== */
fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
legend {
    font-weight: 600;
    font-size: 14px;
    color: #1e3a5f;
    padding: 0 8px;
}

/* Grid forma — 4 kolone, da forma zauzima manje visine */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 16px;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.form-field--wide {
    grid-column: span 2;
}
@media (max-width: 900px) {
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .form-field--wide { grid-column: 1 / -1; }
}
.form-field label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    transition: border-color .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}
.req { color: #ef4444; }

/* Stari form-row (za login i sl.) */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}
.form-row label {
    min-width: 160px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
    flex: 1;
    max-width: 400px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    transition: border-color .15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

/* Tabela usluga unutar forme */
#tabela-usluga { margin-top: 14px; table-layout: fixed; }
#tabela-usluga thead tr { background: #374151; }
#tabela-usluga th:nth-child(1) { width: 15%; }
#tabela-usluga th:nth-child(2) { width: 35%; }
#tabela-usluga th:nth-child(3) { width: 12%; }
#tabela-usluga th:nth-child(4) { width: 12%; }
#tabela-usluga th:nth-child(5) { width: 12%; }
#tabela-usluga th:nth-child(6) { width: 10%; }
#tabela-usluga th:nth-child(7) { width: 4%; }
#tabela-usluga td { word-break: break-word; }
.input-broj { width: 70px; padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px; }
.btn-obrisi-uslugu {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}
.btn-obrisi-uslugu:hover { color: #b91c1c; }

/* Rod za odabir partnera + usluge */
.usluge-odabir {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: nowrap;
    margin-bottom: 14px;
}
.usluge-odabir .form-field {
    min-width: 180px;
    flex: 1;
}
.usluge-odabir #usluga-wrap {
    min-width: 260px;
    flex: 2;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-top: 8px;
}

/* ===== MODAL ===== */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#modal-box {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
#modal-box h3 { margin-bottom: 16px; font-size: 16px; color: #1e3a5f; }
#modal-box ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.btn-izaberi-uslugu {
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 13px;
    transition: background .12s;
}
.btn-izaberi-uslugu:hover { background: #dbeafe; border-color: #2563eb; }
#btn-zatvori-modal {
    margin-top: 18px;
    padding: 7px 20px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
#btn-zatvori-modal:hover { background: #f3f4f6; }

/* ===== LOGIN ===== */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    border-radius: 10px;
    padding: 40px 44px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    width: 360px;
}
.login-box h2 { text-align: center; margin-bottom: 24px; color: #1e3a5f; }
.login-box .form-row { flex-direction: column; align-items: flex-start; }
.login-box .form-row label { min-width: unset; margin-bottom: 4px; }
.login-box .form-row input { max-width: 100%; width: 100%; }
.login-error { color: #ef4444; font-size: 13px; margin-bottom: 12px; text-align: center; }

