:root {
  --navy: #1f4e8c; --navy2: #163a69; --side: #13294b; --side-h: #1d3a66; --accent: #f2a516;
  --bg: #eef1f6; --card: #fff; --line: #d5dbe5; --line2: #e8ecf2; --ink: #1b2330; --muted: #667085;
  --dr: #0b6b3a; --cr: #b42318; --focus: #fff7d6; --sel: #dbe8ff;
  font-family: "Segoe UI", system-ui, Arial, sans-serif; font-size: 13px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
#app { display: grid; grid-template: "top top" 42px "side view" 1fr "keys keys" 26px / 220px 1fr; height: 100vh; }
#top { grid-area: top; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 12px; }
#top .brand { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
#top .brand img { width: 30px; height: 30px; }
.applogo { display: block; width: 100%; max-width: 320px; margin: 0 auto 18px; }
#top .co { font-weight: 600; background: rgba(255,255,255,.12); padding: 3px 10px; border-radius: 4px; }
#top .muted { color: #c9d6ea; }
.spacer { flex: 1; }
#side { grid-area: side; background: var(--side); color: #cfd9ea; overflow-y: auto; padding: 6px 0 20px; }
/* Company select / Login: sidebar khaali hai toh hata do, page full width */
#app:has(#side:empty) { grid-template: "top" 42px "view" 1fr "keys" 26px / 1fr; }
#side:empty, #coName:empty { display: none; }
#side h4 { margin: 12px 14px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8ea3c4; }
#side a { display: flex; justify-content: space-between; padding: 5px 14px 5px 20px; color: inherit; text-decoration: none; }
#side a:hover, #side a.on { background: var(--side-h); color: #fff; }
#side a.on { box-shadow: inset 3px 0 var(--accent); }
#side a.sub { padding-left: 38px; font-size: 12.5px; color: #b5c4dc; }
#side a.tx.open { color: #fff; }
#side a kbd { font-size: 10px; color: #7f95b8; background: none; border: 0; }
#view { grid-area: view; overflow: auto; padding: 14px 18px 40px; }
#keys { grid-area: keys; background: #dfe5ee; border-top: 1px solid var(--line); display: flex; gap: 18px; align-items: center; padding: 0 12px; font-size: 12px; color: #344054; overflow: hidden; white-space: nowrap; }
kbd { background: #fff; border: 1px solid #b8c2d1; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font: 11px Consolas, monospace; }
h2 { margin: 0 0 12px; font-size: 18px; color: var(--navy2); display: flex; align-items: center; gap: 10px; }
h2 .sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.f { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.f > span { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.f.w2 { min-width: 260px; flex: 1; } .f.w3 { min-width: 360px; flex: 2; } .f.sm { min-width: 80px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #b9c3d3; border-radius: 3px; padding: 5px 7px; background: #fff; height: 30px; }
textarea { height: auto; min-height: 54px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #5b8def; outline-offset: -1px; background: var(--focus); }
input[readonly] { background: #f3f5f9; color: #475467; }
input.num { text-align: right; }
button { font: inherit; border: 1px solid #b9c3d3; background: #fff; border-radius: 4px; padding: 5px 12px; cursor: pointer; height: 30px; }
button:hover { background: #f2f5fa; }
button.pri { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
button.pri:hover { background: var(--navy2); }
button.danger { color: var(--cr); border-color: #f0b4ae; }
button.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); }
button.link { border: 0; background: none; color: var(--navy); padding: 0 4px; height: auto; text-decoration: underline; }
button:focus { outline: 2px solid #5b8def; }
.btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
table.t { width: 100%; border-collapse: collapse; background: #fff; }
table.t th { background: #e9eef6; color: #344054; text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t td { padding: 5px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td, table.t tr.cur td { background: var(--sel); }
table.t tfoot td { font-weight: 700; background: #f4f6fa; border-top: 1px solid var(--line); }
table.t td.r, table.t th.r, .r { text-align: right; }
table.t td.n { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.dr { color: var(--dr); } .cr { color: var(--cr); } .muted { color: var(--muted); }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #e7eefb; color: var(--navy2); white-space: nowrap; }
.tag.g { background: #e3f4ea; color: #0b6b3a; } .tag.r { background: #fde8e6; color: #b42318; } .tag.y { background: #fff1d1; color: #8a5a00; }
.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.grid th { background: #e9eef6; font-size: 11px; text-transform: uppercase; color: #475467; padding: 5px 4px; text-align: left; border-bottom: 1px solid var(--line); }
.grid td { padding: 2px 3px; border-bottom: 1px solid var(--line2); }
.grid input { width: 100%; height: 28px; border-color: transparent; background: transparent; }
.grid input:hover { border-color: #cdd5e1; }
.grid input:focus { border-color: #5b8def; background: var(--focus); }
.grid td.sr { color: var(--muted); text-align: center; width: 28px; }
.grid td.calc { text-align: right; padding-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid .del { border: 0; background: none; color: #98a2b3; height: 24px; padding: 0 6px; }
.grid .del:hover { color: var(--cr); }
.vgrid { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
.totals { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 6px; font-size: 18px; font-weight: 700; color: var(--navy2); }
.totals .due { color: var(--cr); font-weight: 600; }
.sec { font-size: 12px; font-weight: 700; color: var(--navy2); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 10px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; border-top: 3px solid var(--navy); }
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.kpi .v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pop { position: fixed; z-index: 60; background: #fff; border: 1px solid #7f96bd; box-shadow: 0 8px 24px rgba(16,24,40,.22); max-height: 320px; overflow-y: auto; min-width: 280px; border-radius: 3px; }
.pop .o { padding: 5px 10px; display: flex; justify-content: space-between; gap: 16px; cursor: pointer; white-space: nowrap; }
.pop .o small { color: var(--muted); }
.pop .o.on { background: var(--navy); color: #fff; } .pop .o.on small { color: #d0dcf0; }
.pop .hd { padding: 4px 10px; background: #e9eef6; font-size: 11px; color: #475467; display: flex; justify-content: space-between; position: sticky; top: 0; }
.pop .new { padding: 6px 10px; color: var(--navy); border-top: 1px solid var(--line2); cursor: pointer; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; }
.mbox { background: var(--bg); border-radius: 8px; width: min(820px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.mhead { background: var(--navy); color: #fff; padding: 8px 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; }
.mhead .x { background: none; border: 0; color: #fff; height: auto; }
#toasts { position: fixed; top: 50px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 8px 16px; border-radius: 4px; color: #fff; background: #344054; box-shadow: 0 4px 12px rgba(0,0,0,.2); font-weight: 500; }
.toast.ok { background: #0b6b3a; } .toast.err { background: #b42318; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.bar { display: flex; height: 140px; align-items: flex-end; gap: 3px; padding-top: 8px; }
.bar div { flex: 1; background: var(--navy); border-radius: 2px 2px 0 0; min-height: 1px; position: relative; }
.bar div:hover { background: var(--accent); }
.companies { max-width: 760px; margin: 30px auto; }
.cobox { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; }
.chk { display: flex; align-items: center; gap: 6px; height: 30px; }
.chk input { height: auto; }
.bs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); background: #fff; }
.bs > div + div { border-left: 1px solid var(--line); }
.bs h3 { margin: 0; padding: 6px 10px; background: #e9eef6; font-size: 13px; }
.bs .g { display: flex; justify-content: space-between; padding: 4px 10px; font-weight: 600; }
.bs .a { display: flex; justify-content: space-between; padding: 2px 10px 2px 26px; color: #475467; cursor: pointer; }
.bs .a:hover { background: var(--sel); }
.bs .tot { display: flex; justify-content: space-between; padding: 6px 10px; font-weight: 700; border-top: 2px solid var(--navy); background: #f4f6fa; }
.serials { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.serials label { display: flex; gap: 6px; align-items: center; padding: 4px 6px; background: #fff; border: 1px solid var(--line2); border-radius: 3px; font-family: Consolas, monospace; }
@media print {
  #top, #side, #keys, .filters, .btns, .noprint { display: none !important; }
  #app { display: block; height: auto; } #view { overflow: visible; padding: 0; }
  body { background: #fff; } .card { border: 0; padding: 0; }
  table.t th { position: static; }
}


/* Automatic voucher no. — locked */
input.locked { background: #eef1f6; color: #33415c; cursor: not-allowed; }
input.locked::placeholder { color: #33415c; opacity: 1; }

/* Sale / Purchase header — 12 column grid */
.vh { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 12px; align-items: start; }
.vh + .vh { margin-top: 8px; }
.vh .f { min-width: 0; }
.vh .f input, .vh .f select { width: 100%; box-sizing: border-box; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; }
.vsec { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line2, #e4e8ef); }
.vsh { font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.vsh .link { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0; }
.pinfo { font-size: 11.5px; min-height: 16px; margin-top: 2px; text-transform: none; letter-spacing: 0; font-weight: 400; }
@media (max-width: 1100px) { .vh { grid-template-columns: repeat(6, minmax(0, 1fr)); } .c8 { grid-column: span 6; } .c5, .c6 { grid-column: span 6; } .c4 { grid-column: span 3; } .c3 { grid-column: span 3; } .c2 { grid-column: span 2; } }
/* item lines poori chaudai me; totals neeche right me */
table.vlines { width: 100%; margin-bottom: 12px; }
.grid th.r { text-align: right; padding-right: 10px; }
/* Proper table format — Busy jaisa grid (har cell ki border) */
.grid th, .grid td { border: 1px solid #d3dae6; }
.grid th { padding: 6px 6px; white-space: nowrap; }
.grid td { padding: 1px 2px; height: 32px; }
.grid tbody tr:nth-child(even) td { background: #fafbfd; }
.grid tbody tr:focus-within td { background: #f1f6ff; }
.grid td.calc, .grid td.lu { color: #344054; }
.grid td.lu { text-align: center; font-size: 12px; }
.grid input.num { padding-right: 8px; }
.c12 { grid-column: 1 / -1; }

/* Configuration — left nav + setting rows */
#view.cfgpage { display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 18px; align-content: start; }
#view.cfgpage > h2 { grid-column: 1 / -1; }
#view.cfgpage > .cfgnav { grid-column: 1; grid-row: 2 / span 60; align-self: start; position: sticky; top: 0; }
#view.cfgpage > :not(h2):not(.cfgnav) { grid-column: 2; min-width: 0; }
.cfgnav { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 0 10px; }
.cfgnav .cfgg { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px 4px; }
.cfgnav a { display: block; padding: 6px 14px 6px 18px; color: #344054; text-decoration: none; border-left: 3px solid transparent; }
.cfgnav a:hover { background: #f2f5fa; }
.cfgnav a.on { background: #e8eef8; color: var(--navy); font-weight: 700; border-left-color: var(--accent); }
.cfghead h3 { margin: 0 0 2px; font-size: 17px; color: var(--navy); }
.cfghead p { margin: 0 0 12px; }
.cfgcard { padding: 4px 16px 6px; }
.cfgct { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); padding: 10px 0 6px; border-bottom: 1px solid var(--line2, #e4e8ef); }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line2, #eef1f6); }
.srow:last-child { border-bottom: 0; }
.srow .sl b { display: block; font-weight: 600; color: #1d2939; }
.srow .sl small { display: block; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.srow .sc { display: flex; justify-content: flex-end; }
.srow .sc select, .srow .sc input:not([type=checkbox]):not([type=file]), .srow .sc textarea { width: 100%; box-sizing: border-box; }
.srow .sc textarea { height: 64px; }
.logobox { display: flex; align-items: center; gap: 8px; width: 100%; } .logobox img { max-height: 40px; max-width: 90px; }
.switch { position: relative; display: inline-block; width: 42px; height: 23px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c5cdd9; border-radius: 23px; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: #1f8f55; }
.switch input:checked + span::before { transform: translateX(19px); }
.switch input:focus-visible + span { outline: 2px solid #5b8def; outline-offset: 2px; }
.cfgbar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; background: var(--bg, #eef1f6); padding: 10px 0; margin-top: 4px; border-top: 1px solid var(--line); }
.cfgbar .cr { font-weight: 700; }
@media (max-width: 1000px) { #view.cfgpage { grid-template-columns: 1fr; } #view.cfgpage > .cfgnav { grid-row: auto; position: static; } #view.cfgpage > :not(h2):not(.cfgnav) { grid-column: 1; } .srow { grid-template-columns: 1fr; } .srow .sc { justify-content: flex-start; } }
.cfgbar { box-shadow: 0 -6px 10px -8px rgba(16,24,40,.25); padding-right: 4px; }

/* IMEI picker — ek IMEI ek line (table) */
.mbox.wide { width: min(880px, 94vw); max-width: none; }
.imeipick #sq { width: 100%; box-sizing: border-box; height: 34px; font-size: 14px; }
.imeibar { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 6px; font-size: 12.5px; }
.imeiwrap { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.imeit { width: 100%; margin: 0; }
.imeit thead th { position: sticky; top: 0; z-index: 1; }
.imeit tbody tr { cursor: pointer; }
.imeit tbody tr:hover td { background: #f3f7ff; }
.imeit tbody tr.sel td { background: #e5f4ea; }
.imeit td.imei { font-family: Consolas, monospace; font-size: 13.5px; letter-spacing: .02em; }
.imeit td, .imeit th { padding: 5px 8px; }
.imeit input[type=checkbox] { height: 15px; width: 15px; margin: 0; vertical-align: middle; }
.imeit tbody td { padding: 4px 8px; line-height: 1.3; }
.imeit tbody tr.bad td { background: #fdecea; }
.imeit .del { border: 0; background: none; color: #98a2b3; cursor: pointer; font-size: 14px; } .imeit .del:hover { color: var(--cr); }
.grid input.ls.pick { cursor: pointer; background: #f7f9fc; }
.grid input.ls.bad { background: #fdecea; outline: 1px solid #f04438; }
#scnt b.ok { color: #0b6b3a; } #scnt b.cr { color: var(--cr); }
.bsum { padding: 6px 10px; background: #f7f9fc; border: 1px dashed #c9d3e2; border-radius: 4px; min-height: 18px; }
.bsum kbd { font-size: 10.5px; }
.vsh .link { margin-left: 8px; }
.mbox.cust { width: min(640px, 94vw); }
#billrow .bsum { height: 30px; box-sizing: border-box; padding: 5px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; line-height: 18px; }
#billrow .bsum:hover { border-color: #5b8def; background: #f1f6ff; }
#billrow > span a { font-size: 10.5px; margin-left: 6px; text-transform: none; letter-spacing: 0; }
.c9 { grid-column: span 9; }
.lineacts { display: flex; gap: 8px; margin: -6px 0 12px; }
.lineacts button { font-size: 12.5px; padding: 4px 12px; }
.multi .mqty { width: 70px; height: 26px; text-align: right; }
.c7 { grid-column: span 7; }
.c1 { grid-column: span 1; }

/* Splash screen — app khulte hi ek baar (per window), phir fade out */
#splash { position: fixed; inset: 0; z-index: 9999; overflow: hidden; background: #f4f7fc; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .55s ease, transform .55s ease; }
#splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
#splash .sp-bg { position: absolute; inset: 0; background: url(/splash-bg.jpg) center / cover no-repeat; animation: spBg 1.2s ease-out both; }
#splash .sp-mark { position: relative; height: min(30vh, 230px); aspect-ratio: 1; animation: spPop .9s cubic-bezier(.34,1.56,.64,1) .15s both; }
#splash .sp-mark img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(20,60,130,.18)); }
#splash .sp-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%) no-repeat; background-size: 250% 100%; background-position: 150% 0;
  -webkit-mask: url(/mark.png) center / contain no-repeat; mask: url(/mark.png) center / contain no-repeat; animation: spShine 1.1s ease-in-out 1.05s both; }
#splash .sp-star { position: absolute; right: 7%; top: 10%; width: 18%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,120,.95) 0, rgba(255,170,40,.45) 30%, transparent 65%); animation: spTwinkle 1.6s ease-in-out 1s infinite both; }
#splash .sp-word { position: relative; width: min(44vw, 400px); margin-top: 6px; animation: spReveal .8s cubic-bezier(.65,0,.35,1) .7s both; }
#splash .sp-word img { width: 100%; display: block; }
#splash .sp-load { position: relative; margin-top: 42px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: spFade .5s ease 1.2s both; }
#splash .sp-ring { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(from 0deg, #1e6fd9, #4aa3ff 40%, #ff9a1f 60%, #f57c00 85%, transparent 86%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px)); animation: spSpin .9s linear infinite; }
#splash .sp-txt { color: #3a4660; font-size: 15px; letter-spacing: .2px; }
@keyframes spBg { from { transform: scale(1.06); opacity: .35; } to { transform: scale(1); opacity: 1; } }
@keyframes spPop { from { transform: scale(.35) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spShine { to { background-position: -50% 0; } }
@keyframes spTwinkle { 0%, 100% { transform: scale(.6); opacity: 0; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes spReveal { from { clip-path: inset(0 100% 0 0); transform: translateY(10px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes spFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #splash *, #splash *::after, #splash .sp-bg { animation: none !important; } #splash .sp-ring { animation: spSpin 1.6s linear infinite !important; } }

/* Company list header + Create Company popup */
.cohead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cohead h2 { margin: 0; }
.mbox.cobx { width: min(860px, 94vw); }
.mbox.cobx .mbody { padding: 6px 22px 18px !important; background: #fff; }
.mbox.cobx .sec { margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line2); }
.mbox.cobx .sec:first-child { margin-top: 8px; }
.mbox.cobx .row { gap: 12px; }
.mbox.cobx input, .mbox.cobx select { height: 32px; font-size: 13.5px; }
.mfoot { position: sticky; bottom: -18px; background: #fff; margin: 18px -22px -18px; padding: 12px 22px; border-top: 1px solid var(--line2); align-items: center; }
.mfoot .muted { margin-left: auto; font-size: 12px; }
/* Print name: auto (naam se) ho to halka "same as name" hint */
.f .ph { display: none; font-weight: 500; text-transform: none; letter-spacing: 0; color: #98a2b3; margin-left: 4px; }
.f.autoP .ph, .f .ph.on { display: inline; }
.f.autoP input { color: #475467; }
.f.bad input { border-color: var(--cr); background: #fff5f4; }

/* Company login popup (Busy jaisa: company select → username/password) */
.modal.lgmodal { background: rgba(15, 30, 60, .55); backdrop-filter: blur(3px); align-items: center; padding-top: 0; }
.mbox.lgmbox { width: min(410px, 94vw); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 30px 70px rgba(10, 25, 60, .45); animation: lgIn .32s cubic-bezier(.2, .9, .3, 1.2) both; }
.mbox.lgmbox .mhead { display: none; }
.mbox.lgmbox .mbody { padding: 0 !important; background: #fff; }
.mbox.lgmbox.shake { animation: lgShake .4s ease; }
@keyframes lgIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lgShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lg-top { position: relative; text-align: center; padding: 26px 24px 52px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 154, 31, .55) 0, transparent 45%), linear-gradient(135deg, #0b3d91 0%, #1565d8 60%, #2b86ff 100%); }
.lg-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px; background: #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.lg-word { height: 34px; padding: 6px 12px; background: #fff; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.lg-title { font-size: 20px; font-weight: 700; margin-top: 14px; letter-spacing: .2px; }
.lg-sub { font-size: 12.5px; opacity: .85; margin-top: 3px; }
.lg-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 14px; cursor: pointer; padding: 0; }
.lg-x:hover { background: rgba(255, 255, 255, .3); }
.lg-co { position: relative; z-index: 1; margin: -38px 22px 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e3e8f2; border-radius: 12px; box-shadow: 0 8px 22px rgba(20, 50, 110, .12); }
.lg-co img { width: 40px; height: 40px; flex: none; }
.lg-co b { display: block; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-co small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.lg-co > div { min-width: 0; }
.lgbox { padding: 18px 22px 6px; }
.lg-note { margin: 0 0 12px; padding: 8px 10px; font-size: 12.5px; color: #7a4b00; background: #fff6e5; border: 1px solid #ffe0a6; border-radius: 8px; }
/* fields: baaki app jaise (.f label + normal input), sirf password me aankh ka button */
.lgbox .lf { margin-bottom: 12px; }
.lgbox .ib { position: relative; }
.lgbox .ib input { width: 100%; height: 32px; padding-right: 34px; }
.lgbox .ib .eye { position: absolute; right: 2px; top: 1px; width: 30px; height: 30px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.lgbox .ib .eye svg { width: 16px; height: 16px; fill: none; stroke: #98a2b3; stroke-width: 1.8; }
.lgbox .ib .eye:hover svg, .lgbox .ib .eye.on svg { stroke: var(--navy); }
.lg-caps { margin: -6px 0 10px; font-size: 12px; color: #b54708; font-weight: 600; }
.lg-err { margin: -4px 0 12px; padding: 8px 10px; font-size: 12.5px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; }
.lgbox .lg-go { width: 100%; height: 34px; margin-top: 2px; font-size: 14px; }
.lg-go.busy { opacity: .8; cursor: progress; }
.lg-cancel { display: block; width: 100%; margin-top: 8px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; border-radius: 8px; }
.lg-cancel:hover { background: #f2f4f7; color: var(--ink); }
.lg-foot { padding: 10px 22px 16px; text-align: center; font-size: 11.5px; color: #98a2b3; border-top: 1px solid #f0f2f6; margin-top: 8px; }

/* Header live clock */
#topInfo .clk { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 4px; background: rgba(255,255,255,.12); color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* Header Logout — red */
#top .logout { margin-left: 8px; height: 28px; padding: 0 12px; border: 0; border-radius: 5px; background: #d92d20; color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
#top .logout:hover { background: #b42318; }
#top .logout:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* License: header chip, company-screen line, Configuration → License */
.licchip { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 600; border: 0; }
.licchip.warn { background: #fff1d1; color: #8a5a00; } .licchip.bad { background: #fde8e6; color: #b42318; } .licchip.ok { background: #e3f4ea; color: #0b6b3a; }
.licline { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.licdot { width: 8px; height: 8px; border-radius: 50%; background: #0b6b3a; } .licdot.warn { background: #d99a00; } .licdot.bad { background: #b42318; }
.licbox { max-width: 560px; } .licbox .sec { margin: 16px 0 6px; font-weight: 700; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.licstat { padding: 10px 12px; border-radius: 6px; border: 1px solid; } .licstat b { display: block; font-size: 15px; } .licstat small { display: block; margin-top: 3px; line-height: 1.4; }
.licstat.ok { background: #e3f4ea; border-color: #b7e0c6; color: #0b6b3a; } .licstat.warn { background: #fff7e0; border-color: #f2d48a; color: #8a5a00; } .licstat.bad { background: #fde8e6; border-color: #f0b4ae; color: #b42318; }
.lict { margin-top: 10px; } .lict td { padding: 4px 8px; } .lict td:first-child { width: 120px; }
.licmid { display: flex; gap: 8px; align-items: center; } .licmid code { font: 600 18px Consolas, monospace; letter-spacing: .06em; background: #f2f5fa; border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; user-select: all; }
.lickey { width: 100%; box-sizing: border-box; height: 80px; font: 12px Consolas, monospace; word-break: break-all; }
.licchip.upd { background: #e7eefb; color: #163a69; }
.licupd { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-top: 10px; padding: 10px 12px; border: 1px solid #c9d8f0; background: #f3f7fd; border-radius: 6px; }
.licupd > div { flex: 1; } .licnotes { white-space: pre-line; font-size: 12px; color: #475467; margin: 4px 0; }
.litiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.litile { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; min-width: 0; }
.litile > span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.litile > b { display: block; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.litile.wide { grid-column: span 2; }
.litile > small { display: block; color: var(--muted); font-size: 11px; }
.libar { display: block; height: 4px; background: #e8ecf2; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.libar > i { display: block; height: 100%; background: #0b6b3a; } .libar > i.warn { background: #d99a00; } .libar > i.bad { background: #b42318; }
.licbox { max-width: 680px; }
.licdemo { margin-top: 10px; padding: 12px; border: 1px solid #bae6fd; background: #f0f9ff; border-radius: 6px; }
.licdemo .row { gap: 10px; }
/* Header: license validity + version (time ke paas) */
.hdrlic { background: none; border: 0; color: #c9d6ea; font-size: 12px; padding: 0 4px; height: auto; cursor: pointer; white-space: nowrap; }
.hdrlic:hover { color: #fff; text-decoration: underline; } .hdrlic b { color: #fff; font-weight: 600; } .hdrlic .sep { opacity: .5; margin: 0 6px; }
.hdrlic.warn b { color: #ffd479; } .hdrlic.bad b { color: #ffb4ab; }
@media (max-width: 900px) { .hdrlic { display: none; } }
/* Plans: locked menu items, upgrade card, plan comparison */
#side a.lock { opacity: .55; } #side a.lock .lk { float: right; font-size: 11px; }
.upg { text-align: center; max-width: 520px; margin: 30px auto; } .upg .upgi { font-size: 34px; } .upg h3 { margin: 6px 0 8px; color: var(--navy); }
.plant { font-size: 12px; } .plant th, .plant td { text-align: center; padding: 5px 8px; } .plant td:first-child, .plant th:first-child { text-align: left; }
.plant th small { display: block; font-weight: 600; color: #0b6b3a; text-transform: none; } .plant .cur { background: #eef6ff; }
.plant .pyes { color: #0b6b3a; font-weight: 700; } .plant .pno { color: #98a2b3; }
/* WhatsApp button */
button.wab { background: #e7f8ee; border-color: #9fdcb7; color: #0b6b3a; font-weight: 600; } button.wab:hover { background: #d5f2e1; }
/* License screen v2: status patti, code box, This PC */
.lichero { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 8px; border: 1px solid; }
.lichero.ok { background: #e3f4ea; border-color: #b7e0c6; color: #0b6b3a; } .lichero.warn { background: #fff7e0; border-color: #f2d48a; color: #8a5a00; } .lichero.bad { background: #fde8e6; border-color: #f0b4ae; color: #b42318; }
.lhi { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex: none; }
.lht { flex: 1; min-width: 0; } .lht b { display: block; font-size: 17px; } .lht > small { display: block; margin-top: 2px; line-height: 1.4; }
.lhbar { height: 6px; background: rgba(255,255,255,.75); border-radius: 3px; margin-top: 8px; overflow: hidden; max-width: 420px; }
.lhbar i { display: block; height: 100%; background: #0b6b3a; } .lhbar i.warn { background: #d99a00; } .lhbar i.bad { background: #b42318; }
.lhdays { display: block; margin-top: 3px; font-weight: 600; }
.lha button { white-space: nowrap; }
.licgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.liccard { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; min-width: 0; }
.liccard .sec { margin-top: 0 !important; }
.lhelp { font-size: 12px; margin: 4px 0 8px; display: block; }
.licode { display: flex; gap: 8px; } .lcode { flex: 1; min-width: 0; font: 700 18px Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; height: 40px; text-align: center; }
.licode button { height: 40px; padding: 0 18px; }
.lmid { font: 700 13px Consolas, monospace; letter-spacing: .05em; }
.licbox { max-width: 860px; }
/* dealer contact + update progress */
.dlbtns { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
a.wabtn, a.callbtn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 5px; font-weight: 600; text-decoration: none; font-size: 13px; }
a.wabtn { background: #25a35a; color: #fff; } a.wabtn:hover { background: #1e8a4b; } a.callbtn { border: 1px solid #b9c3d3; color: var(--navy); background: #fff; } a.callbtn:hover { background: #f2f5fa; }
.updst { font-size: 12px; margin-top: 6px; color: #163a69; font-weight: 600; }
.updbar { height: 8px; background: #dbe5f3; border-radius: 4px; overflow: hidden; margin-top: 5px; }
.updbar i { display: block; height: 100%; background: linear-gradient(90deg, #1f4e8c, #3a78c9); transition: width .6s; }
.updbar i.ind { background: repeating-linear-gradient(45deg, #1f4e8c 0 12px, #3a78c9 12px 24px); background-size: 34px 34px; animation: updmv 1s linear infinite; }
@keyframes updmv { to { background-position: 34px 0; } }
.licline .updnow { height: 26px; padding: 0 12px; font-size: 12px; }
/* company khulte waqt loading */
.opening { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 60vh; color: var(--navy); font-size: 15px; }
.opening .spin { width: 34px; height: 34px; border: 3px solid #d5dbe5; border-top-color: var(--navy); border-radius: 50%; animation: kbspin .8s linear infinite; }
@keyframes kbspin { to { transform: rotate(360deg); } }
/* demo company */
.cohead .sp { flex: 1; } .tag.demo { background: #fff1d1; color: #8a5a00; font-weight: 700; letter-spacing: .04em; }
.dmlist { margin: 6px 0 10px; padding-left: 18px; line-height: 1.6; }
#coName .tag.demo { margin-left: 6px; font-size: 10.5px; vertical-align: middle; }
/* server tak na pahunche → Reconnecting overlay */
#kbOff { position: fixed; inset: 0; z-index: 9999; background: rgba(238, 241, 246, .92); display: flex; align-items: center; justify-content: center; }
#kbOff .kbobox { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 36px; text-align: center; max-width: 420px; display: flex; flex-direction: column; gap: 6px; align-items: center; box-shadow: 0 8px 30px rgba(20,40,80,.1); }
#kbOff .spin { width: 30px; height: 30px; border: 3px solid #d5dbe5; border-top-color: var(--navy); border-radius: 50%; animation: kbspin .8s linear infinite; }
#kbOff b { color: var(--navy); font-size: 16px; } #kbOff small { color: var(--muted); }
#kbOff .kbost { margin-top: 6px; background: var(--navy); color: #fff; border-radius: 6px; padding: 8px 18px; font-weight: 600; text-decoration: none; }
