:root {
  --saffron: #FF9933;
  --saffron-dark: #B85C00;
  --saffron-light: #FFF1DE;
  --amber: #d97706;
  --green: #15803d;
  --red: #b91c1c;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

.tricolor-bar {
  height: 5px;
  background: linear-gradient(to right, #FF9933 0%, #FF9933 33.33%, #ffffff 33.33%, #ffffff 66.66%, #138808 66.66%, #138808 100%);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

html { overflow-x: hidden; }

a { color: var(--saffron); }

.topbar {
  background: var(--saffron);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

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

.topbar .brand .badge {
  background: #fff;
  color: var(--saffron);
  font-weight: 700;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.topbar .tagline {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.92;
  padding: 6px 10px;
  border-radius: 6px;
}

.topbar nav a:hover, .topbar nav a.active {
  background: rgba(255,255,255,0.15);
  opacity: 1;
}

.lang-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  overflow: hidden;
}

.lang-toggle button {
  background: transparent;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.lang-toggle button.active {
  background: #fff;
  color: var(--saffron);
  font-weight: 600;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

h2 {
  margin-top: 0;
  font-size: 20px;
  color: var(--saffron-dark);
}

.update-item {
  border-bottom: 1px solid var(--gray-100);
  padding: 14px 0;
}
.update-item:last-child { border-bottom: none; }
.update-item h3 { margin: 0 0 4px; font-size: 16px; }
.update-item .date { font-size: 12px; color: var(--gray-400); margin-bottom: 6px; }
.update-item p { margin: 0; white-space: pre-wrap; }

.cta-box {
  background: var(--saffron-light);
  border: 1px solid #cfe0f7;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.btn {
  display: inline-block;
  background: var(--saffron);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { background: var(--saffron-dark); }
.btn.secondary { background: var(--gray-600); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { font-size: 14px; }

.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.success { background: #ecfdf5; color: var(--green); border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
th { color: var(--gray-600); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

.badge-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-status.new { background: #fef3c7; color: #92400e; }
.badge-status.in-progress { background: #dbeafe; color: #1e40af; }
.badge-status.resolved { background: #dcfce7; color: #166534; }

.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters select { width: auto; }

.table-wrap { overflow-x: auto; }

.update-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.update-row > div { flex: 1 1 220px; min-width: 0; }
.update-row:last-child { border-bottom: none; }

footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  padding: 20px;
}

.photo-thumb { max-width: 90px; max-height: 60px; border-radius: 6px; object-fit: cover; }

.empty-note { color: var(--gray-400); font-size: 14px; padding: 10px 0; }

.leadership-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.leader {
  text-align: center;
}

.leader-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
}

.leader-name {
  font-weight: 700;
  font-size: 14px;
  margin-top: 8px;
  color: var(--gray-800);
}

.leader-role {
  font-size: 12px;
  color: var(--gray-600);
}

@media (max-width: 480px) {
  .leadership-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .leader-name { font-size: 12px; }
  .leader-role { font-size: 11px; }
}

.party-logo {
  height: 34px;
  width: auto;
  margin-right: 4px;
}

.leadership-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leadership-logo {
  height: 28px;
  width: auto;
}

@media (max-width: 480px) {
  .party-logo { height: 26px; }
}

footer .credit {
  margin-top: 4px;
  font-size: 11px;
  color: var(--gray-400);
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25D366;
  flex-shrink: 0;
}
.whatsapp-btn:hover { background: #1ebe57; }

.complaint-number {
  margin-top: 8px;
  font-size: 14px;
}
.complaint-number strong {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  main { padding: 18px 12px 48px; }
  .card { padding: 16px; }
  h2 { font-size: 18px; }

  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 16px; }
  .topbar .tagline { font-size: 11px; }
  .topbar .brand { gap: 8px; }
  .topbar .brand .badge { width: 34px; height: 34px; font-size: 13px; }
  .topbar nav { gap: 8px; row-gap: 8px; }
  .topbar nav a { padding: 5px 8px; font-size: 13px; }

  .filters { flex-direction: column; align-items: stretch; }
  .filters select { width: 100%; }

  table { font-size: 12.5px; }
  th, td { padding: 6px 8px; }

  #complaint-form .btn,
  #login-form .btn,
  #update-form .btn,
  .cta-box .btn,
  .card > a.btn {
    width: 100%;
    text-align: center;
  }

  form .field { margin-bottom: 14px; }
}

@media (max-width: 360px) {
  .leadership-grid { gap: 6px; }
  .leader-name { font-size: 11px; }
  .leader-role { font-size: 10px; }
}

.status-select {
  min-width: 140px;
  width: auto;
}

@media (max-width: 600px) {
  .status-select { min-width: 120px; }
}
