/* GSS Novi Grad Sarajevo - Baza */

/* Compact sizing. Pico grows the base font from 16px up to 20px on wide screens and makes every
   button full width; keep one calm size everywhere and let buttons fit their text. */
:root {
    --font-size: 15px;
    --line-height: 1.45;
    --spacing: 0.75rem;
    --typography-spacing-vertical: 1rem;
    --form-element-spacing-vertical: 0.4rem;
    --form-element-spacing-horizontal: 0.65rem;
    --border-radius: 6px;
    --primary: #d32f2f;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1.02rem; }
button, [role=button] { display: inline-block; width: auto; font-size: 0.9rem; margin-bottom: 0; }
form { margin-bottom: 0; }
label { font-size: 0.92rem; }
input:not([type=checkbox], [type=radio]), select, textarea { margin-bottom: 0.65rem; }
.btn-small { padding: 0.25rem 0.7rem; font-size: 0.82rem; }
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: 12px 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: 8px 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid #f5c6cb; font-size: 0.9rem; }
.alert-success { background: #d4edda; color: #155724; padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; border: 1px solid #c3e6cb; font-size: 0.9rem; }
.alert-warning, .recommendation-box { background: #fff3cd; color: #856404; padding: 8px 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: 12px 14px; border-radius: 10px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.panel h3 { font-size: 1.05rem; margin-bottom: 8px; }
.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; }

/* Edit mode: sections show their data; "Uredi" reveals the form, "Odustani" hides it again */
.editable .edit-mode { display: none; }
.editable.editing .edit-mode { display: block; }
.editable.editing .view-mode, .editable.editing .edit-toggle { display: none; }
.edit-toggle { background: none; border: 1px solid #dfe3e8; color: #444; padding: 2px 10px; font-size: 0.8rem; border-radius: 6px; cursor: pointer; }
.edit-toggle:hover { background: #f4f6f8; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 0.92rem; }
.data-list dt { color: #777; font-weight: normal; }
.data-list dd { margin: 0; }
.empty-value { color: #999; font-style: italic; }
.edit-toggle-inline { margin-left: 6px; }
.panel-head .edit-toggle { margin-left: auto; }

/* Header: name links to the own card */
.brand-container a { text-decoration: none; }
.brand-name { display: block; font-weight: 700; font-size: 1.1rem; color: #222; line-height: 1.2; }
.me-link { font-size: 0.82rem; color: #2e7d32; }
.me-link.active { font-weight: 700; }

/* Toolbars and tabs */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .btn-small, .toolbar [role=button] { margin-left: auto; }
.toolbar-filter select { margin: 0; font-size: 0.85rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.subtabs { display: flex; gap: 2px; background: #e9ecef; padding: 3px; border-radius: 8px; margin-bottom: 10px; width: fit-content; }
.toolbar .subtabs { margin-bottom: 0; }
.subtabs a { padding: 4px 12px; border-radius: 6px; font-size: 0.85rem; color: #444; text-decoration: none; }
.subtabs a.active { background: white; color: #111; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.report-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.report-form select { width: auto; margin: 0; padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* Events */
.event-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: white; border-radius: 10px;
    padding: 10px 14px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-left: 4px solid #cfd8dc; }
.event-row.type-akcija { border-left-color: #d32f2f; }
.event-row.type-obuka { border-left-color: #1565c0; }
.event-row.type-vjezba { border-left-color: #2e7d32; }
.event-row.type-dezurstvo { border-left-color: #6a1b9a; }
.event-row.cancelled { opacity: 0.6; }
.event-row.cancelled .event-title { text-decoration: line-through; }
.event-main { min-width: 0; flex: 1 1 260px; }
.event-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.82rem; color: #555; }
.event-title { display: block; font-weight: 600; font-size: 1rem; color: #111; text-decoration: none; margin: 2px 0; }
.type-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; background: #eef1f4; color: #333; white-space: nowrap; }
.type-chip.type-akcija { background: #fdecea; color: #b71c1c; font-weight: 600; }
.type-chip.type-obuka { background: #e3f2fd; color: #0d47a1; }
.type-chip.type-vjezba { background: #e8f5e9; color: #1b5e20; }
.type-chip.type-dezurstvo { background: #f3e5f5; color: #4a148c; }
.phase { font-size: 0.72rem; padding: 2px 7px; border-radius: 4px; background: #eceff1; color: #455a64; font-weight: 600; }
.phase-ongoing { background: #fff3cd; color: #856404; }
.phase-awaiting { background: #fff3cd; color: #856404; }
.phase-closed { background: #e8f5e9; color: #1b5e20; }
.phase-cancelled { background: #f8d7da; color: #721c24; }
.event-head.type-akcija { border-top: 4px solid #d32f2f; }
.event-description { font-size: 0.92rem; background: #fafafa; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.share-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.share-bar .viber { background: #7360f2; border-color: #7360f2; color: white; }
.my-reply { font-size: 0.85rem; font-weight: 600; }

/* Reply buttons: neutral until chosen */
.rsvp { display: flex; gap: 4px; flex-wrap: wrap; }
.rsvp form { margin: 0; }
.rsvp button, .callout-reply button { padding: 0.3rem 0.65rem; font-size: 0.85rem; background: white; color: #333; border: 1px solid #cfd8dc; }
.rsvp button:hover { background: #f4f6f8; }
.rsvp .rsvp-dolazim.selected, .callout-reply .rsvp-dolazim.selected { background: #2e7d32; border-color: #2e7d32; color: white; }
.rsvp .rsvp-mozda.selected { background: #f9a825; border-color: #f9a825; color: #222; }
.rsvp .rsvp-ne.selected { background: #c62828; border-color: #c62828; color: white; }
.callout-reply { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.callout-reply select { width: auto; margin: 0; padding-top: 0.25rem; padding-bottom: 0.25rem; font-size: 0.85rem; }

/* People lists */
.people-group { margin-bottom: 4px; }
.people-group summary { font-size: 0.92rem; }
.person-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.person-row:last-child { border-bottom: none; }
.attention-panel { border-left: 4px solid #f9a825; }
table.attendance input { margin: 0; padding-top: 0.2rem; padding-bottom: 0.2rem; font-size: 0.85rem; }
.hours-input { width: 5rem !important; }
.role-input { min-width: 8rem; }
.reply-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.reply-row .callout-reply { margin-bottom: 0; }
.brand-name .app-name { font-weight: 400; color: #666; }
