/**
 * agro-page-setting.css — Page-setting redesign (Sage + cream paleta).
 *
 * BEM root: .agro-ps
 * Color tone: muted sage (#5d8067) na cream (#FAF6EE) — minimalistički,
 * profesionalan, manje "jarko zeleno". Override SAMO u .agro-ps scope-u
 * preko local CSS variables — ne dira globalni token sistem.
 */

/* Cream pozadina samo dok je page-setting aktivan — bez globalnog "leak"-a. */
body:has(.agro-ps) .page-margin { background: var(--agro-cream, #FAF6EE); }

.agro-ps {
  /* Scoped palette — sage muted + cream */
  --ps-surface:        #FAF6EE;     /* cream pozadina */
  --ps-surface-card:   #ffffff;     /* kartice, formae */
  --ps-surface-input:  #f6f1e6;     /* input field bg */
  --ps-surface-alt:    #f1ebdd;     /* hover, subtle */

  --ps-text:           #2c3e2e;     /* dark forest — high contrast */
  --ps-text-secondary: #4a5b4d;     /* secondary copy */
  --ps-text-muted:     #6b7a6e;     /* hints, meta */

  --ps-primary:        #5d8067;     /* muted sage primary */
  --ps-primary-hover:  #4d6f57;     /* hover state */
  --ps-primary-soft:   rgba(93,128,103,0.10);
  --ps-primary-ring:   rgba(93,128,103,0.30);

  --ps-accent:         #B8860B;     /* dark gold — premium accent */
  --ps-accent-soft:    rgba(184,134,11,0.10);

  --ps-border:         #d8d0bc;     /* warm border */
  --ps-border-strong:  #c4baa0;
  --ps-border-soft:    #e7dfca;

  --ps-danger:         #b87474;     /* muted red — manje agresivno */
  --ps-danger-bg:      #fbeeee;
  --ps-success:        #6d9474;
  --ps-success-bg:     #eef4ef;
  --ps-warning:        #c4956c;
  --ps-warning-bg:     #faf2e7;

  --ps-radius:         10px;
  --ps-radius-sm:      6px;
  --ps-radius-lg:      14px;
  --ps-shadow-sm:      0 1px 2px rgba(60,50,30,0.04);
  --ps-shadow:         0 1px 3px rgba(60,50,30,0.05), 0 4px 12px rgba(60,50,30,0.04);
  --ps-shadow-lg:      0 8px 24px rgba(60,50,30,0.08);

  --ps-gap:            14px;
  --ps-section-pad:    20px 24px;
  --ps-mobile-bp:      768px;
  --ps-touch-target:   44px;
}

/* Backward-compat aliasi za stari --agro-ps-* (postojeći kod nastavlja da radi) */
.agro-ps {
  --agro-ps-radius: var(--ps-radius);
  --agro-ps-shadow: var(--ps-shadow);
  --agro-ps-border: 1px solid var(--ps-border);
  --agro-ps-gap: var(--ps-gap);
  --agro-ps-section-pad: var(--ps-section-pad);
  --agro-ps-mobile-bp: var(--ps-mobile-bp);
}

/* ============================================================
   LAYOUT — Hero / Sidebar / Body
   ============================================================ */

.agro-ps {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--agro-ps-gap);
  align-items: flex-start;
  margin: 0 auto;
  max-width: 1200px;
  padding: var(--agro-ps-gap);
}

/* CSS Grid items default min-width: auto — bez minmax(0, 1fr) iznad i bez
   eksplicitnog min-width: 0 ovde, kolona ekspanduje preko parent-a kad sadrzaj
   ima implicit min-content veci od available space. */
.agro-ps__body,
.agro-ps__sidebar {
  min-width: 0;
}

/* Kad je u .singlecol (sa platform left-sidebar pored), uklanjamo max-width */
.agro-ps--with-platform-sidebar {
  max-width: none;
  padding: 0 0 var(--agro-ps-gap);
}

@media (max-width: 1024px) {
  .agro-ps { grid-template-columns: 1fr; }
}

/* Bottom-nav skidamo u container.phtml kad je $wo['page'] == 'page_setting' (PHP guard). */

/* ---------- HERO header (preview + completeness) ---------- */
.agro-ps__hero {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, #5d8067 0%, #4a6b54 100%),
    linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-primary-hover) 100%);
  background-blend-mode: normal;
  color: #fff;
  border-radius: var(--ps-radius-lg);
  padding: 22px 26px;
  display: flex;
  gap: 18px;
  align-items: center;
  box-shadow: var(--ps-shadow);
  position: relative;
  overflow: hidden;
}

/* Subtle texture overlay — minimalistički efekat, ne jarko */
.agro-ps__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.06) 0%, transparent 40%),
    radial-gradient(circle at 15% 90%, rgba(0,0,0,0.05) 0%, transparent 50%);
  pointer-events: none;
}
.agro-ps__hero > * { position: relative; z-index: 1; }

.agro-ps__hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

.agro-ps__hero-info { flex: 1; min-width: 0; }
.agro-ps__hero-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.2;
}
.agro-ps__hero-meta {
  font-size: 13px;
  opacity: 0.9;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.agro-ps__hero-meta-item { display: inline-flex; align-items: center; gap: 4px; }

.agro-ps__hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.agro-ps__hero-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease;
}
.agro-ps__hero-btn:hover,
.agro-ps__hero-btn:focus {
  background: rgba(255,255,255,0.28);
  color: #fff;
  text-decoration: none;
}

/* Completeness widget */
.agro-ps__completeness {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex-shrink: 0;
}
.agro-ps__completeness-label {
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  justify-content: space-between;
}
.agro-ps__completeness-bar {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}
.agro-ps__completeness-fill {
  height: 100%;
  /* Suptilan dark-gold → muted sage gradient — usklađen sa hero ali ne preplavan */
  background: linear-gradient(90deg, var(--ps-accent, #B8860B), #a3c5a8);
  border-radius: 4px;
  transition: width .4s ease;
}

@media (max-width: 768px) {
  .agro-ps__hero {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 18px;
  }
  .agro-ps__hero-avatar { margin: 0 auto; }
  .agro-ps__hero-actions { justify-content: center; }
  .agro-ps__completeness { min-width: auto; }
}

/* ---------- SIDEBAR (vertical tab nav) ---------- */
.agro-ps__sidebar {
  background: var(--ps-surface-card);
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border);
  padding: 8px;
  position: sticky;
  top: 80px;
  box-shadow: var(--ps-shadow-sm);
}
.agro-ps__sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agro-ps__sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: var(--ps-touch-target);
  border-radius: var(--ps-radius-sm);
  color: var(--ps-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--agro-transition-fast, 100ms ease), color var(--agro-transition-fast, 100ms ease);
  position: relative;
}
.agro-ps__sidebar-item a:hover,
.agro-ps__sidebar-item a:focus-visible {
  background: var(--ps-surface-alt);
  color: var(--ps-text);
  text-decoration: none;
}
.agro-ps__sidebar-item a:focus-visible {
  outline: 2px solid var(--ps-primary-ring);
  outline-offset: 1px;
}
.agro-ps__sidebar-item--active a {
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
  font-weight: 600;
}
/* Suptilna leva traka na aktivnom — vizuelni anchor bez teskih boja */
.agro-ps__sidebar-item--active a::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--ps-primary);
}
.agro-ps__sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ps-text-muted);
  stroke-width: 1.75;
}
.agro-ps__sidebar-item--active a .agro-ps__sidebar-icon { color: var(--ps-primary); }
.agro-ps__sidebar-label { flex: 1; }

/* Locked tab — analytics premium gate (PRD Page Analytics Redesign v1.1) */
.agro-ps__sidebar-item--locked a {
  position: relative;
}
.agro-ps__sidebar-item--locked .agro-ps__sidebar-label {
  color: var(--ps-text-muted);
}
.agro-ps__sidebar-lock {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--ps-accent, #d97706);
  opacity: 0.85;
}
.agro-ps__sidebar-icon--lock {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.agro-ps__sidebar-item--locked a:hover .agro-ps__sidebar-lock {
  opacity: 1;
}
.agro-ps__sidebar-badge {
  background: var(--ps-accent);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}
.agro-ps__sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 14px 4px;
  margin: 0;
}

/* Mobilni accordion sidebar — kompaktan, ne horizontalan scroll */
@media (max-width: 1024px) {
  .agro-ps { grid-template-columns: 1fr; }
  .agro-ps__sidebar {
    position: static;
    padding: 4px;
  }
  /* Toggle button koji JS umetne — vizuelno header za collapse */
  .agro-ps__sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: 0;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-text);
    cursor: pointer;
    border-radius: var(--ps-radius-sm);
  }
  .agro-ps__sidebar-toggle::after {
    content: "▾";
    margin-left: auto;
    color: var(--ps-text-muted);
    transition: transform 200ms ease;
  }
  .agro-ps__sidebar.is-collapsed .agro-ps__sidebar-toggle::after { transform: rotate(-90deg); }
  .agro-ps__sidebar.is-collapsed .agro-ps__sidebar-list { display: none; }
}
@media (min-width: 1025px) {
  .agro-ps__sidebar-toggle { display: none; }
}

/* ---------- BODY (sekcije forme) ---------- */
.agro-ps__body {
  display: flex;
  flex-direction: column;
  gap: var(--agro-ps-gap);
}

.agro-ps__section {
  background: var(--ps-surface-card);
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border-soft);
  box-shadow: var(--ps-shadow-sm);
  overflow: hidden;
}

.agro-ps__section-header {
  /* Suptilna sage tinta kao header background — ne dosadan flat sivi */
  background: linear-gradient(180deg, var(--ps-surface-alt) 0%, var(--ps-surface-card) 100%);
  padding: 14px 22px;
  border-bottom: 1px solid var(--ps-border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.agro-ps__section-icon {
  width: 20px;
  height: 20px;
  color: var(--ps-primary);
  flex-shrink: 0;
  stroke-width: 1.75;
}
.agro-ps__section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ps-text);
  margin: 0;
  flex: 1;
}
.agro-ps__section-meta {
  font-size: 12px;
  color: var(--ps-text-muted);
}

.agro-ps__section-body {
  padding: var(--agro-ps-section-pad);
}

/* ============================================================
   FORM ELEMENTI — agro-mg style
   ============================================================ */

.agro-ps__form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.agro-ps__form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.agro-ps__form-grid--full { grid-template-columns: 1fr; }
.agro-ps__form-grid > .agro-ps__form-row--full { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .agro-ps__form-grid,
  .agro-ps__form-grid--3 { grid-template-columns: 1fr; }
}

.agro-ps__form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agro-ps__form-row--spaced { margin-top: 14px; }
.agro-ps__form-row label,
.agro-ps__form-row .agro-ps__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ps-text);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.005em;
}
.agro-ps__form-row label .agro-ps__required {
  color: var(--ps-danger);
  font-weight: 700;
}
.agro-ps__form-row .agro-ps__hint,
.agro-ps__hint {
  font-size: 12px;
  color: var(--ps-text-muted);
  font-weight: 400;
}
.agro-ps__hint--block { display: block; margin-top: 6px; }
.agro-ps__empty {
  text-align: center;
  padding: 24px;
  color: var(--ps-text-muted);
  font-size: 13px;
}

/* ============================================================
   UPLOAD ZONE — drag & drop file picker
   Konzistentno sa "Dodaj nov entitet" karticom (dashed border + icon)
   ============================================================ */
.agro-ps__upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 88px;
  padding: 16px 20px;
  background: var(--ps-surface-alt, #fafaf7);
  border: 2px dashed var(--ps-border, #e5e7eb);
  border-radius: var(--ps-radius, 12px);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}
.agro-ps__upload-zone:hover {
  border-color: var(--ps-primary, #3a8a3f);
  background: var(--ps-surface, #fff);
}
.agro-ps__upload-zone:focus-within {
  outline: 2px solid var(--ps-primary, #3a8a3f);
  outline-offset: 2px;
}
.agro-ps__upload-zone.is-dragover {
  border-color: var(--ps-primary, #3a8a3f);
  background: var(--ps-primary-light, #e8f5e9);
  transform: scale(1.005);
}
.agro-ps__upload-zone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* Forsiraj hidden iznad display: flex (browser default `hidden { display: none }` se gubi) */
.agro-ps__upload-zone-empty[hidden],
.agro-ps__upload-zone-preview[hidden] {
  display: none !important;
}

/* Empty state — ikona + tekst + meta */
.agro-ps__upload-zone-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.agro-ps__upload-zone-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px dashed var(--ps-border, #e5e7eb);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ps-text-muted, #6b7268);
  background: var(--ps-surface, #fff);
  transition: border-color 0.18s ease, color 0.18s ease;
}
.agro-ps__upload-zone:hover .agro-ps__upload-zone-icon,
.agro-ps__upload-zone.is-dragover .agro-ps__upload-zone-icon {
  border-color: var(--ps-primary, #3a8a3f);
  color: var(--ps-primary, #3a8a3f);
}

.agro-ps__upload-zone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.agro-ps__upload-zone-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ps-text, #1a2e1a);
}
.agro-ps__upload-zone-text span {
  font-size: 13px;
  color: var(--ps-text-muted, #6b7268);
}
.agro-ps__upload-zone-meta {
  font-size: 12px;
  color: var(--ps-text-muted, #6b7268);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Filled state — preview thumb + meta + remove dugme */
.agro-ps__upload-zone.is-filled {
  border-style: solid;
  border-color: var(--ps-primary, #3a8a3f);
  background: var(--ps-surface, #fff);
}
.agro-ps__upload-zone-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.agro-ps__upload-zone-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--ps-border, #e5e7eb);
}
.agro-ps__upload-zone-preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.agro-ps__upload-zone-preview-info strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ps-text, #1a2e1a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agro-ps__upload-zone-preview-info span {
  font-size: 12px;
  color: var(--ps-text-muted, #6b7268);
}
.agro-ps__upload-zone-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--ps-border, #e5e7eb);
  background: var(--ps-surface, #fff);
  color: var(--ps-text-muted, #6b7268);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.agro-ps__upload-zone-remove:hover {
  border-color: var(--ps-danger, #c62828);
  color: var(--ps-danger, #c62828);
  background: rgba(198, 40, 40, 0.06);
}

@media (max-width: 600px) {
  .agro-ps__upload-zone-empty {
    flex-wrap: wrap;
  }
  .agro-ps__upload-zone-meta {
    width: 100%;
    margin-left: 64px;
  }
}

.agro-ps__input,
.agro-ps__select,
.agro-ps__textarea {
  width: 100%;
  padding: 10px 12px;
  min-height: var(--ps-touch-target);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: var(--ps-surface-card);
  color: var(--ps-text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  font-family: inherit;
}
.agro-ps__input::placeholder,
.agro-ps__textarea::placeholder { color: var(--ps-text-muted); opacity: 0.7; }
.agro-ps__input:hover:not(:disabled):not([readonly]),
.agro-ps__select:hover:not(:disabled),
.agro-ps__textarea:hover:not(:disabled):not([readonly]) {
  border-color: var(--ps-border-strong);
}
.agro-ps__input:focus,
.agro-ps__select:focus,
.agro-ps__textarea:focus {
  outline: none;
  border-color: var(--ps-primary);
  box-shadow: 0 0 0 3px var(--ps-primary-ring);
  background: var(--ps-surface-card);
}
.agro-ps__input[readonly],
.agro-ps__input:disabled,
.agro-ps__select:disabled,
.agro-ps__textarea:disabled {
  background: var(--ps-surface-input);
  color: var(--ps-text-muted);
  cursor: not-allowed;
}

/* mg-verify: zaključana polja (BPG/PIB/godina osnivanja) posle verifikacije entiteta */
.agro-ps__input--locked {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  cursor: not-allowed;
  border-style: dashed;
  border-color: #d1d5db !important;
}
.agro-ps__lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  background: #e5e7eb;
  border-radius: 999px;
  vertical-align: middle;
}
.agro-ps__lock-badge svg { width: 12px; height: 12px; }
.agro-ps__textarea { min-height: 96px; resize: vertical; }

/* Validation: per-field error stanje */
.agro-ps__form-row--error .agro-ps__input,
.agro-ps__form-row--error .agro-ps__select,
.agro-ps__form-row--error .agro-ps__textarea {
  border-color: var(--ps-danger);
  background: var(--ps-danger-bg);
}
.agro-ps__form-row--error .agro-ps__input:focus,
.agro-ps__form-row--error .agro-ps__select:focus,
.agro-ps__form-row--error .agro-ps__textarea:focus {
  box-shadow: 0 0 0 3px rgba(184,116,116,0.25);
}
.agro-ps__field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ps-danger);
  font-weight: 500;
  margin-top: 2px;
}
.agro-ps__field-error::before {
  content: "⚠";
  font-size: 11px;
  flex-shrink: 0;
}

/* Char counter za textarea[maxlength] */
.agro-ps__char-counter {
  align-self: flex-end;
  font-size: 11px;
  color: var(--ps-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.agro-ps__char-counter.is-near-limit { color: var(--ps-warning); }
.agro-ps__char-counter.is-over-limit { color: var(--ps-danger); font-weight: 600; }

/* Validation summary na vrhu forme — NE prikazuje se po default-u; tek kad
   validateForm() doda .is-visible klasu i ima stvarnih grešaka. Bez ovog
   pravila CSS display:flex pobeđuje [hidden] HTML atribut → prazan crveni
   box bi se prikazivao posle Sačuvaj. */
.agro-ps__validation-summary { display: none; }
.agro-ps__validation-summary.is-visible {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ps-danger-bg);
  border: 1px solid rgba(184,116,116,0.35);
  border-left: 3px solid var(--ps-danger);
  border-radius: var(--ps-radius-sm);
  color: var(--ps-text);
  margin: 0 0 16px 0;
  animation: agro-ps-summary-in 200ms ease-out;
}
@keyframes agro-ps-summary-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.agro-ps__validation-summary > svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ps-danger);
  margin-top: 2px;
}
.agro-ps__validation-summary__title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.agro-ps__validation-summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.agro-ps__validation-summary__list li { margin-bottom: 2px; }
.agro-ps__validation-summary__list a {
  color: var(--ps-text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.agro-ps__validation-summary__list a:hover { color: var(--ps-text); }

.agro-ps__input-group {
  display: flex;
  align-items: stretch;
}
.agro-ps__input-group-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--ps-surface-input);
  border: 1px solid var(--ps-border);
  border-right: 0;
  border-radius: var(--ps-radius-sm) 0 0 var(--ps-radius-sm);
  color: var(--ps-text-muted);
  font-size: 13px;
}
.agro-ps__input-group .agro-ps__input {
  border-radius: 0 var(--ps-radius-sm) var(--ps-radius-sm) 0;
}

/* Checkbox / radio cards */
.agro-ps__check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 768px) { .agro-ps__check-grid { grid-template-columns: 1fr; } }

.agro-ps__check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: var(--ps-touch-target);
  background: var(--ps-surface-card);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.agro-ps__check:hover { border-color: var(--ps-primary); background: var(--ps-surface-alt); }
.agro-ps__check input { margin: 0; cursor: pointer; accent-color: var(--ps-primary); }
.agro-ps__check input:checked + .agro-ps__check-label { color: var(--ps-primary-hover); font-weight: 600; }
.agro-ps__check:has(input:checked) {
  background: var(--ps-primary-soft);
  border-color: var(--ps-primary);
}

/* Chips (cultures, livestock — multi-select) */
.agro-ps__chips-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px;
  background: var(--ps-surface-input);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  min-height: 44px;
}
.agro-ps__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 14px;
}
.agro-ps__chip-remove {
  background: none;
  border: 0;
  color: var(--ps-primary-hover);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

/* Autocomplete dropdown — uočljiviji accent stil (sinhronizovan sa wizard-om).
   2px primary border + drop shadow lg + slide-in animacija + header + pin ikona. */
.agro-ps__autocomplete {
  position: relative;
}
.agro-ps__autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 2px solid var(--ps-primary, var(--agro-primary, #2e7d32));
  border-radius: 10px;
  margin-top: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  list-style: none;
  display: none;
}
@keyframes agroPsAutocompleteSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.agro-ps__autocomplete-list.is-open {
  display: block;
  animation: agroPsAutocompleteSlideIn 180ms ease-out;
}
.agro-ps__autocomplete-list[hidden] { display: none !important; }

/* Header iznad rezultata */
.agro-ps__autocomplete-header {
  align-items: center;
  color: var(--ps-text-muted, #64748b);
  display: flex;
  font-size: 11px;
  font-weight: 600;
  gap: 6px;
  letter-spacing: 0.04em;
  padding: 6px 10px 4px;
  text-transform: uppercase;
  cursor: default;
  border-bottom: 0;
}
.agro-ps__autocomplete-header svg {
  color: var(--ps-primary, var(--agro-primary, #2e7d32));
  flex-shrink: 0;
}

.agro-ps__autocomplete-list li.agro-ps__autocomplete-item {
  align-items: flex-start;
  border-left: 3px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 10px;
  padding: 10px 12px;
  transition: background 0.18s ease, border-left-color 0.18s ease, padding-left 0.18s ease;
}
.agro-ps__autocomplete-list li.agro-ps__autocomplete-item:hover,
.agro-ps__autocomplete-list li.agro-ps__autocomplete-item.is-active {
  background: var(--ps-primary-soft, var(--agro-primary-bg, #f0f7f0));
  border-left-color: var(--ps-primary, var(--agro-primary, #2e7d32));
  padding-left: 14px;
}
.agro-ps__autocomplete-list li.agro-ps__autocomplete-item:hover .agro-ps__autocomplete-item-name,
.agro-ps__autocomplete-list li.agro-ps__autocomplete-item.is-active .agro-ps__autocomplete-item-name {
  color: var(--ps-primary-dark, var(--agro-primary-dark, #1b5e20));
  font-weight: 600;
}

/* Pin ikonica levo */
.agro-ps__autocomplete-pin {
  color: var(--ps-primary, var(--agro-primary, #2e7d32));
  flex-shrink: 0;
  margin-top: 2px;
}

.agro-ps__autocomplete-item-content {
  flex: 1;
  min-width: 0;
}
.agro-ps__autocomplete-item-name {
  color: var(--ps-text, #1f2937);
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.18s ease;
}
.agro-ps__autocomplete-item-meta {
  color: var(--ps-text-muted, #64748b);
  font-size: 11.5px;
  margin-top: 2px;
}

/* Mini-mapa za pin */
.agro-ps__mini-map {
  height: 240px;
  border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border);
  overflow: hidden;
  background: var(--ps-surface-input);
}
.agro-ps__mini-map-hint {
  font-size: 12px;
  color: var(--ps-text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Read-only mini-mapa na javnom profilu (about-gazdinstvo / about-firma).
   Globalna klasa, NIJE u .agro-ps scope-u — pa koristi default agro-* tokene. */
.agro-profile-mini-map {
  height: 240px;
  border-radius: 10px;
  border: 1px solid var(--agro-border, #e0d8c8);
  overflow: hidden;
  background: var(--agro-surface-alt, #f5f0e8);
  width: 100%;
  /* Read-only feel — kursor default, ne grab */
  cursor: default;
}
.agro-profile-mini-map .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255,255,255,0.85);
}
.agro-profile-mini-map__caption {
  font-size: 12px;
  color: var(--agro-text-secondary, #3a4e3a);
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.agro-profile-mini-map__caption::before {
  content: "";
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  background: var(--agro-primary, #5d8067);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Avatar/cover preview + drop zone */
.agro-ps__media-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) { .agro-ps__media-block { grid-template-columns: 1fr; } }

.agro-ps__media-card {
  background: var(--ps-surface-alt);
  border: 2px dashed var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 18px;
  text-align: center;
  position: relative;
  transition: border-color 150ms ease, background 150ms ease;
}
.agro-ps__media-card:hover {
  border-color: var(--ps-primary);
  background: var(--ps-primary-soft);
}
.agro-ps__media-card-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ps-text);
}
.agro-ps__media-preview-avatar,
.agro-ps__media-preview-cover {
  display: block;
  margin: 0 auto 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--agro-surface, #fff);
  border-radius: 50%;
}
.agro-ps__media-preview-avatar {
  width: 96px;
  height: 96px;
  border: 2px solid var(--ps-primary);
}
.agro-ps__media-preview-cover {
  width: 100%;
  aspect-ratio: 16 / 5;
  border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border);
}
.agro-ps__media-card input[type="file"] {
  display: none;
}
.agro-ps__media-btn {
  background: var(--ps-primary);
  color: #fff;
  padding: 9px 18px;
  min-height: var(--ps-touch-target);
  border-radius: var(--ps-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 150ms ease, transform 100ms ease;
}
.agro-ps__media-btn:hover { background: var(--ps-primary-hover); }
.agro-ps__media-btn:active { transform: translateY(1px); }
.agro-ps__media-hint {
  font-size: 11px;
  color: var(--ps-text-muted);
  margin-top: 6px;
}

/* ============================================================
   ACTIONS (footer save bar)
   ============================================================ */

.agro-ps__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  background: var(--ps-surface-alt);
  border-top: 1px solid var(--ps-border-soft);
}
.agro-ps__actions--end { justify-content: flex-end; }

.agro-ps__btn {
  padding: 10px 18px;
  min-height: var(--ps-touch-target);
  border-radius: var(--ps-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 150ms ease, border-color 150ms ease, transform 100ms ease;
  letter-spacing: -0.005em;
}
.agro-ps__btn:focus-visible {
  outline: 2px solid var(--ps-primary-ring);
  outline-offset: 2px;
}
.agro-ps__btn:active { transform: translateY(1px); }
.agro-ps__btn--primary {
  background: var(--ps-primary);
  color: #fff;
  border-color: var(--ps-primary);
}
.agro-ps__btn--primary:hover { background: var(--ps-primary-hover); border-color: var(--ps-primary-hover); }
.agro-ps__btn--ghost {
  background: transparent;
  color: var(--ps-text);
  border-color: var(--ps-border);
}
.agro-ps__btn--ghost:hover { background: var(--ps-surface-card); border-color: var(--ps-border-strong); }
.agro-ps__btn--danger {
  background: var(--ps-danger);
  color: #fff;
  border-color: var(--ps-danger);
}
.agro-ps__btn--danger:hover { background: #a06363; border-color: #a06363; }
.agro-ps__btn:disabled { opacity: 0.5; cursor: not-allowed; }
.agro-ps__btn-loader {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: agro-ps-spin .8s linear infinite;
  display: none;
}
.agro-ps__btn.is-loading .agro-ps__btn-loader { display: inline-block; }
@keyframes agro-ps-spin {
  to { transform: rotate(360deg); }
}

/* Auto-save indicator */
.agro-ps__autosave {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 200ms ease;
}
.agro-ps__autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.agro-ps__autosave--saving .agro-ps__autosave-dot {
  background: var(--ps-accent);
  animation: agro-ps-pulse 1s ease-in-out infinite;
}
.agro-ps__autosave--saved .agro-ps__autosave-dot {
  background: #a3c5a8;
}
.agro-ps__autosave--error .agro-ps__autosave-dot {
  background: var(--ps-danger);
}
@keyframes agro-ps-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   ALERT (success/error)
   ============================================================ */

.agro-ps__alert {
  padding: 10px 14px;
  border-radius: var(--ps-radius-sm);
  font-size: 13px;
  margin: 0 0 14px;
  display: none;
  font-weight: 500;
}
.agro-ps__alert--success {
  background: var(--ps-success-bg);
  color: #3d5a44;
  border-left: 3px solid var(--ps-success);
}
.agro-ps__alert--error {
  background: var(--ps-danger-bg);
  color: #6b3a3a;
  border-left: 3px solid var(--ps-danger);
}
.agro-ps__alert--warning {
  background: var(--ps-warning-bg);
  color: #7a4f1c;
  border-left: 3px solid var(--ps-warning);
}
.agro-ps__alert.is-visible { display: block; }
.agro-ps__danger-text { color: var(--ps-danger); font-weight: 600; }
.agro-ps__section-icon--danger { color: var(--ps-danger) !important; }

/* ============================================================
   MISSING FIELDS HINT  (klikabilna lista nepopunjenih)
   ============================================================ */

.agro-ps__missing-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.agro-ps__missing-item {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  border: 0;
  transition: background .15s ease;
}
.agro-ps__missing-item:hover { background: rgba(255,255,255,0.3); }

/* Smooth highlight kad korisnik klikne missing field */
.agro-ps__form-row.is-highlight,
.agro-ps__section.is-highlight {
  animation: agro-ps-highlight 1.2s ease;
}
@keyframes agro-ps-highlight {
  0% { background: rgba(217,119,6,0.18); }
  100% { background: transparent; }
}

/* ============================================================
   ANALYTICS
   ============================================================ */

.agro-ps__stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.agro-ps__stat-tile {
  background: var(--ps-surface-alt);
  border-radius: var(--ps-radius);
  padding: 16px;
  border: 1px solid var(--ps-border-soft);
}
.agro-ps__stat-label {
  font-size: 11px;
  color: var(--ps-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  font-weight: 600;
}
.agro-ps__stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ps-text);
  letter-spacing: -0.02em;
}

/* Chart canvas wrapper */
.agro-ps__chart {
  position: relative;
  height: 280px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--ps-surface-alt);
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border-soft);
  padding: 12px;
  box-sizing: border-box;
}
.agro-ps__chart canvas {
  max-width: 100% !important;
  height: 100% !important;
}
@media (max-width: 768px) {
  .agro-ps__chart { height: 220px; padding: 8px; }
}

/* ============================================================
 * mg-production — multi-row proizvodi (farm_production_items)
 * ============================================================ */
.mg-production { display: flex; flex-direction: column; gap: 10px; }
.mg-production__list { display: flex; flex-direction: column; gap: 8px; }
.mg-production__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: var(--ps-surface-alt, #fafaf7);
  border: 1px solid var(--ps-border-soft, #e5e7eb);
  border-radius: var(--ps-radius, 10px);
  transition: background 120ms;
}
.mg-production__row:hover {
  background: var(--ps-surface-card, #fff);
}
.mg-production__field { display: flex; flex-direction: column; min-width: 0; }
.mg-production__remove {
  align-self: center;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b91c1c;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  padding: 0;
}
.mg-production__remove:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
.mg-production__remove svg { display: block; }
.mg-production__add-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-top: 4px;
}
.mg-production__add {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
}
.mg-production__add[disabled] { opacity: 0.5; cursor: not-allowed; }
.mg-production__counter {
  font-size: 12px;
  color: var(--ps-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.mg-production__counter.is-full { color: #b91c1c; font-weight: 600; }
.mg-production__empty {
  padding: 14px;
  background: var(--ps-surface-alt, #fafaf7);
  border: 1px dashed var(--ps-border-soft, #e5e7eb);
  border-radius: var(--ps-radius, 10px);
  text-align: center;
  margin: 0;
}
.mg-production__alert {
  display: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.mg-production__alert.is-error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.mg-production__alert.is-success {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.agro-ps__sr-label {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
@media (max-width: 720px) {
  .mg-production__row {
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas: "item item remove" "qty unit unit";
  }
  .mg-production__field--item { grid-area: item; }
  .mg-production__field--qty  { grid-area: qty; }
  .mg-production__field--unit { grid-area: unit; }
  .mg-production__remove      { grid-area: remove; align-self: start; }
}

/* Brand ikonice u social-links labelama */
.agro-ps__label--with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.agro-ps__brand-icon {
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--ps-text-secondary, #4a5b4d);
}
