:root {
  --blue: #0e4c9c;
  --blue-2: #1565c0;
  --blue-3: #1d74e6;
  --gold: #f5c518;
  --ink: #1c2b3a;
  --muted: #6b7c90;
  --line: #e4edf6;
  --bg: #f3f7fb;
  --card: #ffffff;
  --green: #1b8a3e;
  --red: #d32f2f;
  --shadow: 0 12px 32px rgba(14, 60, 120, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

.login-body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #8ec8f8 0%, #d7ebfb 42%, #eef5fb 100%);
}
.login-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
}
.login-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #7ec4fb 0%, #2f86e0 48%, #0e4c9c 100%);
  color: white;
  display: flex;
  align-items: center;
  padding: 40px 56px 18%;
}
.sky-sun {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  right: 12%;
  top: 12%;
  background: radial-gradient(circle at 35% 35%, #fff6c8, var(--gold) 60%, #e09a00);
  box-shadow: 0 0 40px rgba(245, 197, 24, 0.7);
}
.sky-cloud {
  position: absolute;
  height: 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}
.sky-cloud::before, .sky-cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.c1 { width: 92px; top: 18%; left: 12%; }
.c1::before { width: 34px; height: 34px; top: -18px; left: 16px; }
.c1::after { width: 24px; height: 24px; top: -10px; left: 44px; }
.c2 { width: 70px; top: 30%; left: 38%; opacity: 0.7; }
.panel-field {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -14%;
  height: 34%;
  background:
    repeating-linear-gradient(90deg, #0a326e 0 22px, #1d62c4 22px 40px, #08285a 40px 43px),
    repeating-linear-gradient(#0000 0 16px, rgba(255, 255, 255, 0.22) 16px 18px);
  transform: perspective(500px) rotateX(46deg);
  transform-origin: center bottom;
  border-top: 4px solid rgba(255, 255, 255, 0.35);
}
.visual-brand { position: relative; z-index: 1; max-width: 520px; }
.visual-brand h1 { font-size: clamp(28px, 3vw, 42px); font-weight: 700; margin: 8px 0; }
.tagline { font-size: 14px; opacity: 0.92; }
.hindi { font-size: 16px; font-weight: 500; }
.wordmark { font-weight: 700; letter-spacing: 0.04em; font-size: 22px; }
.wordmark span { color: #ffffff; }
.wordmark em { color: var(--gold); font-style: normal; }
.wordmark.light { font-size: 28px; margin: 10px 0 4px; }
.logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}
.logo-badge svg { width: 46px; height: 46px; }
.logo-badge.tiny { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, 0.14); }
.logo-badge.tiny svg { width: 26px; height: 26px; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 0;
}
.login-card {
  width: min(400px, 100%);
  max-height: calc(100dvh - 28px);
  background: white;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card-hero {
  position: relative;
  height: 148px;
  flex: none;
  background: linear-gradient(180deg, #8fd0ff, #1565c0 70%);
  overflow: hidden;
  color: white;
}
.hero-sun {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  right: 24px;
  top: 16px;
  background: radial-gradient(circle at 35% 35%, #fff4c2, var(--gold));
}
.hero-panels {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  background: repeating-linear-gradient(90deg, #0b3f86 0 14px, #2a74d6 14px 26px);
  opacity: 0.9;
}
.hero-copy {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 18px;
  text-align: center;
}
.hero-copy .logo-badge { width: 52px; height: 52px; }
.hero-copy .logo-badge svg { width: 38px; height: 38px; }
.hero-copy .wordmark { font-size: 20px; margin-top: 6px; }
.app-name { font-size: 12px; opacity: 0.95; }
.card-body { padding: 14px 20px 12px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.field span { font-size: 12px; font-weight: 600; color: #3e5166; }
.field input, .field select, .search, .toolbar select {
  width: 100%;
  border: 1px solid #d5e2ef;
  background: #f8fbfe;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.field input:focus, .field select:focus, .search:focus, .toolbar select:focus {
  border-color: var(--blue-3);
  box-shadow: 0 0 0 3px rgba(29, 116, 230, 0.15);
  background: white;
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 42px; }
.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #7b8da1;
  width: 28px;
  height: 28px;
  padding: 0;
}
.eye-btn svg { width: 18px; height: 18px; }
.field-error { color: var(--red); font-size: 12px; margin: 4px 0 0; }
.primary-btn {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--blue-3);
  color: white;
  font-weight: 600;
}
.primary-btn:hover { background: var(--blue-2); }
.link-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--blue-3);
  font-weight: 600;
  font-size: 13px;
}
.forgot-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.powered { text-align: center; color: #93a3b5; font-size: 11px; margin-top: 8px; }

.app-body { min-height: 100vh; background: var(--bg); }
.appbar {
  height: 58px;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.appbar-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.admin-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
}
.admin-chip b, .admin-chip small { display: block; line-height: 1.15; }
.admin-chip b { font-size: 12px; }
.admin-chip small { font-size: 10px; opacity: 0.85; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: white;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}
.avatar.lg { width: 52px; height: 52px; font-size: 20px; background: #e8f1ff; }
.menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  padding: 6px;
}
.menu-btn svg { width: 100%; height: 100%; }
.app-shell { display: flex; min-height: calc(100vh - 58px); }
.sidebar {
  width: 228px;
  background: white;
  border-right: 1px solid var(--line);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  text-align: left;
  border: 0;
  background: transparent;
  color: #31475f;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-btn:hover { background: #f3f8fd; }
.nav-btn.active { background: #e7f1ff; color: var(--blue); font-weight: 600; }
.nav-ico { width: 16px; color: var(--blue-3); text-align: center; }
.logout-btn {
  margin-top: auto;
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
  border-radius: 10px;
  padding: 8px;
  font-weight: 600;
  font-size: 13px;
}
.content { flex: 1; min-width: 0; padding: 16px 18px 28px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.section-label { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }
.section-label.in-panel { padding: 0 4px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.mini, .biz, .money, .panel, .detail-card, .job {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.mini, .biz {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.mini p, .biz p, .money p { font-size: 11px; color: var(--muted); line-height: 1.25; }
.mini strong, .biz strong { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; }
.ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 15px;
  font-weight: 700;
}
.tone-blue .ico, .ico.tone-blue { background: #e7f0ff; color: #1565c0; }
.tone-green .ico, .ico.tone-green { background: #e5f7ec; color: var(--green); }
.tone-orange .ico { background: #fff1e4; color: #e07a12; }
.tone-red .ico { background: #fdecec; color: var(--red); }
.tone-purple .ico { background: #f3eaff; color: #7b3fe4; }
.tone-sky .ico { background: #e7f7ff; color: #0284c7; }
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz-grid.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.biz strong { color: var(--blue); }
.money-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.money { padding: 10px 12px; }
.money strong { display: block; margin-top: 2px; font-size: 18px; color: var(--blue); }
.money.paid strong { color: var(--green); }
.money.due strong { color: #c2410c; }
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.search { flex: 1; min-width: 220px; }
.toolbar select { width: 170px; background: white; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: #f8fbfe; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f5f9fd; }
small { color: var(--muted); }
.tag {
  display: inline-flex;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #fff4d6;
  color: #9a6700;
  white-space: nowrap;
}
.tag.install { background: #e3f0ff; color: #1565c0; }
.tag.meter { background: #fde8e8; color: #d32f2f; }
.tag.done { background: #e5f6ea; color: #1b8a3e; }
.tag.loan { background: #f1e8ff; color: #7b3fe4; }
.tag.survey { background: #fff1de; color: #e07a12; }
.tag.disbursed { background: #e6f7f4; color: #0f766e; }
.back-btn {
  border: 0;
  background: transparent;
  color: var(--blue-3);
  font-weight: 600;
  padding: 0 0 10px;
}
.detail-card { padding: 14px; }
.detail-top { display: flex; gap: 12px; align-items: center; }
.detail-top h2 { font-size: 18px; }
.detail-top p { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.tabs { display: flex; gap: 6px; margin: 14px 0 10px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--blue); border-bottom-color: var(--blue-3); }
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.info div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.info dt { font-size: 11px; color: var(--muted); }
.info dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; }
.money-row.tight { margin-top: 4px; }
.job-list { display: grid; gap: 8px; }
.job {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}
.job p { font-size: 12px; color: var(--muted); }
.job strong { font-size: 14px; }
.stage { height: 6px; background: #e8eef5; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.stage span { display: block; height: 100%; background: var(--blue-3); }
.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.bar i {
  display: block;
  width: 100%;
  max-width: 36px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #5aa6f5, #0e4c9c);
}
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 12px; }
.panel { padding: 12px; }
.emp-form .primary-btn { margin-top: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--blue);
  color: white;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.scrim { position: fixed; inset: 0; background: rgba(10, 28, 52, 0.45); z-index: 6; }

@media (max-height: 760px) {
  .login-visual { padding-bottom: 16%; }
  .visual-brand h1 { font-size: 28px; }
  .panel-field { height: 28%; bottom: -16%; }
  .card-hero { height: 112px; }
  .hero-copy .logo-badge { width: 40px; height: 40px; }
  .card-body { padding: 8px 16px 8px; }
  .field { margin-top: 6px; }
  .field input { padding: 8px 10px; }
  .primary-btn { margin-top: 8px; padding: 9px; }
}
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .stat-grid, .biz-grid, .biz-grid.three, .money-row, .split, .info, .job { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed;
    z-index: 7;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    pointer-events: none;
  }
  .sidebar.open { transform: none; pointer-events: auto; }
  .toolbar { flex-wrap: wrap; }
  .search, .toolbar select { max-width: none; width: 100%; }
}

#view-staff tbody tr,
#view-payments tbody tr,
#view-meters tbody tr,
#view-reports tbody tr,
#recent-body tr { cursor: default; }

.admin-hint{margin:12px 0 0;background:#e7f1ff;border:1px solid #c5dbf7;border-radius:10px;padding:8px 10px;font-size:12px;color:#0e4c9c;line-height:1.45}

.login-alert{display:block;margin:0 0 10px;padding:8px 10px;background:#fdecec;border:1px solid #f5c2c0;border-radius:8px;color:#b42318;font-size:13px;font-weight:600}
.customer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.primary-btn.slim { width: auto; margin-top: 0; padding: 8px 14px; }
.customer-form { margin: 0 0 12px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.form-grid .field { margin-top: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.form-actions .link-btn { width: auto; }
.status-board { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag.idle { background: #f2f4f7; color: #8b97a6; }
.status-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.status-form .field { margin-top: 0; }
@media (max-width: 860px) {
  .form-grid, .status-form { grid-template-columns: 1fr; }
  .customer-head { align-items: flex-start; flex-direction: column; }
}
.hint-line { color: #5c6b7a; font-size: 12px; margin: 8px 0 0; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 4px 0 8px; }
.check-grid label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #24384c; }
.status-form .hint-line { margin: 0; align-self: center; }
@media (max-width: 860px) {
  .check-grid { grid-template-columns: 1fr; }
}
