/* Pata Book — UI styles. Plain CSS, no build step needed. */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --ink: #17201c;
  --muted: #646e69;
  --line: #e2e0d8;
  --brand: #0d7a4e;
  --brand-ink: #ffffff;
  --brand-dark: #095c3a;
  --brand-soft: #e3f2ea;
  --amber: #b86e00;
  --amber-soft: #fff3dc;
  --red: #b93226;
  --red-soft: #fde9e6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
code { background: #efeee8; padding: 1px 5px; border-radius: 5px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 14px; border-radius: 10px; font: 600 14px/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #c9c6bb; background: #fbfaf7; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f2c4bd; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; border: 1px solid #d6d3c9; background: #fff; border-radius: 10px; padding: 10px 12px; font: 15px/1.3 var(--font); color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(13, 122, 78, .25); border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-text { color: var(--red); font-size: 13px; margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--brand-soft); color: #08452c; border-color: #c4e4d3; }
.alert-error { background: var(--red-soft); color: #7d1f16; border-color: #f2c4bd; }
.alert-warn { background: var(--amber-soft); color: #6b4000; border-color: #f4dcae; }
.alert ul { margin: 4px 0 0 18px; padding: 0; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #efede7; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfaf6; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eeece5; color: #4a524e; }
.badge-green { background: var(--brand-soft); color: #08452c; }
.badge-amber { background: var(--amber-soft); color: #7a4a00; }
.badge-red { background: var(--red-soft); color: #8c2318; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.stat.hl { border-color: #f4dcae; background: var(--amber-soft); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.pager .on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: #12201a; color: #d8e4de; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .logo { color: #fff; font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 9px; padding: 0 8px 18px; text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; color: #c7d5ce; padding: 9px 10px; border-radius: 9px; font-weight: 600; font-size: 14px; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: rgba(13, 122, 78, .35); color: #fff; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 4px; }
.side .who { margin-top: auto; font-size: 13px; padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side .who b { display: block; color: #fff; }
.side .who button { color: #9fb7ab; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; margin-top: 6px; }
.main { padding: 26px 30px 60px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.mob-top { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .mob-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #12201a; color: #fff; position: sticky; top: 0; z-index: 40; }
  .mob-top .logo { color: #fff; font-weight: 800; display: flex; gap: 8px; align-items: center; }
  .mob-top button { background: none; border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; }
  .main { padding: 18px 16px 60px; }
  .row { grid-template-columns: 1fr; }
}

/* ---------- Contacts list ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search input { padding-left: 38px; height: 46px; font-size: 16px; }
.toolbar .search svg { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.bulkbar { display: none; align-items: center; gap: 10px; background: #12201a; color: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 30; flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.cod-input { width: 96px !important; padding: 7px 8px !important; font-size: 14px !important; text-align: right; }
.cod-wrap { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.c-name { font-weight: 700; }
.c-addr { color: var(--muted); font-size: 13px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.btn-print { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-print:hover { background: var(--brand-dark); }
.cards { display: none; }
@media (max-width: 760px) {
  .table-desktop { display: none; }
  .cards { display: grid; gap: 10px; }
  .ccard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
  .ccard .top { display: flex; gap: 10px; align-items: flex-start; }
  .ccard .top .info { flex: 1; min-width: 0; }
  .ccard .bottom { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
  .ccard .bottom .btn-print { flex: 1; }
}

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(620px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(15, 25, 20, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 18px 20px; max-height: calc(100vh - 180px); overflow: auto; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: #faf9f5; flex-wrap: wrap; }
.x { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.paste-box { background: var(--brand-soft); border: 1px dashed #9fd0b6; border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.paste-box textarea { min-height: 70px; background: #fff; }
.dup-warn { display: none; }
.dup-warn.show { display: block; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #12201a; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s; z-index: 100; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#toast a { color: #8ee0b7; margin-left: 8px; }

/* ---------- Label settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.preset-list { display: grid; gap: 6px; }
.preset-list label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 600; cursor: pointer; margin: 0; }
.preset-list label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.preset-list input { accent-color: var(--brand); }
.preview-stage { background: repeating-linear-gradient(45deg, #ecebe5, #ecebe5 10px, #e6e4dd 10px, #e6e4dd 20px); border-radius: 12px; padding: 24px; display: flex; justify-content: center; align-items: flex-start; overflow: auto; min-height: 320px; }
.preview-stage .lbl { background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); }
.preview-note { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); justify-content: center; margin-bottom: 18px; text-decoration: none; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ---------- Bar chart (admin) ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b:hover { opacity: 1; }
.bars .b span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ==========================================================
   LABELS — shared by preview and print. Units are mm/pt so
   the printed size is exact. Black & white for thermal.
   ========================================================== */
.lbl { box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; color: #000; background: #fff; font-family: Arial, "Helvetica Neue", "Noto Sans", "Noto Nastaliq Urdu", sans-serif; line-height: 1.22; position: relative; }
.lbl * { box-sizing: border-box; }
.lbl .l-top { display: flex; gap: 2.5mm; align-items: flex-start; }
.lbl .l-to { flex: 1; min-width: 0; }
.lbl .l-tag { font-size: .72em; font-weight: 700; letter-spacing: .08em; border: .25mm solid #000; padding: .2mm 1.2mm; display: inline-block; margin-bottom: 1mm; }
.lbl .l-name { font-size: 1.45em; font-weight: 800; word-break: break-word; }
.lbl .l-phone { font-size: 1.15em; font-weight: 700; margin-top: .6mm; }
.lbl .l-addr { margin-top: 1mm; word-break: break-word; white-space: pre-line; }
.lbl .l-city { font-weight: 800; text-transform: uppercase; margin-top: .6mm; font-size: 1.1em; }
.lbl .l-cod { border: .5mm solid #000; padding: 1.2mm 2mm; text-align: center; flex: none; }
.lbl .l-cod .t { font-size: .75em; font-weight: 700; letter-spacing: .06em; }
.lbl .l-cod .v { font-size: 1.5em; font-weight: 800; white-space: nowrap; }
.lbl .l-notes { margin-top: 1.5mm; font-size: .9em; font-style: italic; word-break: break-word; }
.lbl .l-from { margin-top: auto; border-top: .3mm solid #000; padding-top: 1.5mm; font-size: .82em; word-break: break-word; }
.lbl .l-from b { font-weight: 700; }
.lbl .l-tagrow { display: flex; align-items: center; gap: 2mm; margin-bottom: 1mm; }
.lbl .l-tagrow .l-tag { margin-bottom: 0; }
.lbl .l-date { font-size: .72em; }
.lbl .l-brand { position: absolute; bottom: .6mm; right: 2mm; font-size: 5pt; color: #000; opacity: .7; }
.lbl.small .l-top { gap: 1.5mm; }
.lbl.small .l-tagrow { display: none; }
.lbl.small .l-name { font-size: 1.2em; }
.lbl.small .l-addr { margin-top: .3mm; }
.lbl.small .l-cod { padding: .4mm 1mm; border-width: .3mm; }
.lbl.small .l-cod .t { display: none; }
.lbl.small .l-cod .v { font-size: 1.1em; }

/* Print container: rendered off-screen (so it can be measured), shown only when printing. */
#print-root { position: fixed; left: -20000px; top: 0; }
.p-page { overflow: hidden; }
.p-grid { display: grid; }
.p-grid .lbl { border: .2mm dashed #888; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { position: static; left: auto; }
  .p-page { break-after: page; page-break-after: always; }
  .p-page:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- Landing page ---------- */
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.site-nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; }
.site-nav .links { display: flex; gap: 10px; align-items: center; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 60px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.08; letter-spacing: -.03em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 1.15rem; color: #3c4541; max-width: 34em; margin-bottom: 26px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .trust { margin-top: 16px; font-size: 13px; color: var(--muted); }
.hero-art { position: relative; }
.hero-art .phone-card { padding-bottom: 50px; }
.hero-art .phone-card { background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(20, 40, 30, .18); padding: 18px; border: 1px solid var(--line); }
.hero-art .mini-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0eee8; font-size: 14px; }
.hero-art .mini-row b { display: block; }
.hero-art .mini-row small { color: var(--muted); }
.hero-art .sticker { position: relative; width: max-content; margin: -38px 18px 0 auto; transform: rotate(3deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .2); }
.section { padding: 60px 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; }
.section .sub { color: var(--muted); font-size: 1.05rem; max-width: 40em; }
.pain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.pain .card { margin: 0; }
.pain .n { font-size: 28px; margin-bottom: 6px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; counter-reset: s; }
.steps .card { margin: 0; position: relative; padding-top: 46px; }
.steps .card::before { counter-increment: s; content: counter(s); position: absolute; top: 16px; left: 20px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feature b { display: block; margin-bottom: 4px; }
.feature span { color: var(--muted); font-size: 14px; }
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 18px; margin-top: 26px; justify-content: center; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.price-card.pro { border: 2px solid var(--brand); box-shadow: 0 20px 50px rgba(13, 122, 78, .14); }
.price-card .amt { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; }
.price-card .amt small { font-size: 1rem; font-weight: 600; }
.price-card ul { padding-left: 18px; margin: 14px 0 22px; }
.price-card li { margin-bottom: 6px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: #3c4541; }
.cta-band { background: #12201a; color: #fff; border-radius: 22px; padding: 44px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #b9cbc2; }
.site-foot { padding: 30px 0 50px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.wa-float { position: fixed; right: 18px; bottom: 18px; background: #1faa59; color: #fff; border-radius: 999px; padding: 12px 18px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 20; text-decoration: none !important; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .hero-art .sticker { position: static; transform: none; margin-top: 16px; display: flex; justify-content: center; box-shadow: none; }
  .pain, .steps { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .cta-band { padding: 30px 20px; }
  .site-nav .links .hide-m { display: none; }
}
.prose { max-width: 760px; }
.prose h2 { margin-top: 28px; }

/* ---------- Password show/hide ---------- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: #f1efe9; }
.pw-eye:focus-visible { outline: 2px solid rgba(13, 122, 78, .35); }
