:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --cta: #ff6f61;
  --ink: #1c1917;
  --muted: #5f5a55;
  --line: #e7e5e4;
  --bg: #f5f5f4;
  --paper: #ffffff;
  --ok: #166534;
  --ok-bg: #e9f7ef;
  --no: #9a3412;
  --no-bg: #fff1e8;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 10px 30px rgba(28, 25, 23, 0.05);
  --radius: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Manrope, "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
body.admin { background: #f3f6f5; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 8px 12px;
  z-index: 50;
}
.skip:focus { top: 12px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hindi { font-family: "Noto Sans Devanagari", Manrope, sans-serif; }

.topbar { background: var(--brand-dark); color: #e7f6f3; font-size: 13px; }
.topbar-inner, .header-inner, .footer-grid, .hero, .detail, .split, .admin-shell {
  display: flex;
  gap: 16px;
}
.topbar-inner { justify-content: space-between; align-items: center; min-height: 36px; }
.topbar-inner.has-lic { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 700; }
.top-address { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-lic { justify-self: center; font-weight: 750; white-space: nowrap; text-align: center; }
.top-phone { justify-self: end; white-space: nowrap; }

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner { align-items: center; min-height: 76px; }
.logo { display: flex; gap: 10px; align-items: center; text-decoration: none; min-width: 0; }
.mark {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: none;
}
.mark svg { width: 22px; height: 22px; }
.logo strong { display: block; font-size: 15px; line-height: 1.15; letter-spacing: -0.02em; }
.logo small { display: block; color: var(--muted); font-size: 12px; font-weight: 650; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; flex: 0 1 280px; width: 280px; max-width: 320px; min-width: 160px; }
.search input, .field input, .field select, .field textarea, .filters input, .filters select {
  width: 100%;
  border: 1.5px solid #ddd9d4;
  background: #fff;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 16px;
  outline: none;
}
.search input:focus, .field input:focus, .field select:focus, .field textarea:focus, .filters input:focus, .filters select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}
.field textarea { border-radius: 14px; min-height: 120px; padding: 12px 14px; resize: vertical; }
.field select, .filters select { border-radius: 12px; background: #fff; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 40;
}
.suggest-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; text-decoration: none; }
.suggest-item:hover, .suggest-item:focus { background: #f3faf8; }
.suggest-item span { color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0;
  text-decoration: none; font-weight: 750; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-cta { background: var(--cta); color: #3b120c; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid #ddd9d4; }
.btn-small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-danger { background: #fff1f0; color: #9f1239; border: 1px solid #fecdd3; }

.branch { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 700; min-width: 180px; }
.branch select, .branch option { min-height: 36px; border-radius: 10px; border: 1px solid var(--line); padding: 0 8px; color: #1c1917; background: #fff; }
.account-link { font-weight: 800; text-decoration: none; white-space: nowrap; color: var(--brand); }
.logo-img { width: auto; height: 58px; max-width: 240px; object-fit: contain; flex: none; }
.site-menu { display: flex; gap: 4px; align-items: center; overflow-x: auto; padding: 0; scrollbar-width: none; flex: 1; min-width: 0; }
.site-menu::-webkit-scrollbar { display: none; }
.site-menu a { text-decoration: none; font-weight: 750; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.site-menu a.on, .site-menu a:hover { background: #e7f5f2; color: var(--brand); }
.secret { position: relative; display: block; }
.secret input { padding-right: 48px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.eye svg { width: 20px; height: 20px; }
.about-photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 16px; margin-bottom: 12px; }

main { padding: 22px 0 48px; }
.banner {
  display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 22px; align-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.16), transparent 32%),
    var(--brand);
  color: #fff; border-radius: 24px; padding: 28px;
}
.eyebrow, .kicker {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: 999px; background: rgba(255,255,255,0.16); font-size: 13px; font-weight: 750;
}
.banner h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -0.04em; margin: 10px 0 6px; }
.banner .hindi { font-size: 18px; font-weight: 700; }
.banner .address { margin: 10px 0 0; max-width: 46ch; color: rgba(255,255,255,0.92); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.banner .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.45); }
.stat-grid { display: grid; gap: 10px; }
.stat-grid div, .panel, .cat-card, .prow, .person, .license, .side-card, .empty, .admin-card, .table-wrap {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.stat-grid div { padding: 14px 16px; color: var(--ink); }
.stat-grid strong { display: block; font-size: 28px; letter-spacing: -0.04em; }
.stat-grid span { color: var(--muted); font-size: 13px; font-weight: 700; }

.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 12px; }
.section h2, .page-title h1 { font-size: 26px; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.scroller { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 8px; flex: none; min-height: 42px; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 750; font-size: 14px;
}
.chip .icon, .cat-card .icon, .mono { display: grid; place-items: center; flex: none; }
.icon { width: 28px; height: 28px; border-radius: 999px; background: #e7f5f2; color: var(--brand); }
.icon svg { width: 16px; height: 16px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; text-decoration: none; min-height: 132px; }
.cat-card .icon { width: 42px; height: 42px; }
.cat-card .icon svg { width: 22px; height: 22px; }
.cat-card strong { font-size: 15px; letter-spacing: -0.02em; }
.cat-card span, .person span, .license span { color: var(--muted); font-size: 13px; }
.cat-card:hover, .prow:hover, .chip:hover { border-color: #c9e4de; box-shadow: var(--shadow); }

.people, .license-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.person, .license { padding: 16px; }
.person strong, .license strong { display: block; }
.about-grid, .detail { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; }
.panel { padding: 18px; }
.panel h2, .panel h3 { margin-bottom: 8px; }
.panel p + p { margin-top: 8px; }
.stack { display: grid; gap: 10px; margin-top: 14px; }

.page-title { margin-bottom: 14px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.crumbs a { color: var(--brand-dark); font-weight: 750; }
.filters { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; margin: 14px 0; }
.filters label, .field { display: grid; gap: 6px; font-size: 13px; font-weight: 750; }
.filters input { border-radius: 12px; }
.letters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.letters a {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; text-decoration: none;
  border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 800; font-size: 13px;
}
.letters a.on, .pager a.on, .pager span.on, .nav a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.letters a:first-child { width: auto; padding: 0 8px; }
.cat-card strong { word-break: break-word; }
table.data input, table.data select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: #fff; }
.panel ul { margin: 8px 0 0; padding-left: 18px; }
.list { display: grid; gap: 8px; }
.prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px; text-decoration: none;
}
.mono {
  width: 52px; height: 52px; border-radius: 14px; font-weight: 800;
  background: hsl(var(--tone) 55% 92%); color: hsl(var(--tone) 42% 26%);
}
.prow-name { display: block; font-weight: 780; letter-spacing: -0.02em; word-break: break-word; }
.prow-meta, .qty { display: block; color: var(--muted); font-size: 13px; }
.prow-stock { text-align: right; }
.badge { display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.no { background: var(--no-bg); color: var(--no); }
mark { background: #fff1b8; color: inherit; border-radius: 4px; padding: 0 2px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.pager a, .pager span {
  min-width: 38px; min-height: 38px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 750;
}
.empty { padding: 28px; text-align: center; }
.flash { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: #fff1f2; color: #9f1239; }

.side-card { padding: 16px; position: sticky; top: 92px; }
.facts { width: 100%; border-collapse: collapse; margin-top: 8px; }
.facts th, .facts td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 42%; color: var(--muted); font-weight: 700; }
.note { margin-top: 12px; color: var(--muted); font-size: 14px; }

.footer { background: #14221f; color: #d7e4e0; padding: 32px 0 28px; }
.footer a { color: #fff; text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 22px; }
.footer h2, .footer h3 { color: #fff; margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fine { margin-top: 18px; color: #9fb2ac; font-size: 13px; }
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: #fff; border-top: 1px solid var(--line); padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a { flex: 1; text-align: center; text-decoration: none; font-size: 12px; font-weight: 750; color: var(--muted); padding: 6px 0; }
.bottom-nav a.on { color: var(--brand-dark); }

.admin-shell { min-height: 100vh; align-items: stretch; }
.side {
  width: 250px; flex: none; background: #10211e; color: #d5e6e1; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; max-height: 100vh; overflow: auto;
}
.side a, .side button.linkish { color: #fff; text-decoration: none; border: 0; background: transparent; text-align: left; padding: 8px 12px; border-radius: 10px; font-weight: 750; cursor: pointer; }
.side a.on, .side a:hover { background: rgba(255,255,255,0.08); }
.side a.brand, .side a.brand:hover { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; padding: 6px 12px 12px; letter-spacing: -0.03em; background: transparent; }
.side a.brand.logo-only, .side a.brand.logo-only:hover { justify-content: center; padding: 8px 8px 14px; }
.panel-logo { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.panel-logo.solo { width: auto; height: auto; max-width: 100%; max-height: 72px; padding: 6px; }
.side-label { display: block; font-size: 12px; font-weight: 700; color: #d5e6e1; margin: 4px 0 6px; }
.branch-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.side .branch-picker { grid-template-columns: 1fr; }
.side .switch-btn { width: 100%; }
.side form { margin: 0 0 8px; }
.side select, .side option { width: 100%; min-height: 40px; border-radius: 10px; border: 0; color: #1c1917; background: #fff; }
.switch-btn { background: #fff; color: #10211e; min-height: 40px; }
.color-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.color-grid input[type="color"], .field input[type="color"] { padding: 4px; border-radius: 12px; background: #fff; }
.logo-preview { display: block; width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
.license-box { border: 1px solid #c9e4de; background: #f3faf8; border-radius: 14px; padding: 14px; }
.license-box h2 { margin-bottom: 4px; }
.admin-main { flex: 1; min-width: 0; padding: 22px; }
.admin-card { padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.admin-card strong { display: block; font-size: 28px; letter-spacing: -0.04em; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 680px; }
table.data th, table.data td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.repeat { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.repeat.people-row { grid-template-columns: 0.8fr 1.2fr 1fr 0.8fr auto; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 24px; border: 1px solid var(--line); }
.login-card h1 { margin: 8px 0; letter-spacing: -0.03em; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.help { color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .banner, .about-grid, .detail, .footer-grid, .people, .cards { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .admin-shell { display: block; }
  .side { width: auto; position: static; max-height: none; }
  .repeat, .repeat.people-row, .filters, .two, .color-grid { grid-template-columns: 1fr; }
}
@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  .cat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar-inner, .topbar-inner.has-lic { display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 2px; padding: 6px 0; }
  .top-address, .top-lic, .top-phone { white-space: normal; overflow: visible; text-overflow: unset; justify-self: center; }
  .header-inner { flex-wrap: wrap; min-height: 0; padding: 10px 0; }
  .search { order: 3; flex: 0 1 46%; width: 46%; max-width: 46%; min-width: 0; }
  .site-menu { order: 4; flex: 1 1 50%; }
  .logo strong { font-size: 14px; max-width: 46vw; }
  .banner { padding: 20px; border-radius: 18px; }
  .prow { grid-template-columns: auto minmax(0, 1fr); }
  .prow-stock { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: center; }
  .bottom-nav { display: flex; }
  body:not(.admin) { padding-bottom: 74px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
