﻿/* static/css/style.css */

body {
    background-color: #EDE8E3; /* iOS-style warm neutral background */
    overflow-x: hidden;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    height: 100%;
}

body.page-scroll {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Optional: force-disable page scroll where needed */
body.no-page-scroll {
    overflow: hidden;
}

/* Global heading sizes (reduce oversized Markdown headings) */
h1 { font-size: 1.4rem; line-height: 1.2; }
h2 { font-size: 1.2rem; line-height: 1.25; }
h3 { font-size: 1.05rem; line-height: 1.3; }

.filters-section .accordion-body.no-scroll {
  max-height: none;
  overflow: visible;
}

/* Style for individual results - customize heavily */
.search-result-item {
    border: 1px solid #dee2e6;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #fff;
}

.search-result-item h5 {
    margin-bottom: 5px;
}

.search-result-item p {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #6c757d;
}

.search-result-item .badge {
    margin-right: 5px;
}

/* Chat container */
#chat-messages {
  flex: 1 1 auto;          /* rasteÅ¾e se koliko treba */
  min-height: 0;           /* sprjeÄava rupe */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

/* OpÄ‡a struktura poruke */
.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Poruke AI-a: s lijeve strane */
.chat-message.ai {
    justify-content: flex-start;
}

/* Poruke korisnika: s desne strane, obrnut redoslijed (ikona desno) */
.chat-message.user {
    justify-content: flex-end;
}

/* Balon poruke - zajedniÄki za AI i korisnika */
.chat-bubble {
    background-color: #f1f3f5;
    color: #212529;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;   /* manji tekst */
    padding: 0.5rem 0.75rem;  /* manje unutarnjeg razmaka */
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Desni tekst u korisniÄkim balonima */
.chat-message.user .chat-bubble {
    background-color: #f8f9fa;
    margin-left: auto;
    text-align: left;
}

/* Lijevi tekst u AI balonima (opcionalno, veÄ‡ je default) */
.chat-message.ai .chat-bubble {
    text-align: left;
    border-bottom-left-radius: 0.25rem;
}

/* Ikonice za korisnika i AI */
.chat-icon, .chat-avatar {
    background-color: #dee2e6;
    color: #495057;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Razmak ikonica */
.chat-message.user .chat-icon,
.chat-message.user .chat-avatar {
    margin-left: 0.5rem;
}

.chat-message.ai .chat-icon,
.chat-message.ai .chat-avatar {
    margin-right: 0.5rem;
}

/* Prijelom dugih rijeÄi */
.chat-bubble.text-break {
    word-break: break-word;
}

.chat-message.ai .chat-bubble {
  max-width: 90%;   /* AI neka koristi punu Å¡irinu kontejnera */
}

.chat-message.user .chat-bubble {
  max-width: 70%;    /* korisnik malo uÅ¾e, izgleda urednije */
}


/* Responsive (opcionalno) */
@media (max-width: 576px) {
    .chat-bubble {
        max-width: 100%;
    }
}

#ainesa-prompt {
  font-size: 0.9rem;
}

.workflow-input {
  min-width: 0;
}

.workflow-input.has-verb #ainesa-prompt {
  padding-top: 2.1rem;
}

.workflow-verb-chip {
  position: absolute;
  top: 0.35rem;
  left: 0.5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e8f1ff;
  border: 1px solid #b7d0ff;
  color: #1f3b73;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1;
}

.workflow-verb-chip .btn-close {
  opacity: 0.7;
  font-size: 0.6rem;
}

.workflow-verb-overlay {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(122,148,172,0.48);
  border-radius: var(--ios-radius-sm);
  background: rgba(248,251,255,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--brand-600);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.16,1,.3,1);
}

.workflow-verb-overlay:hover {
  background: rgba(232,244,251,0.96);
  border-color: var(--brand-500);
  border-style: solid;
  color: var(--brand-700);
  box-shadow: 0 2px 8px rgba(11,56,83,.08);
}

.workflow-input.has-verb .workflow-verb-overlay {
  display: none;
}

.ainesa-body {
  position: relative;
}

.workflow-verb-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.workflow-verb-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.workflow-verb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.workflow-verb-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.workflow-verb-collapse {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  margin-bottom: 8px;
  z-index: 11;
}

.workflow-verb-panel {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(209,226,242,0.75);
  border-radius: var(--ios-radius);
  box-shadow: 0 20px 50px rgba(15,23,42,0.13), 0 4px 12px rgba(11,56,83,.06);
  padding: 0.5rem;
}
.workflow-verb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brand-700);
  border-bottom: 1px solid rgba(11,56,83,0.08);
  margin-bottom: 0.25rem;
}

.workflow-verb-panel-body {
  padding: 0 0.25rem 0.5rem;
  overflow: visible;
}

.workflow-verb-detail {
  background: rgba(247,251,255,0.80);
  border: 1px solid rgba(122,148,172,0.18);
  border-radius: var(--ios-radius-sm);
  padding: 0.75rem;
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
}

.workflow-verb-detail h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.workflow-verb-detail .workflow-verb-example {
  background: #f7faff;
  border: 1px solid #e6edf7;
  border-left: 3px solid var(--brand-500);
  border-radius: 0.5rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

#workflowVerbList {
  max-height: none !important;
  overflow: visible !important;
}

.workflow-verb-panel .list-group-item.workflow-verb-active {
  background: var(--brand-150);
  border-color: rgba(122,148,172,0.40);
  color: var(--brand-700);
  border-radius: var(--ios-radius-sm) !important;
}

.workflow-verb-modal-body {
  height: 360px;
  overflow: hidden;
}

#ask-ainesa-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
#ask-ainesa-btn.btn-light-brand {
  background-color: #F0A78A !important;
  border-color: #F0A78A !important;
  color: #fff !important;
}
#ask-ainesa-btn.btn-light-brand:hover,
#ask-ainesa-btn.btn-light-brand:focus-visible {
  background-color: #e08870 !important;
  border-color: #e08870 !important;
  box-shadow: 0 0 0 0.2rem rgba(240, 167, 138, 0.35) !important;
}
#ask-ainesa-btn.btn-light-brand:active {
  background-color: #cc6e52 !important;
  border-color: #cc6e52 !important;
}

.ainesa-body {
  display: flex;
  flex-direction: column;
  height: 75vh;      /* ili koliko Å¾eliÅ¡ od viewport visine */
  max-height: 100%;  /* da ne puca */
}

.ainesa-body #chat-messages {
  flex: 1 1 auto;
  min-height: 0;     /* bitno da ne ostavlja prazninu */
}


/* --- Markdown u chat balonima --- */
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3,
.chat-bubble h4, .chat-bubble h5, .chat-bubble h6 {
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
}

.chat-bubble p { margin: 0.5rem 0; }
.chat-bubble ul, .chat-bubble ol { margin: 0.5rem 0 0.5rem 1.25rem; }
.chat-bubble li + li { margin-top: 0.25rem; }

.chat-bubble a { color: #0d6efd; text-decoration: underline; }
.chat-bubble a:hover { text-decoration: none; }

/* Inline code */
.chat-bubble :not(pre) > code {
  background: #f6f8fa;
  border: 1px solid #e9ecef;
  padding: .1rem .35rem;
  border-radius: .35rem;
  font-size: 0.9em;
}

/* Code block (hljs friendly) */
.chat-bubble pre {
  background: #f6f8fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  margin: 0.5rem 0;
}
.chat-bubble pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

/* Tablice */
.chat-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
.chat-bubble th, .chat-bubble td {
  border: 1px solid #e9ecef;
  padding: 6px 8px;
  vertical-align: top;
}
.chat-bubble thead th { background: #f8f9fa; }

/* Blok citati */
.chat-bubble blockquote {
  border-left: 4px solid #e9ecef;
  padding: .25rem .75rem;
  color: #6c757d;
  margin: .5rem 0;
}

/* Horizontalna linija */
.chat-bubble hr {
  border: 0;
  border-top: 1px solid #e9ecef;
  margin: .75rem 0;
}

/* Slike unutar poruke */
.chat-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* SprijeÄi razbijanje layouta zbog super dugih rijeÄi/linkova */
.chat-bubble p,
.chat-bubble li {
  overflow-wrap: anywhere;
}

.chat-bubble a {
  word-break: break-word; /* mekÅ¡e od break-all */
  outline: none;
}
.chat-bubble a:focus-visible {
  outline: 2px solid rgba(13,110,253,.35);
  outline-offset: 2px;
}

/* Ako hljs tema postavlja svoju pozadinu, poniÅ¡ti je da se slaÅ¾e s tvojim .pre backgroundom */
.chat-bubble pre code.hljs {
  background: transparent !important;
}

/* Lagani polish avatara */
.chat-avatar {
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* Kontejner za akcije (Copy / Report) */
.chat-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

/* Dugmad unutar chat akcija */
.chat-actions .btn-action {
  background: transparent;
  border: none;
  color: #6c757d;          /* sivo */
  font-size: 0.8rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

/* Hover efekt */
.chat-actions .btn-action:hover {
  background: #e9ecef;
  color: #212529;
}

/* RazliÄite boje za specifiÄne akcije */
.chat-actions .btn-copy:hover {
  color: #0d6efd;  /* plava za Copy */
}

.chat-actions .btn-report:hover {
  color: #dc3545;  /* crvena za Report */
}

/* More (tri toÄke) dugme unutar AI balona */
.chat-more .btn.btn-link {
  color: #6c757d;
  text-decoration: none;
}
.chat-more .btn.btn-link:hover {
  color: #0d6efd;
}

/* Drop-down unutar chat balona nek bude malo "zbijeniji" */
.chat-more .dropdown-item {
  font-size: 0.85rem;
  padding: .375rem .75rem;
  color: #212529;
}

/* Hover efekt */
.chat-more .dropdown-item:hover {
  background-color: #f1f3f5; /* svijetlija siva */
  color: #212529;
}

/* Active (kliknut) efekt */
.chat-more .dropdown-item:active {
  background-color: #dee2e6 !important; /* tamnija siva umjesto plave */
  color: #212529 !important;
}

/* Inline varijanta akcija (gore desno uz tekst) */
.chat-bubble.d-flex .chat-more-inline {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
  align-self: flex-start;
  flex-shrink: 0;
}

/* Poravnaj sadrÅ¾aj i â€œmoreâ€ meni u balonu */
.chat-bubble.d-flex {
  align-items: flex-start;
  gap: .5rem;
}


/* Malo smanji padding balona na mobitelu */
@media (max-width: 576px) {
  .chat-bubble {
    padding: 0.6rem 0.75rem;
  }
}

/* (Opcionalno) Uvijek prikaÅ¾i horizontalni scroll za code blokove na mobilnim */
@media (max-width: 576px) {
  .chat-bubble pre {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
  }
}

/* Kontejner za toÄkice */
.typing-indicator {
  display: flex;       /* Poravnaj toÄkice jednu do druge */
  align-items: center; /* Vertikalno ih centriraj */
  justify-content: center; /* Horizontalno ih centriraj unutar chat bubble-a */
  padding: 10px 0;     /* Malo razmaka gore i dolje */
}

/* Stil samih toÄkica */
.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #9ca3af; /* Svijetlo siva boja, moÅ¾ete je promijeniti */
  border-radius: 50%;     /* ÄŒini ih okruglima */
  margin: 0 3px;          /* Mali razmak izmeÄ‘u toÄkica */
  
  /* Povezivanje s animacijom koju definiramo ispod */
  animation: bounce 1.2s infinite ease-in-out;
}

/* KaÅ¡njenje animacije za svaku toÄkicu kako bi se stvorio "val" efekt */
.typing-indicator span:nth-child(1) {
  animation-delay: -0.3s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0s;
}

.highlighted-title {
    font-weight: 600;     /* malo jaÄe od normalnog */
    color: #0d6efd;       /* Bootstrap primary plava */
}

/* Definicija same animacije "skakanja" */
@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0); /* Vrati se na poÄetnu poziciju */
  }
  40% {
    transform: translateY(-6px); /* SkoÄi prema gore */
  }
}

.search-result-item .add-to-project-btn {
  white-space: nowrap;
}

/* Ako Å¾eliÅ¡ da se â€œâž• Dodaj u projektâ€ vizualno odvoji od linkova */
.search-result-item .mt-2.d-flex .add-to-project-btn {
  margin-left: auto; /* gurni gumb u desno */
}

/* Badge za aktivni projekt (ako ga u toolbaru ne Å¾eliÅ¡ default plavi) */
#active-project-name.badge {
  background-color: #0d6efd; /* Bootstrap primary */
  color: #fff;
}

/* Rezultati pretrage: linkovi + gumb u istom redu */
.search-result-item .actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* razmak izmeÄ‘u linkova i gumba */
  flex-wrap: nowrap; /* sprijeÄi prelamanje u novi red */
}

.search-result-item .actions-row a,
.search-result-item .actions-row button {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ---------- Projekti (gornja tablica) ---------- */
.projects-inline-header {
  background: linear-gradient(180deg, rgba(13,110,253,0.06), rgba(13,110,253,0.00));
  border-bottom: 1px solid rgba(13,110,253,.15);
}

.table-projects > tbody > tr {
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.table-projects > tbody > tr:hover {
  background-color: #f8fafc; /* vrlo svijetla */
}
.table-projects > tbody > tr.expanded {
  background-color: #f3f7ff; /* naglasi otvoren red */
  box-shadow: inset 0 1px 0 rgba(13,110,253,.1), inset 0 -1px 0 rgba(13,110,253,.08);
}

.table-projects .project-name {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
}
.table-projects .project-name .chev {
  font-size: .9rem;
  transition: transform .15s ease;
  color: #6c757d;
}
.table-projects tr[aria-expanded="true"] .project-name .chev {
  transform: rotate(90deg);
}

/* ---------- Detalji (podtablica odluka) ---------- */
.project-details {
  background: var(--bs-body-bg);
  border-left: 4px solid rgba(13,110,253,.35);
  border-top: 1px solid rgba(0,0,0,.06);
  border-bottom: 1px solid rgba(0,0,0,.04);
  border-radius: 0 6px 6px 6px;
}

/* manji font i zbijen raspored u podtablici */
.project-details .details-table,
.project-details .table {
  font-size: .875rem; /* manji od projekata */
}
.project-details .table thead {
  background: #f1f3f5;
}
.project-details .table tbody tr:hover {
  background: #fafbfe;
}

/* â€œbadgeâ€ broj odluka */
.project-details .count-badge {
  font-size: .75rem;
  border: 1px solid rgba(0,0,0,.08);
}

/* sekundarne informacije */
.project-details .meta {
  color: #6c757d;
  font-size: .8rem;
}

/* gumbi u detaljima */
.project-details .btn {
  --bs-btn-padding-y: .2rem;
  --bs-btn-padding-x: .5rem;
  --bs-btn-font-size: .8rem;
}

/* Manji font i kompaktniji razmak u podtablici presuda unutar projekta */
.project-details .details-table {
  font-size: 0.75rem; /* â‰ˆ13px; po Å¾elji 0.875rem (14px) */
  line-height: 1.25;
}

.project-details .details-table th,
.project-details .details-table td {
  padding: 0.25rem 0.5rem; /* zbijenije od .table-sm */
  vertical-align: middle;
}

/* Ako u podtablici ima bedÅ¾eva ili meta teksta, i njih smanji: */
.project-details .details-table .badge,
.project-details .details-table .meta,
.project-details .details-table .text-muted {
  font-size: 0.75rem; /* â‰ˆ12px */
}

.project-details .details-title {
  font-size: 0.875rem;
  line-height: 1.2;
}
.project-details .details-title .badge {
  font-size: 0.70rem;
  padding: 0.2em 0.5em;
}



/* --- Stil za tablice projekata i odluka --- */
.table, 
.table tbody tr,
.details-table tbody tr {
  background-color: #ffffff !important;  /* svi redovi bijeli */
}

.table tbody tr:hover,
.details-table tbody tr:hover {
  background-color: #f1f3f5 !important;  /* svijetlosiva na hover */
  cursor: pointer;
}

/* Ako koristiÅ¡ .card za odluke iz pretrage */
.search-result-item.card:hover {
  background-color: #f8f9fa;   /* lagano posvijetli */
  transition: background-color 0.2s ease-in-out;
}

/* Stil za button Napredna semantiÄka pretraga */
.btn-advanced-search {
  display: block;           /* da moÅ¾e biti centriran */
  margin: 1rem auto 0 auto; /* gornji razmak od 1rem, centriranje horizontalno */
  text-align: center;
}

/* Neutralni minimalistiÄki stil za ostale grupe (lijepi kontrast) */
.filters-section .accordion-item:not(:has(.highlighted-title)):not(:has(.additional-title)) .accordion-button {
  background: #ffffff;
  color: #212529;
  border: 1px solid #e9ecef;
  border-radius: .5rem .5rem 0 0;
}
.filters-section .accordion-item:not(:has(.highlighted-title)):not(:has(.additional-title)) .accordion-button:not(.collapsed) {
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.04);
}

/* ===== Istaknuti naslovi (bez gradijenata) + gumb "SemantiÄka pretraga" ===== */
:root{
  /* malo tamnije svijetle pozadine + tamniji tekst + akcent rubovi */
  --sem-bg:   #dfeaff;   /* Napredna â€“ tamnija svijetla plava */
  --sem-edge: #2f6fd8;   /* plavi akcent rub */
  --sem-text: #133a73;   /* tamnoplavi tekst */

  --add-bg:   #dbf3ee;   /* Dodatni â€“ tamnija svijetla teal */
  --add-edge: #208f84;   /* teal akcent rub */
  --add-text: #0e4f47;   /* tamniji teal tekst */
}

/* zajedniÄke postavke za header */
.filters-section .accordion-button{
  border: 0;
  box-shadow: none !important;
  background: #fff !important;          /* default za ostale grupe */
  color: #212529 !important;
  padding: .75rem 1rem;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Napredna semantiÄka pretraga â€” JAÄŒE istaknuta */
.filters-section .accordion-button.highlighted-title{
  font-size: 1.05rem;                   /* mrvu veÄ‡i naslov */
  border-left: 8px solid var(--sem-edge);
  background: var(--sem-bg) !important; /* Äista, bez gradijenta */
  color: var(--sem-text) !important;
}

/* Dodatni filteri â€” SUZDRÅ½ANIJE */
.filters-section .accordion-button.additional-title{
  font-size: .95rem;                    /* mrvu manji naslov */
  border-left: 5px solid var(--add-edge);
  background: var(--add-bg) !important; /* Äista, bez gradijenta */
  color: var(--add-text) !important;
}

/* otvoreno stanje â€“ suptilan donji razdjelnik; chevron standardni */
.filters-section .accordion-button:not(.collapsed){
  border-bottom: 1px solid #e3e7ee;
}
.filters-section .accordion-button::after{
  filter: none !important;
}

/* blagi hover/focus (bez glowa) */
.filters-section .accordion-button:hover,
.filters-section .accordion-button:focus{
  filter: brightness(1.02);
}

/* Gumb "SemantiÄka pretraga" â€“ koherentan s plavim akcentom */
.btn-advanced-search.btn-primary{
  background: #2f6fd8;
  border-color: #1857c1;
  color: #fff;
  border-width: 2px;
  padding: .55rem 1rem;
  font-weight: 700;
  border-radius: .6rem;
}
.btn-advanced-search.btn-primary:hover{ background:#2b66c8; border-color:#1857c1; }
.btn-advanced-search.btn-primary:active{ background:#275db8; border-color:#1857c1; }
.btn-advanced-search.btn-primary:focus{ box-shadow:0 0 0 .15rem rgba(47,111,216,.22); }

/* (opcionalno) full-width gumb na Å¡irim ekranima */
@media (min-width: 576px){
  .btn-advanced-search{ width: 100%; }
}
/* Fina hijerarhija teÅ¾ine teksta za naslove u filter panelu */
.filters-section .accordion-button {
  font-weight: 600; /* default za sve grupe */
}

/* Primarna sekcija â€“ jaÄe */
.filters-section .accordion-button.highlighted-title {
  font-weight: 700;
}

/* Sekundarna sekcija â€“ suptilnije */
.filters-section .accordion-button.additional-title {
  font-weight: 500; /* ili 600 ako Å¾eliÅ¡ mrvu jaÄe */
}


/* === LOGIN PAGE === */
body.login-page{
  min-height:100dvh;                 /* bolje ponaÅ¡anje na mobitelima */
  background: linear-gradient(160deg, #2d98cc 0%, #44ACE1 40%, #5aab9a 72%, #69B39D 100%);
  background-attachment:fixed;
  background-size:cover;
  background-repeat:no-repeat;
}

/* base ima .container.mt-5 â€“ makni taj razmak samo na loginu */
body.login-page .container.mt-5{ margin-top:0 !important; }

.login-wrap{
  min-height:100dvh;
  display:flex; align-items:flex-start; justify-content:center;
  padding-top:2rem; padding-bottom:2rem;   /* smanji za joÅ¡ â€œviÅ¡e goreâ€ */
}

.brand-top{
  text-align:center; color:#fff; font-weight:800; letter-spacing:.4px;
  font-size:1.5rem; margin-bottom:.75rem; text-transform:uppercase;
  text-shadow:0 2px 8px rgba(0,0,0,.3);
}

.login-card{
  width:100%; max-width:420px; border:0; border-radius:24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25), 0 8px 20px rgba(0,0,0,.15);
  overflow:hidden;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(255,255,255,.94);
}
.login-card .card-body{ padding:2rem; }
@media (max-width: 420px){
  .login-card .card-body{ padding:1.25rem; }
}

.btn-brand{
  --bs-btn-bg: var(--accent-500);
  --bs-btn-border-color: var(--accent-500);
  --bs-btn-color:#fff;
  --bs-btn-hover-bg: var(--accent-600);
  --bs-btn-hover-border-color: var(--accent-600);
  --bs-btn-hover-color:#fff;
  --bs-btn-active-bg: var(--accent-700);
  --bs-btn-active-border-color: var(--accent-700);
  --bs-btn-active-color:#fff;
  --bs-btn-focus-shadow-rgb: 240,167,138;
  border-radius: var(--ios-radius-pill) !important;
  font-weight: 600;
}

.footer-note{ color:#fff; text-align:center; opacity:.9; margin-top:.9rem; }

.brand{
  text-align:center;
  /* veliÄina branda â€“ po Å¾elji i responsivno: */
  font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
}

.brand-subtitle{
  color:#fff;
  font-weight:700;
  letter-spacing:.3px;
  text-shadow:0 1px 2px rgba(0,0,0,.25);
  /* koristi istu veliÄinu kao .brand (nasljeÄ‘uje) */
}

.brand-logo{
  height: 2em;   /* ~120% visine slova */
  width: auto;
  display: block;
  margin: 0 auto .35rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
}



  /* === iOS Brand paleta === */
  :root{
    /* Primarna tamno-plava paleta */
    --brand-900: #071e2e;        /* najdublja navy */
    --brand-700: #0B3853;        /* dark navy - tekst, zaglavlja */
    --brand-600: #1a5a7c;        /* mid navy - hover */
    --brand-500: #7A94AC;        /* steel blue - interaktivni elementi */
    --brand-400: #9db0c3;        /* light steel - sekundarni */
    --brand-100: #eef3f8;        /* vrlo svjetla steel blue tinta */
    --brand-150: #e2ecf4;        /* svjetla steel blue tinta */

    /* Akcentna salmon/coral boja za CTA gumbe */
    --accent-500: #F0A78A;       /* salmon - primarna CTA */
    --accent-600: #e08870;       /* tamnji salmon - hover */
    --accent-700: #cc6e52;       /* najdublji salmon */
    --accent-100: #fdf0ea;       /* vrlo svjetla salmon tinta */

    /* Header pozadina - frosted navy efekt */
    --header-bg: rgba(11, 56, 83, 0.04);
    --header-border: rgba(122, 148, 172, 0.25);
    --header-frame: rgba(122, 148, 172, 0.30);
    --brand-shadow: 0 2px 16px rgba(11,56,83,.08), 0 1px 4px rgba(0,0,0,.04);

    /* iOS border-radius */
    --ios-radius: 20px;
    --ios-radius-sm: 12px;
    --ios-radius-pill: 999px;
  }

  /* === Responzivno upravljanje visinom panela === */
  :root {
    --pane-h: calc(100dvh - 111px);
  }

  /* Na desktopu, paneli imaju fiksnu visinu vezanu za visinu prozora */
  @media (min-width: 992px) {
    aside > .card,
    main#main-content-area {
      height: var(--pane-h);
      max-height: var(--pane-h);
    }
    #results-pane-mobile-collapse {
        max-height: calc(100dvh - 168px);
    }
  }

  /* Na mobitelu, visina je automatska kako bi se omoguÄ‡ilo skrolanje stranice */
  @media (max-width: 991.98px) {
    aside > .card,
    main#main-content-area {
      height: auto;
      max-height: none;
    }
    #chat-section {
        min-height: 400px; /* Daje chatu minimalnu visinu na mobitelu */
    }
  }

  main .card.shadow-sm.flex-fill { min-height: 0; }
  .ainesa-body { flex: 1 1 auto; min-height: 0; }
  #chat-messages { flex: 1 1 auto; min-height: 0; }

  /* Utility za zaobljenja */
  .rounded-16 { border-radius: 16px; }
  .rounded-top-16 { border-top-left-radius: 16px; border-top-right-radius: 16px; }

  /* iOS Kartice */
  .pane {
    position: relative;
    border-radius: var(--ios-radius);
    box-shadow: var(--brand-shadow);
    border: 1px solid rgba(122, 148, 172, 0.20);
    background: #fff;
    overflow: hidden;
  }

  /* iOS Header - frosted glass dark navy efekt */
  .pane .card-header.header-brand {
    background: var(--brand-700);
    border-bottom: none !important;
    color: rgba(255,255,255,0.92);
  }
  .pane .card-header.header-brand.framed{
    border: 1px solid rgba(122, 148, 172, 0.15);
    border-bottom: none;
    margin: -1px -1px 0 -1px;
    border-top-left-radius: var(--ios-radius);
    border-top-right-radius: var(--ios-radius);
    box-shadow: none;
  }
  .text-brand-ink { color: rgba(255,255,255,0.92); }

  /* iOS Gumbi */
  /* CTA gumb - salmon akcentna boja */
  .btn-light-brand{
    --bs-btn-bg: var(--accent-500);
    --bs-btn-border-color: var(--accent-500);
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--accent-600);
    --bs-btn-hover-border-color: var(--accent-600);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--accent-700);
    --bs-btn-active-border-color: var(--accent-700);
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 240,167,138;
    border-radius: var(--ios-radius-pill) !important;
    font-weight: 600;
    letter-spacing: 0.01em;
  }
  /* Outline gumb - steel blue */
  .btn-outline-brand{
    --bs-btn-color: var(--brand-700);
    --bs-btn-border-color: rgba(122,148,172,0.5);
    --bs-btn-bg: rgba(255,255,255,0.8);
    --bs-btn-hover-color: var(--brand-700);
    --bs-btn-hover-bg: var(--brand-100);
    --bs-btn-hover-border-color: var(--brand-500);
    --bs-btn-active-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-150);
    --bs-btn-active-border-color: var(--brand-500);
    --bs-btn-focus-shadow-rgb: 122,148,172;
    border-radius: var(--ios-radius-pill) !important;
    font-weight: 500;
  }
  /* Header gumbi (outline-brand unutar tamnog headera) */
  .header-brand .btn-outline-brand {
    --bs-btn-color: rgba(255,255,255,0.85);
    --bs-btn-border-color: rgba(255,255,255,0.3);
    --bs-btn-bg: rgba(255,255,255,0.1);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255,255,255,0.2);
    --bs-btn-hover-border-color: rgba(255,255,255,0.5);
  }
  .cta-btn { align-self: center; height: 38px; min-width: 100px; white-space: nowrap; flex-shrink: 0; }
  .btn-set-sm .btn{ padding:.3rem .8rem; font-size:.825rem; line-height:1.2; }
  .header-compact { padding:.5rem .75rem; }

  /* === iOS KOMPAKTNI REZULTATI === */
  #results-list .search-result-item{
    border: 1px solid rgba(122,148,172,.18);
    border-radius: var(--ios-radius-sm);
    background: #fff;
    box-shadow: 0 1px 4px rgba(11,56,83,.06), 0 0.5px 1px rgba(0,0,0,.04);
    margin-bottom:.35rem !important; font-size:.8rem; line-height:1.25;
    transition: all .2s cubic-bezier(.16,1,.3,1);
  }
  #results-list .search-result-item .card-body{ padding:.25rem .6rem !important; }
  #results-list .search-result-item .card-title{ display:none !important; }
  #results-list .search-result-item .card-text{ display:none !important; }
  .result-compact{ display:grid; gap:.15rem; }
  .rc-row{ width:100%; }
  .rc-row1{ display:flex; align-items:center; gap:.5rem; color: var(--brand-700); }
  .rc-ordinal{
    display:inline-block; min-width:1.6rem; text-align:center;
    padding:0 .35rem; border:1px solid rgba(122,148,172,.25);
    border-radius:6px; background: var(--brand-100); font-weight:700;
    color: var(--brand-700);
  }
  .rc-case{ font-weight:700; }
  .rc-row2{ display:flex; align-items:center; gap:.4rem; color:#475569; }
  .rc-row2 .bi{ font-size:.95em; color: var(--brand-500); }
  .rc-row3{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; color:#475569; }
  .rc-row3 .bi{ font-size:.95em; color: var(--brand-500); }
  .rc-badge{ font-size:.68rem; padding:.15em .4em; border-radius:6px; }

  .rc-actions{ display:flex; gap:.45rem; margin-top:.35rem; align-items:center; width: 100%; }
  .rc-icon-btn{
    display:inline-flex; align-items:center; justify-content:center;
    width:28px; height:28px; border-radius:8px; flex-shrink: 0;
    border:1px solid rgba(122,148,172,.25); background:#fff; color: var(--brand-700);
    text-decoration:none; cursor:pointer;
    transition: all .15s ease;
  }
  .rc-add-btn {
      display: inline-flex; align-items: center; justify-content: center;
      border-radius: 8px; padding: 0.2rem 0.6rem; margin-left: auto;
      text-decoration: none; cursor: pointer; white-space: nowrap;
      font-size: 0.75rem; font-weight: 600;
      border: 1px solid rgba(240,167,138,.4); color: var(--accent-700); background: var(--accent-100);
  }
  .rc-icon-btn .bi, .rc-add-btn .bi{ font-size:14px; line-height:1; }
  .rc-icon-btn:hover { color: var(--brand-700); border-color: rgba(122,148,172,.5); background: var(--brand-100); }
  .rc-add-btn:hover { background-color: var(--accent-500); color: #fff; border-color: var(--accent-500); }
  .rc-add-btn.added, .rc-add-btn:disabled{ border-color:rgba(25,135,84,.45); background:#ecfdf5; color:#146c43; }

  #results-list .search-result-item:hover,
  #results-list .search-result-item:focus-within{
    background-color: var(--brand-100);
    border-color: rgba(122,148,172,.45);
    box-shadow: 0 4px 14px rgba(11,56,83,.10);
    transform: translateY(-1px);
  }
  @media (prefers-reduced-motion: reduce){
    #results-list .search-result-item:hover,
    #results-list .search-result-item:focus-within{ transform: none; }
  }

  .secondary-controls-row {
    border-top: 1px solid rgba(122,148,172,.15);
  }
  .filter-label-inline {
    font-size: .8rem;
    font-weight: 500;
    color: #495057;
  }
  .compact-filters {
    background-color: var(--brand-100); border: 1px solid rgba(122,148,172,.15);
    border-radius: var(--ios-radius-sm); padding: 1rem;
  }
  .compact-filters .filter-heading {
    font-size: .7rem; font-weight: 700;
    text-transform: uppercase; color: var(--brand-500);
    margin-bottom: .6rem; letter-spacing: .5px;
  }
  .compact-filters .form-label-sm {
    font-size: .75rem; margin-bottom: .2rem;
    font-weight: 500; white-space: nowrap;
  }
  .compact-filters .form-check { margin-bottom: .3rem; }
  .compact-filters .form-check-label { font-size: .8rem; }
  .compact-filters .form-check-inline { margin-right: .75rem; }

  #search-section { flex-shrink: 0; }
  #chat-section { flex-grow: 1; min-height: 0; }

  .project-controls-compact {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: .35rem;
    margin-top: .35rem;
  }
  .btn-icon {
      background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.85);
      width: 28px; height: 28px; display: inline-flex; align-items: center;
      justify-content: center; padding: 0; border-radius: 8px;
      transition: all .15s ease;
  }
  .btn-icon:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); color: #fff; }

  @media (min-width: 992px){
    .results-23 { flex: 0 0 20%; max-width: 20%; }
    .main-77    { flex: 0 0 80%; max-width: 80%; }
  }
  /* (po Å¾elji) na XL vrati na 25/75 */
  @media (min-width: 1200px){
    .results-23 { flex: 0 0 22%; max-width: 22%; }
    .main-77    { flex: 0 0 78%; max-width: 78%; }
  }
  
 /* Primijeni istu Å¡irinu na OBA plivajuÄ‡a menija */
@media (min-width: 1200px) {
  #projectsOffcanvas,
  #dkomProjectsOffcanvas {
    --bs-offcanvas-width: 600px;
  }
}

/* Primijeni istu Å¡irinu na OBA menija na malim ekranima */
@media (max-width: 576px) {
  #projectsOffcanvas,
  #dkomProjectsOffcanvas {
    --bs-offcanvas-width: 100vw;
  }
}

/* ============================================= */
/* === PROJEKT KARTICE (ZajedniÄki stilovi) === */
/* ============================================= */

#project-list-container,
#dkom-project-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-card {
    border: 1px solid #e0e5ec;
    border-left: 4px solid #ced4da;
    border-radius: 8px;
    background-color: #ffffff;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.project-card:hover {
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.project-card.active {
    border-color: #a9cfff;
    border-left-color: #0d6efd;
    background-color: #f7faff;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.project-card-title {
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.project-card-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

/* 1. UkljuÄi Flexbox na zaglavlje kartice */
.project-card-header {
  display: flex;                 
  justify-content: space-between;  
  align-items: center;           
  gap: 8px;                      /* Stvara mali razmak izmeÄ‘u naslova i akcija */
}

/* 2. Definiraj kako se naslov treba ponaÅ¡ati (fleksibilni dio) */
.project-card-title {
  /* Dozvoli mu da raste i da se smanjuje ovisno o prostoru */
  flex-grow: 1;                  
  flex-shrink: 1;                
  
  /* KLJUÄŒNI DIO: OmoguÄ‡uje smanjivanje ispod prirodne Å¡irine teksta */
  min-width: 0;                  

  /* CSS recept za skraÄ‡ivanje teksta i dodavanje "..." */
  white-space: nowrap;           
  overflow: hidden;              
  text-overflow: ellipsis;       
}

/* 3. Osiguraj da se blok s akcijama nikada ne smanjuje (fiksni dio) */
.project-card-actions {
  flex-shrink: 0;                
}

.project-card-actions .btn {
    --bs-btn-padding-y: .1rem;
    --bs-btn-padding-x: .4rem;
    --bs-btn-font-size: .75rem;
}

.project-card-actions .btn-link {
    font-size: 1rem;
    padding: 0.25rem !important;
}

.project-card-meta {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.1rem;
}

.project-details-content-wrapper {
    padding: 0.75rem 0.25rem 0.25rem 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.project-description {
    font-size: 0.8rem;
    color: #495057;
    margin-bottom: 1rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.documents-list-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.documents-table {
    font-size: 0.75rem;
}

.documents-table td,
.documents-table th {
    padding: 0.3rem 0.4rem;
}

.btn-xs {
    --bs-btn-padding-y: .1rem;
    --bs-btn-padding-x: .3rem;
    --bs-btn-font-size: .7rem;
    --bs-btn-border-radius: .2rem;
}

/* ============================================= */
/* === OFFCANVAS PROJEKT HEADER === */
/* ============================================= */

#projectsOffcanvas .offcanvas-header,
#dkomProjectsOffcanvas .offcanvas-header {
    background: var(--brand-150);
    border-bottom: 2px solid var(--brand-100);
}

#projectsOffcanvas .offcanvas-title,
#dkomProjectsOffcanvas .offcanvas-title {
    color: var(--brand-700);
    font-weight: 700;
}

/* Novi projekt gumb */
#open-create-project-from-offcanvas,
#dkom-new-project-btn {
    background: var(--brand-500);
    border: 0;
    border-radius: 8px;
    font-weight: 600;
}

#open-create-project-from-offcanvas:hover,
#dkom-new-project-btn:hover {
    background: var(--brand-600);
}

/* ============================================= */
/* === PROJEKT KARTICE - DODATNI DETALJI === */
/* ============================================= */

/* Ikona foldera u naslovu */
.project-card-title .bi-folder {
    color: var(--brand-500);
}

/* Badge s brojem dokumenata */
.project-card-title .badge {
    font-size: 0.6rem;
    padding: .15em .4em;
    border-radius: 6px;
    background: var(--brand-500);
    color: white;
}

/* Hover state za projekt kartice */
.project-card:hover {
    border-left-color: var(--brand-500);
}

.project-card.active {
    border-left-color: var(--brand-600);
}

/* Gumb akcije styling */
.project-card-actions .btn-outline-primary {
    border-color: var(--brand-500);
    color: var(--brand-600);
}

.project-card-actions .btn-outline-primary:hover {
    background: var(--brand-150);
    border-color: var(--brand-600);
}

.project-card-actions .btn-link:hover {
    color: var(--brand-600);
}

/* Tablica dokumenata - header */
.documents-table th {
    background: var(--brand-100);
    font-weight: 600;
    padding: .35rem .5rem;
}

.documents-table td {
    padding: .35rem .5rem;
}

.documents-table tbody tr:hover {
    background: var(--brand-100);
}

.documents-table .btn-xs {
    padding: .15rem .35rem;
    font-size: 0.65rem;
}

/* Empty state */
.documents-list-wrapper .text-muted {
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
    color: #6c757d;
}

/* ============================================= */
/* === AI DISCLAIMER (HEADER PILL VERSION) === */
/* ============================================= */

.ai-disclaimer.disclaimer-pill {
  padding: 0.2rem 0.6rem;
  font-size: 0.65rem;
  color: #0a4f7c;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  border: 1px solid rgba(13, 110, 253, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.ai-disclaimer.disclaimer-pill i {
  font-size: 0.7rem;
  color: #0d6efd;
}

/* DKOM override (za teal boju) */
body.dkom-page .ai-disclaimer.disclaimer-pill,
#chat-section .ai-disclaimer.disclaimer-pill {
  color: #0a4f45;
  border-color: rgba(20, 184, 166, 0.25);
}

body.dkom-page .ai-disclaimer.disclaimer-pill i,
#chat-section .ai-disclaimer.disclaimer-pill i {
  color: #14b8a6;
}

/* Sakrij na mobitelu ako header postane pretrpan */
@media (max-width: 767px) {
  .ai-disclaimer.disclaimer-pill {
      font-size: 0.6rem;
      padding: 0.15rem 0.5rem;
  }
}

/* iOS Navbar - dark navy */
nav.navbar {
  background-color: var(--brand-700);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 4px 16px rgba(11,56,83,0.3);
}

.navbar .navbar-nav .nav-item {
  margin: 0 0.1rem;
}

/* Aktivni nav-link - iOS pill stil */
.navbar .nav-link.active {
  font-weight: 600;
  background-color: rgba(240, 167, 138, 0.2);
  color: var(--accent-500) !important;
  border: 1px solid rgba(240, 167, 138, 0.4);
  border-radius: var(--ios-radius-pill);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.navbar .nav-link:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: var(--ios-radius-pill);
}

/* Dropdown pozadina - tamno navy, iOS stil */
.navbar .dropdown-menu {
  background-color: rgba(11, 40, 62, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--ios-radius-sm);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.2);
}

.navbar .dropdown-item {
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  margin: 1px 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

.navbar .dropdown-item:hover {
  background-color: rgba(240, 167, 138, 0.15);
  color: var(--accent-500);
}

/* Aktivna stavka u dropdownu */
.navbar .dropdown-item.active,
.navbar .dropdown-item:active {
  background-color: rgba(240, 167, 138, 0.25);
  color: var(--accent-500);
  font-weight: 600;
}

/* Dropdown header */
.navbar .dropdown-header {
  color: rgba(255,255,255,0.35);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.navbar .dropdown-divider {
  border-color: rgba(255,255,255,0.08);
}

/* Navbar brand */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
}

.navbar-brand img {
  display: block;
  position: relative;
  top: -2px;
}

/* Profil dropdown badge poravnanje */
.navbar .nav-link .badge {
  font-size: 0.65rem;
  padding: 0.25em 0.45em;
}

/* ==========================================
   AINESA QUANTUM — Navbar atom + shimmer
   ========================================== */

.quantum-atom-icon {
  vertical-align: -0.25em;
  margin-right: 0.3rem;
  filter: drop-shadow(0 0 3px rgba(68, 172, 225, 0.4));
}

/* Shimmer text: Ainesa plava (#44ACE1) ↔ Ainesa zelena (#69B39D) */
@keyframes quantumShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.quantum-shimmer-text {
  background: linear-gradient(
    90deg,
    #44ACE1 0%,
    #69B39D 25%,
    #44ACE1 50%,
    #69B39D 75%,
    #44ACE1 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: quantumShimmer 4s linear infinite;
  font-weight: 600;
}

/* Active state keeps shimmer but adds pill */
.quantum-nav-link.active .quantum-shimmer-text {
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   USER DOCUMENTS - UPLOAD & MANAGEMENT
   ========================================== */

/* Upload Docs Button (pored chat input) */
.upload-docs-btn {
    position: relative;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(122,148,172,0.38);
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--brand-600);
    transition: all 0.2s cubic-bezier(.16,1,.3,1);
    margin-right: 0.5rem;
    border-radius: var(--ios-radius-sm);
}

.upload-docs-btn:hover {
    background: rgba(248,251,255,0.96);
    border-color: var(--brand-500);
    color: var(--brand-700);
    box-shadow: 0 2px 8px rgba(11,56,83,.08);
}

.upload-docs-btn i {
    font-size: 1.25rem;
}

.doc-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.65rem;
    padding: 0.2rem 0.35rem;
    border-radius: 10px;
}

/* ==================== OFFCANVAS USER DOCS ==================== */
#offcanvasUserDocs {
  width: 380px !important;
}
#offcanvasUserDocs .offcanvas-header {
  background: var(--brand-700);
  padding: 1rem 1.25rem;
}
#offcanvasUserDocs .offcanvas-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
#offcanvasUserDocs .offcanvas-title i {
  color: var(--accent-500);
}
#offcanvasUserDocs .offcanvas-title #docCountBadge {
  background: rgba(255,255,255,.15) !important;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--ios-radius-pill);
  padding: 2px 8px;
}
#offcanvasUserDocs .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}
#offcanvasUserDocs .offcanvas-body {
  background: #f4f7fa;
  padding: 1rem;
}

/* Upload Zone (Drag & Drop) */
.upload-zone {
    border: 2px dashed rgba(122,148,172,.4);
    border-radius: var(--ios-radius-sm);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.25s cubic-bezier(.16,1,.3,1);
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(11,56,83,.05);
}

.upload-zone:hover {
    border-color: var(--brand-500);
    background: var(--brand-100);
}

.upload-zone.drag-over {
    border-color: var(--accent-500);
    background: var(--accent-100);
    transform: scale(1.015);
    box-shadow: 0 4px 16px rgba(240,167,138,.2);
}

.upload-zone-content {
    pointer-events: none;
}

.upload-zone-content i.display-4 {
    font-size: 2.4rem;
    color: var(--brand-400) !important;
}

.upload-zone-content h6 {
    font-weight: 600;
    color: var(--brand-700);
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.upload-zone-content .text-muted {
    font-size: 0.78rem;
    color: var(--brand-400) !important;
}

#selectFilesBtn {
    border-radius: var(--ios-radius-pill) !important;
    border-color: var(--brand-500);
    color: var(--brand-600);
    font-size: 0.82rem;
    padding: 0.35rem 1rem;
    font-weight: 500;
}
#selectFilesBtn:hover {
    background: var(--brand-100);
    border-color: var(--brand-600);
    color: var(--brand-700);
}

.upload-requirements {
    padding: 0.55rem 0.75rem;
    background: var(--brand-100);
    border-radius: var(--ios-radius-sm);
    border: 1px solid rgba(122,148,172,.18);
}
.upload-requirements small {
    color: var(--brand-500);
    font-size: 0.75rem;
}

/* Upload Progress */
.upload-progress {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: var(--ios-radius-sm);
    border: 1px solid rgba(122,148,172,.18);
}
.upload-progress .progress {
    height: 4px;
    border-radius: var(--ios-radius-pill);
    background: rgba(122,148,172,.18);
}
.upload-progress .progress-bar {
    background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
    border-radius: var(--ios-radius-pill);
}
.upload-progress .spinner-border {
    color: var(--accent-500) !important;
}

/* Documents List */
.documents-list {
    max-height: none;
    overflow-y: visible;
}

.documents-list h6 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--brand-500);
    margin-bottom: 0.6rem;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem;
    background: #fff;
    border: 1px solid rgba(122,148,172,.18);
    border-radius: var(--ios-radius-sm);
    margin-bottom: 0.45rem;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(11,56,83,.04);
}

.document-item:hover {
    box-shadow: 0 2px 10px rgba(11,56,83,.09);
    border-color: rgba(122,148,172,.38);
    background: var(--brand-100);
}

.document-item-number {
    flex-shrink: 0;
    width: 18px;
    text-align: right;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--brand-400);
    padding-right: 0;
}

.document-item-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-right: 0;
}

.document-item-icon.pdf { color: #e05252; }

.document-item-icon.doc,
.document-item-icon.docx { color: var(--brand-500); }

.document-item-details {
    flex-grow: 1;
    min-width: 0;
}

.document-item-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--brand-700);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-item-meta {
    font-size: 0.72rem;
    color: var(--brand-400);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.document-item-meta span {
    display: inline-flex;
    align-items: center;
}

.document-item-meta i { margin-right: 0.2rem; }

.document-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-delete-doc {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--ios-radius-pill) !important;
    border-color: rgba(204,110,82,.35);
    color: var(--accent-700);
}
.btn-delete-doc:hover {
    background: rgba(204,110,82,.08);
    border-color: rgba(204,110,82,.6);
}

/* OCR Badge */
.ocr-badge {
    background: rgba(229,192,123,.2);
    color: #b58c30;
    border: 1px solid rgba(229,192,123,.5);
    font-size: 0.62rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
}

/* Doc summary popover */
.doc-summary-popover {
    max-width: 320px;
}

.doc-summary-popover .popover-header {
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--brand-100);
    border-bottom: 1px solid rgba(122,148,172,.2);
    padding: 6px 12px;
    color: var(--brand-700);
}

.doc-summary-popover .popover-body {
    font-size: 0.80rem;
    line-height: 1.55;
    color: #374151;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 12px;
}

.document-item[data-summary] { cursor: default; }

/* Empty State */
#emptyState {
    padding: 2rem 1rem;
}
#emptyState i {
    color: var(--brand-400);
    opacity: 0.4;
}
#emptyState p {
    color: var(--brand-500);
    font-size: 0.84rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-zone { padding: 1.25rem 0.75rem; }
    .document-item { flex-wrap: wrap; }
    .document-item-actions {
        flex-direction: row;
        width: 100%;
        margin-top: 0.25rem;
    }
}


/* ==================== ANNOUNCEMENT MODAL ==================== */

#announcementModal .modal-content {
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#announcementModal .modal-header {
  background-color: #0d6efd;
  color: white;
  border: none;
  padding: 1.25rem 1.5rem;
}

#announcementModal .modal-title {
  font-weight: 600;
  font-size: 1rem;
}

#announcementTimestamp {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

#announcementModal .modal-header .btn-close {
  filter: brightness(0) invert(1);
}

#announcementModal .modal-body {
  padding: 1.5rem;
}

#announcementText {
  color: #212529;
  line-height: 1.6;
}

#announcementModal .modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

/* ==================== INBOX STYLES (GMAIL-LIKE, COMPACT) ==================== */

.inbox-list {
  background: white;
  border-radius: 8px;
  overflow: hidden; /* Osigurava da se border-radius primijeni na sadrÅ¾aj */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #dee2e6; /* Vanjski rub oko cijele liste */
}

.inbox-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef; /* Linija izmeÄ‘u poruka */
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-left: 4px solid transparent; /* Priprema za unread stanje */
}

.inbox-item:hover {
  background: #f8f9fa; /* Suptilni hover efekt kao u Gmailu */
}

.inbox-item:last-child {
  border-bottom: none; /* Uklanja liniju ispod zadnje poruke */
}

.inbox-item.unread {
  background: var(--brand-100, #eaf6ff);
  border-left-color: var(--brand-500, #2b9fd3);
}

.inbox-item.unread .inbox-title {
  font-weight: 700; /* JaÄi bold za neproÄitane naslove */
  color: var(--brand-700, #1f7fa9);
}

.inbox-status {
  padding-right: 1rem;
  padding-top: 0.2rem;
}

.priority-icon {
  font-size: 1rem;
  width: 20px;
}

.priority-icon.priority-info::before { content: "\2139\FE0F"; }
.priority-icon.priority-success::before { content: "\2705"; }
.priority-icon.priority-warning::before { content: "\26A0\FE0F"; }
.priority-icon.priority-error::before { content: "\274C"; }

.inbox-content {
  flex: 1;
  min-width: 0;
}

/* NOVO: Flex kontejner za labele i tekst */
.inbox-details-line {
    display: flex;
    align-items: baseline; /* Poravnava osnovnu liniju teksta */
    gap: 0.5rem;
}

/* NOVO: Stil za labele "Naslov:" i "SadrÅ¾aj:" */
.inbox-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    flex-shrink: 0; /* SprjeÄava da se labela smanji ako je naslov dug */
}

.inbox-title {
  font-size: 0.9rem;
  color: #212529;
  font-weight: 500;
  margin: 0; /* Resetiramo marginu s h5 taga */
  
  /* SprjeÄava prelamanje i dodaje '...' ako je naslov predug */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-preview {
  font-size: 0.8rem;
  color: #6c757d;
  line-height: 1.4;
  margin: 0; /* Resetiramo marginu s p taga */

  /* OgraniÄava pregled na jedan redak */
  display: -webkit-box;
  -webkit-line-clamp: 1; 
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inbox-content small.text-muted {
    font-size: 0.75rem;
    white-space: nowrap; /* SprjeÄava prelamanje datuma */
}

/* Paginacija ostaje ista */
.pagination { margin-top: 1.5rem; }
.pagination .page-link { color: var(--brand-600, #238ebd); border-color: #dee2e6; }
.pagination .page-item.active .page-link { background-color: var(--brand-500, #2b9fd3); border-color: var(--brand-500, #2b9fd3); color: #fff; }
.pagination .page-link:hover { background-color: var(--brand-100, #eaf6ff); }

#chat-messages :not(pre) > code {
  background: #f6f8fa;
  border: 1px solid #e9ecef;
  padding: .1rem .35rem;
  border-radius: .35rem;
  font-size: 0.9em;
  color: #212529 !important; /* preskoÄi rozu / teme od hljs-a */
}

/* Court (plavi ton) */
.ctx-court #chat-messages :not(pre) > code {
  background: rgba(13,110,253,.08);
  border-color: rgba(13,110,253,.25);
  color: #0a58ca !important;
}

/* DKOM (teal ton) â€“ koristi postojeÄ‡e DKOM varijable ako postoje */
.ctx-dkom #chat-messages :not(pre) > code {
  background: var(--dkom-100, #e6f7f5);
  border-color: rgba(20,184,166,.35);
  color: var(--dkom-700, #0e7a6e) !important;
}

/* Kompaktan, fiksne dimenzije â€“ bez skakanja layouta */
.search-toggle {
  min-width: 64px;
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 700;
  border-width: 1.5px;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.search-toggle:hover,
.search-toggle:focus-visible {
  background-color: var(--brand-100);
  color: var(--brand-ink);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--brand-500) 22%, transparent);
}

.search-toggle .icon-expanded {
  display: inline-block;
}
.search-toggle .icon-collapsed {
  display: none;
}

/* Kad je zatvoreno (Bootstrap doda .collapsed na gumb) */
.search-toggle.collapsed .icon-expanded {
  display: none;
}
.search-toggle.collapsed .icon-collapsed {
  display: inline-block;
}

.pane { overflow: hidden; }

/* 2. Default framed header (otvoreno stanje) â€“ kao i do sada */
#search-section .card-header.header-brand.framed {
  margin: -2px -2px 0 -2px;       /* kompenzira okvir .pane (2px) gore+boÄno */
  border: 2px solid var(--header-frame);
  border-bottom: none;             /* prelazi u body */
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

/* 3. Kad je collapse ZATVOREN, header postaje "cijela kartica": 
      - vrati donji border
      - zaobli i donje rubove
      - margin: -2px sa SVA 4 ruba da okvir bude oko svega
*/
#search-section .card-header.header-brand.framed:has(+ #search-body.collapse:not(.show)) {
  margin: -2px;                                  /* kompenzira okvir oko cijele kartice */
  border-bottom: 2px solid var(--header-frame);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* ============================================= */
/* === PREVIEW (SCOPED) â€“ COMPACT CARD STYLE === */
/* ============================================= */

/* Animacija samo za panel */
@keyframes ainesaPreviewIn {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Panel â€“ scope je .ainesapreview-panel */
.ainesapreview-panel{
  position: fixed !important;         /* pozicionira ga JS */
  max-width: 420px;
  background: #fff;
  border: none;
  border-radius: 12px;
  overflow: hidden;              /* panel NE scrolla */
  box-shadow:
    0 0 0 1px rgba(31,127,169,.08),
    0 8px 24px rgba(31,127,169,.12),
    0 16px 48px rgba(0,0,0,.08);
  animation: ainesaPreviewIn .18s cubic-bezier(.16,1,.3,1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header (samo unutar panela) */
.ainesapreview-panel .preview-title{
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: #fff;
  padding: .55rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  border-bottom: 2px solid var(--brand-150);
  display: flex; align-items: center; gap: .4rem;
}

/* Tijelo â€“ JEDINI scroll je ovdje */
.ainesapreview-panel .preview-body{
  background: #fff;
  padding: .5rem;
  max-height: 360px;             /* kompaktnije */
  overflow: auto;                /* jedini scrollbar */
  font-size: .76rem;             /* manji font */
  line-height: 1.35;
  color: #3f4950;
  scroll-behavior: smooth;
}

/* Kartice (heading + njegov sadrÅ¾aj) â€“ samo unutar panela */
.ainesapreview-panel .preview-card{
  background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
  border: 1px solid var(--brand-150);
  border-left: 4px solid var(--brand-500);   /* vertikalna brand linija */
  border-radius: 10px;
  padding: .5rem .6rem .55rem .6rem;
  margin: 0 0 .45rem 0;
  box-shadow: 0 2px 8px rgba(31,127,169,.06);
}
.ainesapreview-panel .preview-card:last-child{ margin-bottom: 0; }
.ainesapreview-panel .preview-card--plain{ border-left-color: var(--brand-600); }

/* Naslovi i tekst unutar kartice â€“ kompaktni */
.ainesapreview-panel .preview-card h1,
.ainesapreview-panel .preview-card h2,
.ainesapreview-panel .preview-card h3,
.ainesapreview-panel .preview-card h4,
.ainesapreview-panel .preview-card h5,
.ainesapreview-panel .preview-card h6{
  margin: 0 0 .35rem 0;
  font-weight: 700;
  color: var(--brand-700);
  font-size: .8rem;              /* svi headingi jednaki, mali */
}
.ainesapreview-panel .preview-card p{ margin: 0 0 .3rem 0; }
.ainesapreview-panel .preview-card p:last-child{ margin-bottom: 0; }

/* Liste i toÄkice â€“ samo u karticama */
.ainesapreview-panel .preview-card ul,
.ainesapreview-panel .preview-card ol{ margin: .25rem 0 0 0; padding-left: 1.1rem; }
.ainesapreview-panel .preview-card li{ margin: .18rem 0; }
.ainesapreview-panel .preview-card ul{ list-style: none; }
.ainesapreview-panel .preview-card ul > li{ position: relative; padding-left: .45rem; }
.ainesapreview-panel .preview-card ul > li::before{
  content: "\2022"; color: var(--brand-500); font-weight: 700;
  position: absolute; left: -0.8rem; top: 0;
}

/* Linkovi â€“ scopeirani na panel */
.ainesapreview-panel .preview-card a{
  color: var(--brand-500); text-decoration: none; font-weight: 500; transition: color .12s;
}
.ainesapreview-panel .preview-card a:hover{ color: var(--brand-600); text-decoration: underline; }

/* Tanke, brandirane scroll trake â€“ samo unutar .preview-body */
.ainesapreview-panel .preview-body::-webkit-scrollbar{ width: 6px; }
.ainesapreview-panel .preview-body::-webkit-scrollbar-track{ background: var(--brand-100); border-radius: 3px; }
.ainesapreview-panel .preview-body::-webkit-scrollbar-thumb{ background: var(--brand-500); border-radius: 3px; }
.ainesapreview-panel .preview-body::-webkit-scrollbar-thumb:hover{ background: var(--brand-600); }

#results-list .search-result-item.ainesapreview-active{
  background-color: var(--brand-100);
  border-color: rgba(43,159,211,.55);
  box-shadow: 0 6px 16px rgba(43,159,211,.12);
  transform: translateY(-1px);
  transition: none; /* sprijeÄi trzaje prilikom paljenja/gaÅ¡enja */
}

/* Brandirani tooltip - pun, neproziran */
.tooltip-brand {
  --bs-tooltip-bg: var(--brand-700);  /* ili --brand-600 ako Å¾eliÅ¡ svjetlije */
  --bs-tooltip-opacity: 1;           /* makni prozirnost */
}

.tooltip-brand .tooltip-inner {
  max-width: 350px;
  white-space: normal;
  background-color: var(--brand-700); /* puna boja, bez prozirnosti */
  color: #fff;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
}

/* Strelica iste boje, isto neprozirna */
.tooltip-brand.bs-tooltip-top .tooltip-arrow::before,
.tooltip-brand.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip-brand.bs-tooltip-start .tooltip-arrow::before,
.tooltip-brand.bs-tooltip-end .tooltip-arrow::before {
  border-top-color: var(--brand-700);
  border-bottom-color: var(--brand-700);
  border-left-color: var(--brand-700);
  border-right-color: var(--brand-700);
}

.tooltip-icon-brand {
  color: var(--brand-600);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1; 
}

.tooltip-icon-orange {
color: #fd7e14;
cursor: pointer;
font-size: 0.9rem;
line-height: 1; 
}

.filter-label-main {
  width: 120px;
}


/* ESLJP (grey ton) â€“ boja za code blokove u chatu */
.ctx-esljp #chat-messages :not(pre) > code {
  background: #e9ecef; /* vrlo svijetla siva */
  border-color: rgba(108, 117, 125, .35);
  color: #495057 !important;
}

body.dkom-page .tooltip-brand {
    --brand-700: var(--dkom-700); /* Forsira teal boju */
}

/* Boja strelice tooltipa */
body.dkom-page .tooltip-brand.bs-tooltip-top .tooltip-arrow::before,
body.dkom-page .tooltip-brand.bs-tooltip-bottom .tooltip-arrow::before,
body.dkom-page .tooltip-brand.bs-tooltip-start .tooltip-arrow::before,
body.dkom-page .tooltip-brand.bs-tooltip-end .tooltip-arrow::before {
    border-top-color: var(--dkom-700);
    border-bottom-color: var(--dkom-700);
    border-left-color: var(--dkom-700);
    border-right-color: var(--dkom-700);
}

/* Stil kada validacija ne proÄ‘e (crvenkasti gumb) */
#advanced-search-btn-dkom.sem-invalid {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
    cursor: not-allowed !important;
}


/* Primjena ESLJP boja na tooltip */
body.esljp-page .tooltip-brand {
    --brand-700: var(--esljp-700); /* Postavlja tamno sivu boju */
}

/* Boja strelice tooltipa */
body.esljp-page .tooltip-brand.bs-tooltip-top .tooltip-arrow::before,
body.esljp-page .tooltip-brand.bs-tooltip-bottom .tooltip-arrow::before,
body.esljp-page .tooltip-brand.bs-tooltip-start .tooltip-arrow::before,
body.esljp-page .tooltip-brand.bs-tooltip-end .tooltip-arrow::before {
    border-top-color: var(--esljp-700);
    border-bottom-color: var(--esljp-700);
    border-left-color: var(--esljp-700);
    border-right-color: var(--esljp-700);
}

/* Boja validacijske greÅ¡ke (kad je gumb onemoguÄ‡en) - siva varijanta */
#advanced-search-btn-esljp.sem-invalid {
    background-color: #e2e3e5 !important;
    border-color: #d3d6d8 !important;
    color: #41464b !important;
}

/* --- ANALITIKA: BOJE ZA BADGEVE TIPA PRETRAGE --- */

/* DKOM (Teal) - usklaÄ‘eno s tabom */
.badge.bg-teal {
    background-color: var(--dkom-100, #e6f7f5) !important; /* Svijetla teal pozadina */
    color: var(--dkom-700, #0e7a6e) !important;           /* Tamna teal slova */
    border: 1px solid var(--dkom-500, #14b8a6);            /* Tanki obrub */
}

/* ESLJP (Siva/LjubiÄasta - ovisno kako Å¾eliÅ¡, ali tab je siv) */
/* Ako Å¾eliÅ¡ da odgovara "active-purple" gumbu (koji je zapravo siv u tvom CSS-u): */
.badge.bg-purple {
    background-color: #f8f9fa !important;       /* Vrlo svijetla siva */
    color: #495057 !important;                  /* Tamno siva slova */
    border: 1px solid #6c757d;                  /* Sivi obrub */
}

/* SUD (Primary/Blue) - za svaki sluÄaj da i to Å¾eliÅ¡ uskladiti */
.badge.bg-primary {
    background-color: #e7f1ff !important;       /* Svijetla plava */
    color: #0d6efd !important;                  /* Tamna plava slova */
    border: 1px solid #0d6efd;
}

#docCountBadge {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border: none;
}

/* INTERNET (Info) */
.badge.bg-info {
    background-color: #cff4fc !important;
    color: #055160 !important;
    border: 1px solid #0dcaf0;
}

.additional-filters-toggle {
  border-width: 1.5px;
  padding: 0.2rem 0.75rem;
  background-color: var(--brand-100);
  color: var(--brand-ink);
  border-color: color-mix(in srgb, var(--brand-500) 55%, white);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.additional-filters-toggle:hover,
.additional-filters-toggle:focus-visible {
  background-color: color-mix(in srgb, var(--brand-100) 55%, white);
  color: var(--brand-ink);
  border-color: var(--brand-500);
  box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--brand-500) 18%, transparent);
}
.additional-filters-toggle .label-expanded { display: inline; }
.additional-filters-toggle .label-collapsed { display: none; }
.additional-filters-toggle.collapsed .label-expanded { display: none; }
.additional-filters-toggle.collapsed .label-collapsed { display: inline; }

body.dkom-page .additional-filters-toggle {
  background-color: var(--dkom-100, #e6f7f5);
  color: var(--dkom-700, #0e7a6e);
  border-color: var(--dkom-500, #14b8a6);
}
body.dkom-page .additional-filters-toggle:hover,
body.dkom-page .additional-filters-toggle:focus-visible {
  background-color: color-mix(in srgb, var(--dkom-100, #e6f7f5) 60%, white);
  color: var(--dkom-700, #0e7a6e);
  border-color: var(--dkom-500, #14b8a6);
}

body.esljp-page .additional-filters-toggle {
  background-color: var(--esljp-100, #eef2f7);
  color: var(--esljp-700, #334155);
  border-color: var(--esljp-500, #64748b);
}
body.esljp-page .additional-filters-toggle:hover,
body.esljp-page .additional-filters-toggle:focus-visible {
  background-color: color-mix(in srgb, var(--esljp-100, #eef2f7) 60%, white);
  color: var(--esljp-700, #334155);
  border-color: var(--esljp-500, #64748b);
}

body.seu-page .additional-filters-toggle {
  background-color: var(--seu-100, #eaf2ff);
  color: var(--seu-700, #1d4ed8);
  border-color: var(--seu-500, #3b82f6);
}
body.seu-page .additional-filters-toggle:hover,
body.seu-page .additional-filters-toggle:focus-visible {
  background-color: color-mix(in srgb, var(--seu-100, #eaf2ff) 60%, white);
  color: var(--seu-700, #1d4ed8);
  border-color: var(--seu-500, #3b82f6);
}



/* =============================================
   iOS / SwiftUI DESIGN ENHANCEMENTS
   Primijenjeno s novom paletom boja:
   #0B3853 (dark navy), #7A94AC (steel blue)
   #F0A78A (salmon/CTA), #FEF1EB (cream bg)
   ============================================= */

/* iOS Form inputi - zaobljeni, čišći */
.form-control,
.form-select {
  border-radius: 10px;
  border-color: rgba(122, 148, 172, 0.25);
  background-color: #fff;
  font-size: 0.875rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(122, 148, 172, 0.18);
  outline: none;
}

/* iOS Badge stilovi */
.badge.bg-primary-subtle {
  background-color: var(--brand-100) !important;
  color: var(--brand-700) !important;
  border: 1px solid rgba(122,148,172,.25);
  font-weight: 600;
  border-radius: 6px;
}

/* iOS Chat mjehurići - user poruke */
.chat-message.user .chat-bubble {
  background-color: var(--brand-700);
  color: #fff;
}
.chat-message.user .chat-bubble a {
  color: var(--accent-500);
}

/* AI mjehurić */
.chat-message.ai .chat-bubble {
  background-color: #f5f6f8;
  border: 1px solid rgba(122,148,172,.12);
}

/* iOS Workflow verb chip */
.workflow-verb-chip {
  background: rgba(240,167,138,.12);
  border: 1px solid rgba(240,167,138,.35);
  color: var(--accent-700);
  border-radius: 999px;
}

/* iOS Offcanvas headers */
#projectsOffcanvas .offcanvas-header,
#dkomProjectsOffcanvas .offcanvas-header {
  background: var(--brand-700);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#projectsOffcanvas .offcanvas-title,
#dkomProjectsOffcanvas .offcanvas-title {
  color: #fff;
  font-weight: 600;
}
#projectsOffcanvas .btn-close,
#dkomProjectsOffcanvas .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

/* iOS Novi projekt gumb */
#open-create-project-from-offcanvas,
#dkom-new-project-btn {
  background: var(--accent-500);
  border: 0;
  border-radius: var(--ios-radius-pill);
  font-weight: 600;
  color: #fff;
}
#open-create-project-from-offcanvas:hover,
#dkom-new-project-btn:hover {
  background: var(--accent-600);
}

/* iOS Projekt kartice */
.project-card {
  border: 1px solid rgba(122,148,172,.18);
  border-left: 3px solid rgba(122,148,172,.35);
  border-radius: var(--ios-radius-sm);
  background-color: #ffffff;
  padding: 0.6rem 0.8rem;
  transition: all 0.2s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 1px 3px rgba(11,56,83,.05);
}
.project-card:hover {
  border-left-color: var(--accent-500);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11,56,83,.08);
}
.project-card.active {
  border-color: rgba(240,167,138,.4);
  border-left-color: var(--accent-500);
  background-color: var(--accent-100);
}

/* iOS Announcement modal */
#announcementModal .modal-header {
  background-color: var(--brand-700);
}
#announcementModal .modal-content {
  border-radius: var(--ios-radius);
}

/* Upload Error Modal */
#uploadErrorModal .modal-content {
  border: none;
  border-radius: var(--ios-radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 4px 12px rgba(11,56,83,.10);
  overflow: hidden;
}
#uploadErrorModal .modal-header {
  background: var(--brand-700);
  border-bottom: none;
  padding: 1.1rem 1.4rem;
  align-items: center;
}
#uploadErrorModal .modal-title {
  color: #fff;
  font-weight: 600;
  font-size: 0.97rem;
  margin-bottom: 0;
}
#uploadErrorModal .upload-error-subtitle {
  color: rgba(255,255,255,.6);
  font-size: 0.75rem;
  margin-bottom: 0;
}
#uploadErrorModal .upload-error-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#uploadErrorModal .upload-error-header-icon i {
  color: var(--accent-500);
  font-size: 1rem;
}
#uploadErrorModal .modal-body {
  padding: 1.1rem 1.4rem;
}
#uploadErrorModal .modal-footer {
  border-top: 1px solid rgba(122,148,172,.15);
  padding: 0.85rem 1.4rem;
  background: rgba(238,243,248,.45);
}
#uploadErrorList .upload-error-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--ios-radius-sm);
  background: rgba(240,167,138,.07);
  border: 1px solid rgba(240,167,138,.22);
  margin-bottom: 0.45rem;
}
#uploadErrorList .upload-error-item:last-child {
  margin-bottom: 0;
}
#uploadErrorList .upload-error-item i {
  color: var(--accent-600);
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 0.88rem;
}
#uploadErrorList .upload-error-filename {
  display: block;
  font-weight: 600;
  color: var(--brand-700);
  font-size: 0.84rem;
  line-height: 1.3;
}
#uploadErrorList .upload-error-reason {
  color: var(--brand-600);
  font-size: 0.81rem;
  line-height: 1.4;
}

/* ==================== ANON CHOICE MODAL ==================== */
#anonChoiceModal .modal-content,
#anonProgressModal .modal-content {
  border: none;
  border-radius: var(--ios-radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 4px 12px rgba(11,56,83,.10);
  overflow: hidden;
}
#anonChoiceModal .modal-header,
#anonProgressModal .modal-header {
  background: var(--brand-700);
  border-bottom: none;
  padding: 1.1rem 1.4rem;
  align-items: center;
  gap: 0.7rem;
}
#anonChoiceModal .anon-modal-icon,
#anonProgressModal .anon-modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#anonChoiceModal .anon-modal-icon i,
#anonProgressModal .anon-modal-icon i {
  color: var(--accent-500);
  font-size: 1rem;
}
#anonChoiceModal .modal-title,
#anonProgressModal .modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.97rem;
  margin-bottom: 0;
}
#anonChoiceModal .modal-body,
#anonProgressModal .modal-body {
  padding: 1.1rem 1.4rem;
}
#anonChoiceModal .anon-choice-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 0.4rem;
}
#anonFileList li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--ios-radius-sm);
  background: var(--brand-100);
  border: 1px solid rgba(122,148,172,.18);
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  color: var(--brand-700);
  font-weight: 500;
}
#anonFileList li:last-child { margin-bottom: 0; }
#anonFileList li i { color: var(--brand-500); font-size: 0.82rem; flex-shrink: 0; }
#anonChoiceModal .anon-info-box {
  background: linear-gradient(135deg, rgba(122,148,172,.09) 0%, rgba(122,148,172,.04) 100%);
  border: 1px solid rgba(122,148,172,.22);
  border-radius: var(--ios-radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.81rem;
  color: var(--brand-600);
  line-height: 1.5;
  margin-top: 0.75rem;
}
#anonChoiceModal .anon-info-box i { color: var(--brand-500); }
#anonChoiceModal .modal-footer {
  border-top: 1px solid rgba(122,148,172,.15);
  padding: 0.85rem 1.1rem;
  background: rgba(238,243,248,.45);
  flex-direction: column;
  gap: 0.45rem;
}
#anonChoiceModal #anonYesBtn {
  border-radius: var(--ios-radius-pill) !important;
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
}
#anonChoiceModal #anonYesBtn:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
}
#anonChoiceModal #anonNoBtn {
  border-radius: var(--ios-radius-pill) !important;
  border-color: rgba(122,148,172,.4);
  color: var(--brand-600);
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
}
#anonChoiceModal #anonNoBtn:hover { background: rgba(122,148,172,.1); }

/* ==================== ANON PROGRESS MODAL ==================== */
#anonProgressModal .modal-body { padding: 1rem 1.4rem; }
#anonProgressModal .modal-footer {
  border-top: 1px solid rgba(122,148,172,.15);
  padding: 0.85rem 1.1rem;
  background: rgba(238,243,248,.45);
}
#anonProgressModal #anonCancelBtn {
  border-radius: var(--ios-radius-pill) !important;
  border-color: rgba(204,110,82,.4);
  color: var(--accent-700);
  font-size: 0.88rem;
  padding: 0.45rem 1.1rem;
}
#anonProgressModal #anonCancelBtn:hover { background: rgba(204,110,82,.08); }
#anonProgressList .anon-job-item {
  padding: 0.6rem 0.8rem;
  border-radius: var(--ios-radius-sm);
  background: var(--brand-100);
  border: 1px solid rgba(122,148,172,.18);
  margin-bottom: 0.5rem;
}
#anonProgressList .anon-job-item:last-child { margin-bottom: 0; }
#anonProgressList .progress {
  height: 6px;
  border-radius: var(--ios-radius-pill);
  background: rgba(122,148,172,.18);
  margin: 0.35rem 0 0.25rem;
}
#anonProgressList .progress-bar {
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: var(--ios-radius-pill);
}

/* ==================== ANON REVIEW MODAL ==================== */
#anonReviewModal .modal-content {
  border: none;
  border-radius: var(--ios-radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 4px 12px rgba(11,56,83,.10);
  overflow: hidden;
}
#anonReviewModal .modal-header {
  background: var(--brand-700);
  border-bottom: none;
  padding: 1.1rem 1.4rem;
  align-items: flex-start;
}
#anonReviewModal .anon-review-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
#anonReviewModal .anon-review-header-icon i {
  color: var(--accent-500);
  font-size: 1rem;
}
#anonReviewModal .modal-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}
#anonReviewModal .anon-review-filename {
  color: rgba(255,255,255,.6);
  font-size: 0.75rem;
  display: block;
}
#anonReviewModal .anon-review-counter {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 0.72rem;
  border-radius: var(--ios-radius-pill);
  padding: 2px 8px;
  font-weight: 500;
  margin-left: auto;
  align-self: center;
  white-space: nowrap;
}
#anonReviewModal .anon-review-banner {
  background: linear-gradient(135deg, rgba(240,167,138,.14) 0%, rgba(240,167,138,.07) 100%);
  border: 1.5px solid rgba(240,167,138,.35);
  border-radius: var(--ios-radius-sm);
  padding: 0.85rem 1rem;
  margin: 1rem 1rem 0;
}
#anonReviewModal .anon-review-banner .banner-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--brand-700);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#anonReviewModal .anon-review-banner .banner-title i {
  color: var(--accent-600);
  font-size: 0.95rem;
}
#anonReviewModal .anon-review-banner .banner-text {
  font-size: 0.82rem;
  color: var(--brand-600);
  line-height: 1.5;
  margin-bottom: 0;
}
#anonReviewModal .anon-review-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.35rem;
  font-size: 0.78rem;
  color: var(--brand-500);
}
#anonReviewModal .anon-review-legend .legend-tag {
  background: rgba(229,192,123,.18);
  border: 1px solid #e5c07b;
  border-radius: 4px;
  padding: 1px 5px;
  color: #b58c30;
  font-weight: 700;
  font-family: monospace;
  font-size: 0.79rem;
  white-space: nowrap;
}
#anonReviewModal #anon-review-editor {
  border: 1.5px solid rgba(122,148,172,.25) !important;
  border-radius: var(--ios-radius-sm) !important;
  background: #fff !important;
  min-height: 420px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 1rem;
  font-size: .88rem;
  line-height: 1.75;
}
#anonReviewModal .modal-footer {
  border-top: 1px solid rgba(122,148,172,.15);
  padding: 0.85rem 1.1rem;
  background: rgba(238,243,248,.45);
  gap: 0.5rem;
}
#anonReviewModal #anonReviewCancelBtn {
  border-radius: var(--ios-radius-pill) !important;
  border-color: rgba(122,148,172,.4);
  color: var(--brand-600);
  font-size: 0.88rem;
  padding: 0.45rem 1.1rem;
}
#anonReviewModal #anonReviewCancelBtn:hover {
  background: rgba(122,148,172,.1);
}
#anonReviewModal #anonReviewConfirmBtn {
  border-radius: var(--ios-radius-pill) !important;
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 1.3rem;
}
#anonReviewModal #anonReviewConfirmBtn:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
}

/* iOS Upload zona */
.upload-zone {
  border: 2px dashed rgba(122,148,172,.3);
  background: var(--brand-100);
  border-radius: var(--ios-radius-sm);
}
.upload-zone:hover {
  border-color: var(--brand-500);
  background: var(--brand-150);
}
.upload-zone.drag-over {
  border-color: var(--accent-500);
  background: var(--accent-100);
  transform: scale(1.01);
}

/* iOS AI disclaimer pill */
.ai-disclaimer.disclaimer-pill {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
}
.ai-disclaimer.disclaimer-pill i {
  color: var(--accent-500);
}

/* iOS preview panel */
.ainesapreview-panel .preview-title {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 100%);
}
.ainesapreview-panel .preview-card {
  border-left-color: var(--accent-500);
}

/* iOS Pagination */
.pagination .page-link {
  color: var(--brand-700);
  border-color: rgba(122,148,172,.2);
  border-radius: 8px !important;
}
.pagination .page-item.active .page-link {
  background-color: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
.pagination .page-link:hover {
  background-color: var(--brand-100);
  color: var(--brand-700);
}

/* iOS Search toggle gumb unutar headera */
#search-section .search-toggle {
  color: rgba(255,255,255,0.8) !important;
  border-color: rgba(255,255,255,0.25) !important;
  background: rgba(255,255,255,0.08) !important;
}
#search-section .search-toggle:hover {
  background: rgba(255,255,255,0.15) !important;
  border-color: rgba(255,255,255,0.4) !important;
  color: #fff !important;
}

/* Rounded-16 / rounded-top-16 override za iOS */
.rounded-16 { border-radius: var(--ios-radius) !important; }
.rounded-top-16 {
  border-top-left-radius: var(--ios-radius) !important;
  border-top-right-radius: var(--ios-radius) !important;
}

/* iOS Modal */
.modal-content {
  border-radius: var(--ios-radius);
  border: none;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}
.modal-header {
  border-bottom: 1px solid rgba(122,148,172,.15);
  border-radius: var(--ios-radius) var(--ios-radius) 0 0;
}

/* iOS form-check (checkboxes) */
.form-check-input:checked {
  background-color: var(--brand-700);
  border-color: var(--brand-700);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(11,56,83,.15);
  border-color: var(--brand-500);
}

/* iOS text-brand-ink na bijeloj podlozi (van headera) */
.card-body .text-brand-ink,
.card-body .fw-semibold.text-brand-ink {
  color: var(--brand-700) !important;
}

/* ------------------------------------------------------------------ */
/* Mobilna prilagodba formi za pretragu (sve *_odluke stranice)        */
/* ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
  /* Red s labelom + textarea/input steka vertikalno */
  .d-flex.align-items-center:has(> .filter-label-main) {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.35rem !important;
  }

  /* Label zauzima punu širinu */
  .filter-label-main {
    width: 100% !important;
    margin-bottom: 0;
  }

  /* Select "ILI / I" zauzima punu širinu */
  .form-select[name="kljucne_rijeci_operator"] {
    width: 100% !important;
  }

  /* Gumb za pretragu puna širina na mobitelu */
  .btn-set-sm {
    width: 100%;
  }
  .btn-set-sm .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------------ */
/* Mobile UX: Chat panel & Workflow verb bottom sheet                  */
/* ------------------------------------------------------------------ */

/* Chat panel - normalna visina na mobitelu (scrollable stranica) */
@media (max-width: 991.98px) {
  /* Dopusti skrolanje stranice na mobitelu (body.no-page-scroll inače blokira) */
  body.no-page-scroll {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Oslobodi visine koje drže layout "zaključanim" na viewport */
  html, body {
    height: auto !important;
    min-height: 100%;
  }

  .ainesa-body {
    height: 65dvh !important;    /* fiksna visina = chat-messages može scrollati */
    min-height: 320px;
  }

  /* Chat section - flex-fill ne smije biti beskonačno visok u scroll layoutu */
  #chat-section {
    flex: none !important;
  }
}

/* Puna širina chata na mobilnom: chat se prostire do rubova ekrana */
@media (max-width: 767.98px) {
  /* Ukloni horizontalni padding containera da chat dopire do ruba */
  .container-fluid.px-3 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Ukloni zaobljenost i sjenu na chat sekciji - nativan mobile look */
  #chat-section {
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Rezultati i search sekcija zadržavaju blagi padding */
  #search-section,
  .results-23 > .card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
}

/* Workflow verb panel - bottom sheet na mobitelu */
@media (max-width: 767.98px) {
  /* Panel se zakači na dno ekrana */
  .workflow-verb-collapse {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    margin: 0 !important;
    z-index: 1055 !important;
  }

  .workflow-verb-panel {
    border-radius: 20px 20px 0 0 !important;
    max-height: 65vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, 1rem);
  }

  /* Handle bar indikator */
  .workflow-verb-panel-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(0,0,0,0.18);
    border-radius: 2px;
    margin: 0 auto 0.5rem;
  }

  /* Sakrij detail panel - lista je dovoljna na mobitelu */
  .workflow-verb-panel .col-12.col-md-7 {
    display: none !important;
  }

  /* Lista zauzima punu širinu */
  .workflow-verb-panel .col-12.col-md-5 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Povećaj stavke liste za lakši dodir */
  .workflow-verb-panel .list-group-item {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  /* Backdrop pokrije cijeli viewport */
  .workflow-verb-backdrop.is-open {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1054 !important;
  }

  /* ── Mobile input: chat.html pattern ─────────────────────── */

  /* Input row: vertikalni stack, bez gap-a */
  .mt-2.d-flex.gap-2.align-items-stretch {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Sakrij desktop upload button, send button i desktop mic */
  .upload-docs-btn { display: none !important; }
  #ask-ainesa-btn  { display: none !important; }
  #wf-desktop-mic  { display: none !important; }

  /* Sakrij desktop overlay "Odaberite radnju" */
  .workflow-verb-overlay { display: none !important; }

  /* Textarea: full-width, room for action buttons at bottom */
  .workflow-input {
    width: 100%;
  }
  .workflow-input #ainesa-prompt {
    width: 100%;
    padding-bottom: 48px;
    min-height: 80px;
    border-radius: 14px !important;
    font-size: 0.9rem;
  }
  .workflow-input.has-verb #ainesa-prompt {
    padding-top: 2.1rem;
  }

  /* Mobile action buttons: positioned inside textarea */
  .wf-mobile-actions {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Verb picker button (left) */
  .wf-mobile-verb-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(54, 73, 101, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: rgba(54, 73, 101, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
  }
  .wf-mobile-verb-btn:hover,
  .wf-mobile-verb-btn:active {
    border-color: rgba(54, 73, 101, 0.4);
    background: #fff;
  }
  /* Kada je verb odabran, promijeni ikonu */
  .workflow-input.has-verb .wf-mobile-verb-btn {
    background: rgba(105, 179, 157, 0.18);
    border-color: rgba(105, 179, 157, 0.5);
    color: #084742;
  }

  /* Spacer pushes mic/send to the right */
  .wf-mobile-actions::after {
    content: '';
    flex: 1;
  }

  /* Mic button */
  .wf-mic-btn {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
    border-radius: 50% !important;
    border: 1px solid rgba(54, 73, 101, 0.2) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: rgba(54, 73, 101, 0.7) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0 !important;
  }
  .wf-mic-btn.is-recording {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
    animation: mic-pulse 1s ease-in-out infinite;
  }

  /* Send button */
  .wf-mobile-send-btn {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #364965 0%, #084742 100%) !important;
    border: none !important;
    color: #fff !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(54, 73, 101, 0.25);
  }

  /* Toggle: no text → show mic, has text → show send */
  .workflow-input.has-text .wf-mic-btn    { display: none !important; }
  .workflow-input.has-text .wf-mobile-send-btn { display: flex !important; }

  /* Mic pulse animation */
  @keyframes wf-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
  }
}

/* ── Desktop: hide mobile-only elements ─────────────────────── */
@media (min-width: 768px) {
  .wf-mobile-actions { display: none !important; }
}

/* ── Desktop voice mic button (inside textareas) ──────────────── */
.voice-input-wrap { width: 100%; height: 100%; }

.voice-mic-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(54, 73, 101, 0.18) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: rgba(54, 73, 101, 0.55) !important;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  z-index: 2;
}
.voice-mic-btn:hover {
  border-color: rgba(8, 71, 66, 0.4) !important;
  color: #084742 !important;
  background: rgba(105, 179, 157, 0.12) !important;
}
.voice-mic-btn.is-recording {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: #fff !important;
  animation: voice-pulse 1.2s infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
}

/* Voice mic buttons next to action buttons (search / send) */
.btn-set-sm > .voice-mic-btn,
.search-inline > .voice-mic-btn,
#wf-desktop-mic {
  position: static;
  width: 38px;
  height: 38px;
  border-radius: 50% !important;
  flex-shrink: 0;
  font-size: 1rem;
  align-self: center;
}

/* ====================================================================
   CASES — Globalni stilovi (navbar badge, popover, chat save button)
   Page-specifican CSS je u cases/static/css/cases.css
   ==================================================================== */


/* [cases page CSS premjesten u cases/static/css/cases.css] */

/* --- Navbar badge --- */
@keyframes caseBadgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); box-shadow: 0 0 14px rgba(167, 215, 238, 0.5); }
    100% { transform: scale(1); }
}
/* --- Results empty state --- */
.results-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    color: #6c757d;
}
.results-empty-state i {
    font-size: 1.6rem;
    opacity: 0.3;
}
.results-empty-state span {
    font-size: 0.82rem;
    font-weight: 500;
}

.case-badge-pulse { animation: caseBadgePulse 0.6s ease; }

.nav-case-link {
    text-decoration: none;
    transition: all 0.2s ease-out;
}
.nav-case-link:hover .nav-case-badge {
    background: linear-gradient(135deg, rgba(224, 136, 112, 1) 0%, rgba(204, 110, 82, 1) 100%);
    box-shadow: 0 4px 14px rgba(240, 167, 138, 0.45);
}
.nav-case-icon {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    transition: color 0.15s;
}
.nav-case-link:hover .nav-case-icon {
    color: #A7D7EE;
}
.nav-case-badge {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 4px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(240, 167, 138, 0.9) 0%, rgba(224, 136, 112, 0.9) 100%);
    color: #fff;
    border: 1px solid rgba(240, 167, 138, 0.6);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(240, 167, 138, 0.3);
    transition: all 0.2s ease-out;
}

/* --- Case modal shell --- */
.case-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(54, 73, 101, 0.18);
}
.case-modal-header {
    background: linear-gradient(135deg, #364965 0%, #084742 100%);
    color: #fff;
    padding: 14px 20px;
    border-bottom: none;
}
.case-modal-selector {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 10px;
    padding: 5px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
}
.case-modal-selector:hover,
.case-modal-selector:focus {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.case-modal-dropdown {
    border-radius: 14px;
    border: 1px solid rgba(54, 73, 101, 0.08);
    box-shadow: 0 8px 24px rgba(54, 73, 101, 0.15);
    padding: 6px;
}
.case-modal-dropdown .dropdown-item {
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 6px 12px;
    transition: background 0.12s;
}
.case-modal-dropdown .dropdown-item:hover { background: rgba(167, 215, 238, 0.15); }
.case-modal-dropdown .dropdown-item.active { background: rgba(8, 71, 66, 0.1); font-weight: 600; }

.case-modal-btn-new {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 10px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.15s ease-out;
}
.case-modal-btn-new:hover { background: rgba(255,255,255,0.22); color: #fff; }

.case-modal-btn-delete {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff8a98;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 0.78rem;
    transition: all 0.15s ease-out;
    display: none;
}
.case-modal-btn-delete:hover { background: rgba(220, 53, 69, 0.3); color: #fff; }

/* --- Create panel --- */
.case-create-panel {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(54, 73, 101, 0.08);
    background: linear-gradient(180deg, #eef6fb 0%, #e4eef6 100%);
}
.case-form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e2d40;
    margin-bottom: 4px;
}
.case-form-input {
    border: 1px solid rgba(54, 73, 101, 0.15);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.case-form-input:focus {
    border-color: rgba(167, 215, 238, 0.9);
    box-shadow: 0 0 0 3px rgba(167, 215, 238, 0.25);
}
.case-btn-create {
    background: linear-gradient(135deg, #F0A78A 0%, #e08870 100%);
    border: 1px solid rgba(240, 167, 138, 0.72);
    color: #fff;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s ease-out;
}
.case-btn-create:hover {
    background: linear-gradient(135deg, #e08870 0%, #cc6e52 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(240, 167, 138, 0.35);
}

/* --- Body --- */
.case-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    background: #f8f9fa;
}
.case-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 8px;
}

/* --- Columns --- */
.case-column {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(54, 73, 101, 0.08);
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(54, 73, 101, 0.05);
    transition: box-shadow 0.2s ease-out;
}
.case-column:hover {
    box-shadow: 0 4px 16px rgba(54, 73, 101, 0.1);
}
.case-column-header {
    background: rgba(54, 73, 101, 0.03);
    border-bottom: 1px solid rgba(54, 73, 101, 0.06);
    padding: 8px 10px;
}
.case-column-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e2d40;
}
.case-column-badge {
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(54, 73, 101, 0.08);
    color: #495057;
    padding: 1px 8px;
    border-radius: 999px;
}
.case-column-body {
    padding: 8px;
    max-height: 260px;
    overflow-y: auto;
    flex: 1;
}
.case-column-body::-webkit-scrollbar { width: 4px; }
.case-column-body::-webkit-scrollbar-thumb { background: rgba(54, 73, 101, 0.15); border-radius: 2px; }
.case-empty-state {
    color: #6c757d;
    font-size: 0.78rem;
    font-style: italic;
    padding: 10px 4px;
}

/* --- Action buttons in column header --- */
.case-action-btn {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(54, 73, 101, 0.2);
    color: #364965;
    background: transparent;
    transition: all 0.15s ease-out;
}
.case-action-btn:hover {
    background: rgba(54, 73, 101, 0.08);
    color: #084742;
    border-color: rgba(54, 73, 101, 0.35);
}

/* --- Items in columns --- */
.case-item {
    padding: 5px 6px;
    border-radius: 8px;
    transition: background 0.12s ease-out;
}
.case-item:hover { background: rgba(167, 215, 238, 0.1); }
.case-item .btn-sm {
    padding: 1px 5px;
    font-size: 0.72rem;
    line-height: 1.3;
}
.case-judgment-cb {
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
    border-radius: 4px;
    accent-color: #084742;
    margin: 0;
    vertical-align: middle;
    border: 2px solid #364965;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease-out;
}
.case-judgment-cb:checked {
    background: #084742;
    border-color: #084742;
}
.case-judgment-cb:checked::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -1px;
}
.case-judgment-cb:hover {
    border-color: #084742;
    box-shadow: 0 0 0 3px rgba(167, 215, 238, 0.25);
}
.case-judgment-info, .case-dkom-expand, .case-dkom-doc-info {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    align-self: center;
}
.case-judgment-info:hover i, .case-dkom-doc-info:hover i { color: #364965; }
.case-dkom-expand:hover i { color: #084742; }

/* DKOM expand docs */
.case-dkom-docs {
    border-left: 2px solid rgba(167, 215, 238, 0.4);
}
.case-dkom-doc-item:last-child { border-bottom: none; }

/* --- Summary popover (court/esljp/seu) --- */
.case-summary-popover {
    max-width: 400px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(54, 73, 101, 0.18);
}
.case-summary-popover .popover-arrow { display: none; }
.case-summary-popover .popover-body {
    font-size: 0.82rem;
    padding: 12px 16px;
    border-radius: 14px;
    max-height: 50vh;
    overflow-y: auto;
}
.case-summary-popover .popover-body::-webkit-scrollbar { width: 4px; }
.case-summary-popover .popover-body::-webkit-scrollbar-thumb { background: rgba(54, 73, 101, 0.15); border-radius: 2px; }
.case-summary-content p { margin: 0 0 0.4em; }
.case-summary-content p:last-child { margin-bottom: 0; }
.case-summary-content ul, .case-summary-content ol { padding-left: 1.2em; margin: 0.3em 0; }
.case-summary-content li { margin-bottom: 0.15em; }
.case-summary-content strong { font-weight: 700; color: #084742; }
.case-summary-content h1, .case-summary-content h2, .case-summary-content h3 {
    font-size: 0.88rem; font-weight: 700; color: #1e2d40; margin: 0.5em 0 0.25em;
}
.case-summary-content a { color: #0d6efd; }
.case-summary-content a:hover { color: #0a58ca; text-decoration: underline; }

/* --- DKOM preview-style popover --- */
.case-preview-style {
    max-width: 460px;
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(54, 73, 101, 0.18);
}
.case-preview-style .popover-body { padding: 0; }
.case-preview-style .popover-arrow { display: none; }
.case-preview-style .preview-body {
    padding: 8px;
    max-height: 360px;
    overflow-y: auto;
    font-size: 0.76rem;
    line-height: 1.4;
    color: #3f4950;
}
.case-preview-style .preview-card {
    background: linear-gradient(to bottom, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(54, 73, 101, 0.08);
    border-left: 4px solid #A7D7EE;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 0 6px 0;
    box-shadow: 0 2px 6px rgba(54, 73, 101, 0.04);
}
.case-preview-style .preview-card:last-child { margin-bottom: 0; }
.case-preview-style .preview-card--plain { border-left-color: #69B39D; }
.case-preview-style .preview-card h1,
.case-preview-style .preview-card h2,
.case-preview-style .preview-card h3,
.case-preview-style .preview-card h4 {
    margin: 0 0 .35rem 0; font-weight: 700; color: #364965; font-size: .8rem;
}
.case-preview-style .preview-card p { margin: 0 0 .3rem 0; }
.case-preview-style .preview-card p:last-child { margin-bottom: 0; }
.case-preview-style .preview-card ul,
.case-preview-style .preview-card ol { margin: .25rem 0 0 0; padding-left: 1.1rem; }
.case-preview-style .preview-card li { margin: .18rem 0; }
.case-preview-style .preview-card ul { list-style: none; }
.case-preview-style .preview-card ul > li { position: relative; padding-left: .45rem; }
.case-preview-style .preview-card ul > li::before {
    content: "\2022"; color: #A7D7EE; font-weight: 700;
    position: absolute; left: -0.8rem; top: 0;
}
.case-preview-style .preview-card a { color: #0d6efd; text-decoration: none; font-weight: 500; }
.case-preview-style .preview-card a:hover { color: #0a58ca; text-decoration: underline; }
.case-preview-style .preview-card strong { font-weight: 700; color: #084742; }
.case-preview-style .preview-body::-webkit-scrollbar { width: 4px; }
.case-preview-style .preview-body::-webkit-scrollbar-thumb { background: rgba(54, 73, 101, 0.15); border-radius: 2px; }

/* --- Chat view sub-modal --- */
.case-chat-modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(54, 73, 101, 0.18);
    overflow: hidden;
}
.case-chat-modal-header {
    background: rgba(238, 246, 251, 0.8);
    border-bottom: 1px solid rgba(54, 73, 101, 0.08);
    padding: 14px 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.case-chat-modal-footer {
    background: rgba(238, 246, 251, 0.6);
    border-top: 1px solid rgba(54, 73, 101, 0.08);
    padding: 10px 20px;
}
.case-btn-close {
    background: rgba(54, 73, 101, 0.06);
    border: 1px solid rgba(54, 73, 101, 0.12);
    border-radius: 10px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.15s ease-out;
}
.case-btn-close:hover { background: rgba(54, 73, 101, 0.1); }

.chat-view-body { max-height: 60vh; overflow-y: auto; padding: 16px; }
.chat-view-msg { margin-bottom: 14px; }
.chat-view-msg.chat-view-user { text-align: right; }
.chat-view-msg.chat-view-ai { text-align: left; }
.chat-view-bubble-user {
    display: inline-block;
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 18px 18px 4px 18px;
    background: linear-gradient(135deg, #364965 0%, #084742 100%);
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 2px 8px rgba(54, 73, 101, 0.15);
}
.chat-view-bubble-ai {
    display: inline-block;
    max-width: 85%;
    padding: 10px 16px;
    border-radius: 18px 18px 18px 4px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(54, 73, 101, 0.08);
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 2px 6px rgba(54, 73, 101, 0.06);
}
.chat-view-bubble-ai p { margin: 0 0 0.4em; }
.chat-view-bubble-ai p:last-child { margin-bottom: 0; }
.chat-view-bubble-ai a { color: #0d6efd; }
.chat-view-bubble-ai a:hover { color: #0a58ca; text-decoration: underline; }

/* --- Save-to-case button on AI chat bubbles --- */
.chat-message.ai .save-msg-to-case-btn {
    opacity: 1;
    transition: background 0.15s ease-out;
}

/* (cases responsive CSS premjesten u cases/static/css/cases.css) */
