:root {
  --primary-muga: #78350f;
  --primary-tea: #78350f; /* backward-compat alias */
  --primary-light: #92400e;
  --accent-gold: #c59b27;
  --accent-amber: #f59e0b;
  --royal-maroon: #831843;
  --bg-sand: #fbf9f4;
  --card-bg: #ffffff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --success: #10b981;
  --badge-gi: #854d0e;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-sand);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #2a081d 0%, #4a0e2e 45%, #78350f 100%);
  color: #fff;
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.brand-logo {
  font-size: 2.2rem;
}

.brand-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-title p {
  font-size: 0.85rem;
  opacity: 0.9;
  color: #d1fae5;
}

.header-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Tutorial Button */
.tutorial-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  border: 1.5px solid #fde68a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
}

.tutorial-btn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.45);
}

.tutorial-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.gi-tag-pill {
  background: #fef3c7;
  color: #78350f;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid #f59e0b;
}

.silk-mark-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid #7dd3fc;
}

.cmerti-pill {
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid #6ee7b7;
}

.tocklai-pill {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Modal Styles */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 24, 39, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

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

.modal-close-btn:hover {
  color: #111827;
  background: #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

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

.tutorial-intro-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}

.tutorial-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tutorial-pills span {
  background: #ffffff;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #6ee7b7;
}

.tutorial-role-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.85rem;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.tutorial-role-card:hover {
  border-color: var(--primary-light);
}

.tutorial-role-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.role-icon {
  font-size: 1.4rem;
}

.btn-tutorial-jump {
  margin-left: auto;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tutorial-jump:hover {
  background: #0284c7;
  color: #ffffff;
}

.tutorial-steps {
  list-style: none;
  padding-left: 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.6;
}

.tutorial-steps li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.25rem;
}

.tutorial-steps li::before {
  content: "•";
  position: absolute;
  left: 0.3rem;
  color: var(--primary-tea);
  font-weight: bold;
}

/* Nav */
nav.tab-nav {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary-tea);
}

.tab-btn.active {
  color: var(--primary-tea);
  border-bottom-color: var(--primary-tea);
}

main.content-area {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Card Styling */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.25rem;
  color: var(--primary-tea);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Stat Box */
.stat-box {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1.2rem;
  border-left: 4px solid var(--primary-tea);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 0.25rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: #cbd5e1;
}

.timeline-step {
  position: relative;
  margin-bottom: 1.75rem;
}

.timeline-step:last-child {
  margin-bottom: 0;
}

.step-node {
  position: absolute;
  left: -2rem;
  top: 0.15rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--primary-tea);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--primary-tea);
}

.step-content {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-tea);
}

.step-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step-body {
  font-size: 0.9rem;
  color: #374151;
}

.step-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  font-weight: 600;
}

/* Search bar */
.search-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary-tea);
}

.btn-primary {
  background: var(--primary-tea);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* Map SVG styling */
.assam-map-container {
  background: #f0fdf4;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}

.map-svg {
  width: 100%;
  max-height: 290px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.garden-pin-group {
  cursor: pointer;
  outline: none;
}

.garden-pin-pulse {
  animation: pinPulse 2.5s infinite ease-in-out;
  transform-origin: center;
}

@keyframes pinPulse {
  0% { r: 10px; opacity: 0.4; }
  50% { r: 16px; opacity: 0.1; }
  100% { r: 10px; opacity: 0.4; }
}

.garden-pin {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), fill 0.2s ease;
}

.garden-pin-group:hover .garden-pin {
  transform: scale(1.35);
  transform-origin: center;
}

.garden-pin-group.active-pin .garden-pin {
  fill: #eab308 !important;
  stroke: #ffffff;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.8));
}

.garden-pin-group.active-pin text {
  fill: #854d0e !important;
  font-size: 11.5px !important;
}

/* District Details Card */
.district-card {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  animation: cardFadeIn 0.25s ease-out;
}

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

.district-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0fdf4;
}

.district-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-tea);
}

.district-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.metric-pill-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.metric-pill-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 0.2rem;
}

/* Telemetry monitor */
.telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.telemetry-badge.optimal {
  background: #d1fae5;
  color: #065f46;
}

.telemetry-badge.active {
  background: #fef3c7;
  color: #92400e;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Batch Chips */
.batch-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.batch-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.batch-chip:hover {
  border-color: var(--primary-tea);
  background: #f0fdf4;
  color: var(--primary-tea);
}

.batch-chip.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.batch-chip.danger {
  border-color: #fecaca;
  color: #991b1b;
}

.batch-chip.danger:hover,
.batch-chip.danger.active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #7f1d1d;
}

.chip-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chip-status-dot.green { background: #10b981; }
.chip-status-dot.blue { background: #3b82f6; }
.chip-status-dot.yellow { background: #f59e0b; }
.chip-status-dot.purple { background: #8b5cf6; }
.chip-status-dot.red { background: #ef4444; }

/* Quick Action Bar */
.quick-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

.btn-action-tool {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-action-tool:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toastIn 0.25s ease-out;
  border-left: 4px solid var(--accent-gold);
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

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

/* Admin Sub-Navigation */
.admin-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.admin-tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.admin-tab-btn:hover {
  border-color: var(--primary-tea);
  color: var(--primary-tea);
}

.admin-tab-btn.active {
  background: var(--primary-tea);
  color: #ffffff;
  border-color: var(--primary-tea);
}

.admin-subpane {
  display: none;
}

.admin-subpane.active {
  display: block;
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #ffffff;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 700;
}

.admin-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

.btn-sm-action {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-sm-revoke {
  background: #fee2e2;
  color: #991b1b;
}

.btn-sm-revoke:hover {
  background: #fca5a5;
}

.btn-sm-authorize {
  background: #dcfce7;
  color: #166534;
}

.btn-sm-authorize:hover {
  background: #86efac;
}

/* Official Provenance Certificate Layout */
.cert-container {
  border: 4px double #1b4d3e;
  padding: 2rem;
  background: #fffdfa;
  border-radius: 8px;
  position: relative;
  font-family: Georgia, serif;
}

.cert-header {
  text-align: center;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.cert-title {
  font-size: 1.6rem;
  font-weight: bold;
  color: #1b4d3e;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cert-subtitle {
  font-size: 0.9rem;
  color: #78350f;
  margin-top: 0.25rem;
  font-style: italic;
}

.cert-badge-row {
  display: flex;
  justify-content: space-around;
  margin: 1.25rem 0;
  padding: 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-family: -apple-system, sans-serif;
  font-size: 0.85rem;
}

.cert-timeline-box {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: -apple-system, sans-serif;
  font-size: 0.85rem;
}

.cert-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed #d1d5db;
  font-family: -apple-system, sans-serif;
  font-size: 0.8rem;
  color: #4b5563;
}

/* Retail Packaging Stamp */
.stamp-card {
  border: 2px dashed #1b4d3e;
  padding: 1.5rem;
  background: #fefce8;
  border-radius: 10px;
  text-align: center;
}

.stamp-qr-placeholder {
  width: 140px;
  height: 140px;
  margin: 0.75rem auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* GIS Layer Switcher & Cadastral Views */
.gis-layer-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 8px;
  gap: 0.25rem;
  border: 1px solid var(--border-color);
}

.gis-mode-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.gis-mode-btn:hover {
  color: var(--primary-tea);
}

.gis-mode-btn.active {
  background: #ffffff;
  color: var(--primary-tea);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.gis-view-panel {
  display: none;
}

.gis-view-panel.active {
  display: block;
}

/* Cadastral Map Container & Toolbar */
.cadastral-map-container {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  padding: 1rem;
}

.cadastral-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.cadastral-legend {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: #475569;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 2px;
  border: 1.5px solid;
}

/* Cadastral SVG & Interactive Parcels */
.cadastral-svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.03);
  display: block;
  user-select: none;
}

.cadastral-parcel {
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cadastral-parcel:hover polygon {
  filter: brightness(0.94);
  stroke-width: 3px;
}

.cadastral-parcel.active-dag polygon {
  stroke: #0f172a !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.18));
}

/* Radar pulse animation for live GPS sensor */
@keyframes radar-pulse {
  0% {
    r: 5px;
    opacity: 0.9;
  }
  70% {
    r: 14px;
    opacity: 0.15;
  }
  100% {
    r: 16px;
    opacity: 0;
  }
}

.cadastral-sensor-ping {
  animation: radar-pulse 1.8s infinite ease-out;
  transform-origin: center;
}

/* Cadastral Details Box / Drawer */
.cadastral-details-box {
  margin-top: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-tea);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.cadastral-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cadastral-details-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-tea);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cadastral-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  font-size: 0.85rem;
}

.cadastral-attr {
  background: #ffffff;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.cadastral-attr-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.cadastral-attr-value {
  color: #1e293b;
  font-weight: 600;
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  background: #ffffff;
  line-height: 1.6;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f8fafc;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
}

.footer-email-link {
  color: var(--primary-tea);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-email-link:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

.footer-disclaimer {
  max-width: 860px;
  margin: 1.25rem auto 0;
  padding: 0.85rem 1.2rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #57534e;
  line-height: 1.55;
  text-align: left;
}

/* =========================================================
   Admin Panel Login Gateway & Session Management
   ========================================================= */
.admin-login-card {
  max-width: 560px;
  margin: 2.5rem auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-icon-bubble {
  width: 56px;
  height: 56px;
  background: #ecfdf5;
  color: var(--primary-tea);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
  border: 2px solid #a7f3d0;
}

.login-header h2 {
  font-size: 1.35rem;
  color: var(--primary-tea);
  margin-bottom: 0.4rem;
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Demo Credentials Callout */
.demo-creds-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}

.demo-creds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.demo-creds-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-sm-autofill {
  background: #f59e0b;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm-autofill:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.demo-creds-body {
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.6;
}

.demo-creds-body code {
  background: #fef3c7;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  color: #92400e;
  border: 1px solid #fde68a;
}

.login-error-alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 4px solid #ef4444;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Admin Authenticated Session Header Bar */
.admin-session-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.session-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dcfce7;
  color: #166534;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  border: 1px solid #bbf7d0;
}

.session-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
}

.session-meta {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.btn-logout {
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fca5a5;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: #fee2e2;
  border-color: #ef4444;
}
