/* Global gray background override */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: #f3f6fb;
  color: #0f172a;
  height: 100%;
  overflow-x: hidden;
}

/* minimal side padding on desktop only */
@media (min-width: 768px) {
  html, body { padding-left: .25rem !important; padding-right: .25rem !important; }
}

.container, .container-fluid, main, .main, .content, #content {
  background-color: transparent !important;
}

/* Layout polish for Bootstrap containers/rows – closer to Tailwind spacing */
.container, .container-fluid{
  padding-left: 1rem;
  padding-right: 1rem;
}

.row{
  row-gap: .75rem;
}

[class^="col-"], [class*=" col-"]{
  padding-top: .25rem;
  padding-bottom: .25rem;
}

/* keep cards white – ravniji, manje "bootstrap" izgled */
.card {
  background-color: #c9f5ff !important;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,.05);
}

/* Global page header (title + subtitle) */
.page-header{
  margin-bottom: 1rem;
}
.page-header .title{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.page-header .subtitle{
  color: #6b7280; /* slate-500 */
  font-size: .85rem;
}

/* Card sections */
.card .card-header{
  background: #fbfbfb;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.card .card-body{
  padding: 0.9rem 1rem;
}

/* ======================================
   Buttons – Tailwind-like, less Bootstrap
   ====================================== */
.btn{
  border-radius: .5rem;
  font-weight: 500;
  border-width: 1px;
  padding: .425rem .95rem;
  font-size: .9rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.05);
  transition: background-color .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease, transform .08s ease;
}

.btn:active{
  transform: translateY(1px);
  box-shadow: 0 0 0 rgba(15,23,42,0);
}

/* Primary = indigo */
.btn-primary{
  background-color: #4f46e5 !important; /* indigo-600 */
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}
.btn-primary:hover{
  background-color: #4338ca !important; /* indigo-700 */
  border-color: #4338ca !important;
}
.btn-primary:disabled,
.btn-primary.disabled{
  background-color: #a5b4fc !important; /* indigo-300 */
  border-color: #a5b4fc !important;
  color: #e5e7eb !important;
}

/* Secondary = slate */
.btn-secondary{
  background-color: #e5e7eb !important; /* gray-200 */
  border-color: #d1d5db !important;
  color: #111827 !important;
}
.btn-secondary:hover{
  background-color: #d1d5db !important; /* gray-300 */
  border-color: #9ca3af !important;
}

/* Outline variants */
.btn-outline-secondary{
  border-color: #cbd5e1 !important; /* slate-300 */
  color: #334155 !important;        /* slate-700 */
  background-color: transparent !important;
}
.btn-outline-secondary:hover{
  background-color: #e5edf5 !important;
}

.btn-outline-primary{
  border-color: #6366f1 !important; /* indigo-500 */
  color: #4338ca !important;        /* indigo-700 */
  background-color: transparent !important;
}
.btn-outline-primary:hover{
  background-color: #eef2ff !important; /* indigo-50 */
}

/* Semantic colors */
.btn-success{
  background-color: #16a34a !important; /* green-600 */
  border-color: #16a34a !important;
  color: #ffffff !important;
}
.btn-success:hover{
  background-color: #15803d !important; /* green-700 */
}

.btn-danger{
  background-color: #dc2626 !important; /* red-600 */
  border-color: #dc2626 !important;
  color: #ffffff !important;
}
.btn-danger:hover{
  background-color: #b91c1c !important; /* red-700 */
}

.btn-warning{
  background-color: #f59e0b !important; /* amber-500 */
  border-color: #f59e0b !important;
  color: #111827 !important;
}
.btn-warning:hover{
  background-color: #d97706 !important; /* amber-600 */
}

.btn-link{
  border-color: transparent !important;
  background-color: transparent !important;
  color: #4f46e5 !important;
  padding-left: 0;
  padding-right: 0;
}
.btn-link:hover{
  color: #4338ca !important;
  text-decoration: underline;
}

.btn-sm{
  padding: .25rem .6rem;
  font-size: .8rem;
  border-radius: .375rem;
}

.btn-lg{
  padding: .6rem 1.2rem;
  font-size: .95rem;
  border-radius: .75rem;
}

/* Tables polish */
.table thead th{
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #374151; /* slate-700 */
  background: #f9fafb;
}
.table tbody td{
  vertical-align: middle;
}
.compact-table{ font-size: .82rem; }
.compact-table thead th{ font-size: .70rem; }
.compact-table th, .compact-table td{ padding: .35rem .50rem; }
.compact-table .numcol{ font-variant-numeric: tabular-nums; white-space: nowrap; }
.compact-table .text-end{ font-variant-numeric: tabular-nums; }

/* Badges polish – мањи радијус, без pill изгледа */
.badge{ border-radius: 4px; }
.badge.text-bg-light{ background: #eef2f7 !important; color: #334155 !important; }
.badge.text-bg-success{ background: #22c55e !important; }
.badge.text-bg-danger{ background: #ef4444 !important; }
.badge.bg-success{ background: #22c55e !important; }
.badge.bg-danger{ background: #ef4444 !important; }

/* Alerts – flatter, Tailwind-inspired */
.alert{
  border-radius: .75rem;
  border-width: 1px;
  padding: .65rem .9rem;
  font-size: .88rem;
}

.alert-primary{
  background-color: #eef2ff !important; /* indigo-50 */
  border-color: #c7d2fe !important;     /* indigo-200 */
  color: #312e81 !important;            /* indigo-900 */
}

.alert-success{
  background-color: #ecfdf3 !important; /* emerald-50 */
  border-color: #bbf7d0 !important;     /* emerald-200 */
  color: #14532d !important;            /* emerald-900 */
}

.alert-danger,
.alert-error{
  background-color: #fef2f2 !important; /* red-50 */
  border-color: #fecaca !important;     /* red-200 */
  color: #7f1d1d !important;            /* red-900 */
}

.alert-warning{
  background-color: #fffbeb !important; /* amber-50 */
  border-color: #fef3c7 !important;     /* amber-200 */
  color: #78350f !important;            /* amber-900 */
}

.alert-info{
  background-color: #ecfeff !important; /* cyan-50 */
  border-color: #bae6fd !important;     /* sky-200 */
  color: #0f172a !important;            /* slate-900 */
}

/* City structure grid cards */
.bm-card{ transition: box-shadow .2s ease, transform .08s ease; }
.bm-card:hover{ box-shadow: 0 10px 18px rgba(0,0,0,.08); transform: translateY(-1px); }

/* Form controls – Tailwind-like inputs/selects on top of Bootstrap */
.form-control,
.form-select{
  border-radius: .5rem;
  border-color: #d1d5db;
  padding: .45rem .7rem;
  font-size: .9rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}

.form-control:focus,
.form-select:focus{
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(129,140,248,.7);
}

textarea.form-control{
  min-height: 120px;
}

/* Modal look – softer card-like */
.modal-content{
  border-radius: 1rem;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 22px 45px rgba(15,23,42,.28);
}

.modal-header{
  border-bottom-color: rgba(15,23,42,.06);
}

.modal-footer{
  border-top-color: rgba(15,23,42,.06);
}

/* KPI tiles (for totals on BM detail) */
.kpi-grid{ margin-top: .25rem; }
.kpi-card{
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: .75rem .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.kpi-title{ font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; }
.kpi-value{ font-size: 1.15rem; font-weight: 700; }
.kpi-total      { border-left: 4px solid #0ea5e9; } /* cyan */
.kpi-visited    { border-left: 4px solid #22c55e; } /* green */
.kpi-visited-pct{ border-left: 4px solid #6366f1; } /* indigo */
.kpi-sig-plus   { border-left: 4px solid #f59e0b; } /* amber */

/* Focus highlight for totals card */
.card-highlight{
  animation: cardFlash 1.2s ease;
}
@keyframes cardFlash{
  0%{ box-shadow: 0 0 0 0 rgba(99,102,241,.0); }
  50%{ box-shadow: 0 0 0 8px rgba(99,102,241,.15); }
  100%{ box-shadow: 0 0 0 0 rgba(99,102,241,.0); }
}

/* ==========================
   Admin -> Финална база (voters)
   Compact / minimalist table
   ========================== */
/* Scroll wrapper: vertikalni scroll + kontrolisan horizontalni */
.admin-voters-table-wrap{
  max-height: 72vh;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;
}

/* Tabela: neka ima minimalnu širinu da kolone ne budu sabijene */
.admin-voters-table{
  font-size: 0.84rem;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1100px; /* ključno za mnogo kolona */
}

/* Ćelije: malo vazduha + bolja čitljivost */
.admin-voters-table th,
.admin-voters-table td{
  padding: 0.38rem 0.55rem;
  line-height: 1.15;
  white-space: nowrap;         /* mnogo kolona = jedan red */
  vertical-align: middle;
}

/* Sticky header + lepši izgled */
.admin-voters-table thead th{
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
}

/* Zebra + hover (olakšava praćenje reda) */
.admin-voters-table tbody tr:nth-child(even){
  background: rgba(0,0,0,.02);
}
.admin-voters-table tbody tr:hover{
  background: rgba(37,99,235,.06);
}

/* Opcionalno: “zalepljena” prva kolona (najbitnije) */
.a


body.dark-mode .admin-voters-table thead th{
  background: #f3f6fb;
  color: #e5e7eb;
}


/* ==========================
   Admin -> Users actions (fix dropdown wrapping/clipping)
   ========================== */
.admin-actions{ white-space: nowrap; position: relative; }
.admin-actions .d-flex{ flex-wrap: nowrap !important; }
.admin-actions-menu{ z-index: 3000; }

/* QR image link and action button styles for users table */
.qr-thumb-link {
  display: inline-block;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #0f172a;
  box-shadow: 0 1px 4px rgba(15,23,42,.07);
  transition: box-shadow .13s, border-color .13s, background .13s;
}
.qr-thumb-link:hover {
  background: #e0e7ef;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99,102,241,.13);
}
.qr-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: none;
  box-shadow: none;
}
.action-btn {
  border-radius: 6px;
  background: #6366f1;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(99,102,241,.09);
  transition: background .13s, box-shadow .13s;
}
.action-btn:hover {
  background: #4338ca;
  box-shadow: 0 2px 8px rgba(99,102,241,.18);
}

/* ===== FIX za /admin/field-stats ===== */
.field-stats-table {
  table-layout: auto !important;
}

.field-stats-table th,
.field-stats-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Lep font za zaglavlje tabela ===== */
.field-stats-table thead th {
  font-size: 0.72rem;          /* sitnije, profesionalno */
  font-weight: 600;            /* polu-bold, ne “debelo” */
  letter-spacing: 0.03em;      /* vazduh između slova */
  text-transform: uppercase;   /* ADMIN look */
  color: #374151;              /* slate-700 */
  background: #f9fafb;         /* blago siva */
  border-bottom: 1px solid #e5e7eb;
}
/* ===== Field stats tabela: normalan layout + dvoredni header ===== */
.field-stats-table { table-layout: auto !important; }

.field-stats-table th,
.field-stats-table td {
  white-space: normal;     /* dozvoli prelamanje u 2 reda */
  vertical-align: middle;
}

.field-stats-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
  color: #374151;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.field-stats-table .th-main {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.05;
}

.field-stats-table .th-sub {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0.65;
  margin-top: 2px;
}

/* Dark mode */
body.dark-mode .field-stats-table thead th {
  background: #f3f6fb;
  color: #e5e7eb;
  border-bottom-color: #1f2937;
}
/* =======================================================
   FIELD STATS – tabela (layout + tipografija + mobile clarity)
   ======================================================= */

/* Važno: za ovu tabelu NE želimo fixed layout */
.field-stats-table {
  table-layout: auto !important;
}

/* Dozvoli prelamanje teksta (header i ćelije) */
.field-stats-table th,
.field-stats-table td {
  white-space: normal;
  vertical-align: middle;
}

/* Header izgled */
.field-stats-table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
  color: #374151;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* Dvoredni header */
.field-stats-table .th-main {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.05;
}
.field-stats-table .th-sub {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0.65;
  margin-top: 2px;
}

/* Align helpers */
.field-stats-table .th-center { text-align: center; }
.field-stats-table .th-left   { text-align: left; }

/* Brojčane ćelije – centar + lepši brojevi */
.field-stats-table .td-center {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* PUNO IME – najbitnije: levo, kompaktno, 2 reda max */
.field-stats-table .td-name {
  text-align: left;
  min-width: 160px;
  max-width: 220px;
}

.field-stats-table .name-main {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.15;
  /* ostavi normal prelamanje da stane na telefon */
}

/* Pod-red (npr. hh:mm ispod broja) */
.field-stats-table .td-main {
  font-weight: 600;
  line-height: 1.05;
}
.field-stats-table .td-sub {
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.6;
  margin-top: 2px;
}

/* Zbijeniji redovi za telefon */
.field-stats-table tbody td {
  padding-top: 0.40rem;
  padding-bottom: 0.40rem;
}

/* Dark mode */
body.dark-mode .field-stats-table thead th {
  background: #f3f6fb;
  color: #e5e7eb;
  border-bottom-color: #1f2937;
}

/* Sitno dodatno stezanje na baš malim ekranima */
@media (max-width: 480px) {
  .field-stats-table thead th { font-size: 0.68rem; }
  .field-stats-table .th-main { font-size: 0.68rem; }
  .field-stats-table .name-main { font-size: 0.80rem; }
}
/* ===== Activity – PRIORITETNE KOLONE ===== */

/* Leva sticky kolona (Grad / BM) */
.activity-table .sticky-col{
  position: sticky;
  left: 0;
  z-index: 6;
  background: inherit;
}

/* Desna sticky kolona (Ocena) */
.activity-table .sticky-col-right{
  position: sticky;
  right: 0;
  z-index: 6;
  background: inherit;
}

/* Header sticky slojevi */
.activity-table thead .sticky-col,
.activity-table thead .sticky-col-right{
  z-index: 8;
  background: #f9fafb;
}

/* Širine – da ne skaču */
.activity-table .col-city{ min-width: 180px; }
.activity-table .col-voters{ min-width: 90px; }
.activity-table .col-potential{ min-width: 90px; }
.activity-table .col-pct{ min-width: 90px; }
.activity-table .col-grade{ min-width: 90px; }

/* BM / Grad – čitljivo na telefonu */
.activity-table .bm-name{
  white-space: normal;
  font-weight: 600;
  line-height: 1.15;
}

/* Dark mode */
body.dark-mode .activity-table thead .sticky-col,
body.dark-mode .activity-table thead .sticky-col-right{
  background: #f3f6fb;
}
/* =======================================================
   ACTIVITY – isti “peglani” izgled kao field-stats (mobile)
   ======================================================= */

/* Wrapper (ako već imaš, ostaje) */
.activity-table-wrap{
  max-height: 72vh;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;
}

/* Tabela: ne sabijaj kolone */
.activity-table{
  table-layout: auto;
  font-size: 0.84rem;
  min-width: 1000px;
  border-collapse: separate;
  border-spacing: 0;
}

/* Ćelije: uredno, bez previše zbijanja */
.activity-table th,
.activity-table td{
  padding: 0.38rem 0.55rem;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: middle;
}

/* ===== Header “ispeglan” kao field-stats ===== */
.activity-table thead th{
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f9fafb;
  color: #374151;
  border-bottom: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 1px 0 rgba(0,0,0,.06);

  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
}

/* dvoredni header */
.activity-table .th-main{
  display:block;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.05;
}
.activity-table .th-sub{
  display:block;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  opacity: .65;
  margin-top: 2px;
}

/* Brojevi – lepši i stabilni */
.activity-table .text-end,
.activity-table .text-center,
.activity-table .col-voters,
.activity-table .col-potential,
.activity-table .col-pct,
.activity-table .col-grade{
  font-variant-numeric: tabular-nums;
}

/* % u dva reda (isto kao field-stats) */
.activity-table .td-main{
  font-weight: 600;
  line-height: 1.05;
}
.activity-table .td-sub{
  font-size: 0.65rem;
  line-height: 1;
  opacity: .6;
  margin-top: 2px;
}

/* BM/Grad nazivi – dozvoli 2 reda da bude čitljivo na telefonu */
.activity-table .bm-name,
.activity-table .col-city{
  white-space: normal;
  line-height: 1.15;
}
.activity-table .bm-name{
  font-weight: 600;
  max-width: 260px;
}

/* Sticky prioritetne kolone (grad/bm levo, ocena desno) */
.activity-table .sticky-col{
  position: sticky;
  left: 0;
  z-index: 6;
  background: inherit;
}
.activity-table .sticky-col-right{
  position: sticky;
  right: 0;
  z-index: 6;
  background: inherit;
}
.activity-table thead .sticky-col,
.activity-table thead .sticky-col-right{
  z-index: 8;
  background: #f9fafb;
}

/* Zebra + hover */
.activity-table tbody tr:nth-child(even){ background: rgba(0,0,0,.02); }
.activity-table tbody tr:hover{ background: rgba(37,99,235,.06); }

/* Mobilno dodatno stezanje */
@media (max-width: 480px){
  .activity-table{ min-width: 920px; font-size: 0.82rem; }
  .activity-table th, .activity-table td{ padding: 0.34rem 0.50rem; }
  .activity-table thead th{ font-size: 0.68rem; }
  .activity-table .th-main{ font-size: 0.68rem; }
}

/* Dark mode */
body.dark-mode .activity-table-wrap{
  background: #0f172a;
  border-color: #1f2937;
}
body.dark-mode .activity-table thead th,
body.dark-mode .activity-table thead .sticky-col,
body.dark-mode .activity-table thead .sticky-col-right{
  background: #f3f6fb;
  color: #e5e7eb;
  border-bottom-color: #1f2937;
}
/* ================================
   TABLE HEADERS – STABLE RULESET
   ================================ */

/* Opšti izgled zaglavlja tabela */
.table thead th {
  font-weight: 600;              /* ne bold, ali jasno */
  font-size: 0.78rem;            /* kompaktnije */
  text-transform: uppercase;     /* administrativni izgled */
  letter-spacing: 0.04em;
  color: #475569;                /* slate-600 */
  background-color: #f8fafc;     /* vrlo svetla siva */
  border-bottom: 2px solid #e5e7eb;
  vertical-align: middle;
  white-space: nowrap;
}

/* Bootstrap table-light override (da ne ode u belo) */
.table-light thead th {
  background-color: #f1f5f9;
  color: #475569;
}

/* Hover ne sme da menja header */
.table thead th:hover {
  background-color: inherit;
}

/* DARK MODE */
body.dark-mode .table thead th {
  background-color: #f3f6fb;     /* isto kao header */
  color: #cbd5e1;                /* slate-300 */
  border-bottom-color: #1f2937;
}

/* Sort ikone / strelice (ako ih ima) */
.table thead th .sort,
.table thead th .sort-icon {
  opacity: 0.55;
  font-size: 0.65rem;
}

/* Tabele koje su "mini" (dashboard, activity) */
.table.table-sm thead th {
  font-size: 0.72rem;
  padding-top: 6px;
  padding-bottom: 6px;
  
 /* =========================================================
   ACTIVITY TABLE – 2-LINE HEADERS (OVERRIDE, SAFE)
   ========================================================= */

.activity-table thead th {
  vertical-align: bottom;
  padding-top: .55rem;
  padding-bottom: .55rem;
  font-weight: 700;
}

.activity-table thead th .th-main {
  display: block;
  font-size: .78rem;
  line-height: 1.05;
  letter-spacing: .2px;
  color: #0f172a;
}

.activity-table thead th .th-sub {
  display: block;
  margin-top: 2px;
  font-size: .62rem;
  line-height: 1.05;
  font-weight: 600;
  color: #64748b;
}

/* Body cells */
.activity-table .td-main {
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.1;
}
.activity-table .td-sub {
  font-size: .68rem;
  color: #64748b;
  line-height: 1.1;
  margin-top: 2px;
}

/* Wrapper + responsive scroll */
.activity-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
  border: 1px solid #e0e7ef;
  border-radius: 14px;
  box-shadow: 0 6px 32px rgba(99,102,241,.09);
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ef 100%);
.activity-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}
.activity-table .sticky-col-right {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 2;
}

/* Sticky header */
.activity-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

/* Column sizing helpers */
.col-city { min-width: 180px; }
.col-voters { min-width: 110px; }
.col-potential { min-width: 110px; }
.col-pct { min-width: 110px; }
.col-grade { min-width: 90px; }

/* Modern users table scroll area */
.users-table-scroll {
  max-height: calc(100vh - 320px);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e0e7ef;
  box-shadow: 0 6px 32px rgba(99,102,241,.09);
  background: linear-gradient(135deg, #f1f5f9 0%, #e0e7ef 100%);
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}
.users-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(90deg, #e0e7ef 0%, #f8fafc 100%);
  color: #6366f1;
  border-bottom: 1px solid #c7d2fe;
}
/* admin/activity – FORCED borders (color + style + width) */
#activity-page table{
  border-collapse: collapse !important;
  border: 1px solid #185ce3 !important;
}

#activity-page th,
#activity-page td{
  border: 1px solid #185ce3 !important;   /* OVO je ključno */
  padding-top: 0.28rem !important;
  padding-bottom: 0.28rem !important;
  line-height: 1.1 !important;
  white-space: nowrap;
}

/* ANALYTICS PRO UI */

.analytics-page{background: linear-gradient(180deg,#f8fafc 0%,#eef2ff 100%);}
.ap-card{border:1px solid #0f172a;border-radius:16px;background:#ffffff;box-shadow:0 1px 2px rgba(15,23,42,.06);}
.ap-card-h{background:linear-gradient(90deg,#0f172a 0%,#1e3a8a 100%);color:#fff;border-top-left-radius:16px;border-top-right-radius:16px;}
.ap-btn{background:#0f172a;color:#fff;border-radius:12px;padding:.55rem .9rem;display:inline-flex;align-items:center;gap:.5rem;}
.ap-btn:hover{background:#111c33;}
.ap-btn:disabled{opacity:.55;cursor:not-allowed;}
.ap-label{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .5rem;border-radius:999px;font-weight:600;font-size:.78rem;background:#0f172a;color:#0f172a;}
/* status pills */
.st-pill{display:inline-flex;align-items:center;justify-content:center;min-width:2.1rem;padding:.2rem .55rem;border-radius:999px;font-weight:700;font-size:.78rem;color:#0f172a;background:#0f172a;}
.st-0{background:#dbeafe;color:#1e3a8a;}   /* Član */
.st-1{background:#dcfce7;color:#14532d;}   /* Siguran */
.st-2{background:#fae8ff;color:#701a75;}   /* Neopred */
.st-3{background:#fee2e2;color:#7f1d1d;}   /* Protiv */
.st-4{background:#ffedd5;color:#7c2d12;}   /* Nije kući */
.st-9{background:#e0f2fe;color:#075985;}   /* Komisija */
.st-10{background:#cffafe;color:#155e75;}  /* Prevoz */
.st-11{background:#e0e7ff;color:#312e81;}  /* Sig. bez tel */
.st-20{background:#fef9c3;color:#713f12;}  /* Koalicija */


/* --- Analytics PRO helpers --- */
.ap-btn-ghost{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.28);}
.ap-btn-ghost:hover{background:rgba(255,255,255,.08);}
.ap-btn-lite{background:#0f172a;color:#0f172a;border:1px solid #cbd5e1;}
.ap-btn-lite:hover{background:#cbd5e1;}
.ap-tabbtn{border:1px solid #0f172a;border-radius:999px;padding:.35rem .7rem;font-weight:700;font-size:.8rem;color:#0f172a;background:#fff;}
.ap-tabbtn-active{background:#0f172a;color:#fff;border-color:#0f172a;}
.ap-citypanel{position:absolute;right:0;top:2.6rem;z-index:50;width:min(360px,92vw);background:#fff;border:1px solid #0f172a;border-radius:16px;box-shadow:0 12px 30px rgba(15,23,42,.18);padding:.6rem;}
.ap-citypanel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.35rem;}
.ap-citypanel-list{max-height:320px;overflow:auto;border-top:1px solid #0f172a;padding-top:.5rem;margin-top:.35rem;}
.ap-cityrow{display:flex;align-items:center;gap:.5rem;padding:.35rem .25rem;border-radius:10px;}
.ap-cityrow:hover{background:#f1f5f9;}
.ap-x{width:32px;height:32px;border-radius:999px;border:1px solid #0f172a;display:inline-flex;align-items:center;justify-content:center;}
.ap-x:hover{background:#f1f5f9;}


/* TOPBAR EDGE FIX */
html, body { margin:0 !important; padding:0 !important; background:#f3f6fb; }


/* FIX: remove global top gap under admin topbar (Bootstrap container padding/margin) */
body > .container,
body > .container-fluid {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
