/* =========================================================================
   FZM — vladin stil za admin panel
   Preuzeto sa javnog portala ePosrednik (Registar posrednika), radi vizuelne
   usklađenosti sa portalima Vlade Crne Gore.

   Paleta:  cyprus #003845 (primarna) · zlatna #FFC000 (akcent) · crvena #E30000
   Forma:   oštri uglovi (border-radius 0), Brioni Sans Pro, mirne površine.

   Učitava se preko config/backpack/ui.php → 'styles'.
   ========================================================================= */

/* ---------- Font Vlade Crne Gore ---------- */
@font-face {
    font-family: "Brioni Sans Pro";
    src: url(/fonts/regular.woff2) format("woff2"), url(/fonts/regular.woff) format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Brioni Sans Pro";
    src: url(/fonts/bold.woff2) format("woff2"), url(/fonts/bold.woff) format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Brioni Sans Pro";
    src: url(/fonts/italic.woff2) format("woff2"), url(/fonts/italic.woff) format("woff");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --gov-cyprus: #003845;
    --gov-cyprus-dark: #002731;
    --gov-cyprus-soft: rgba(0, 56, 69, .08);
    --gov-gold: #ffc000;
    --gov-red: #e30000;
    --gov-green: #0f6b57;
    --gov-surface: #f3f5f5;
    --gov-border: #e5e5e5;
    --gov-ink: #212529;
    --gov-muted: #5c6a70;

    /* Widgeti kontrolne table već čitaju ove varijable — preusmjeravamo ih
       na vladinu paletu, pa se KPI kartice, lijevak statusa i trake usklade. */
    --fzm-blue: #003845;
    --fzm-blue-soft: rgba(0, 56, 69, .10);
    --fzm-aqua: #0f6b57;
    --fzm-aqua-soft: rgba(15, 107, 87, .12);
    --fzm-red: #e30000;
    --fzm-red-soft: rgba(227, 0, 0, .10);
    --fzm-amber: #b58400;
    --fzm-amber-soft: rgba(255, 192, 0, .20);
    --fzm-violet: #00596b;
    --fzm-violet-soft: rgba(0, 89, 107, .10);
    --fzm-track: rgba(0, 56, 69, .10);
}

/* ---------- Osnova ---------- */
body,
.sidebar,
.app-header,
.btn,
.form-control,
.card,
input,
select,
textarea,
button {
    font-family: "Brioni Sans Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    color: var(--gov-ink);
    background: #fafbfb;
}

/* Brioni Sans Pro ima samo rezove 400 i 700.
   Bootstrap/CoreUI na više mjesta traže 800/900 (npr. `b, strong { font-weight: bolder }`
   nad roditeljem koji je već 700 daje 900). Kad rez ne postoji, pregledač ga *sintetiše* —
   razmazuje glifove i tekst izgleda mutno, kao da ima sjenku.
   Zato: gasimo sintezu i spuštamo sve teže težine na stvarni rez 700. */
* {
    font-synthesis: none;
    font-synthesis-weight: none;
}

b,
strong,
th,
label,
h1, h2, h3, h4, h5, h6,
.font-weight-bold,
.font-weight-bolder,
.fw-bold,
.fw-bolder,
.navbar-brand,
.card-header,
.btn {
    font-weight: 700 !important;
}

/* Oštri uglovi — potpis državnih portala. */
.card,
.btn,
.form-control,
.custom-select,
.input-group-text,
.badge,
.alert,
.dropdown-menu,
.modal-content,
.nav-pills .nav-link,
.list-group-item,
.page-link,
.select2-container--bootstrap .select2-selection,
.select2-dropdown,
.table,
.progress,
.close {
    border-radius: 0 !important;
}

a {
    color: var(--gov-cyprus);
}
a:hover {
    color: var(--gov-cyprus-dark);
}

/* Sve što vuče Backpack-ovu primarnu (ljubičastu) boju: tekstualna dugmad
   ("+ Novi podnosilac"), njihove ikone, linkovi i select2 kontrole. */
html body .btn-link,
html body .btn-link:hover,
html body .btn-link .la,
html body .btn-link i,
html body .text-primary,
html body a.text-primary,
html body .page-link,
html body .select2-selection__clear,
html body .select2-container--bootstrap .select2-results__option--highlighted[aria-selected],
html body .nav-tabs .nav-link.active {
    color: var(--gov-cyprus) !important;
}
html body .btn-link:hover {
    color: var(--gov-cyprus-dark) !important;
}
html body .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
    background-color: var(--gov-cyprus) !important;
    color: #fff !important;
}
html body .custom-control-input:checked ~ .custom-control-label::before,
html body .form-check-input:checked {
    background-color: var(--gov-cyprus) !important;
    border-color: var(--gov-cyprus) !important;
}

/* Fokus — zlatni prsten, vidljiv i pristupačan. */
a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid var(--gov-gold);
    outline-offset: 2px;
}

/* ---------- Gornja traka: grb + naziv Fonda + linija zastave ---------- */
html body .app-header.navbar {
    background: #fff !important;
    border-bottom: none !important;
    box-shadow: none;
    position: relative;
    height: auto;
    min-height: 68px;
    padding: 0 1rem;
}

/* Grb i naziv.
   VAŽNO: tema drži opacity: .2 na .navbar-brand (logo je zato bio jedva vidljiv),
   pa ga eksplicitno vraćamo na 1. */
html body .app-header .navbar-brand.fzm-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: auto;
    min-width: 0;
    padding: .5rem 0;
    background: transparent;
    text-decoration: none;
    opacity: 1 !important;
}
.fzm-brand__grb {
    height: 46px;
    width: auto;
    flex: 0 0 auto;
}
.fzm-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.fzm-brand__title {
    color: var(--gov-cyprus);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .005em;
    white-space: nowrap;
}
.fzm-brand__sub {
    color: var(--gov-muted);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

html body .app-header .nav-link {
    color: var(--gov-ink) !important;
}

/* Crveno-zlatna linija ispod trake — motiv zastave Crne Gore.
   Lijevi isječak crven, ostatak zlatan, kao na portalima Vlade. */
.fzm-header .line-cg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: var(--gov-red);
}
.fzm-header .line-cg__red {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8.3333%;
    background: var(--gov-red);
}
.fzm-header .line-cg__gold {
    position: absolute;
    left: 8.3333%;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--gov-gold);
}

@media (max-width: 767.98px) {
    .fzm-brand__title { white-space: normal; font-size: 13px; }
    .fzm-brand__grb { height: 36px; }
    .fzm-header .line-cg { height: 3px; }
}

/* ---------- Bočni meni ----------
   Selektori su namjerno "pretjerani" (html body .sidebar.sidebar-pills):
   tema nosi svoja pravila sa !important i istom specifičnošću, pa bi inače
   ona pobijedila — aktivna stavka je ostajala ljubičasta na tamnoj podlozi. */
/* Širi meni: na 225px su se "Ocjenjivanje komisije", "Generalna podešavanja" i
   "Nacionalne zajednice" lomili u dva reda.
   Nije dovoljno proširiti samo .sidebar — tema drži FIKSNIH 200px na unutrašnjim
   omotačima (.sidebar-scroll, .sidebar-nav, .nav), pa se tekst i dalje lomio.
   Zato se širina postavlja na svakom od njih. */
html body .sidebar,
html body .app-body .sidebar,
html body .app-body .sidebar.sidebar-pills,
html body .sidebar-pills {
    background: var(--gov-cyprus) !important;
    border-right: none;
    width: 280px !important;
    flex: 0 0 280px !important;
}

/* Unutrašnji omotači MORAJU da prate roditelja, ne da imaju svoju fiksnu širinu.
   Kad su bili fiksno 280px, počinjali su sa pomakom od 10px pa im je desna ivica
   izlazila 10px van sidebara — submeni je "bježao" van menija. */
html body .sidebar .sidebar-scroll,
html body .sidebar .sidebar-nav,
html body .sidebar .nav,
html body .sidebar .nav-dropdown-items {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

html body .sidebar .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body .sidebar .nav-link,
html body .sidebar.sidebar-pills .nav-link {
    color: rgba(255, 255, 255, .85) !important;
    background: transparent !important;
    border-left: 4px solid transparent;
    border-radius: 0 !important;
    font-weight: 400;
    padding-left: .9rem;
}

html body .sidebar .nav-link:hover,
html body .sidebar.sidebar-pills .nav-link:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    border-left-color: rgba(255, 192, 0, .45);
}

html body .sidebar .nav-link.active,
html body .sidebar.sidebar-pills .nav-link.active,
html body .sidebar.sidebar-pills .nav-link.active:hover {
    background: var(--gov-cyprus-dark) !important;
    color: #fff !important;
    border-left-color: var(--gov-gold) !important;
    font-weight: 700;
}

/* Ikone: prigušene kad miruju, zlatne kad je stavka aktivna. */
html body .sidebar .nav-link .nav-icon,
html body .sidebar .nav-link i {
    color: rgba(255, 255, 255, .65) !important;
}
html body .sidebar .nav-link:hover .nav-icon,
html body .sidebar .nav-link:hover i,
html body .sidebar .nav-link.active .nav-icon,
html body .sidebar .nav-link.active i {
    color: var(--gov-gold) !important;
}

/* Otvorena grupa u meniju — tek toliko tamnija da se vidi da je otvorena. */
html body .sidebar .nav-dropdown.open {
    background: rgba(0, 0, 0, .16) !important;
}
html body .sidebar .nav-dropdown.open > .nav-dropdown-toggle {
    color: #fff !important;
}
html body .sidebar .nav-dropdown-toggle::before {
    filter: invert(1) opacity(.55);
}
html body .sidebar .sidebar-minimizer {
    background: var(--gov-cyprus-dark) !important;
}
html body .sidebar .sidebar-minimizer::before {
    filter: invert(1) opacity(.6);
}

/* Naslovi sekcija u meniju, ako ih tema koristi. */
html body .sidebar .nav-title {
    color: rgba(255, 255, 255, .45) !important;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
}

/* ---------- Dugmad ---------- */
.btn-primary {
    background-color: var(--gov-cyprus);
    border-color: var(--gov-cyprus);
    color: #fff;
    font-weight: 700;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
    background-color: var(--gov-cyprus-dark) !important;
    border-color: var(--gov-cyprus-dark) !important;
}
.btn-outline-primary {
    color: var(--gov-cyprus);
    border-color: var(--gov-cyprus);
}
.btn-outline-primary:hover {
    background-color: var(--gov-cyprus);
    border-color: var(--gov-cyprus);
}
.btn-success {
    background-color: var(--gov-green);
    border-color: var(--gov-green);
}
.btn-danger {
    background-color: var(--gov-red);
    border-color: var(--gov-red);
}
.btn-warning {
    background-color: var(--gov-gold);
    border-color: var(--gov-gold);
    color: var(--gov-ink);
}

/* ---------- Prostor sadržaja ----------
   Sadržaj je bio nabijen odmah uz gornju traku. */
html body .main {
    padding-top: 1rem;
}
html body .main .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Pozdrav na kontrolnoj tabli.
   Pravilo mora stajati OVDJE i biti jako: element nosi i klasu .container-fluid,
   a tema na njoj drži `padding: 0 30px` (skraćeni zapis) — što nulira gornji i
   donji padding i nadjačava pravilo iz dashboard_style.blade.php.
   Zato je pozdrav ostajao zalijepljen za traku i za kartice ispod. */
html body .main .fzm-dash-header {
    padding-top: 2.25rem !important;
    padding-bottom: 2rem !important;
}
html body .main .fzm-dash-header h2 {
    font-size: 1.8rem;
    line-height: 1.25;
    margin-bottom: .5rem;
}
html body .main .fzm-dash-header p {
    margin-bottom: 0;
}

/* ---------- Kartice ---------- */
.card {
    border: 1px solid var(--gov-border);
    box-shadow: none;
    margin-bottom: 1.25rem;
}
.card-body {
    padding: 1.25rem;
}
.card-header {
    background: var(--gov-surface);
    border-bottom: 1px solid var(--gov-border);
    color: var(--gov-cyprus);
    font-weight: 700;
}

/* ---------- Tabele ---------- */
.table > thead th,
.table thead th {
    background: var(--gov-surface);
    color: var(--gov-cyprus);
    border-bottom: 2px solid var(--gov-border);
    border-top: none;
    font-weight: 700;
    white-space: nowrap;
}
.table td,
.table th {
    border-color: var(--gov-border);
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 56, 69, .025);
}
.table-hover tbody tr:hover {
    background-color: var(--gov-cyprus-soft);
}

/* ---------- Forme ---------- */
.form-control:focus,
.custom-select:focus {
    border-color: var(--gov-cyprus);
    box-shadow: 0 0 0 .15rem rgba(0, 56, 69, .18);
}
label {
    color: var(--gov-ink);
    font-weight: 700;
}
.required::after {
    color: var(--gov-red);
}

/* ---------- Tabovi (forma projekta) ---------- */
.nav-tabs .nav-link {
    border-radius: 0;
    color: var(--gov-muted);
    border-bottom: 3px solid transparent;
}
.nav-tabs .nav-link.active {
    color: var(--gov-cyprus);
    font-weight: 700;
    border-color: transparent transparent var(--gov-cyprus);
    background: transparent;
}

/* ---------- Značke i obavještenja ---------- */
.badge-primary { background-color: var(--gov-cyprus); }
.badge-danger  { background-color: var(--gov-red); }
.badge-warning { background-color: var(--gov-gold); color: var(--gov-ink); }
.badge-success { background-color: var(--gov-green); }

.alert-primary {
    background: var(--gov-cyprus-soft);
    border-color: var(--gov-cyprus);
    color: var(--gov-cyprus-dark);
}

/* ---------- Putanja (breadcrumb) ---------- */
.breadcrumb {
    background: transparent;
    border-radius: 0;
    padding-left: 0;
}
.breadcrumb a {
    color: var(--gov-cyprus);
}

/* ---------- Podnožje ---------- */
.app-footer {
    background: #f3f3f3;
    border-top: 1px solid var(--gov-border);
    color: var(--gov-muted);
}

/* ---------- Statusni „stepper" na projektu ----------
   Završeni koraci nose cyprus, trenutni zlatnu — čitljivo i u skladu sa palettom. */
.fzm-step.is-done {
    --step-bg: #cfdcdf !important;
    --step-fg: #003845 !important;
}
.fzm-step.is-done .fzm-step-idx {
    background: var(--gov-cyprus) !important;
    color: #fff !important;
}
.fzm-step.is-current {
    --step-bg: var(--gov-cyprus) !important;
    --step-fg: #fff !important;
    box-shadow: inset 0 -3px 0 var(--gov-gold) !important;
}
.fzm-step.is-current .fzm-step-idx {
    background: var(--gov-gold) !important;
    color: var(--gov-cyprus) !important;
}
.fzm-step.is-upcoming {
    --step-bg: #eef1f1 !important;
    --step-fg: #6b7780 !important;
}

/* ---------- Ponavljajuća polja (faze, plaćanja, utuženja…) ----------
   Backpack 7 postavlja .controls na position:absolute, ali NE zada horizontalni
   pomak — pa dugme "×" padne na statičku poziciju (uz lijevu ivicu reda) umjesto
   u gornji desni ugao. Provjereno: greška postoji i bez ove teme, došla je sa
   nadogradnjom na Backpack 7. */
html body .container-repeatable-elements .repeatable-element {
    position: relative;
    padding-right: 2.75rem !important;   /* da sadržaj ne ulazi pod dugme */
}

html body .container-repeatable-elements .controls {
    position: absolute;
    top: .5rem;
    right: .5rem;
    /* Tema drži `left: -16px !important` — dok je `left` zadan, u LTR-u ON pobjeđuje
       nad `right`, pa je dugme visilo lijevo izvan reda. Mora se ugasiti isto tako. */
    left: auto !important;
    bottom: auto;
    display: flex;
    gap: .25rem;
    z-index: 3;
}

html body .container-repeatable-elements .controls button {
    float: none;
    opacity: .65;
    color: var(--gov-cyprus);
    background: transparent;
    border: 0;
    line-height: 1;
    text-shadow: none;
}
html body .container-repeatable-elements .controls button:hover {
    opacity: 1;
    color: var(--gov-red);
}

/* ---------- Obavještenja: zvono + padajući meni ---------- */
html body .fzm-notif__toggle {
    position: relative;
    padding: .5rem .75rem;
}
html body .fzm-notif__toggle .la-bell {
    font-size: 1.25rem;
    color: var(--gov-cyprus);
}
html body .fzm-notif__count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--gov-red) !important;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    padding: 2px 4px;
    border-radius: 999px !important;
    line-height: 1;
}

html body .fzm-notif__menu {
    width: 360px;
    max-width: 94vw;
    padding: 0;
    border: 1px solid var(--gov-border);
    border-top: 3px solid var(--gov-cyprus);
    border-radius: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.fzm-notif__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem .85rem;
    background: var(--gov-surface);
    border-bottom: 1px solid var(--gov-border);
    font-weight: 700;
    color: var(--gov-cyprus);
    font-size: .9rem;
}
.fzm-notif__readall {
    background: none;
    border: 0;
    padding: 0;
    font-size: .75rem;
    font-weight: 700;
    color: var(--gov-cyprus);
    text-decoration: underline;
    cursor: pointer;
}

.fzm-notif__list {
    max-height: 340px;
    overflow-y: auto;
}
.fzm-notif__item {
    display: flex;
    gap: .6rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--gov-border);
    color: var(--gov-ink);
    text-decoration: none;
    background: #fffdf5;      /* nepročitano — blago istaknuto */
}
.fzm-notif__item:hover {
    background: var(--gov-cyprus-soft);
    color: var(--gov-ink);
    text-decoration: none;
}
.fzm-notif__item.is-seen {
    background: #fff;
    opacity: .68;
}
.fzm-notif__dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: .35rem;
    border-radius: 50%;
}
.fzm-notif__dot--danger  { background: var(--gov-red); }
.fzm-notif__dot--warning { background: var(--gov-gold); }

.fzm-notif__body { display: flex; flex-direction: column; min-width: 0; }
.fzm-notif__title { font-weight: 700; font-size: .85rem; color: var(--gov-cyprus); }
.fzm-notif__text  { font-size: .8rem; color: var(--gov-muted); }
.fzm-notif__ago   { font-size: .72rem; color: var(--gov-faint, #97a1ad); margin-top: .15rem; }

.fzm-notif__empty {
    padding: 1.25rem .85rem;
    text-align: center;
    color: var(--gov-muted);
    font-size: .85rem;
}
.fzm-notif__footer {
    display: block;
    padding: .6rem;
    text-align: center;
    background: var(--gov-surface);
    border-top: 1px solid var(--gov-border);
    color: var(--gov-cyprus);
    font-weight: 700;
    font-size: .8rem;
}
.fzm-notif__footer:hover {
    background: var(--gov-cyprus);
    color: #fff;
    text-decoration: none;
}

/* ---------- Obavještenja: posebna stranica ---------- */
html body .main .fzm-notifpage-header {
    padding-top: 2.25rem;
    padding-bottom: 1.5rem;
}
.fzm-notifpage-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gov-border);
    background: #fffdf5;
}
.fzm-notifpage-item.is-seen { background: #fff; opacity: .7; }
.fzm-notifpage-item:last-child { border-bottom: 0; }

.fzm-notifpage-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: .45rem;
    border-radius: 50%;
}
.fzm-notifpage-dot--danger  { background: var(--gov-red); }
.fzm-notifpage-dot--warning { background: var(--gov-gold); }

.fzm-notifpage-body { flex: 1 1 auto; min-width: 0; }
.fzm-notifpage-title { font-weight: 700; color: var(--gov-cyprus); }
.fzm-notifpage-title a { color: var(--gov-cyprus); }
.fzm-notifpage-text { color: var(--gov-ink); font-size: .9rem; margin-top: .1rem; }
.fzm-notifpage-meta { color: var(--gov-muted); font-size: .78rem; margin-top: .3rem; }

.fzm-notifpage-new {
    display: inline-block;
    margin-left: .4rem;
    padding: 1px 6px;
    background: var(--gov-gold);
    color: var(--gov-ink);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.fzm-notifpage-read {
    flex: 0 0 auto;
    border: 1px solid var(--gov-cyprus);
    color: var(--gov-cyprus);
    background: #fff;
    font-weight: 700;
    border-radius: 0;
    white-space: nowrap;
}
.fzm-notifpage-read:hover { background: var(--gov-cyprus); color: #fff; }

html body .fzm-notif-tabs .nav-link.active {
    color: var(--gov-cyprus);
    font-weight: 700;
    border-bottom: 3px solid var(--gov-cyprus);
}

/* ---------- Paginacija ---------- */
html body .pagination .page-link {
    color: var(--gov-cyprus);
    border-color: var(--gov-border);
    border-radius: 0 !important;
}
html body .pagination .page-link:hover {
    background: var(--gov-cyprus-soft);
    color: var(--gov-cyprus-dark);
    border-color: var(--gov-border);
}
html body .pagination .page-item.active .page-link,
html body .pagination .page-item.active .page-link:hover,
html body .pagination .page-item.active .page-link:focus {
    background-color: var(--gov-cyprus) !important;
    border-color: var(--gov-cyprus) !important;
    color: #fff !important;
}
html body .pagination .page-item.disabled .page-link {
    color: var(--gov-muted);
    background: transparent;
}

/* ---------- DataTables ---------- */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--gov-cyprus) !important;
    border-color: var(--gov-cyprus) !important;
    color: #fff !important;
}
table.dataTable thead th {
    background: var(--gov-surface);
    color: var(--gov-cyprus);
}
