/* ══════════════════════════════════════════════════════
   ITC Yippee हाट मित्र — Stylesheet
   Rural canopy activation platform
═══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
  --saffron: #E8690A;
  --saffron-light: #F5832A;
  --saffron-pale: #FEF0E6;
  --earth: #062F62;
  --earth-mid: #0D4F9E;
  --earth-light: #4A7AB5;
  --leaf: #1A6B35;
  --leaf-light: #28A154;
  --cream: #F0F5FB;
  --cream-dark: #D5E3F5;
  --stone: #9AB4D4;
  --white: #FFFFFF;
  --red: #C0392B;
  --shadow: 0 4px 24px rgba(6,47,98,0.10);
  --shadow-lg: 0 12px 48px rgba(6,47,98,0.16);
}

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

/* Reserve space for the vertical scrollbar even when content fits — prevents
   the dashboard from "jumping width" when switching tabs of different height. */
html {
  scrollbar-gutter: stable;
  overflow-y: scroll;        /* fallback for browsers without scrollbar-gutter */
  overflow-x: hidden;        /* never allow horizontal scroll on the document */
  width: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--earth);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }

/* ── LAYOUT ── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── SCREENS ── */
.screen { display: none; flex-direction: column; min-height: 100vh; }
.screen.active { display: flex; }

/* ══════════════════════════════════
   LANDING / ROLE SELECT SCREEN
══════════════════════════════════ */
#screen-landing {
  background: var(--earth);
  position: relative;
  overflow: hidden;
}

.landing-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(232,105,10,0.18) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(26,107,53,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.landing-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

.landing-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; padding: 40px 24px;
  gap: 0;
}

.itc-badge {
  background: var(--saffron);
  color: white;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 3px;
  padding: 6px 18px;
  border-radius: 2px;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.landing-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: clamp(42px, 10vw, 80px);
  font-weight: 800;
  color: white;
  line-height: 0.9;
  text-align: center;
  margin-bottom: 8px;
}

.landing-title span { color: var(--saffron); }

.landing-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  margin-bottom: 56px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  max-width: 440px;
}

.role-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 28px 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

.role-card:hover {
  background: rgba(232,105,10,0.2);
  border-color: var(--saffron);
  transform: translateY(-2px);
}

.role-icon { font-size: 36px; }

.role-label {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: white;
}

.role-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
}

/* ══════════════════════════════════
   SHARED AUTH SCREEN
══════════════════════════════════ */
.auth-screen {
  background: var(--earth);
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
}

.auth-box {
  background: var(--cream);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.back-btn {
  position: absolute; top: 24px; left: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  transition: all 0.2s;
}
.back-btn:hover { background: rgba(255,255,255,0.18); }

.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--earth);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--earth-light);
  margin-bottom: 28px;
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--earth-light);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* Red asterisk for required fields */
.required-mark {
  color: #dc2626;
  font-weight: 700;
  margin-left: 2px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--earth);
  background: white;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--saffron);
}

textarea { resize: vertical; min-height: 80px; }

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn-primary { background: var(--saffron); color: white; }
.btn-primary:hover { background: var(--saffron-light); transform: translateY(-1px); }

.btn-secondary { background: var(--cream-dark); color: var(--earth); }
.btn-secondary:hover { background: var(--stone); color: white; }

.btn-leaf { background: var(--leaf); color: white; }
.btn-leaf:hover { background: var(--leaf-light); }

.btn-sm {
  width: auto;
  padding: 8px 18px;
  font-size: 13px;
}

.toggle-link {
  text-align: center;
  font-size: 13px;
  margin-top: 16px;
  color: var(--earth-light);
}

.toggle-link a {
  color: var(--saffron);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.error-msg {
  background: #FEE;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.success-msg {
  background: #E8F5ED;
  border: 1px solid var(--leaf);
  color: var(--leaf);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ══════════════════════════════════
   AGENT DASHBOARD
══════════════════════════════════ */
#screen-agent-dash {
  background: var(--cream);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.top-bar {
  background: var(--earth);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(6,47,98,0.3);
}

.top-bar-brand {
  display: flex; align-items: center; gap: 10px;
}

.brand-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--saffron);
}

.brand-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: white;
}

.user-chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex; align-items: center; gap: 8px;
}

.user-chip-name {
  font-size: 13px;
  color: white;
  font-weight: 500;
}

.logout-icon {
  width: 18px;
  height: 18px;
  color: white;          /* drives currentColor on the inline SVG strokes */
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.logout-icon:hover  { opacity: 1; }
.logout-icon:focus  { outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px; border-radius: 4px; }

.dash-content {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}

.dash-hero {
  background: linear-gradient(135deg, var(--earth) 0%, var(--earth-mid) 100%);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.dash-hero::before {
  content: '🏕️';
  position: absolute;
  right: 24px; top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  opacity: 0.2;
}

.dash-hero-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--saffron);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.dash-hero-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.dash-hero-info {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cream-dark);
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }
.stat-card.orange { border-top-color: var(--saffron); }
.stat-card.green { border-top-color: var(--leaf); }
.stat-card.red { border-top-color: var(--red); }

.stat-card-clickable {
  cursor: pointer;
  user-select: none;
}
.stat-card-clickable:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

.stat-num {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--earth);
}

.stat-label {
  font-size: 11px;
  color: var(--earth-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--earth);
}

/* ── HAAT CARDS ── */
.haat-list { display: flex; flex-direction: column; gap: 12px; }

.haat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border-left: 4px solid var(--cream-dark);
  cursor: pointer;
  transition: transform 0.2s;
}
.haat-card,
.haat-card * { cursor: pointer; }

.haat-card:hover { transform: translateX(2px); }
.haat-card.VERIFIED { border-left-color: var(--leaf); }
.haat-card.PENDING { border-left-color: var(--saffron); }
.haat-card.REJECTED { border-left-color: var(--red); }

.haat-village {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--earth);
}

.haat-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 6px;
}

.meta-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--cream-dark);
  color: var(--earth-light);
  font-weight: 500;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge.VERIFIED { background: #E8F5ED; color: var(--leaf); }
.status-badge.PENDING { background: #FEF0E6; color: var(--saffron); }
.status-badge.REJECTED { background: #FEE; color: var(--red); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--earth-light);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ══════════════════════════════════
   हाट जोड़ें FORM SCREEN
══════════════════════════════════ */
#screen-add-haat { background: var(--cream); }

.form-screen-content {
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.form-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.form-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 13px;
  color: var(--earth-light);
  margin-bottom: 28px;
}

.photo-upload-area {
  border: 2px dashed var(--stone);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--cream);
}

.photo-upload-area:hover {
  border-color: var(--saffron);
  background: var(--saffron-pale);
}

.photo-upload-icon { font-size: 32px; margin-bottom: 8px; }

.photo-upload-text { font-size: 13px; color: var(--earth-light); }
.photo-upload-text strong { color: var(--saffron); }

.photos-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-thumb-wrap {
  position: relative;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
  border: 2px solid var(--cream-dark);
  display: block;
}

.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.geo-row {
  display: flex; align-items: center; gap: 12px;
}

.geo-status {
  flex: 1;
  font-size: 13px;
  color: var(--earth-light);
  line-height: 1.4;
}

.geo-status.ok    { color: var(--leaf); font-weight: 600; }
.geo-status.error { color: var(--red);  font-weight: 500; }

/* ══════════════════════════════════
   ADMIN DASHBOARD
══════════════════════════════════ */
#screen-admin-dash { background: var(--cream); }

.admin-top-bar {
  background: var(--earth);
  padding: 16px 24px;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(6,47,98,0.3);
}

.admin-tag {
  font-size: 10px;
  background: var(--saffron);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-tabs {
  display: flex;
  padding: 16px 24px 0;
  gap: 4px;
  border-bottom: 2px solid var(--cream-dark);
  max-width: 1100px;
  margin: 0 auto;
}

.admin-tab {
  padding: 10px 20px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--earth-light);
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.admin-tab.active {
  color: var(--saffron);
  border-bottom-color: var(--saffron);
  background: var(--saffron-pale);
}

.admin-content {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* ── ADMIN TABLE ── */
.table-wrap {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cream-dark);
}

.table-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--earth-light);
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--earth);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--saffron-pale); }

.filter-row {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-row input, .filter-row select {
  flex: 1; min-width: 150px;
  padding: 10px 14px;
  font-size: 13px;
}

/* ══════════════════════════════════
   MODAL
══════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,47,98,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex; align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.modal-close {
  font-size: 22px;
  cursor: pointer;
  color: var(--earth-light);
  transition: color 0.2s;
  line-height: 1;
}
.modal-close:hover { color: var(--red); }

.modal-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.modal-photos img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--cream-dark);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-item label {
  font-size: 10px;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.detail-item p {
  font-size: 14px;
  font-weight: 500;
  color: var(--earth);
}

/* ── MAP LINK ── */
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--saffron);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin: 8px 0;
}
.map-link:hover { text-decoration: underline; }

/* ══════════════════════════════════
   LOADER & TOAST
══════════════════════════════════ */
.loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6,47,98,0.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.loading-overlay.show { display: flex; }

.loading-box {
  background: white;
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ══════════════════════════════════
   MOBILE CARDS (admin tables → cards)
══════════════════════════════════ */
.m-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(44,26,14,0.08);
  border-left: 4px solid var(--cream-dark);
  position: relative;
}
.m-card.VERIFIED { border-left-color: var(--leaf); }
.m-card.PENDING  { border-left-color: var(--saffron); }
.m-card.REJECTED { border-left-color: var(--red); }

.m-card-title {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--earth);
  margin-bottom: 10px;
  padding-right: 80px;
}
.m-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 13px;
}
.m-card-row:last-of-type { border-bottom: none; }
.m-card-label {
  color: var(--earth-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.m-card-value {
  color: var(--earth);
  font-weight: 500;
  text-align: right;
}
.m-card-action {
  position: absolute;
  top: 14px; right: 14px;
}
.m-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.m-chip {
  background: var(--cream-dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  color: var(--earth-mid);
  font-weight: 500;
}
.m-agent-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(44,26,14,0.08);
}
.m-agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.m-agent-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--earth);
}
.m-agent-code {
  font-size: 11px;
  background: var(--earth);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.m-village-card {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(44,26,14,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.m-village-name {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--earth);
}
.m-village-sub {
  font-size: 12px;
  color: var(--earth-light);
  margin-top: 2px;
}
.m-village-pin {
  font-size: 11px;
  background: var(--cream-dark);
  color: var(--earth-light);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* Admin tables: card layout is mobile-only; hidden on desktop */
.mobile-cards-container {
  display: none;
}

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 700px) {
  .admin-top-bar { padding: 12px 16px; }
  .brand-name { font-size: 14px; }
  .user-chip-name { display: none; }

  .admin-tabs {
    padding: 10px 16px 0;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab {
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .admin-content { padding: 10px 8px; }
  .admin-stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
  .stat-card { padding: 14px 12px; border-radius: 12px; }
  .stat-num { font-size: 28px; }
  .stat-label { font-size: 10px; }

  /* Hide tables on mobile — JS renders cards instead */
  .table-wrap table { display: none; }
  .mobile-cards-container {
    display: block;
    padding: 0 0 8px;
  }
  .table-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .table-title { font-size: 14px; }

  .filter-row { flex-direction: column; gap: 8px; padding: 0 0 8px; }
  .filter-row input, .filter-row select { min-width: 0; }

  .modal { padding: 20px 16px; border-radius: 20px 20px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px 16px; }
}

@media (max-width: 400px) {
  .admin-stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--earth);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--leaf); }
.toast.error { background: var(--red); }

.divider {
  height: 1px;
  background: var(--cream-dark);
  margin: 20px 0;
}

.inline-flex {
  display: flex; align-items: center; gap: 8px;
}

/* ── AGENT DASHBOARD TABS — same width as History (equal halves, content-neutral) ── */
.agent-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--cream-dark);
  border-radius: 12px;
  padding: 4px;
  width: 100%;
  box-sizing: border-box;
}

.agent-tab {
  /* flex-basis 0 + width 0: both tabs share space equally (History width), not by label length */
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  padding: 10px;
  text-align: center;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--earth-light);
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-tab.active {
  background: white;
  color: var(--saffron);
  box-shadow: var(--shadow);
}

.village-list-agent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.village-list-agent > div {
  background: white;
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  min-width: 0;
  box-sizing: border-box;
}
