:root {
  --primary-50: #ecfdf5;
  --primary-100: #d1fae5;
  --primary-200: #a7f3d0;
  --primary-300: #6ee7b7;
  --primary-400: #34d399;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;
  --primary-950: #022c22;

  --accent-gold: #d97706;
  --accent-gold-light: #fef3c7;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-header: #0f172a;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #059669;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --bg-input: #1f2937;
  --bg-subtle: #1e293b;
  --bg-header: #030712;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --border-color: #334155;
  --border-focus: #10b981;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */
.top-bar {
  background: var(--bg-header);
  color: #94a3b8;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 38px;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gov-flag {
  color: #cbd5e1;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gov-flag i {
  color: var(--primary-400);
}

.top-divider {
  color: #475569;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-btn.active, .lang-btn:hover {
  background: var(--primary-600);
  color: #fff;
}

.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #e2e8f0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */
.main-header {
  background: var(--bg-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.emblem-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-800));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
  line-height: 1.15;
}

.brand-text span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--primary-400);
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  color: #e2e8f0;
}

.header-badge i {
  color: var(--primary-400);
  font-size: 1.25rem;
}

.header-badge strong {
  display: block;
  font-size: 0.82rem;
  color: #fff;
}

.header-badge small {
  font-size: 0.7rem;
  color: var(--primary-300);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  background: linear-gradient(180deg, var(--bg-header) 0%, rgba(15, 23, 42, 0.95) 50%, var(--bg-main) 100%);
  padding: 2.5rem 0 1.5rem;
  color: #ffffff;
}

.hero-content {
  max-width: 960px;
  margin: 0 auto 2rem;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.4);
  color: #fde68a;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1.75rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.45);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.hero-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Stats Cards */
.stats-card-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-main);
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-400);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-50);
  color: var(--primary-600);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

[data-theme="dark"] .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-600);
  line-height: 1.1;
}

[data-theme="dark"] .stat-number {
  color: var(--primary-400);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   FILTER CARD & CONTROLS
   ========================================================================== */
.main-content {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
  flex: 1;
}

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr auto;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-field input,
.filter-field select {
  height: 42px;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.filter-reset-field {
  justify-content: flex-end;
}

.btn-reset {
  height: 42px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-reset:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Specialization Bar & View Switcher */
.specialization-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.chips-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spec-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.spec-chip:hover {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.spec-chip.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
}

.view-switcher {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--bg-card);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .view-btn.active {
  color: var(--primary-400);
}

/* Results header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding: 0 0.25rem;
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results-count strong {
  color: var(--text-main);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary-600);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

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

/* ==========================================================================
   DATA TABLE VIEW
   ========================================================================== */
.table-responsive-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.agro-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  table-layout: auto;
}

.agro-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  line-height: 1.3;
  vertical-align: middle;
}

.agro-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  line-height: 1.35;
}

.agro-table tbody tr:hover {
  background-color: var(--primary-50);
}

[data-theme="dark"] .agro-table tbody tr:hover {
  background-color: rgba(16, 185, 129, 0.05);
}

.col-num {
  width: 45px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.875rem;
  padding-left: 0.75rem;
}
.col-region {
  font-weight: 600;
  color: var(--primary-700);
  width: 140px;
}
[data-theme="dark"] .col-region { color: var(--primary-400); }
.col-district {
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--text-main);
  width: 130px;
}
.col-name {
  font-size: 0.875rem;
  min-width: 220px;
  line-height: 1.3;
}
.name-surname {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.95rem;
}
.name-rest {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 1px;
}
.col-phone {
  white-space: nowrap;
  width: 155px;
}
.col-phone a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  white-space: nowrap;
}
.col-phone a:hover { text-decoration: underline; }
.col-birth {
  white-space: nowrap;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  width: 110px;
}
.col-spec {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.875rem;
  width: 170px;
}
.col-university {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.35;
}
.col-year {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  width: 110px;
}
.col-actions {
  width: 115px;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-action {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.btn-action-primary {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

.btn-action-primary:hover {
  background: var(--primary-700);
  color: #fff;
}

.btn-action-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

/* ==========================================================================
   CARDS GRID VIEW
   ========================================================================== */
.agro-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.agro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.agro-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-400);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
  color: var(--primary-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

[data-theme="dark"] .card-avatar {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-400);
}

.card-meta {
  flex: 1;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.card-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-region {
  background: var(--primary-50);
  color: var(--primary-700);
}

[data-theme="dark"] .badge-region {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
}

.badge-spec {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.card-details {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.card-detail-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-detail-item i {
  color: var(--primary-500);
  width: 14px;
  text-align: center;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.card-phone-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: var(--transition);
}

[data-theme="dark"] .card-phone-btn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
}

.card-phone-btn:hover {
  background: var(--primary-600);
  color: #fff;
}

/* Empty State */
.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 1.25rem;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.pagination {
  display: flex;
  gap: 0.35rem;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary-500);
  color: var(--primary-600);
}

.page-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #ffffff;
}

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

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}

.modal-lg {
  max-width: 800px;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary-600);
}

[data-theme="dark"] .modal-title-group {
  color: var(--primary-400);
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-form, .modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

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

.form-col-2 {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group .req {
  color: #ef4444;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.modal-footer .btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.modal-footer .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="dark"] .modal-footer .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.modal-status-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
}

.modal-status-message.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
}

.modal-status-message.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

/* Drag & Drop Zone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

[data-theme="dark"] .dropzone:hover, [data-theme="dark"] .dropzone.dragover {
  background: rgba(16, 185, 129, 0.1);
}

.dropzone i {
  font-size: 2.5rem;
  color: var(--primary-500);
  margin-bottom: 0.75rem;
}

.dropzone h4 {
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.dropzone p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.template-download-row {
  margin-top: 0.5rem;
}

.template-link {
  color: var(--primary-600);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

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

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.25rem 0 0.5rem;
}

.preview-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.consult-agronomist-banner {
  background: var(--primary-50);
  border-left: 4px solid var(--primary-600);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1rem;
}

[data-theme="dark"] .consult-agronomist-banner {
  background: rgba(16, 185, 129, 0.12);
}

.consult-agronomist-banner strong {
  display: block;
  font-size: 0.95rem;
  color: var(--primary-900);
}

[data-theme="dark"] .consult-agronomist-banner strong {
  color: var(--primary-300);
}

.consult-agronomist-banner small {
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-header);
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: #dc2626;
}

.toast.success {
  background: #059669;
}

/* Footer */
.main-footer {
  background: var(--bg-header);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.emblem-icon-sm {
  width: 36px;
  height: 36px;
  background: var(--primary-600);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.footer-brand h4 {
  color: #ffffff;
  font-size: 0.95rem;
}

.footer-brand p {
  font-size: 0.8125rem;
  color: #64748b;
}

/* ==========================================================================
   AUTHENTICATION & REGIONAL RBAC STYLES
   ========================================================================== */
.auth-guest-box, .auth-user-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-btn-login {
  background: var(--primary-600);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.auth-btn-login:hover {
  background: var(--primary-500);
}

.user-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.auth-action-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.auth-action-btn.btn-accounts {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.3);
}

.auth-action-btn.btn-accounts:hover {
  background: rgba(217, 119, 6, 0.25);
  color: #fef08a;
}

.auth-action-btn.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.auth-action-btn.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Regional banner */
.regional-info-bar {
  margin-top: 1.25rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #d1fae5;
}

.regional-info-bar i {
  font-size: 1.2rem;
  color: var(--primary-400);
}

/* Region Lock Badge in Form */
.region-lock-badge {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--primary-900);
}

[data-theme="dark"] .region-lock-badge {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--primary-300);
}

.region-pill {
  display: inline-block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: normal;
  line-height: 1.25;
}

.phone-link {
  color: var(--primary-700);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

[data-theme="dark"] .phone-link {
  color: var(--primary-400);
}

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

.btn-action-edit {
  background: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-200);
}

.btn-action-edit:hover {
  background: var(--primary-600);
  color: #ffffff;
  border-color: var(--primary-600);
}

[data-theme="dark"] .btn-action-edit {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-300);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Password Input */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 2.5rem;
  width: 100%;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.25rem;
}

.btn-toggle-password:hover {
  color: var(--text-main);
}

/* ==========================================================================
   MODERN LOGIN CARD REDESIGN
   ========================================================================== */
.login-card-custom {
  max-width: 450px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.login-card-header {
  padding: 1.35rem 1.5rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.02) 100%);
  border-bottom: 1px solid var(--border-color);
}

.login-emblem-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.modal-subtitle {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.login-form-body {
  padding: 1.5rem;
}

.login-intro-text {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.login-field {
  margin-bottom: 1.1rem;
}

.login-field label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.login-field label i {
  color: var(--primary-600);
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-lead-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.input-icon-wrap input {
  padding-left: 2.35rem !important;
  width: 100%;
  height: 42px;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
}

.input-icon-wrap input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  outline: none;
}

/* Captcha Component */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.captcha-image-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  padding: 3px 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.captcha-canvas {
  width: 120px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  cursor: pointer;
  display: block;
}

[data-theme="dark"] .captcha-canvas {
  background: #1e293b;
}

.btn-refresh-captcha {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.2s ease;
}

.btn-refresh-captcha:hover {
  color: var(--primary-600);
  transform: rotate(90deg);
}

.captcha-input-wrap {
  flex: 1;
}

.captcha-input-wrap input {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  padding-left: 2.2rem !important;
}

.login-footer {
  padding: 1.1rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-login-cancel {
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.btn-login-submit {
  padding: 0.55rem 1.35rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   MODERN AGRONOMIST FORM MODAL REDESIGN
   ========================================================================== */
.agro-form-card {
  max-width: 820px;
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.form-section-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
  transition: var(--transition);
}

.form-section-card:hover {
  border-color: var(--primary-300);
}

[data-theme="dark"] .form-section-card:hover {
  border-color: var(--primary-700);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-700);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .section-title {
  color: var(--primary-400);
}

/* Admin Accounts Table */
.accounts-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.accounts-header-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 75%;
}

.credential-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--text-main);
}

.credential-box.password-box {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

[data-theme="dark"] .credential-box.password-box {
  background: rgba(217, 119, 6, 0.2);
  border-color: rgba(217, 119, 6, 0.4);
  color: #fcd34d;
}

.btn-copy {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.25rem;
  transition: var(--transition);
}

.btn-copy:hover {
  background: var(--bg-subtle);
  color: var(--primary-600);
  border-color: var(--border-color);
}

.badge-admin {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.badge-regional {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-600);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .badge-regional {
  color: var(--primary-400);
}

/* Admin Banner */
.admin-info-bar {
  margin-top: 1.25rem;
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #fef3c7;
}

.admin-info-bar i {
  font-size: 1.2rem;
  color: #f59e0b;
}

/* Staff Management Modal */
.modal-xl {
  max-width: 960px;
}

.staff-create-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.staff-box-header {
  margin-bottom: 1rem;
}

.staff-box-header h4 {
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.staff-box-header .subtext {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.staff-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 0.85rem;
  align-items: flex-end;
}

.staff-form-grid .form-group {
  margin-bottom: 0;
}

.btn-create-staff {
  white-space: nowrap;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.staff-list-section h4 {
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  .top-bar, .main-header, .hero-actions, .filter-card, .results-header, .pagination-wrapper, .modal-overlay, .main-footer, .col-actions, .table-actions {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .hero-section {
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
  }

  .hero-title {
    color: #000 !important;
    font-size: 1.4rem !important;
  }

  .stats-card-row {
    display: none !important;
  }

  .table-responsive-wrapper {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }

  .agro-table th, .agro-table td {
    border: 1px solid #000 !important;
    padding: 6px 8px !important;
    font-size: 8pt !important;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .stats-card-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stats-card-row {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-col-2 {
    grid-column: span 1;
  }
}
