/* =============================================================================
   STYLE.CSS — Transparentnost Redesign
   Mobile-first, modern, clean slate
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');
@import url('design-tokens.css');

/* ── 1. Reset & Base ────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background-color: var(--bg-root);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* Aurora Background */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background-color: var(--bg-root);
}

.aurora-blob {
  position: absolute;
  filter: blur(80px);
  border-radius: 50%;
  opacity: 0.15;
  animation: floatBlob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.aurora-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-secondary);
  animation-duration: 25s;
}

.aurora-2 {
  bottom: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: var(--accent-primary);
  animation-duration: 28s;
  animation-delay: -5s;
}

.aurora-3 {
  top: 40%;
  left: 40%;
  width: 40vw;
  height: 40vw;
  background: var(--accent-info);
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(10%, -15%) scale(1.1);
  }

  66% {
    transform: translate(-10%, 15%) scale(0.9);
  }

  100% {
    transform: translate(5%, 5%) scale(1.2);
  }
}

/* ── City Skyline with Animated Edge ───────────────────────────────────────── */
.city-skyline-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35vh;
  min-height: 250px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
}

.city-skyline-base {
  position: absolute;
  inset: 0;
  background-image: url('../img/grad.png');
  background-position: bottom center;
  background-repeat: repeat-x;
  background-size: auto 100%;
  /* Po potrebi možemo zatamniti osnovni grad da linija više dođe do izražaja: */
  /* filter: brightness(0.8); */
}

.city-skyline-outline {
  position: absolute;
  /* Pomičemo siluetu lagano prema gore kako bi dobili gornji "outline" (rub) */
  bottom: 3px;
  left: 0;
  width: 100%;
  height: 100%;

  /* Jedna uska, oštrija linija sa zlatnim sjajem */
  background: linear-gradient(90deg,
      transparent 0%,
      transparent 47%,
      rgba(196, 180, 113, 0) 48%,
      var(--accent-primary) 49.5%,
      #fff 50%,
      var(--accent-primary) 50.5%,
      rgba(196, 180, 113, 0) 52%,
      transparent 53%,
      transparent 100%);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  animation: speedLine 12s infinite ease-in-out;

  /* Maskiramo gradijent točno u oblik zgrada */
  -webkit-mask-image: url('../img/grad.png');
  -webkit-mask-position: bottom center;
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-size: auto 100%;
  mask-image: url('../img/grad.png');
  mask-position: bottom center;
  mask-repeat: repeat-x;
  mask-size: auto 100%;
}

@keyframes speedLine {
  0% {
    background-position: 100% 0;
  }

  85% {
    background-position: 0% 0;
  }

  100% {
    background-position: 0% 0;
  }
}

/* Subtle noise texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

a {
  color: var(--text-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

/* ── 2. Layout ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.app-main {
  flex: 1;
  padding-bottom: var(--space-16);
}

/* ── 3. Header ──────────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-glass);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--container-px);
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  /*text-transform: uppercase;*/
  letter-spacing: 0.06em;
  margin-top: 2px;
  white-space: nowrap;
  /*  overflow: hidden;*/
  text-overflow: ellipsis;
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-spring);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-accent);
  border-color: var(--border-accent);
  transform: rotate(20deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Help button */
.help-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.help-btn:hover {
  background: var(--bg-hover);
  color: var(--text-accent);
  border-color: var(--border-accent);
}

.help-btn svg {
  width: 18px;
  height: 18px;
}

/* ── 4. Hero / Search Section ───────────────────────────────────────────────── */
.hero-section {
  padding: var(--space-10) var(--container-px) var(--space-6);
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-active);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  color: var(--text-accent);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-3);
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: var(--lh-relaxed);
}

/* Search form */
.search-form {
  max-width: 640px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-base);
  overflow: hidden;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-input-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input-icon svg {
  width: 20px;
  height: 20px;
}

#searchString {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: var(--space-4) var(--space-4) var(--space-4) 52px;
  font-size: var(--text-base);
  color: var(--text-primary);
  font-weight: var(--fw-regular);
  min-width: 0;
}

#searchString::placeholder {
  color: var(--text-muted);
}

/* Hide native browser search clear button */
#searchString::-webkit-search-decoration,
#searchString::-webkit-search-cancel-button,
#searchString::-webkit-search-results-button,
#searchString::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-right: var(--space-2);
  flex-shrink: 0;
}

#btnPonisti {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

#btnPonisti:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

#btnPonisti svg {
  width: 14px;
  height: 14px;
}

#btnPretraga {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--accent-gradient);
  color: white;
  border-radius: 20px;
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  transition: opacity var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
  white-space: nowrap;
}

#btnPretraga:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

#btnPretraga:active {
  transform: translateY(0);
}

#btnPretraga.loading {
  opacity: 0.7;
  pointer-events: none;
}

#btnPretraga svg {
  width: 16px;
  height: 16px;
}

/* ── 5. Stats Section ───────────────────────────────────────────────────────── */
.stats-section {
  padding: 0 var(--container-px) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 8px 24px -4px rgba(217, 119, 6, 0.15);
  border-color: var(--border-accent);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--text-accent);
  transition: transform var(--transition-spring), background var(--transition-fast), color var(--transition-fast);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
  background: var(--accent-gradient);
  color: white;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  transition: color var(--transition-base);
}

.stat-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.stat-filter {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.stat-desc {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: var(--fw-semi);
  margin-top: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1;
}

.stat-desc:empty {
  display: none;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.badge-muted {
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.stat-value.updated {
  color: var(--accent-primary);
}

/* ── 6. Filters Section ─────────────────────────────────────────────────────── */
.filters-section {
  padding: 0 var(--container-px) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 50;
  /* Sprječava da Choices.js dropdown pada ispod donjih elemenata */
}

.filters-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.filters-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.filters-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filters-label svg {
  width: 14px;
  height: 14px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}

.filter-select,
.filter-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  /* 16px prevents iOS Safari auto-zoom */
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238890aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: var(--bg-input-focus);
}

/* ── 7. Charts Section ──────────────────────────────────────────────────────── */
.charts-section {
  padding: 0 var(--container-px) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.section-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semi);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title svg {
  width: 20px;
  height: 20px;
  color: var(--text-accent);
}

.section-badge {
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px var(--space-2);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  overflow: hidden;
  position: relative;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 8px 24px -4px rgba(217, 119, 6, 0.15);
  border-color: var(--border-accent);
}

.chart-card-header {
  margin-bottom: var(--space-4);
}

.chart-card-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.chart-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.chart-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-container {
  width: 100%;
  min-height: 280px;
  position: relative;
}

/* Collapse toggle for charts */
.charts-collapse-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-overlay);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.charts-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-accent);
}

.charts-collapse-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-base);
}

.charts-collapse-btn.collapsed svg {
  transform: rotate(180deg);
}

.charts-wrapper {
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.charts-wrapper.collapsed {
  max-height: 0;
}

/* ── 8. Results Section ─────────────────────────────────────────────────────── */
.results-section {
  padding: 0 var(--container-px) var(--space-6);
  max-width: var(--max-width);
  margin: 0 auto;
}

.results-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.results-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-overlay);
}

.results-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semi);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.results-title svg {
  width: 18px;
  height: 18px;
  color: var(--text-accent);
}

#results-info {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--fw-regular);
}

.results-body {
  padding: var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── 9. DataTables.net Custom Styles ─────────────────────────────────────── */
.dt-container {
  font-size: var(--text-sm);
  width: 100%;
}

/* Layout Rows */
.dt-container .dt-layout-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dt-container .dt-layout-row:last-child {
  margin-bottom: 0;
  margin-top: var(--space-4);
}

.dt-container .dt-layout-row.dt-layout-table {
  display: block;
  margin: 0;
}

.dt-container .dt-layout-cell {
  display: flex;
  align-items: center;
}

.dt-container .dt-layout-start {
  justify-content: flex-start;
}

.dt-container .dt-layout-end {
  justify-content: flex-end;
}

/* Choices inside dt-length */
.dt-container .dt-length .choices {
  margin-bottom: 0;
  min-width: 80px;
}

.dt-length label,
.dt-search label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}

.dt-search input {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  box-shadow: var(--shadow-xs);
  padding: var(--space-2) var(--space-3);
  min-width: 200px;
}

.dt-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: var(--bg-input-focus);
}

/* Sorting arrows */
table.dataTable thead th.dt-orderable-asc,
table.dataTable thead th.dt-orderable-desc,
table.dataTable thead th.dt-ordering-asc,
table.dataTable thead th.dt-ordering-desc {
  cursor: pointer;
  position: relative;
  padding-right: 30px !important;
}

table.dataTable thead th .dt-column-order {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.3;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238890aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  transition: opacity var(--transition-fast);
}

table.dataTable thead th:hover .dt-column-order {
  opacity: 0.6;
}

table.dataTable thead th[aria-sort="ascending"] .dt-column-order,
table.dataTable thead th.dt-ordering-asc .dt-column-order {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d8c886' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E");
}

table.dataTable thead th[aria-sort="descending"] .dt-column-order,
table.dataTable thead th.dt-ordering-desc .dt-column-order {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d8c886' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

table.dataTable {
  width: 100% !important;
  border-collapse: collapse;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: var(--space-4) !important;
}

table.dataTable thead th {
  background: var(--bg-overlay);
  border-bottom: 2px solid var(--border-color) !important;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
}

table.dataTable.no-footer {
  border-bottom: 1px solid var(--border-color);
}

table.dataTable tbody tr {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

table.dataTable tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] table.dataTable tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

table.dataTable tbody tr:hover {
  background: var(--bg-hover) !important;
}

table.dataTable tbody td {
  padding: var(--space-3) var(--space-2);
  color: var(--text-primary);
  vertical-align: middle;
  border-top: none;
}

table.dataTable tbody td.iznos-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
  color: var(--accent-success);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

table.dataTable tbody td.naziv-cell {
  font-weight: var(--fw-medium);
  color: var(--text-primary);
}

table.dataTable tbody td.oib-cell {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

table.dataTable tbody td.datum-cell {
  white-space: nowrap;
  color: var(--text-secondary);
}

.dt-info {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding-top: var(--space-2) !important;
}

.dt-paging {
  display: flex;
  align-items: center;
  padding-top: var(--space-2) !important;
}

.dt-paging nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.dt-paging .dt-paging-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 var(--space-4) !important;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary) !important;
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border-color) !important;
  transition: all var(--transition-fast);
  cursor: pointer;
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.dt-paging .dt-paging-button:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  transform: translateY(-1px);
}

.dt-paging .dt-paging-button.current,
.dt-paging .dt-paging-button.current:hover {
  background: var(--accent-gradient-h) !important;
  color: var(--text-on-accent) !important;
  border-color: transparent !important;
  font-weight: var(--fw-semi);
  box-shadow: var(--shadow-accent);
}

.dt-paging .dt-paging-button.disabled,
.dt-paging .dt-paging-button.disabled:hover {
  opacity: 0.35;
  pointer-events: none;
  background: transparent !important;
  border-color: var(--border-color) !important;
}

/* Responsive Datatables Controls */
@media (max-width: 576px) {

  .dt-container .dt-length,
  .dt-container .dt-search {
    text-align: left;
    float: none;
    margin-bottom: var(--space-3);
  }

  .dt-container .dt-search input {
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-1);
  }

  .dt-container .dt-info,
  .dt-container .dt-paging {
    float: none;
    text-align: center;
    justify-content: center;
  }

  .dt-paging {
    flex-wrap: wrap;
    margin-top: var(--space-3);
  }
}

/* ── 10. Toast Notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn var(--transition-spring) forwards;
  will-change: transform, opacity;
  overflow: hidden;
  position: relative;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.toast.toast-success::before {
  background: var(--accent-success);
}

.toast.toast-warning::before {
  background: var(--accent-warning);
}

.toast.toast-danger::before {
  background: var(--accent-danger);
}

.toast.toast-info::before {
  background: var(--accent-info);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.toast-success .toast-icon {
  color: var(--accent-success);
}

.toast.toast-warning .toast-icon {
  color: var(--accent-warning);
}

.toast.toast-danger .toast-icon {
  color: var(--accent-danger);
}

.toast.toast-info .toast-icon {
  color: var(--accent-info);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
  line-height: var(--lh-normal);
}

.toast-close {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast), background var(--transition-fast);
  margin-top: 1px;
}

.toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast.toast-leaving {
  animation: toastOut var(--transition-base) forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
    max-height: 200px;
    margin-bottom: 0;
  }

  to {
    transform: translateX(110%);
    opacity: 0;
    max-height: 0;
    margin-bottom: calc(-1 * var(--space-3));
  }
}

/* ── 11. Skeleton Loading ───────────────────────────────────────────────────── */
.skeleton {
  background: var(--bg-skeleton);
  background-size: 200% 100%;
  animation: skeletonWave 1.5s linear infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

@keyframes skeletonWave {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius-xs);
  margin-bottom: var(--space-2);
}

.skeleton-text.w-75 {
  width: 75%;
}

.skeleton-text.w-50 {
  width: 50%;
}

.skeleton-text.w-33 {
  width: 33%;
}

.skeleton-text.w-100 {
  width: 100%;
}

.skeleton-chart {
  height: 280px;
  border-radius: var(--radius-md);
}

.skeleton-table-row {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.skeleton-table-cell {
  height: 14px;
  border-radius: var(--radius-xs);
}

/* ── 12. Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  text-align: center;
  width: 100%;
  margin: 0 auto;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-2xl);
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--text-accent);
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semi);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  text-align: center;
  width: 100%;
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 400px;
  line-height: var(--lh-relaxed);
  text-align: center;
  white-space: normal;
}

/* ── 13. Tooltip ────────────────────────────────────────────────────────────── */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.tooltip-content {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--lh-relaxed);
  white-space: normal;
  min-width: 240px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.tooltip-wrapper:hover .tooltip-content,
.tooltip-wrapper:focus-within .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 767px) {
  .tooltip-content {
    left: auto;
    right: 0;
    transform: translateY(-4px);
  }

  .tooltip-wrapper:hover .tooltip-content,
  .tooltip-wrapper:focus-within .tooltip-content {
    transform: translateY(0);
  }
}

/* ── 14. Footer ─────────────────────────────────────────────────────────────── */
.app-footer {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur-sm);
  border-top: 1px solid var(--border-color);
  padding: var(--space-4) var(--space-6);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-copy {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-copy a {
  color: var(--text-accent);
  font-weight: var(--fw-medium);
  transition: color var(--transition-fast);
}

.footer-copy a:hover {
  color: var(--accent-secondary);
  text-decoration: none;
}

/* ── 15. Loading overlay ────────────────────────────────────────────────────── */
.global-loader {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-color);
  z-index: var(--z-toast);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.global-loader.active {
  opacity: 1;
}

.global-loader-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  animation: loaderBar 1.4s ease infinite;
  transform-origin: left;
}

@keyframes loaderBar {
  0% {
    width: 0%;
    opacity: 1;
  }

  60% {
    width: 80%;
    opacity: 1;
  }

  90% {
    width: 100%;
    opacity: 1;
  }

  100% {
    width: 100%;
    opacity: 0;
  }
}

/* ── 16. Utility classes ────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.text-accent {
  color: var(--text-accent);
}

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

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

.fw-semi {
  font-weight: var(--fw-semi);
}

.fw-bold {
  font-weight: var(--fw-bold);
}

/* Fade animations */
.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.slide-up {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 17. Responsive ─────────────────────────────────────────────────────────── */

/* Small Mobile (≥ 480px) */
@media (min-width: 480px) {
  :root {
    --container-px: var(--space-5);
  }

  .brand-title {
    font-size: var(--text-lg);
  }

  .brand-subtitle {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #searchString {
    font-size: var(--text-lg);
  }
}

/* Tablet (≥ 768px) */
@media (min-width: 768px) {
  :root {
    --container-px: var(--space-6);
  }

  .hero-section {
    padding: var(--space-16) var(--container-px) var(--space-10);
  }

  .hero-desc {
    font-size: var(--text-lg);
  }

  .stats-section {
    padding-bottom: var(--space-6);
  }

  .filters-section {
    padding-bottom: var(--space-6);
  }

  .charts-section {
    padding-bottom: var(--space-6);
  }

  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters-row {
    flex-wrap: nowrap;
  }

  .filter-group {
    min-width: 0;
  }

  .filter-select,
  .filter-input {
    font-size: var(--text-sm);
  }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
  :root {
    --container-px: var(--space-8);
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .results-body {
    padding: var(--space-6);
  }

  .chart-container {
    min-height: 320px;
  }
}

/* Wide (≥ 1280px) */
@media (min-width: 1280px) {
  .header-inner {
    padding: 0 var(--container-px);
  }

  .hero-section {
    padding: var(--space-16) var(--container-px) var(--space-12);
  }
}

/* Mobile table behavior */
@media (max-width: 767px) {

  table.datatable-table thead th:nth-child(1),
  /* Isplatitelj */
  table.datatable-table thead th:nth-child(2),
  /* OIB */
  table.datatable-table thead th:nth-child(4),
  /* Konto */
  table.datatable-table thead th:nth-child(5),
  /* Konto naziv */
  table.datatable-table thead th:nth-child(6),
  /* Općina */
  table.datatable-table thead th:nth-child(8),
  /* Godina */
  table.datatable-table tbody td:nth-child(1),
  table.datatable-table tbody td:nth-child(2),
  table.datatable-table tbody td:nth-child(4),
  table.datatable-table tbody td:nth-child(5),
  table.datatable-table tbody td:nth-child(6),
  table.datatable-table tbody td:nth-child(8) {
    display: none;
  }

  .chart-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  #toast-container {
    bottom: var(--space-4);
    right: var(--space-4);
    width: calc(100vw - 32px);
  }
}

/* Extra mobile styles (max-width: 479px) */
@media (max-width: 479px) {
  #btnPretragaText {
    display: none;
  }

  #btnPretraga {
    padding: var(--space-2) var(--space-3);
    gap: 0;
  }

  .stats-grid {
    gap: var(--space-3);
  }

  .stat-card {
    padding: var(--space-4);
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    margin-bottom: var(--space-2);
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-value {
    font-size: var(--text-lg);
  }

  .datatable-pagination li a,
  .datatable-pagination li button,
  .datatable-pagination-list-item-link {
    width: 28px !important;
    height: 28px !important;
    font-size: var(--text-xs) !important;
  }
}

/* Simple-DataTables responsive formatting */
@media (max-width: 575px) {
  .datatable-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  /* Simplify DataTables pagination on mobile */
  .dt-paging nav {
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .dt-paging .dt-paging-button {
    padding: 0 var(--space-2) !important;
    min-width: 32px !important;
    height: 32px !important;
  }

  .dt-paging .dt-paging-button.previous,
  .dt-paging .dt-paging-button.next {
    font-size: 0 !important;
  }

  .dt-paging .dt-paging-button.previous::after {
    content: "‹";
    font-size: var(--text-sm);
  }

  .dt-paging .dt-paging-button.next::after {
    content: "›";
    font-size: var(--text-sm);
  }

  .dt-paging .dt-paging-button.first,
  .dt-paging .dt-paging-button.last {
    display: none !important;
  }

  .datatable-dropdown,
  .datatable-search {
    width: 100%;
    margin-left: 0;
  }

  .datatable-selector,
  .datatable-input {
    width: 100%;
    box-sizing: border-box;
  }

  .datatable-bottom {
    flex-direction: column-reverse;
    align-items: center;
    gap: var(--space-3);
  }

  .datatable-pagination {
    margin-left: 0;
  }
}

/* ── Mobile Expandable Table Rows ────────────────────────────────────────────── */
@media (max-width: 992px) {

  /* Make table more compact on mobile to fit 3 columns perfectly */
  table.dataTable thead th,
  table.dataTable tbody td {
    padding: var(--space-2) !important;
    font-size: var(--text-xs) !important;
  }

  table.dataTable thead th {
    white-space: normal !important;
  }

  /* Hide columns: OIB (2), Konto (4), Konto naziv (5), Općina (6), Datum (7), Godina (8) */
  table.dataTable th:nth-child(2),
  table.dataTable td:nth-child(2),
  table.dataTable col:nth-child(2),
  table.dataTable th:nth-child(4),
  table.dataTable td:nth-child(4),
  table.dataTable col:nth-child(4),
  table.dataTable th:nth-child(5),
  table.dataTable td:nth-child(5),
  table.dataTable col:nth-child(5),
  table.dataTable th:nth-child(6),
  table.dataTable td:nth-child(6),
  table.dataTable col:nth-child(6),
  table.dataTable th:nth-child(7),
  table.dataTable td:nth-child(7),
  table.dataTable col:nth-child(7),
  table.dataTable th:nth-child(8),
  table.dataTable td:nth-child(8),
  table.dataTable col:nth-child(8) {
    display: none !important;
    width: 0 !important;
  }

  /* Row click affordance (td included for iOS Safari event delegation) */
  table.dataTable tbody tr:not(.child-row),
  table.dataTable tbody tr:not(.child-row) td {
    cursor: pointer;
    transition: background-color var(--transition-fast);
  }

  /* Expanded row visual cue */
  table.dataTable tbody tr.expanded td:first-child {
    border-left: 3px solid var(--accent-primary);
    padding-left: calc(var(--space-4) - 3px);
  }

  /* Child Row Styling */
  table.dataTable tbody tr.child-row {
    background: var(--bg-overlay) !important;
  }

  table.dataTable tbody tr.child-row td {
    padding: var(--space-4) !important;
  }

  .mobile-row-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .mobile-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: var(--fw-bold);
    letter-spacing: 0.05em;
  }

  .mobile-detail-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--fw-medium);
  }
}

/* ── Choices.js Customizations ────────────────────────────────────────────────── */
.choices {
  margin-bottom: 0 !important;
}

.choices__inner {
  background-color: var(--bg-input) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  min-height: 44px !important;
  padding: 5px 12px !important;
  color: var(--text-primary) !important;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex !important;
  align-items: center !important;
}

.choices[data-type*="select-one"] .choices__inner {
  padding-bottom: 5px !important;
}

.choices__list--single {
  padding: 0 !important;
}

.choices__list--single .choices__item {
  margin: 0 !important;
  line-height: normal !important;
}

.choices.is-focused .choices__inner {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px var(--accent-light) !important;
}

.choices__list--dropdown {
  background-color: var(--bg-card-solid) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  margin-top: 4px !important;
  z-index: 100 !important;
  word-break: break-word;
}

.choices__list--dropdown .choices__item {
  color: var(--text-primary) !important;
  font-size: var(--text-sm) !important;
  padding: 10px 16px !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list--dropdown .choices__item--selectable:hover,
.choices__list--dropdown .choices__item--choice.is-selected {
  background-color: var(--bg-hover) !important;
  color: var(--accent-primary) !important;
}

.choices__input {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

/* ── Flatpickr Customizations ─────────────────────────────────────────────── */
.flatpickr-calendar {
  background: var(--bg-card-solid) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-lg) !important;
  width: auto !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
  display: none !important;
}

.flatpickr-month {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  color: var(--text-primary) !important;
  font-weight: var(--fw-semi) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: var(--bg-hover) !important;
}

span.flatpickr-weekday {
  color: var(--text-muted) !important;
}

.flatpickr-day {
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
}

.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus {
  background: var(--bg-hover) !important;
  border-color: var(--border-accent) !important;
}

.flatpickr-day.today {
  border-color: var(--accent-primary) !important;
}

.flatpickr-day.selected {
  background: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: var(--text-on-accent) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--text-muted) !important;
}

/* ── DataTables Overrides ─────────────────────────────────────────────────── */
.dt-search input,
.dataTables_filter input {
  margin-left: 8px !important;
}

.dt-search label,
.dataTables_filter label {
  color: var(--text-secondary);
  font-weight: var(--fw-medium);
}