/* GSS Novi Grad Sarajevo - Mini Inventar */
:root { --primary: #d32f2f; }
html { background-color: #f4f6f8; }
body { padding: 12px; max-width: 900px; margin: auto; background-color: #f4f6f8; font-family: system-ui, -apple-system, sans-serif; }
body.wide { max-width: 1100px; }

.top-nav, body > header.top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.brand-container { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-container:hover { text-decoration: none; }
.nav-logo { height: 40px; width: auto; object-fit: contain; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { margin: 0; white-space: nowrap; padding: 6px 10px; border-radius: 6px; font-size: 0.9rem; color: #444; text-decoration: none; background: white; border: 1px solid #e3e6ea; }
.main-nav a.active { background: var(--primary); border-color: var(--primary); color: white; }

.badge { font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; font-weight: 600; display: inline-block; }
.badge-ispravno { background: #d4edda; color: #155724; }
.badge-teren { background: #cce5ff; color: #004085; }
.badge-provjera { background: #fff3cd; color: #856404; }
.badge-osteceno { background: #f8d7da; color: #721c24; }
.badge-rashod { background: #e2e3e5; color: #41464b; }
.chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; background: #eef1f4; color: #444; display: inline-block; margin: 2px 4px 2px 0; }

.gear-card { background: white; padding: 14px; border-radius: 10px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.gear-card.retired { opacity: 0.7; }
.gear-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; float: right; margin-left: 10px; }
.assigned-box { display: inline-block; background: #fff3cd; color: #856404; padding: 4px 10px; border-radius: 6px; font-size: 0.9rem; font-weight: bold; margin-top: 6px; border: 1px solid #ffeeba; }
.assigned-box small { font-weight: normal; }

.controls { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.controls button, .controls a[role=button] { padding: 4px 10px; font-size: 0.8rem; margin: 0; width: auto; }
.inline-form { display: inline; margin: 0; }

.filter-row { display: flex; gap: 8px; margin-bottom: 8px; }
.filter-row select, .filter-grid select { margin-bottom: 0; font-size: 0.85rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 8px; }
details.more-filters { margin-bottom: 8px; }
details.more-filters summary { font-size: 0.85rem; color: #555; }
.list-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; font-size: 0.85rem; color: #444; }
.list-summary .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-summary .actions a { padding: 4px 10px; font-size: 0.8rem; margin: 0; }

dialog { border: none; padding: 0; background: transparent; }
dialog article { max-width: 520px; margin: auto; background: white; border-radius: 12px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.modal-head h4 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; color: #888; cursor: pointer; padding: 0; margin: 0; line-height: 1; width: auto; }
.modal-buttons { display: flex; gap: 10px; margin-top: 15px; }
.modal-buttons button, .modal-buttons a { margin-bottom: 0; }

.mgmt-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #f8f9fa; border-radius: 6px; margin-bottom: 6px; font-size: 0.9rem; gap: 8px; }
.mgmt-item small { color: #777; }
.btn-status { color: #b45309 !important; border-color: #d97706 !important; }
fieldset.status-choices { border: none; padding: 0; margin: 0 0 12px; }
fieldset.status-choices legend { font-size: 0.95rem; margin-bottom: 6px; }
.status-choice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid #dfe3e8; border-radius: 8px; cursor: pointer; }
.status-choice:has(input:checked) { border-color: #d97706; background: #fff8eb; }
.status-choice input { margin: 0; }
.status-choice.is-current { opacity: 0.45; cursor: not-allowed; }
.act-Promjena { background: #fff3cd; color: #856404; }
.link-danger { background: none; border: none; color: #d32f2f; font-weight: bold; padding: 2px 8px; margin: 0; width: auto; font-size: 0.85rem; cursor: pointer; }

.btn-loading { opacity: 0.7; pointer-events: none; }
.alert-error { background: #f8d7da; color: #721c24; padding: 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid #f5c6cb; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; padding: 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid #c3e6cb; font-size: 0.9rem; }
.alert-warning, .recommendation-box { background: #fff3cd; color: #856404; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 0.9rem; border: 1px solid #ffeeba; }
.recommendation-box { display: none; font-size: 0.85rem; }

/* Autocomplete */
.autocomplete-wrapper { position: relative; display: block; }
.autocomplete-list { position: absolute; z-index: 100; background: white; border: 1px solid #ddd; width: 100%; max-height: 200px; overflow-y: auto; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; margin-top: -10px; }
.autocomplete-item { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 0.9rem; font-weight: bold; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f8f9fa; }

/* Overview, history, users */
.panel { background: white; padding: 16px; border-radius: 10px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.panel h3 { font-size: 1.1rem; margin-bottom: 10px; }
.panel h5 { font-size: 0.85rem; text-transform: uppercase; color: #777; margin: 14px 0 6px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.panel-head h3 { margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: white; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); color: inherit; text-decoration: none; display: block; border-top: 4px solid #ccc; }
.tile:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.tile .num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.tile .label { font-size: 0.8rem; color: #555; }
.tile.ok { border-top-color: #2e7d32; }
.tile.field { border-top-color: #1565c0; }
.tile.check { border-top-color: #f9a825; }
.tile.bad { border-top-color: #c62828; }
.tile.total { border-top-color: #555; }
table.compact { font-size: 0.85rem; margin-bottom: 0; }
table.compact th, table.compact td { padding: 6px 8px; vertical-align: top; }
table.compact td.num, table.compact th.num { text-align: right; white-space: nowrap; }
tr.muted td { color: #999; }
table.compact tbody th { font-size: 0.75rem; text-transform: uppercase; color: #666; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.export-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.export-bar a[role=button] { margin: 0; padding: 6px 12px; font-size: 0.85rem; }
.history-entry { background: white; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); font-size: 0.9rem; }
.history-entry .meta { font-size: 0.8rem; color: #777; }
.history-entry .note { font-size: 0.85rem; color: #555; margin-top: 2px; }
.act { font-size: 0.75rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: #eef1f4; }
.act-Zaduženje { background: #cce5ff; color: #004085; }
.act-Razduženje { background: #d4edda; color: #155724; }
.act-Brisanje { background: #f8d7da; color: #721c24; }
.act-Unos { background: #e8daef; color: #4a235a; }
.small-muted { font-size: 0.8rem; color: #777; }

@media (max-width: 600px) {
    body { padding: 8px; }
    .main-nav a { padding: 5px 8px; font-size: 0.82rem; }
    .tile .num { font-size: 1.4rem; }
}

/* Members, teams, users */
.links-panel { border: 2px solid #f9a825; }
.link-row { padding: 8px 0; border-bottom: 1px solid #eee; }
.link-row:last-of-type { border-bottom: none; }
.link-copy { display: flex; gap: 6px; margin-top: 4px; }
.link-copy input { margin: 0; font-size: 0.8rem; }
.link-copy button { margin: 0; width: auto; padding: 4px 12px; font-size: 0.8rem; }
.history-line { font-size: 0.88rem; padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.history-line:last-child { border-bottom: none; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-actions button { margin: 0; }
.checklist { max-height: 260px; overflow-y: auto; border: 1px solid #e3e6ea; border-radius: 8px; padding: 6px 10px; }
.checklist label { display: block; padding: 4px 0; margin: 0; font-size: 0.9rem; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; }
.link-plain { background: none; border: none; color: #1565c0; padding: 2px 6px; margin: 0; width: auto; font-size: 0.8rem; cursor: pointer; }
.row-actions { white-space: nowrap; }
details.panel > summary { cursor: pointer; }
