/* Admin UI — MC Kotli sanitation billing */
@font-face { font-family: 'Nastaliq'; src: url('/fonts/noto-nastaliq-urdu-arabic-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nastaliq'; src: url('/fonts/noto-nastaliq-urdu-arabic-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --green: #1f7a3e; --green-d: #155c2e; --green-l: #e8f4ec; --ink: #1d2530; --muted: #667085; --line: #e4e7ec;
  --bg: #f5f7f6; --card: #fff; --red: #c0352b; --red-l: #fdecea; --amber: #b7791f; --amber-l: #fdf6e3; --blue: #2563eb; --blue-l: #eaf1fe;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--ink); font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--green); }
.ur { font-family: 'Nastaliq', serif; direction: rtl; line-height: 2; }
.muted { color: var(--muted); } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; max-width: 100%; }
.side { background: var(--green-d); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 50%; }
.brand strong { display: block; font-size: 15px; } .brand small { display: block; opacity: .75; font-size: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--green-d); display: grid; place-items: center; font-weight: 800; flex: none; }
.brand-mark.lg { width: 56px; height: 56px; font-size: 18px; background: var(--green); color: #fff; }
.side nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; }
.side nav a { color: #e3efe7; text-decoration: none; padding: 9px 12px; border-radius: 8px; }
.side nav a:hover { background: rgba(255,255,255,.08); }
.side nav a.on { background: #fff; color: var(--green-d); font-weight: 600; }
.side-foot { margin-top: auto; padding: 14px 16px; font-size: 12px; } .side-foot a { color: #cfe5d6; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 18px; margin: 0; }
.who { display: flex; gap: 14px; align-items: center; font-size: 13px; } .who em { color: var(--muted); font-style: normal; margin-left: 4px; text-transform: capitalize; }
.who form { margin: 0; }
.content { padding: 20px 24px 48px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .side { position: static; height: auto; width: 100%; }
  .side nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .side-foot { display: none; }
  body { overflow-x: hidden; }
}

/* blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 15px; }
.card.narrow { max-width: 460px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .g2, .g4 { grid-template-columns: 1fr; } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { display: block; font-size: 24px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; background: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.toolbar label { margin: 0; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* forms */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-l); border-color: var(--green); }
.toolbar input, .toolbar select { min-width: 150px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid #cfd4dc; background: #fff; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; line-height: 1.3; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; } .btn.primary:hover { background: var(--green-d); }
.btn.danger { color: var(--red); border-color: #f1b8b3; } .btn.sm { padding: 4px 10px; font-size: 12px; } .btn.wide { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--green); cursor: pointer; font: inherit; padding: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .actions form { margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; max-width: 100%; }
table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfa; white-space: nowrap; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tbody tr:hover { background: #fafcfb; }
table.t tfoot td { font-weight: 700; background: #fafbfa; }
.pager { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-paid { background: var(--green-l); color: var(--green-d); } .b-partial { background: var(--amber-l); color: var(--amber); }
.b-overdue { background: var(--red-l); color: var(--red); } .b-unpaid { background: var(--blue-l); color: var(--blue); }
.b-carried { background: #f2f4f7; color: #475467; } .b-cancelled { background: #f2f4f7; color: #98a2b3; text-decoration: line-through; }
.b-Active { background: var(--green-l); color: var(--green-d); } .b-Exempt { background: var(--amber-l); color: var(--amber); } .b-Disconnected { background: #f2f4f7; color: #475467; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 14px 24px 0; }
.content .flash, .auth-card .flash { margin: 0 0 14px; }
.flash.ok { background: var(--green-l); color: var(--green-d); } .flash.err { background: var(--red-l); color: var(--red); } .flash.warn { background: var(--amber-l); color: var(--amber); }

/* auth / public */
body.auth { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #e8f4ec, #f5f7f6); }
.auth-card { background: #fff; padding: 28px; border-radius: 14px; width: min(400px, 92vw); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(16,24,40,.06); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.auth-brand img { width: 56px; height: 56px; object-fit: contain; }
.auth-brand strong { display: block; font-size: 17px; } .auth-brand span { color: var(--muted); font-size: 13px; }
.public { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
.public-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.public-head img { width: 64px; height: 64px; object-fit: contain; }
.public-head h1 { margin: 0; font-size: 20px; } .public-head p { margin: 2px 0 0; color: var(--muted); }
.status-big { font-size: 20px; font-weight: 700; }
.chart-box { position: relative; height: 260px; }

/* ---- phones & small tablets ---- */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
  .topbar h1 { width: 100%; font-size: 16px; }
  .who { font-size: 12px; gap: 12px; flex-wrap: wrap; }
  .who em { display: none; }
  .content { padding: 14px 12px 40px; }
  .flash { margin: 10px 12px 0; }
  .card { padding: 14px; border-radius: 10px; }
  .form-grid, .card .form-grid { grid-template-columns: 1fr !important; }
  .span2, .span3 { grid-column: auto; }
  .toolbar { gap: 8px; }
  .toolbar label { flex: 1 1 46%; min-width: 0; }
  .toolbar label.grow { flex-basis: 100%; }
  .toolbar input, .toolbar select { min-width: 0; }
  .toolbar .btn { flex: 1 1 auto; text-align: center; }
  dl.kv { grid-template-columns: 112px 1fr; }
  table.t th, table.t td { white-space: nowrap; padding: 8px; }
  .actions form { flex-wrap: wrap; }
  .actions form input, .actions form select { max-width: none !important; flex: 1 1 120px; }
  .kpi strong { font-size: 20px; }
  .chart-box { height: 220px; }
  .main, .content, .grid, .card, .table-wrap, .toolbar { min-width: 0; max-width: 100%; }
  .side nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px; }
  .side nav a { text-align: center; padding: 8px 6px; white-space: normal; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .toolbar .grow { display: none; }
  .toolbar a.btn, .toolbar .btn, .toolbar button { width: 100%; text-align: center; }
  /* public bill list as cards */
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; }
  table.t.cards td { border: 0; padding: 4px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; white-space: normal; }
  table.t.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  table.t.cards td.num { text-align: right; }
  .public { padding: 16px 12px 40px; }
  .public-head h1 { font-size: 17px; }
}

/* public landing */
.site { background: #f3f6f4; color: var(--ink); }
.site-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 5vw; background: linear-gradient(180deg, #1a7a3c 0%, #124f27 100%); color: #fff; box-shadow: 0 10px 28px rgba(8,32,18,.22); position: sticky; top: 0; z-index: 40; }
.site-brand { display: flex; gap: 10px; align-items: center; min-width: 0; color: #fff; text-decoration: none; position: relative; z-index: 3; }
.site-brand > span { min-width: 0; }
.site-brand img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 50%; }
.site-brand strong { display: block; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .site-brand small { display: block; color: rgba(255,255,255,.78); white-space: nowrap; }
.site-bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-bar nav a { color: #fff; text-decoration: none; font-weight: 650; padding: 8px 14px; border-radius: 999px; transition: background .2s ease, color .2s ease; }
.site-bar nav a:hover { background: rgba(255,255,255,.16); color: #fff; }
.nav-toggle, .nav-shade { display: none; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(720px, calc(100% - 40px)); }
.site .btn { border-radius: 999px; padding: 12px 18px; font-weight: 700; }
.btn.light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.55); }
.btn.light:hover { background: #fff; color: var(--green-d); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin: 0 0 10px; }
.eyebrow.dark { color: var(--green); }

.hero { position: relative; min-height: 640px; color: #fff; display: flex; align-items: flex-end; overflow: hidden; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(8,32,18,.88) 0%, rgba(8,32,18,.62) 46%, rgba(8,32,18,.18) 100%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr .75fr; gap: 36px; align-items: end; padding: 96px 0 48px; }
.hero h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 16px; max-width: 14ch; }
.hero .lead { font-size: 18px; max-width: 560px; color: #e7f6ec; }
.hero-ur { color: #fff; font-size: 26px; margin-top: 4px; }
.hero-card { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 22px; padding: 22px 22px 8px; backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.hero-card h2 { margin: 0 0 8px; font-size: 28px; }
.hero-card a { color: #fff; }

.band { background: #fff; padding: 72px 0; }
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.frame { width: 100%; height: 460px; object-fit: cover; border-radius: 24px; box-shadow: 0 24px 50px rgba(21,40,28,.16); }
.site section h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; }
#about, #services, #bill, #complaint, #contact { scroll-margin-top: 96px; }
#services, #complaint { padding: 72px 0; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 22px 0 16px; }
.shots article { background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 10px 30px rgba(21,40,28,.08); transition: transform .35s ease, box-shadow .35s ease; }
.shots article:hover { transform: translateY(-8px); box-shadow: 0 22px 44px rgba(21,40,28,.16); }
.shots img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .6s ease; }
.shots article:hover img { transform: scale(1.06); }
.shots div { padding: 16px 18px 18px; }
.shots h3, .svc h3 { margin: 0 0 6px; }
.svc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.svc article { background: #fff; border-radius: 22px; padding: 22px; border-top: 4px solid var(--green); box-shadow: 0 10px 30px rgba(21,40,28,.06); transition: transform .35s ease, box-shadow .35s ease; }
.svc article:hover { transform: translateY(-8px); box-shadow: 0 22px 44px rgba(21,40,28,.14); }
.shots article, .svc article, .site .card, .hero-card, .frame { animation: rise .7s ease both; }
.shots article:nth-child(2), .svc article:nth-child(2) { animation-delay: .08s; }
.shots article:nth-child(3), .svc article:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .shots article, .svc article, .site .card, .hero-card, .frame { animation: none; }
  .shots article, .svc article, .shots img { transition: none; }
}
.split, .contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: start; }
.site .card { border: 0; border-radius: 22px; box-shadow: 0 16px 40px rgba(21,40,28,.08); padding: 22px; }
.steps { padding-left: 18px; } .steps li { margin: 10px 0; }
.contact-band { position: relative; color: #fff; overflow: hidden; min-height: 280px; display: flex; align-items: center; }
.contact-band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.contact-band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,32,18,.88), rgba(8,32,18,.55)); }
.contact-grid { position: relative; z-index: 1; width: min(1120px, calc(100% - 40px)); padding: 56px 0; }
.contact-band a:not(.btn) { color: #fff; }
.site-foot { padding: 22px 0; color: #cfe5d6; background: #0e2418; }
.site-foot .wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.site-foot .wrap > span:last-child { text-align: right; }
.site-foot small { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 12px; }
.site-foot a { color: #fff; }
.cookie-pop { display: none; position: fixed; z-index: 40; left: 18px; bottom: 18px; width: min(380px, calc(100% - 36px)); gap: 14px; align-items: flex-start; padding: 18px; border-radius: 22px; background: #121a2b; color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.cookie-pop.show { display: flex; }
.cookie-ico { width: 42px; height: 42px; border-radius: 12px; background: #1c2740; color: #7ee0ff; display: grid; place-items: center; flex: none; }
.cookie-pop strong { display: block; font-size: 18px; margin-bottom: 4px; }
.cookie-pop p { margin: 0 0 14px; color: #c9d2e3; line-height: 1.45; }
.cookie-pop a { color: #7ecbff; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-accept, .cookie-decline { flex: 1; border-radius: 999px; padding: 12px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.cookie-accept { border: 0; color: #082033; background: linear-gradient(90deg, #7af0ff, #8eb6ff); }
.cookie-decline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
@media (max-width: 520px) { .cookie-actions { flex-direction: column; } }
.site .flash { margin: 0 0 14px; }
.issue-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 16px; margin-top: 14px; display: block; }
.thumb { width: 72px; height: 72px; max-width: 72px; max-height: 72px; object-fit: cover; border-radius: 8px; display: block; }
table.t img { width: 72px; height: 72px; max-width: 72px; max-height: 72px; object-fit: cover; }
@media (max-width: 800px) {
  .hero { min-height: 0; }
  .hero-grid, .about-grid, .split, .contact-grid, .shots, .svc { grid-template-columns: 1fr; }
  .hero-shade { background: linear-gradient(180deg, rgba(8,32,18,.35) 0%, rgba(8,32,18,.82) 70%); }
  .hero-grid { padding: 48px 0 32px; }
  .frame, .shots img { height: 220px; }
  .site-bar { padding: 10px 16px; gap: 12px; }
  .nav-toggle { position: relative; z-index: 3; display: grid; gap: 5px; place-content: center; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); cursor: pointer; flex: none; }
  .nav-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .site-bar.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-bar.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-bar.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-shade { position: fixed; z-index: 1; top: 64px; right: 0; bottom: 0; left: 0; border: 0; padding: 0; background: rgba(8,20,12,.5); cursor: pointer; }
  .site-bar.open .nav-shade { display: block; }
  .site-bar nav { position: fixed; z-index: 2; top: 64px; right: 0; bottom: 0; width: min(300px, 100%); margin: 0; padding: 18px 16px 24px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px; background: linear-gradient(180deg, #146b34 0%, #0e3d1e 100%); box-shadow: -16px 0 40px rgba(0,0,0,.28); transform: translateX(105%); transition: transform .25s ease; overflow: auto; }
  .site-bar.open nav { transform: translateX(0); }
  .site-bar nav a { padding: 14px 16px; border-radius: 12px; font-size: 17px; }
  body.menu-open { overflow: hidden; }
}
@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  .nav-toggle span, .site-bar nav { transition: none; }
}
