/* --- Osnovni Stilovi --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1, h2, h3 { color: #2c3e50; margin-top: 0; }
h2 { border-bottom: 2px solid #ecf0f1; padding-bottom: 5px; margin-top: 30px; }

/* --- Navigacioni Meni (Brendiran) --- */
.nav-menu {
    background-color: #ecf0f1;
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    overflow: visible; /* ISPRAVKA ZA DROPDOWN */
}
.nav-menu a {
    text-decoration: none;
    color: #2c3e50;
    padding: 10px 15px;
    margin: 0 5px;
    font-weight: 500;
    display: inline-block;
}
.nav-menu a:hover { background-color: #bdc3c7; border-radius: 3px; }
.nav-menu a.active { font-weight: 700; color: #0078d4; }
.nav-menu .logout-link {
    float: right;
    margin-right: 15px;
    color: #e81123;
    font-weight: bold;
}
.nav-menu .logout-link:hover { background-color: #e81123; color: white; }

/* --- Tabele --- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border: 1px solid #ddd; text-align: left; font-size: 14px; }
th { background-color: #f2f2f2; font-weight: 600; }
tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #f1f1f1; }

/* --- Forme --- */
.detalji-sekcija {
    margin-bottom: 25px;
    padding: 20px;
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 5px;
}
.forma-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.forma-grid-full { grid-column: 1 / -1; }
.forma-grid label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 14px; }
.forma-grid input[type="text"],
.forma-grid input[type="email"],
.forma-grid input[type="password"],
.forma-grid select,
.forma-grid input[type="date"],
.forma-grid input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* --- Dugmad (Brendirana) --- */
button, .btn {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    text-decoration: none;
    display: inline-block;
}
.btn-primary, button { background-color: #0078d4; }
.btn-primary:hover, button:hover { background-color: #005a9e; }
.btn-danger { background-color: #e81123; }
.btn-danger:hover { background-color: #c50f1f; }
.btn-success { background-color: #27ae60; }
.btn-success:hover { background-color: #229954; }
.btn-warning { background-color: #f39c12; }
.btn-warning:hover { background-color: #d48911; }

/* --- Flash Poruke --- */
.flash-message { padding: 15px; margin-bottom: 20px; border-radius: 4px; border: 1px solid; }
.flash-message.success { background-color: #eafaf1; color: #1f7c4d; border-color: #a1e7c5; }
.flash-message.error { background-color: #fdecea; color: #a13a35; border-color: #f5b9b6; }

/* --- Stilovi za Stranicu za Prijavu --- */
body.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 0; }
.login-form { max-width: 360px; width: 100%; margin: 20px; padding: 30px; background: #fff; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); box-sizing: border-box; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { max-width: 80px; }
.login-form h2 { text-align: center; margin-top: 0; margin-bottom: 25px; color: #2c3e50; }
.login-form label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 14px; }
.login-form input[type="text"],
.login-form input[type="password"] { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 15px; }
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus { border-color: #0078d4; outline: none; box-shadow: 0 0 0 2px rgba(0,120,212,0.2); }
.login-form button { width: 100%; padding: 12px; font-size: 16px; font-weight: bold; }
.error { background-color: #fdecea; color: #a13a35; border: 1px solid #f5b9b6; padding: 10px; margin-bottom: 15px; border-radius: 4px; text-align: center; font-size: 14px; }

/* --- Stilovi za Dropdown Meni --- */
.nav-menu .dropdown { position: relative; display: inline-block; }
.nav-menu .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; border-radius: 4px; }
.nav-menu .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; margin: 0; }
.nav-menu .dropdown-content a:hover { background-color: #ddd; }
.nav-menu .dropdown:hover .dropdown-content { display: block; }
.nav-menu .dropdown .dropbtn { text-decoration: none; color: #2c3e50; padding: 10px 15px; margin: 0 5px; font-weight: 500; display: inline-block; cursor: pointer; border: none; background: none; font-size: inherit; font-family: inherit; }
.nav-menu .dropdown:hover .dropbtn { background-color: #bdc3c7; border-radius: 3px; }
.nav-menu .dropdown-content a.active { font-weight: 700; color: #0078d4; }

/* --- Stilovi za Footer --- */
.footer { text-align: center; margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; font-size: 13px; color: #777; }

/* --- Stilovi za Raspored Stranica (GRID) --- */
.master-detail-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.master-grid, .detail-grid { display: grid; grid-template-rows: auto 1fr; gap: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.detail-box { background: #fdfdfd; border: 1px solid #eee; padding: 15px; border-radius: 5px; min-height: 200px; overflow-y: auto; }
.tabela-kontejner { overflow-y: auto; }
.forma-kontejner .detalji-sekcija { padding: 20px; margin-bottom: 0; }
.forma-kontejner .detalji-sekcija label { font-size: 13px; margin-bottom: 3px; }
.forma-kontejner .detalji-sekcija input[type="text"],
.forma-kontejner .detalji-sekcija input[type="checkbox"] { margin-bottom: 8px; }

/* Grids za ostale stranice */
.usluge-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.vlasnici-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.stanovi-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.ugovori-grid { display: grid; grid-template-columns: 450px 1fr; gap: 20px; }

/* --- Stilovi za List Builder (iz ugovori.php) --- */
#stavke_ugovora_list { border: 1px solid #ddd; background: #fdfdfd; min-height: 100px; padding: 10px; border-radius: 4px; }
.stavka-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid #ccc; padding: 5px 10px; margin-bottom: 5px; border-radius: 3px; }
.stavka-item span { font-weight: 500; }
.stavka-item .cena { font-size: 13px; color: #333; }
.stavka-item .btn-ukloni { background-color: #e81123; color: white; padding: 3px 8px; font-size: 12px; text-decoration: none; border-radius: 3px; }

/* Stil za tabele koje se mogu kliknuti */
.clickable-table tbody tr { cursor: pointer; }
.clickable-table tbody tr:hover { background-color: #f0f8ff !important; }
.clickable-table tbody tr.selected { background-color: #d6eaff !important; }
/* Manja dugmad u tabelama */
.action-btn { padding: 5px 10px; font-size: 12px; text-decoration: none; display: inline-block; margin-right: 5px; color: white; }

/* Ispravka za Checkbox polja */
.checkbox-polje { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.checkbox-polje input[type="checkbox"] { width: auto; margin-bottom: 0; }
.checkbox-polje label { display: inline-block; font-weight: normal; margin-bottom: 0; font-size: 14px; cursor: pointer; }
/* zaduzenja_zbirno.php */
.zbirno-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.pojedinacno-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.uplate-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; } 
/* izvestaji.php */
/* izvestaji.php */
.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
}
.izvestaji-lista {
    margin-top: 30px;
    max-width: 300px; 
}
.izvestaji-lista h2 {
    border-bottom: none;
}
.izvestaji-lista a {
    display: block;
    text-decoration: none;
    color: #0078d4; /* Brend Plava */
    font-size: 1.1em;
    font-weight: 500;
    padding: 10px 15px; /* Manji padding */
    margin-bottom: 5px;
    border-radius: 4px;
    border: 1px solid transparent; /* Bez ivica */
}
.izvestaji-lista a:hover {
    background: #f0f8ff; /* Svetlo plava pozadina */
    border-color: #ddd; /* Suptilni border na hover */
}
/* oglasna_tabla.php */
.oglasi-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
.kvarovi-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; }
/* --- Stilovi za Dashboard Panele (index.php) --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dve kolone */
    gap: 20px;
}

.dashboard-panel {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 5px;
}
.dashboard-panel h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* Stil za panel sa uputstvom */
.uputstvo-panel ul {
    padding-left: 20px;
}
.uputstvo-panel li {
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* Stil za panel "Na Čekanju" */
.na-cekanju-panel .stavka {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.na-cekanju-panel .stavka:last-child {
    border-bottom: none;
}
.na-cekanju-panel .stavka-tip {
    font-weight: bold;
    color: #e81123; /* Brend Crvena za hitnost */
}
.na-cekanju-panel .stavka-link {
    text-decoration: none;
    font-weight: 500;
}
/* Osnovni stilovi za meni */
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo levo, stavke centrirane, odjavi se desno */
    position: relative;
}

/* Logo skroz levo */
.nav-logo {
    margin-left: 20px;
    margin-right: 20px;
}

.site-logo {
    height: 40px; /* Prilagodite visinu po potrebi */
    width: auto;
}

/* Centrirane stavke menija */
.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Zauzima dostupan prostor između loga i "Odjavi se" */
}

/* "Odjavi se" desno */
.logout-link {
    margin-left: auto; /* Gura "Odjavi se" skroz desno */
}
