:root {
  --bg: #f7f7f7;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #616161;
  --line: rgba(17, 17, 17, 0.14);
  --red: #d61f1f;
  --red-deep: #7f1111;
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(214, 31, 31, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(17, 17, 17, 0.06), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Devanagari", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-root {
  min-height: 100vh;
  padding: 14px;
}

.frame {
  width: min(100%, 980px);
  margin: 0 auto;
  min-height: calc(100vh - 28px);
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 28px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  border-bottom: 3px solid #111;
}

.topbar__brand {
  min-width: 0;
}

.topbar__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  opacity: 0.84;
}

.topbar__title {
  margin: 2px 0 0;
  font-family: "Archivo Black", "Noto Sans Devanagari", sans-serif;
  font-size: 1.24rem;
  letter-spacing: -0.03em;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.pill--dark {
  background: #111;
  color: #fff;
}

.content {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-tabs__button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 16px;
  background: #fff;
  color: #111;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.05);
}

.mode-tabs__button--active {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  border-color: transparent;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.06);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.panel__title {
  font-size: 1.05rem;
  font-weight: 900;
}

.panel__note {
  color: var(--muted);
  font-size: 0.86rem;
}

.form-grid {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.form-grid--tehsil {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--bulk {
  padding: 0;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 16px 8px;
}

.search-bar input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.action--search {
  min-width: 96px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.88rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input[readonly] {
  background: linear-gradient(180deg, rgba(214, 31, 31, 0.06), rgba(255, 255, 255, 0.95));
  font-weight: 800;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(214, 31, 31, 0.12);
}

.field--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.field--inline span {
  font-size: 0.94rem;
}

.site-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.site-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-box {
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(214, 31, 31, 0.04), rgba(255, 255, 255, 1));
}

.bulk-box__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bulk-box__title {
  font-weight: 900;
}

.bulk-box__note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(90vh, 860px);
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(17, 17, 17, 0.12);
}

.modal__panel--wide {
  width: min(100%, 760px);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.modal__title {
  font-family: "Archivo Black", "Noto Sans Devanagari", sans-serif;
  font-size: 1.18rem;
}

.modal__note {
  color: var(--muted);
  font-size: 0.84rem;
}

.modal__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
}

.action {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  font-weight: 800;
}

.action--ghost {
  background: #111;
}

.grid {
  display: grid;
  gap: 14px;
}

.admin-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}

.admin-row__title {
  font-weight: 900;
}

.admin-row__meta {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 2px;
}

.district-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 22px rgba(17, 17, 17, 0.05);
}

.district-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.district-card__title {
  font-size: 1rem;
  font-weight: 900;
}

.district-card__meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.district-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 800;
}

.mini--danger {
  border-color: rgba(214, 31, 31, 0.2);
  color: #b11616;
}

.district-card__body {
  padding: 14px 16px 16px;
}

.tehsil-list {
  display: grid;
  gap: 10px;
}

.tehsil-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 18px;
  background: #fff;
}

.tehsil-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tehsil-item__name {
  font-weight: 900;
}

.tehsil-item__meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.tehsil-item__keywords {
  color: #7a7a7a;
  font-size: 0.8rem;
  line-height: 1.4;
}

.login-shell {
  min-height: calc(100vh - 28px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 420px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card__title {
  margin: 0 0 6px;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.4rem;
}

.login-card__copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty {
  padding: 16px;
  border: 1px dashed rgba(17, 17, 17, 0.18);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .admin-root {
    padding: 10px;
  }

  .frame {
    min-height: calc(100vh - 20px);
    border-radius: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid--tehsil {
    grid-template-columns: 1fr;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }

  .action--search {
    min-width: 100%;
  }

  .modal {
    padding: 10px;
  }

  .modal__head {
    padding: 14px;
  }
}
