/* ============================================================
   Praćenje aktivnosti: stilovi — „Petrolej i šafran"
   Tamni bočni meni (mastilo), petrolej za radnje i linkove, šafran za ono što je
   danas i aktivno. Sve boje, fontovi, zaobljenja i senke su ovde u promenljivama
   (:root ispod), pa se izgled menja na jednom mestu.
   ============================================================ */

/* ---------- Fontovi (lokalni, public/fonts/; licenca SIL OFL 1.1 — fonts/OFL-*.txt) ----------
   Svaki font je podeljen na delove po pismu (unicode-range). Pregledač preuzima samo delove
   čija se slova zaista pojavljuju na stranici: "latin" (osnovna slova, cifre, „ “ – …),
   "latin-ext" (č ć đ š ž) i "cyrillic" (sva srpska ćirilična slova, i Ђ Ј Љ Њ Ћ Џ).
   Onest       — sav tekst, dugmad, meni, tabele, forme (težine 400–700)
   Unbounded   — naslovi strana i dijaloga, veliki brojevi (težine 500–600)
   JetBrains Mono — datumi, vreme, brojevi telefona (težine 400–500) */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Osnova */
  --ink: #0e2a2f; /* Mastilo: bočni meni, prijava, obaveštenja (toast) */
  --bg: #f2f2ee; /* Kamen: pozadina stranice */
  --surface: #ffffff; /* Površina: kartice, dijalozi, polja */
  --surface-alt: #f7f7f4; /* Površina 2: zaglavlje tabele, hover */
  --text: #172022; /* Tekst (16,6:1 na beloj) */
  --muted: #566164; /* Prigušeno: podnaslov, pomoćni tekst (6,4:1) */
  --border: #e2e3dd; /* Linija: razdelnici, okviri kartica */
  --border-soft: #ecece7; /* linija između redova tabele */
  --border-strong: #8a9290; /* Okvir polja i padajuće liste (3,2:1) */
  --border-control: #c4c8c2; /* okvir sekundarnog dugmeta */
  --placeholder: #687270; /* tekst-primer u praznom polju (5:1) */

  /* Akcenti */
  --accent: #0b6475; /* Petrolej: primarno dugme, link, fokus (beli tekst 6,8:1) */
  --accent-hover: #084c59; /* Petrolej tamni: hover primarnog dugmeta i linka */
  --accent-soft: #e3f0f1; /* Petrolej svetli: ikonice, avatar, čip */
  --accent-border: #b9dadd; /* okvir čipa na petrolej svetloj podlozi */
  --accent-ring: rgba(11, 100, 117, 0.18); /* svetli prsten oko polja u fokusu */
  --accent-text: #ffffff;
  --saffron: #f0ac2a; /* Šafran: „Danas", aktivna stavka menija; NIKAD kao tekst na beloj */
  --saffron-soft: #fdf2dc; /* Šafran svetli: pozadina bedža „Danas" */
  --saffron-text: #7a4c00; /* tekst na šafran svetloj (6,6:1) */

  /* Značenje */
  --danger: #b42318; /* Opasnost: brisanje, greške, zvezdica obaveznog polja */
  --danger-hover: #8f1c13;
  --danger-soft: #fdecea;
  --danger-border: #e8a49d; /* okvir dugmeta „Obriši" bez pozadine */
  --success: #1d6b40; /* Uspeh: „Aktivan", „Prisustvovao" */
  --success-soft: #e6f3ea;
  --info-soft: #e3f0f1;
  --neutral-soft: #ecede8; /* pozadina neutralnog bedža */

  /* Bočni meni (sve na mastilu) */
  --ink-raised: #1a3b41; /* aktivna stavka, krug sa inicijalima */
  --ink-text: #e8f0f0;
  --ink-muted: #c4d3d5; /* stavke menija (9,8:1 na mastilu) */
  --ink-subtle: #9fb5b8; /* uloga ispod imena */
  --ink-line: rgba(255, 255, 255, 0.1);
  --ink-hover: rgba(255, 255, 255, 0.05);

  --row-alt: #fafaf8;
  --row-hover: #edf5f5;

  /* Statusi pozvanog aktiviste na događaju: pozadina oznake / tekst (i tačka u oznaci) /
     boja trake, pločice i tačke u meniju "Promeni status" */
  --st-invited-bg: #ecede8;
  --st-invited-text: #566164;
  --st-invited-bar: #8a9290;
  --st-confirmed-bg: #e3f0f1;
  --st-confirmed-text: #0b6475;
  --st-confirmed-bar: #0b6475;
  --st-attended-bg: #e6f3ea;
  --st-attended-text: #1d6b40;
  --st-attended-bar: #2e8b57;
  --st-no-show-bg: #efecf7;
  --st-no-show-text: #5b4b8a;
  --st-no-show-bar: #7a68b0;
  --st-refused-bg: #fdecea;
  --st-refused-text: #b42318;
  --st-refused-bar: #d0463a;
  --st-excused-bg: #fdf2dc;
  --st-excused-text: #7a4c00;
  --st-excused-bar: #f0ac2a;

  /* Oblici i senke: 8px dugmad/polja, 12px kartice, 16px dijalog i prijava */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(14, 42, 47, 0.05);
  --shadow-lg: 0 14px 34px rgba(14, 42, 47, 0.22);
  --shadow-dialog: 0 24px 60px rgba(14, 42, 47, 0.32);
  --overlay: rgba(14, 42, 47, 0.55);
  --shadow-menu: 0 14px 34px rgba(14, 42, 47, 0.2);
  --sidebar-w: 256px;
  --drawer-w: 304px;
  --topbar-h: 60px; /* tablet; na telefonu 56px */

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

/* ---------- Raspored ----------
   Od 901px: stalni bočni meni (256px) levo. Ispod 901px (tablet i telefon): traka na vrhu
   (mastilo; 60px na tabletu, 56px na telefonu) i meni kao fioka sa leve strane. */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 16px 20px;
  background: var(--ink);
  color: var(--ink-text);
  overflow-y: auto;
}

/* Na tamnom meniju i traci fokus je šafran (petrolej se ne bi video na mastilu) */
.sidebar :focus-visible,
.topbar :focus-visible {
  outline-color: var(--saffron);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 8px;
  text-decoration: none;
}

/* Znak aplikacije (logo C „Mreža"): petrolej kvadrat zaobljenih ivica sa tri povezane tačke */
.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

/* U meniju naziv ide u dva reda („Praćenje / aktivnosti") */
.sidebar .brand-name {
  max-width: min-content;
  font-size: 14px;
  color: #ffffff;
}

/* Dugme X postoji samo u fioci (tablet i telefon) */
.nav-close {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.nav-close:hover {
  background: var(--ink-hover);
  color: #ffffff;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Administratorske stavke (Korisnici, Evidencija...) su ispod tanke linije.
   Koordinator te stavke ne vidi, pa ni liniju. */
.nav-group-admin {
  padding-top: 16px;
  border-top: 1px solid var(--ink-line);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.nav-link .icon {
  stroke-width: 1.8;
}

.nav-link:hover {
  background: var(--ink-hover);
  color: #ffffff;
}

/* Aktivna stavka: svetlija podloga, beli tekst, ikonica u šafranu */
.nav-link.active {
  background: var(--ink-raised);
  color: #ffffff;
  font-weight: 600;
}

.nav-link.active .icon {
  color: var(--saffron);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Dno menija: prekidač pisma, pa korisnik (krug sa inicijalima, ime, uloga) i odjava */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px 4px 0 8px;
  border-top: 1px solid var(--ink-line);
}

/* Krug sa inicijalima prijavljenog korisnika: šafran slova na mastilu */
.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-raised);
  color: var(--saffron);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.user-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-role {
  font-size: 13px;
  color: var(--ink-subtle);
}

/* Odjava: samo ikonica (natpis "Odjavi se" je u aria-label i oblačiću) */
.logout-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.logout-btn:hover {
  background: var(--ink-hover);
  color: #ffffff;
}

/* Prekidač pisma na tamnom meniju: dva dugmeta jednake širine */
.sidebar .seg {
  background: rgba(255, 255, 255, 0.07);
}

.sidebar .seg-btn {
  color: var(--ink-muted);
  font-weight: 500;
}

.sidebar .seg-btn:hover {
  color: #ffffff;
}

.sidebar .seg-btn.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: none;
}

.content {
  min-width: 0;
}

/* Traka na vrhu (tablet i telefon): mastilo, dugme za meni, znak sa nazivom, korisnik */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--topbar-h);
  padding: 8px 20px 8px 12px;
  background: var(--ink);
  color: #ffffff;
}

.topbar-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.topbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.topbar-brand:hover {
  color: #ffffff;
}

.topbar-brand .brand-mark {
  width: 34px;
  height: 34px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  line-height: 1.3;
}

.topbar-user-name {
  max-width: 220px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-role {
  font-size: 12px;
  color: var(--ink-subtle);
}

.view {
  padding: 20px 16px 48px;
  max-width: 1180px;
  margin: 0 auto;
}

.view:focus {
  outline: none;
}

/* Računar: stalni meni, bez trake na vrhu */
@media (min-width: 901px) {
  .content {
    margin-left: var(--sidebar-w);
  }
  .topbar,
  .backdrop {
    display: none;
  }
  .view {
    padding: 28px 32px 56px;
  }
}

/* Tablet i telefon: meni je fioka preko sadržaja, sa zatamnjenjem iza.
   Zatvorena fioka je nevidljiva i za tastaturu (visibility), ne samo pomerena van ekrana. */
@media (max-width: 900px) {
  .sidebar {
    width: var(--drawer-w);
    max-width: 86%;
    padding: 14px 14px 20px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  body.nav-open .sidebar {
    transform: none;
    visibility: visible;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
  }
  body.nav-open .backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar .brand {
    padding: 4px 6px;
  }
  .nav-close {
    display: inline-flex;
  }
  .nav-link {
    gap: 14px;
    min-height: 48px;
    font-size: 16px;
  }
  .sidebar .seg-btn {
    min-height: 40px;
    font-size: 15px;
  }
  .user-card {
    padding: 14px 0 0 6px;
  }
  .user-card-name {
    font-size: 15px;
  }
  .logout-btn {
    width: 44px;
    height: 44px;
  }
  .view {
    padding: 24px 32px 48px;
  }
}

/* Telefon: niža traka (56px), bez imena korisnika u traci */
@media (max-width: 719px) {
  .topbar {
    --topbar-h: 56px;
    gap: 8px;
    padding: 6px 12px 6px 6px;
  }
  .topbar-brand {
    gap: 10px;
  }
  .topbar-brand .brand-mark {
    width: 30px;
    height: 30px;
  }
  .topbar-title {
    font-size: 13px;
  }
  .topbar-user {
    display: none;
  }
  .topbar-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
  .view {
    padding: 20px 16px 48px;
  }
}

/* ---------- Naslov stranice ---------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 500;
}

.page-subtitle {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* "Obriši" u zaglavlju stranice (aktivista, događaj, sigurni glas) je crveni okvir na beloj
   podlozi, kao u redizajnu; puno crveno dugme ostaje u dijalogu potvrde brisanja. */
.page-actions .btn-danger {
  background: var(--surface);
  border-color: var(--danger-border);
  color: var(--danger);
}

.page-actions .btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-hover);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ---------- Kartice i sekcije ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-flush {
  padding: 0;
  overflow: hidden;
}

.section-title {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

/* ---------- Početna ----------
   Računar: naslov levo, brzo dodavanje desno; brojači u jednom redu; tri kartice u istom redu
   (zaglavlje 48px, redovi 72px — redovi se u sve tri kartice poklapaju). Tablet: brzo
   dodavanje ispod naslova (3 kolone), predstojeći događaji preko cele širine, ispod dve kartice.
   Telefon: sve jedno ispod drugog; brzo dodavanje je kartica posle predstojećih događaja. */

.home-header {
  align-items: center;
}

.quick-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Dugme brzog dodavanja: belo sa okvirom, plus u malom petrolej kvadratu */
.quick-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px 0 8px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.quick-add-btn:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--text);
}

.quick-add-plus {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
}

.quick-add-plus .icon {
  stroke-width: 2.4;
}

/* Brojači: ceo brojač je link (ikonica, natpis iznad broja, strelica desno) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(11, 100, 117, 0.14);
}

.stat-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.stat-icon .icon {
  stroke-width: 1.8;
}

.stat-card:hover .stat-icon {
  background: var(--accent);
  color: var(--accent-text);
}

.stat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-arrow {
  flex: none;
  display: inline-flex;
  color: var(--muted);
}

/* Kartice početne */
.home-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

.home-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 48px;
}

.home-card-title {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

.home-card-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.home-card-link:hover {
  text-decoration: underline;
}

.home-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Red u kartici: 72px (tablet 64px), linija iznad svakog reda */
.home-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-top: 1px solid var(--border-soft);
  color: var(--text);
}

.home-row-link {
  text-decoration: none;
}

.home-row-link:hover {
  color: var(--text);
  background: var(--row-hover);
}

.home-row-link:hover .home-row-title {
  color: var(--accent-hover);
}

.home-row-stack {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}

.home-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.home-row-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-row-sub {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-row-sub .num,
.home-row-count .num {
  font-family: var(--font-mono);
}

.home-row-strong {
  color: var(--text);
  font-weight: 500;
}

/* Broj pozvanih desno — vidi se samo kad je kartica preko cele širine (koordinator, tablet) */
.home-row-count {
  flex: none;
  font-size: 14px;
  color: var(--muted);
}

.home-empty {
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--muted);
}

/* Manja oznaka vrste izmene (22px, 12px) */
.badge-sm {
  min-height: 22px;
  padding: 0 8px;
  font-size: 12px;
  flex: none;
}

/* Brzo dodavanje kao kartica (samo telefon) */
.home-card-quick {
  display: none;
  gap: 12px;
}

.quick-add-stack {
  flex-direction: column;
  gap: 12px;
}

.quick-add-stack .quick-add-btn {
  min-height: 48px;
  padding: 0 14px;
  gap: 12px;
}

.quick-add-stack .quick-add-plus {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

/* Računar: tri kartice u istom redu (administrator), broj pozvanih se ne prikazuje */
@media (min-width: 901px) {
  .home-cards-admin {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-cards-admin .home-row-count {
    display: none;
  }
}

/* Tablet: brzo dodavanje ispod naslova u 3 kolone; predstojeći preko cele širine, ostale dve pored */
@media (min-width: 720px) and (max-width: 900px) {
  .home-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .quick-add-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
  }
  .quick-add-top .quick-add-btn {
    min-height: 48px;
    padding: 0 12px 0 10px;
  }
  .quick-add-top .quick-add-plus {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
  }
  .stat-card {
    gap: 12px;
    padding: 14px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
  }
  .stat-value {
    font-size: 26px;
  }
  .stat-arrow {
    display: none;
  }
  .home-cards {
    gap: 14px;
  }
  .home-cards-admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-cards-admin .home-card-upcoming {
    grid-column: 1 / -1;
  }
  .home-card {
    padding: 14px 18px;
  }
  .home-card-title {
    font-size: 17px;
  }
  .home-row {
    min-height: 64px;
  }
}

/* Telefon: brzo dodavanje ide u karticu posle predstojećih događaja; bez broja pozvanih */
@media (max-width: 719px) {
  .quick-add-top,
  .home-row-count {
    display: none;
  }
  .home-card-quick {
    display: flex;
    padding: 16px;
  }
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 14px 14px 14px 16px;
  }
  .stat-value {
    font-size: 26px;
  }
  .home-cards {
    gap: 16px;
  }
  .home-card {
    padding: 12px 16px;
  }
  .home-card-title {
    font-size: 17px;
  }
}

/* Kockica sa datumom (UI.dateTile): gore mesec ("OKT"), dole dan ("3.") u Unbounded-u;
   petrolej svetli, a današnji šafran sa slovima u mastilu i natpisom "DANAS".
   Veličine: sm 44×46 (tabela), md 52×56 (početna, lista na telefonu), lg 60×64 (zaglavlje). */
.date-tile {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 56px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text);
  line-height: 1.1;
}

.date-tile-today {
  background: var(--saffron);
  color: var(--ink);
}

.date-tile-day {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.date-tile-month {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.date-tile-today .date-tile-month {
  letter-spacing: 0.06em;
  color: var(--ink);
}

.date-tile-sm {
  gap: 1px;
  width: 44px;
  height: 46px;
  border-radius: var(--radius-sm);
}

.date-tile-sm .date-tile-day {
  font-size: 16px;
}

.date-tile-sm .date-tile-month {
  font-size: 9px;
}

.date-tile-lg {
  gap: 3px;
  width: 60px;
  height: 64px;
}

.date-tile-lg .date-tile-day {
  font-size: 22px;
}

/* ---------- Dugmad ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-control);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.btn-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* ---------- Forme ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.label {
  font-weight: 600;
  font-size: 14px;
}

.req {
  color: var(--danger);
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.field-checkbox .label {
  cursor: pointer;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

/* Telefon, datum i vreme u poljima su u istom fontu kao u tabelama (JetBrains Mono) */
.input[type="tel"],
.input[type="date"],
.input[type="time"] {
  font-family: var(--font-mono);
}

/* Padajuća lista: sopstvena strelica (siva), ista na svim pregledačima */
select.input {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566164' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  cursor: pointer;
}

.input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.input:hover {
  border-color: var(--muted);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.field-invalid .input {
  border-color: var(--danger);
}

.field-invalid .input:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.field-hint {
  font-size: 13px;
  color: var(--muted);
}

/* Greška ispod polja: crvena ikonica i kratak tekst (npr. "Unesite mesto.") */
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--danger);
}

.field-error .icon {
  margin-top: 1px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field-wide,
.form-section {
  grid-column: 1 / -1;
}

/* Naslov sekcije unutar kartice ili forme (UI.sectionHeading): petrolej ikonica 16px, sitna
   velika slova (12/700, razmak .08em, petrolej) i linija do kraja reda. */
.subsection-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--accent);
}

.subsection-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.subsection-line {
  flex: 1;
  min-width: 16px;
  height: 1px;
  margin-left: 6px;
  background: var(--border);
}

/* U formi: veći razmak iznad svake nove sekcije (sekcije razdvaja razmak od 24px) */
.form-grid > .form-section:not(:first-child) {
  margin-top: 8px;
}

/* "Polja označena zvezdicom (*) su obavezna." ispod polja forme */
.form-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

.form-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}

.input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.input-icon {
  position: relative;
  min-width: 0;
}

.input-icon > .icon {
  position: absolute;
  z-index: 1; /* iznad polja i kad je polje u omotaču sa position (pretraga sa predlozima) */
  left: 12px;
  top: 21px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

@media (max-width: 900px) {
  .input-icon > .icon {
    top: 22px;
  }
}

@media (max-width: 719px) {
  .input-icon > .icon {
    top: 24px;
  }
}

.input-icon .input {
  padding-left: 38px;
}

/* ---------- Obaveštenja u formi (prijava) ---------- */

/* Ikonica levo i tekst: petrolej svetlo (informacija) ili crveno svetlo (greška) */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}

.notice .icon {
  margin-top: 1px;
}

.notice-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.notice-info {
  background: var(--info-soft);
  color: var(--accent-hover);
}

/* ---------- Alatna traka liste ---------- */

/* Alatna traka liste (pretraga, filter po mestu, izvoz) u vrhu kartice, odvojena linijom */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1 1 420px;
  min-width: 0;
}

.toolbar-filters > * {
  flex: 1 1 200px;
  max-width: 320px;
}

.toolbar-filters > .btn {
  flex: none;
}

/* ---------- Tabele ---------- */

/* position: relative — skriveni natpis (.sr-only) u zaglavlju ostaje unutar okvira sa skrolom
   i ne širi celu stranicu */
.table-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table th,
.table td {
  padding: 12px 20px;
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.table tbody tr:hover {
  background: var(--row-hover);
}

.table tbody td {
  border-bottom: 1px solid var(--border-soft);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.row-link {
  cursor: pointer;
}

.table a.cell-link {
  font-weight: 600;
  text-decoration: none;
}

.table a.cell-link:hover {
  text-decoration: underline;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}

.th-sort::after {
  content: "↕";
  opacity: 0.45;
  font-size: 12px;
}

th[aria-sort="ascending"] .th-sort,
th[aria-sort="descending"] .th-sort {
  color: var(--accent);
}

th[aria-sort="ascending"] .th-sort::after {
  content: "▲";
  opacity: 1;
}

th[aria-sort="descending"] .th-sort::after {
  content: "▼";
  opacity: 1;
}

.th-sort:hover {
  color: var(--text);
}

.col-actions {
  text-align: right !important;
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.text-mono {
  font-variant-numeric: tabular-nums;
}

/* Datumi, vreme i telefoni u tabelama: JetBrains Mono (zaglavlje kolone ostaje u običnom fontu) */
.table td.text-mono {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* ---------- Paginacija ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.pager-info {
  color: var(--muted);
}

.pager-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pager-gap {
  padding: 0 4px;
  color: var(--muted);
}

/* Dugmad sa brojem strane (jedina imaju aria-label "Strana N"): cifre u JetBrains Mono */
.pager-buttons .btn[aria-label] {
  min-width: 34px;
  padding-left: 10px;
  padding-right: 10px;
  font-family: var(--font-mono);
}

/* ---------- Značke ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Bedž statusa prisustva ima tačku ispred teksta (boja teksta); oznake uloga i radnji je nemaju.
   Značenje uvek nosi tekst, tačka je samo ukras. */
.badge-status::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Šest statusa pozvanog aktiviste (boje iz redizajna, promenljive --st-* u :root) */
.badge-st-invited {
  background: var(--st-invited-bg);
  color: var(--st-invited-text);
}

.badge-st-confirmed {
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed-text);
}

.badge-st-attended {
  background: var(--st-attended-bg);
  color: var(--st-attended-text);
}

.badge-st-no_show {
  background: var(--st-no-show-bg);
  color: var(--st-no-show-text);
}

.badge-st-refused {
  background: var(--st-refused-bg);
  color: var(--st-refused-text);
}

.badge-st-excused {
  background: var(--st-excused-bg);
  color: var(--st-excused-text);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Red brojača (profil aktiviste, stranica događaja) ---------- */

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

/* Broj na brojaču: Unbounded 24/600 (redizajn: "counter-number") */
.mini-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mini-stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- Detalji ---------- */

.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 24px;
}

.detail-item dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.detail-item dd {
  margin: 0;
  font-size: 15px;
  word-break: break-word;
}

.detail-item dd.is-empty {
  color: var(--muted);
  font-style: italic;
}

.deleted-note {
  font-style: italic;
  color: var(--muted);
}

/* ---------- Stanja (učitavanje, greška, prazno) ---------- */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.state-error {
  color: var(--danger);
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--muted);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Dijalozi ---------- */

/* Dijalog: bela kartica zaobljena 16px sa dubokom senkom; zaglavlje odvojeno linijom,
   naslov u Unbounded-u; dugmad u sivom podnožju (Površina 2) odvojenom linijom. */
dialog.modal {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-dialog);
  overflow: hidden;
}

dialog.modal-sm {
  width: min(460px, calc(100vw - 24px));
}

dialog.modal-lg {
  width: min(760px, calc(100vw - 24px));
}

dialog.modal[open] {
  display: flex;
  flex-direction: column;
}

dialog.modal::backdrop {
  background: var(--overlay);
}

/* Zaglavlje: naslov levo, dugme X desno (na telefonu X ide levo od naslova) */
.modal-header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-close:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
}

.modal-body {
  padding: 22px 24px 0;
  overflow-y: auto;
}

/* Tekst potvrde (npr. "Da li ste sigurni da želite da obrišete…") */
.modal-message {
  color: var(--text);
  padding-bottom: 20px;
  text-wrap: pretty;
}

.modal-footer,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal-footer {
  flex: none;
}

/* U formi su dugmad deo forme (unutar dela koji se pomera), pa se podnožje
   lepi za dno dijaloga i ide od ivice do ivice (poništava bočni razmak tela dijaloga). */
.modal-actions {
  margin: 20px -24px 0;
  position: sticky;
  bottom: 0;
}

@media (min-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Obaveštenja (toast) ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

/* Uspeh: mastilo sa šafran krugom i kvačicom; greška: tamnocrvena */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 10px 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #ffffff;
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast-error {
  background: var(--danger-hover);
}

.toast-text {
  flex: 1;
  font-weight: 500;
}

.toast-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast-success .toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--saffron);
  color: var(--ink);
}

.toast-success .toast-icon .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.toast-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.toast-error .toast-close {
  color: #f5d0cc;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Pretraga sa predlozima ---------- */

.ac {
  position: relative;
}

.ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.ac-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.ac-item:hover,
.ac-item.active {
  background: var(--accent-soft);
}

.ac-main {
  font-weight: 600;
}

.ac-sub,
.ac-empty,
.ac-status {
  font-size: 13px;
  color: var(--muted);
}

.ac-empty {
  padding: 10px;
}

.ac-status:empty {
  display: none;
}

.ac-status {
  margin-top: 4px;
}

.chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}

.chip-text {
  font-weight: 600;
  color: var(--accent-hover);
}

/* ---------- Prekidač pisma ---------- */

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* Prekidač preko cele širine (meni): dva dugmeta jednake širine */
.seg-full {
  display: flex;
}

.seg-full .seg-btn {
  flex: 1;
}

.seg-btn {
  min-width: 46px;
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(14, 42, 47, 0.14);
}

/* ---------- Prijava ---------- */

/* Bela kartica na mastilu, zaobljena 16px, sa dubokom senkom. Redom: znak sa nazivom, naslov,
   obaveštenje, forma, a ispod linije prekidač pisma. */
.login-page {
  background: var(--ink);
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.login-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 28px 28px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-brand {
  padding: 0;
}

.login-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
}

.login-heading .muted {
  font-size: 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card .btn-block {
  min-height: 44px;
  margin-top: 4px;
}

.login-footer {
  display: flex;
  justify-content: center;
  padding-top: 20px;
  margin-top: -4px;
  border-top: 1px solid var(--border-soft);
}

.login-footer .seg-btn {
  padding: 4px 14px;
  font-weight: 500;
}

.login-footer .seg-btn.active {
  font-weight: 600;
}

/* Telefon: manji razmaci, naslov 22px, polja i dugmad 48px (iz opštih pravila), prekidač 38px */
@media (max-width: 719px) {
  .login-wrap {
    padding: 32px 16px;
  }
  .login-card {
    gap: 22px;
    padding: 28px 20px 24px;
  }
  .login-brand .brand-name {
    font-size: 14px;
  }
  .login-title {
    font-size: 22px;
  }
  .login-card .btn-block {
    min-height: 48px;
    font-size: 16px;
  }
  .login-footer .seg-btn {
    min-height: 38px;
    padding: 4px 16px;
    font-size: 15px;
  }
}

/* ---------- Avatar sa inicijalima (aktivisti, korisnici) ---------- */

/* Krug petrolej svetli sa petrolej slovima (UI.avatar). Krug korisnika u meniju je .avatar (mastilo). */
.avatar-light {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar-lg {
  width: 60px;
  height: 60px;
  font-size: 20px;
}

/* ---------- Dugme sa ikonicom (u tabelama) ---------- */

/* Uokvireno, 34×34 na računaru (44×44 na dodir, videti ispod). Obriši/Ukloni: crveni okvir i ikonica. */
.btn-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

.btn-icon-danger {
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-icon-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-hover);
}

.btn-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Paginacija na telefonu ---------- */

/* Na računaru i tabletu se vide brojevi strana; na telefonu samo dva velika dugmeta i
   tekst "· strana X od Y" (videti @media ispod). */
.pager-mobile,
.pager-page-of {
  display: none;
}

.pager-info .num {
  font-family: var(--font-mono);
}

/* ---------- Tablet i telefon: sve što se dodiruje je visoko bar 44px (telefon 48px) ---------- */

@media (max-width: 900px) {
  .btn {
    min-height: 44px;
  }
  .btn-sm,
  .btn-icon {
    min-height: 44px;
    min-width: 44px;
  }
  .btn-icon {
    height: 44px;
    width: 44px;
  }
  /* Polja 16px — manji tekst bi na iPhone-u zumirao stranicu pri unosu */
  .input {
    min-height: 44px;
    font-size: 16px;
  }
  .table {
    font-size: 16px;
  }
  .modal-close {
    width: 44px;
    height: 44px;
  }
  dialog.modal {
    width: min(640px, calc(100vw - 48px));
  }
  dialog.modal-sm {
    width: min(460px, calc(100vw - 48px));
  }
}

@media (max-width: 719px) {
  .btn {
    min-height: 48px;
  }
  .input {
    min-height: 48px;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Paginacija: "Prikazano 1–15 od N · strana X od Y" i dva velika dugmeta */
  .pager {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .pager-info {
    text-align: center;
  }
  .pager-page-of {
    display: inline;
  }
  .pager-buttons {
    display: none;
  }
  .pager-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Dijalog sa formom preko celog ekrana: X gore levo, dugmad dole jedno pored drugog.
     Mali dijalog potvrde (modal-sm) ostaje kartica na sredini. */
  dialog.modal-md,
  dialog.modal-lg {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .modal-header {
    gap: 6px;
    padding: 6px 16px 6px 6px;
    min-height: 56px;
    justify-content: flex-start;
  }
  .modal-close {
    order: -1;
  }
  .modal-title {
    font-size: 18px;
    line-height: 1.3;
  }
  dialog.modal-sm .modal-header {
    padding-left: 16px;
  }
  dialog.modal-sm .modal-close {
    order: 0;
    margin-left: auto;
  }
  .modal-body {
    flex: 1;
    padding: 22px 16px 0;
  }
  .modal-actions,
  .modal-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 16px 20px;
  }
  .modal-actions {
    margin: 20px -16px 0;
  }

  /* Obaveštenje (toast) dole preko cele širine */
  .toasts {
    left: 16px;
    right: 16px;
    width: auto;
  }
  .toast {
    min-height: 52px;
    padding-right: 6px;
  }
  .toast-close {
    width: 40px;
    height: 40px;
  }

  /* Razmak između blokova na telefonu je 16px (na računaru 20px) */
  .section,
  .page-header {
    margin-bottom: 16px;
  }
}

/* ---------- Mali ekrani: tabele postaju kartice ---------- */

@media (max-width: 719px) {
  .page-title {
    font-size: 22px;
  }

  .toolbar,
  .pager {
    padding-left: 14px;
    padding-right: 14px;
  }

  .toolbar-filters > * {
    max-width: none;
  }

  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tbody tr {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }

  .table tbody tr:last-child {
    border-bottom: 0;
  }

  .table tbody td {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 4px 0;
    border: 0;
    text-align: right;
  }

  .table tbody td::before {
    content: attr(data-label);
    flex: none;
    max-width: 45%;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--muted);
    text-align: left;
    padding-top: 2px;
  }

  .col-actions {
    text-align: right !important;
  }

  /* Brojači ostaju u jednom redu (manji tekst) */
  .mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mini-stat {
    padding: 10px 12px;
  }

  /* Unbounded je širi od običnog fonta, pa je broj na telefonu malo manji (20px) */
  .mini-stat-value {
    font-size: 20px;
  }

  .mini-stat-label {
    font-size: 12.5px;
    line-height: 1.3;
  }

  .stat-value {
    font-size: 30px;
  }
}

/* ============================================================
   Liste i stranice detalja (redizajn, korak 4 — Aktivisti; isti delovi služe i ostalim listama)
   Stoji na kraju fajla da bi pravila za telefon imala prednost nad starijim pravilima iznad.
   ============================================================ */

/* Tekst samo za čitač ekrana (npr. natpis polja Napomena, zaglavlje kolone sa strelicom) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Zaglavlje stranice sa linkom "nazad" i avatarom / kockicom ---------- */

.page-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head .back-link {
  align-self: flex-start;
  margin: 0;
}

.page-head .page-header {
  margin-bottom: 0;
}

.page-header-lead {
  align-items: center;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.page-title-row .page-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Podnaslov liste: "U bazu je uneto ukupno 248 aktivista." — broj i imenica podebljani */
.list-total strong {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Alatna traka liste: pretraga i izbor mesta ---------- */

.list-card .toolbar {
  justify-content: flex-start;
}

.toolbar-filters > .toolbar-search {
  flex: 1 1 280px;
  max-width: none;
}

.toolbar-filters > .toolbar-city {
  flex: 0 1 240px;
}

.input-icon select.input {
  padding-left: 36px;
}

/* ---------- Tabela liste ---------- */

.table .col-person {
  width: 44%;
}

.table .col-phone {
  width: 26%;
}

/* Ime sa avatarom (link na pregled) */
.person-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  text-decoration: none;
}

.person-link:hover span:last-child {
  text-decoration: underline;
}

.phone-link {
  font-family: var(--font-mono);
  text-decoration: none;
}

.phone-link:hover {
  text-decoration: underline;
}

/* ---------- Lista na telefonu (umesto tabele) ---------- */

.mobile-list {
  display: none;
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.mobile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}

.mobile-item:first-child {
  border-top: 0;
}

.mobile-item-stack {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}

.mobile-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.mobile-item-title {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-sub {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-sub .phone-link {
  color: var(--text);
}

.mobile-item-sub .num,
.mobile-item-sub.num {
  font-family: var(--font-mono);
}

.mobile-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.mobile-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

/* ---------- Kartica sa tabelom (profil aktiviste, događaj) ---------- */

.table-card {
  margin-bottom: 20px;
}

.table-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.table-card-empty {
  padding: 18px 20px;
}

/* Tabela bez naizmeničnih boja (ima redove sa razlogom ispod) */
.table-reasons tbody tr:nth-child(even),
.table-plain tbody tr:nth-child(even) {
  background: transparent;
}

.table-reasons .col-date {
  width: 150px;
}

.table-reasons .col-time {
  width: 110px;
}

.table-reasons th.col-status,
.table-reasons td.col-status {
  width: 200px;
  padding-right: 8px;
  text-align: right;
}

.table-reasons th.col-reason,
.table-reasons td.col-reason {
  width: 52px;
  padding-left: 0;
  text-align: right;
}

/* Kad je razlog otvoren, red i traka ispod izgledaju kao jedna celina */
.table-reasons tr.is-open td {
  border-bottom: 0;
}

.table-reasons tr.reason-row:hover {
  background: transparent;
}

.table-reasons tr.reason-row td {
  padding: 0 20px 14px;
  white-space: normal;
}

/* Dugme sa strelicom za razlog (32px); otvoreno: petrolej okvir i podloga */
.reason-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
}

.reason-toggle:hover {
  border-color: var(--accent);
}

.reason-toggle.is-open {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Traka sa razlogom: šafran (odsustvo) ili crvenkasta (odbijanje), leva linija 3px */
.reason-panel {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--saffron);
  background: #fdf8ec;
}

.reason-panel-refused {
  border-left-color: var(--danger-border);
  background: #fdf3f2;
}

.reason-panel-icon {
  flex: none;
  padding-top: 2px;
  color: var(--saffron-text);
}

.reason-panel-refused .reason-panel-icon,
.reason-panel-refused .reason-panel-label {
  color: var(--danger);
}

.reason-panel-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.reason-panel-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--saffron-text);
}

.reason-panel-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
}

.mobile-item .reason-panel {
  margin-top: 6px;
}

/* ---------- Brojači (profil aktiviste) ---------- */

.mini-stats-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.label-short {
  display: none;
}

/* ---------- Osnovni podaci (profil) ---------- */

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 20px;
  padding: 20px 24px 24px;
}

.detail-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-card .detail-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.detail-item dt {
  margin-bottom: 0;
}

.detail-item dd {
  overflow-wrap: anywhere;
}

.detail-item dd.mono {
  font-family: var(--font-mono);
}

.detail-item dd a {
  text-decoration: none;
}

.detail-item dd a:hover {
  text-decoration: underline;
}

/* Napomena (i Opis događaja): tekst u svetlom polju, prelomi reda se čuvaju */
.note-box {
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.note-empty {
  font-style: italic;
  font-size: 15px;
}

/* Višeredno polje u formi */
.textarea {
  min-height: 0;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.input.mono {
  font-family: var(--font-mono);
}

/* ---------- Tablet i telefon ---------- */

@media (max-width: 900px) {
  .textarea {
    min-height: 0;
  }
  .reason-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 719px) {
  /* Zaglavlje liste: Dodaj preko širine, Izvoz samo ikonica (48px) */
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1 1 auto;
  }
  .page-actions .btn-export {
    order: 2;
    flex: none;
    width: 48px;
    padding: 0;
  }
  .page-actions .btn-export span {
    display: none;
  }

  /* Lista: pretraga i mesto van kartice; kartica je samo oko liste; paginacija ispod */
  .list-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .list-card .toolbar {
    padding: 0 0 16px;
    background: transparent;
    border: 0;
  }
  .list-card .toolbar-filters > .toolbar-search {
    flex: 1 1 180px;
  }
  .list-card .toolbar-filters > .toolbar-city {
    flex: 1 1 130px;
  }
  .list-card .list-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .list-card .pager {
    padding: 16px 0 0;
    border-top: 0;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-list {
    display: block;
  }

  /* Profil: tri brojača u jednom redu sa kraćim natpisima; podaci u 2 kolone */
  .mini-stats-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .label-long {
    display: none;
  }
  .label-short {
    display: inline;
  }
  .detail-card {
    padding: 16px;
    gap: 20px;
  }
  .detail-card .detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }
  .table-card {
    margin-bottom: 16px;
  }
  .table-card-head {
    padding: 14px 16px;
  }
  .page-title-row {
    gap: 12px;
  }
  .page-title-row .avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 17px;
  }
}

/* ============================================================
   Događaji (redizajn, korak 5): lista, prisustvo, meni "Promeni status", lista pozvanih
   ============================================================ */

/* Lista događaja: Datum = kockica + vreme; broj aktivista desno */
.table .col-event-date {
  width: 160px;
}

.event-date-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.event-date-time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}

.table th.col-num,
.table td.col-num {
  width: 120px;
  text-align: right;
}

/* Lista događaja na telefonu: kockica, naziv / vreme / "lokacija · mesto", desno broj pozvanih */
.mobile-event {
  align-items: center;
  min-height: 76px;
}

.mobile-event-count {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.mobile-event-count .num {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Dugme za smer sortiranja iznad liste (telefon) */
.mobile-sort {
  display: none;
  justify-content: flex-end;
  padding: 4px 8px 4px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.mobile-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- Boje statusa za trake, tačke i pločice ---------- */

.status-bg-invited { background: var(--st-invited-bar); }
.status-bg-confirmed { background: var(--st-confirmed-bar); }
.status-bg-attended { background: var(--st-attended-bar); }
.status-bg-no_show { background: var(--st-no-show-bar); }
.status-bg-refused { background: var(--st-refused-bar); }
.status-bg-excused { background: var(--st-excused-bar); }

.status-dot {
  flex: none;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot-invited { background: var(--st-invited-bar); }
.status-dot-confirmed { background: var(--st-confirmed-bar); }
.status-dot-attended { background: var(--st-attended-bar); }
.status-dot-no_show { background: var(--st-no-show-bar); }
.status-dot-refused { background: var(--st-refused-bar); }
.status-dot-excused { background: var(--st-excused-bar); }

/* ---------- Prisustvo: ukupno, traka, 6 pločica ---------- */

.att-total {
  flex: none;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.att-total strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

.subsection-heading .att-total {
  margin-left: 0;
}

/* Vodoravna traka: širina dela srazmerna broju (flex-grow postavlja events.js) */
.att-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--neutral-soft);
}

.att-bar-part {
  flex: 1 1 0;
  min-width: 4px;
}

.att-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.att-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
}

.att-tile-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.att-tile-label .status-dot {
  width: 8px;
  height: 8px;
}

.att-tile-numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.att-tile-count {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.att-tile-percent {
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0.8;
}

.att-tile-invited { background: var(--st-invited-bg); color: var(--st-invited-text); }
.att-tile-confirmed { background: var(--st-confirmed-bg); color: var(--st-confirmed-text); }
.att-tile-attended { background: var(--st-attended-bg); color: var(--st-attended-text); }
.att-tile-no_show { background: var(--st-no-show-bg); color: var(--st-no-show-text); }
.att-tile-refused { background: var(--st-refused-bg); color: var(--st-refused-text); }
.att-tile-excused { background: var(--st-excused-bg); color: var(--st-excused-text); }

/* ---------- Pozvani aktivisti ---------- */

/* Zaglavlje kartice: naslov, ispod polje za dodavanje (pretraga + Dodaj) */
.attendees-card .table-card-head {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px 20px 16px;
}

.attendee-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: none;
  margin: 0;
}

.attendee-add-row {
  display: flex;
  gap: 10px;
}

.attendee-add-input {
  flex: 1;
  min-width: 0;
}

.attendee-add-row .btn {
  flex: none;
}

.table-reasons .col-att-phone {
  width: 170px;
}

.table-reasons .col-att-status {
  width: 220px;
}

.table-reasons th.col-att-actions,
.table-reasons td.col-att-actions {
  width: 230px;
  text-align: right;
}

.col-att-actions .row-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.status-menu-btn {
  gap: 6px;
  padding-left: 12px;
  padding-right: 10px;
}

.status-with-reason {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-with-reason .reason-toggle {
  width: 28px;
  height: 28px;
}

/* Meni "Promeni status" (position: fixed; mesto računa ui.js::statusMenu) */
.status-menu-wrap {
  display: inline-flex;
}

.status-menu-wrap.is-block {
  flex: 1;
}

.status-menu-btn .icon {
  margin-left: -2px;
}

.status-menu-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.status-menu {
  position: fixed;
  z-index: 70;
  width: 236px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-menu);
  text-align: left;
}

.status-menu-title {
  padding: 4px 10px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.status-menu-item:hover,
.status-menu-item:focus-visible {
  background: var(--row-hover);
}

.status-menu-item.is-current {
  background: var(--accent-soft);
  font-weight: 600;
}

.status-menu-item .icon {
  color: var(--accent);
}

.status-menu-label {
  flex: 1;
}

/* Uvodni tekst u dijalogu (npr. za koga se upisuje razlog) */
.form-intro {
  margin-bottom: 16px;
  color: var(--text);
}

/* ---------- Tablet i telefon ---------- */

@media (max-width: 900px) {
  .att-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  /* Na dodir je i dugme za razlog bar 44px */
  .status-with-reason .reason-toggle {
    width: 44px;
    height: 44px;
  }
  .status-menu-item {
    min-height: 44px;
  }
}

@media (max-width: 719px) {
  .mobile-sort {
    display: flex;
  }
  .att-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .att-tile-count {
    font-size: 22px;
  }
  .attendees-card .table-card-head {
    padding: 14px 16px;
  }
  .attendee-add-row {
    flex-direction: column;
  }
  .attendee-item {
    gap: 10px;
    padding: 12px 0;
  }
  .attendee-item .mobile-item-top {
    align-items: flex-start;
  }
  .attendee-item-actions {
    display: flex;
    gap: 10px;
  }
  .attendee-item-actions .status-menu-btn {
    width: 100%;
  }
  .attendee-item .mobile-item-sub .phone-link {
    color: var(--muted);
  }
}

/* ---------- Korisnici (redizajn, korak 7) ---------- */

/* Ćelija "Korisnik": krug 36px, ime (600) i "(vi)", ispod korisničko ime u JetBrains Mono */
.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-cell .avatar-light {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.user-cell-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.user-cell-name {
  font-weight: 600;
  color: var(--text);
}

.user-cell-you {
  font-weight: 400;
  color: var(--muted);
}

.user-cell-username {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* Datum i vreme (Napravljen, Poslednja prijava) */
.text-date {
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* "Nije se prijavljivao do sada": sivo, koso, običan font */
.never-logged {
  font-family: var(--font);
  font-size: 14px;
  font-style: italic;
  color: var(--muted);
}

.users-table .row-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

/* Kartice na telefonu (umesto tabele) */
.user-item-list {
  padding: 0;
}

.user-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.user-item + .user-item {
  margin-top: 12px;
}

.user-item-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-item-top .user-cell-name {
  font-size: 16px;
}

.user-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-item-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.user-item-dates dt {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.user-item-dates dd {
  margin: 2px 0 0;
}

.user-item-dates .text-date,
.user-item-dates .never-logged {
  white-space: normal;
}

/* margin-top: auto — na tabletu (dve kartice u redu) dugmad su u istoj visini */
.user-item-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.user-item-actions .btn {
  flex: 1 1 0;
  min-height: 44px;
}

.user-item-actions .btn-icon {
  width: 44px;
  height: 44px;
}

/* Tablet: tabela korisnika ne staje (6 kolona i 3 dugmeta od 44px), pa se prikazuju kartice
   kao na telefonu, dve u redu */
@media (min-width: 720px) and (max-width: 900px) {
  .users-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .users-card .desktop-only {
    display: none !important;
  }
  .users-card .user-item-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .users-card .user-item + .user-item {
    margin-top: 0;
  }
  .users-card .pager {
    padding: 16px 0 0;
    border-top: 0;
  }
}

@media (max-width: 719px) {
  /* Svaki korisnik je zasebna kartica, pa sama lista nema okvir */
  .users-card .list-body {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
}

/* ---------- Evidencija izmena (redizajn, korak 8) ---------- */

.audit-filters > .toolbar-search {
  flex: 1 1 260px;
  max-width: none;
}

.audit-filters > .audit-select-user {
  flex: 0 1 200px;
}

.audit-filters > .audit-select-action {
  flex: 0 1 180px;
}

.audit-filters > .audit-select-period {
  flex: 0 1 210px;
}

.audit-select select.input {
  width: 100%;
}

/* Dugme "Filteri" postoji samo na telefonu (videti @media ispod) */
.audit-filters > .audit-filters-btn {
  display: none;
}

.audit-table .col-audit-time,
.audit-table .col-audit-action {
  white-space: nowrap;
}

.audit-table .col-audit-user {
  min-width: 120px;
}

.audit-table .col-audit-item {
  min-width: 170px;
}

.audit-table .col-audit-details {
  min-width: 220px;
}

/* Podatak: vrsta (sitno, sivo), ispod naziv stavke */
.audit-item {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.audit-item-type {
  font-size: 13px;
  color: var(--muted);
}

.audit-item-name {
  font-weight: 600;
  overflow-wrap: break-word;
}

/* Izmena: "polje: staro → novo" (staro crveno precrtano, novo zeleno), napomene sivo */
.audit-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 14px;
}

.audit-change {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.audit-field {
  color: var(--muted);
}

.audit-old,
.audit-new {
  padding: 1px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.audit-old {
  background: var(--danger-soft);
  color: var(--danger);
}

.audit-new {
  background: var(--success-soft);
  color: var(--success);
  text-decoration: none;
}

.audit-arrow {
  color: var(--muted);
}

.audit-note {
  color: var(--muted);
}

.audit-reason {
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.audit-values {
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.audit-sep {
  color: var(--muted);
}

/* Kartice na telefonu */
.audit-card-list,
.backup-item-list {
  padding: 0;
}

.audit-card-item,
.backup-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.audit-card-item + .audit-card-item,
.backup-item + .backup-item {
  margin-top: 10px;
}

.audit-card-top,
.backup-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.audit-card-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.audit-card-item .audit-item-name {
  font-size: 16px;
}

.audit-card-user {
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--muted);
}

/* Najuži telefoni: dugme "Filteri" samo sa ikonicom, da pretraga ima mesta */
@media (max-width: 359px) {
  .audit-filters > .audit-filters-btn {
    width: 48px;
    padding: 0;
    justify-content: center;
  }
  .audit-filters > .audit-filters-btn span {
    display: none;
  }
}

/* ---------- Rezervna kopija (redizajn, korak 8) ---------- */

.backup-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-bottom: 20px;
  padding: 20px 24px;
}

.backup-summary-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.backup-summary-text {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.backup-summary-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

.backup-summary-when {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
}

.backup-summary-none {
  font-weight: 400;
  color: var(--muted);
}

.backup-summary-note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.backup-summary .backup-make {
  flex: none;
}

.backups-table .col-num {
  text-align: right;
}

.backups-table .col-backup-time {
  white-space: nowrap;
}

.backup-status-failed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.backup-reason {
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.backups-hint {
  margin: 0;
  padding: 12px 20px 16px;
  font-size: 13px;
  color: var(--muted);
}

.backup-item {
  gap: 10px;
}

.backup-item-when {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.backup-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.backup-download-wide {
  width: 100%;
  min-height: 44px;
}

/* Tablet: tabele Evidencije i Rezervne kopije ne staju bez vodoravnog skrola, pa se, kao na
   telefonu, prikazuju kartice (pretraga i izbori ostaju u jednom redu iznad njih). */
@media (min-width: 720px) and (max-width: 900px) {
  .audit-card,
  .backups-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }
  .audit-card .toolbar {
    padding: 0 0 16px;
    background: transparent;
    border: 0;
  }
  .audit-card .desktop-only,
  .backups-card .desktop-only {
    display: none !important;
  }
  .audit-card .mobile-list,
  .backups-card .mobile-list {
    display: block;
  }
  .audit-card .pager,
  .backups-card .pager {
    padding: 16px 0 0;
    border-top: 0;
  }
  .backups-card .table-card-head {
    padding: 4px 0 10px;
    border-bottom: 0;
  }
  .backups-hint {
    padding: 12px 0 0;
  }
}

@media (max-width: 719px) {
  /* Evidencija: pretraga i "Filteri" u jednom redu; izbori su u dijalogu */
  .page-header-solo-action {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .page-header-solo-action .page-actions {
    width: auto;
    flex: none;
  }
  .audit-filters {
    flex-wrap: nowrap;
  }
  .audit-filters > .toolbar-search {
    flex: 1 1 auto;
    min-width: 0;
  }
  .audit-filters > .audit-select {
    display: none;
  }
  .audit-filters > .audit-filters-btn {
    display: inline-flex;
    flex: none;
    min-height: 48px;
  }
  .audit-filters > .btn-ghost {
    display: none;
  }

  /* Svaka stavka je zasebna kartica, pa sama lista nema okvir */
  .audit-card .list-body,
  .backups-card .list-body {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* Rezervna kopija: ikonica i vreme u prvom redu, napomena i dugme preko cele širine */
  .backup-summary {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }
  .backup-summary-icon {
    width: 48px;
    height: 48px;
  }
  .backup-summary-text {
    display: contents;
  }
  .backup-summary-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.35;
  }
  .backup-summary-label {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
  }
  .backup-summary-colon {
    display: none;
  }
  .backup-summary-note,
  .backup-summary .backup-make {
    grid-column: 1 / -1;
  }
  .backup-summary .backup-make {
    min-height: 48px;
    font-size: 16px;
  }
  .backups-card .table-card-head {
    padding: 4px 0 10px;
    border-bottom: 0;
  }
  .backups-card .section-title {
    font-size: 17px;
  }
  .backups-hint {
    padding: 12px 0 0;
    text-align: center;
  }
}

/* ---------- Površine za dodir na tabletu i telefonu (korak 9: najmanje 44px) ---------- */

/* "mesto · telefon" ispod imena: tekst se skraćuje, telefon je poseban deo reda (UI.subLineWithPhone) */
.mobile-item-sub-phone {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.mobile-item-sub-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-item-sep {
  flex: none;
  padding: 0 5px;
}

.mobile-item-sub-phone .phone-link {
  flex: none;
}

@media (max-width: 900px) {
  /* Ceo red liste vodi na stavku: link imena se "razvlači" preko reda; dugmad, telefon i
     razlog ostaju iznad njega i rade svoje */
  .mobile-item {
    position: relative;
  }
  .mobile-item .mobile-item-title::after {
    content: "";
    position: absolute;
    inset: 0;
  }
  .mobile-item button,
  .mobile-item select,
  .mobile-item a:not(.mobile-item-title),
  .mobile-item .reason-panel {
    position: relative;
    z-index: 1;
  }

  /* Telefon, "Nazad na …" i linkovi u podacima: veća površina za dodir bez pomeranja rasporeda */
  .phone-link,
  .detail-item dd a {
    display: inline-block;
    padding: 14px 0;
    margin: -14px 0;
  }
  .page-head .back-link {
    padding: 12px 0;
    margin: -12px 0;
  }
  /* Tabele na tabletu: link u ćeliji, osoba (krug + ime) i zaglavlje za sortiranje */
  .table a.cell-link {
    display: inline-block;
    padding: 12px 0;
    margin: -12px 0;
  }
  .table .person-link {
    padding: 6px 0;
    margin: -6px 0;
  }
  .table .th-sort {
    min-height: 44px;
    margin: -13px 0;
  }
  .topbar-brand {
    min-height: 44px;
  }
  .mobile-sort-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
