/* ==========================================================================
   Cold Storage — design system
   Navy chamber + frost surfaces. Lot numbers and big figures are set in a
   condensed face, like the stencil marks on crates and jute bags.
   ========================================================================== */

:root {
  /* colour */
  --ink: #0E2230;          /* chamber navy: sidebar, headings */
  --ink-2: #183449;
  --frost: #EEF3F6;        /* app background */
  --surface: #FFFFFF;
  --surface-2: #F5F8FA;
  --line: #DCE5EB;
  --line-2: #C3D1DB;
  --text: #13222F;
  --muted: #5B6F80;
  --ice: #1F6FA8;          /* primary */
  --ice-d: #175886;
  --ice-l: #E4EFF8;
  --in: #0F7B5A;   --in-l: #E1F2EA;    /* stock in */
  --out: #B5582A;  --out-l: #F8EADF;   /* stock out (jute) */
  --pay: #3E4FB8;  --pay-l: #E8EBFA;   /* money */
  --warn: #9A5B05; --warn-l: #FCF0D9;
  --danger: #B42318; --danger-l: #FCE9E7;
  --wa: #128C4A;

  /* type */
  --font: "IBM Plex Sans", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-c: "IBM Plex Sans Condensed", "IBM Plex Sans", "Arial Narrow", sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq";
  --fs: 15.5px;

  /* shape */
  --r-s: 8px; --r: 10px; --r-l: 14px;
  --sh-1: 0 1px 2px rgba(14, 34, 48, .06);
  --sh-2: 0 4px 14px rgba(14, 34, 48, .08), 0 1px 3px rgba(14, 34, 48, .06);
  --sh-3: 0 18px 40px rgba(14, 34, 48, .18), 0 3px 8px rgba(14, 34, 48, .08);
  --side-w: 252px;
}
html.big { --fs: 18px; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--frost); color: var(--text); font: 400 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; }
html[dir=rtl] body { font-family: var(--font-ur), var(--font); line-height: 2.05; }
a { color: var(--ice); text-decoration: none; }
a:hover { color: var(--ice-d); }
:focus-visible { outline: 3px solid rgba(31, 111, 168, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: #CFE3F3; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.ur { font-family: var(--font-ur), var(--font); direction: rtl; unicode-bidi: isolate; line-height: 2; }
.num, .n, input[type=number], input[type=date] { font-variant-numeric: tabular-nums; }
html[dir=rtl] .num { direction: ltr; unicode-bidi: isolate; font-family: var(--font); }
.muted { color: var(--muted); }
.owes { color: var(--danger); }
.clear { color: var(--in); }
.inline { display: inline; }

/* ============================ App shell ============================ */
.app { display: flex; min-height: 100vh; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 28px 60px; }
body.no-app .page { max-width: 460px; padding-top: 8vh; }

/* sidebar */
.side { width: var(--side-w); flex: none; background: var(--ink); color: #C8D5DF; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #1C4A68; color: #9FD3F5; box-shadow: inset 0 0 0 1px rgba(159,211,245,.25); }
.brand-mark .ic { width: 22px; height: 22px; }
.brand-name { font-weight: 600; line-height: 1.25; font-size: .98rem; }
.brand-name small { display: block; font-weight: 400; color: #8EA5B7; font-size: .78rem; }
.side-nav { padding: 10px 10px 14px; flex: 1; }
.side-group + .side-group { margin-top: 14px; }
.side-label { padding: 6px 10px; font-size: .76rem; color: #7F97AA; font-weight: 500; }
.side-link { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 8px; color: #C8D5DF; font-weight: 500; font-size: .94rem;
  border-inline-start: 3px solid transparent; transition: background .12s, color .12s; }
.side-link .ic { width: 19px; height: 19px; color: #8EA9BD; }
.side-link span { flex: 1; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.on { background: rgba(120, 190, 240, .13); color: #fff; border-inline-start-color: #6CC0F2; }
.side-link.on .ic { color: #8FD0F7; }
.side-link kbd { background: transparent; border-color: rgba(255,255,255,.16); color: #8EA5B7; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.side-av { width: 34px; height: 34px; border-radius: 50%; background: #234F6C; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .9rem; }
.side-who { flex: 1; min-width: 0; line-height: 1.3; }
.side-who b { display: block; color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-who small { color: #8EA5B7; font-size: .76rem; }
.side-out { color: #8EA5B7; padding: 8px; border-radius: 8px; display: grid; }
.side-out:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-scrim { display: none; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.gsearch { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.gsearch > .ic { position: absolute; inset-inline-start: 13px; color: var(--muted); pointer-events: none; }
.gsearch input { height: 40px; padding-inline: 40px 44px; background: var(--surface-2); border-color: var(--line); border-radius: 10px; font-size: .95rem; }
.gsearch input:focus { background: #fff; }
.gsearch kbd { position: absolute; inset-inline-end: 10px; }
.tools { display: flex; gap: 6px; margin-inline-start: auto; }
.toolbtn, .iconbtn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: 500 .9rem var(--font); cursor: pointer; }
.toolbtn:hover, .iconbtn:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--text); }
.toolbtn .ic { color: var(--muted); }
.toolbtn span { font-family: var(--font-ur), var(--font); line-height: 1; }
html[lang=ur] .toolbtn span { font-family: var(--font); }

/* bottom bar (mobile) */
.bottombar { display: none; }

kbd { font: 500 .7rem var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); background: #fff; }

@media (max-width: 960px) {
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--sh-3); }
  html[dir=rtl] .side { transform: translateX(102%); }
  body.nav-open .side { transform: none; }
  body.nav-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(14,34,48,.45); }
  .menu-btn { display: inline-flex; padding: 0 9px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .gsearch kbd, .toolbtn span { display: none; }
  .page { padding: 18px 14px 96px; }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 40; background: #fff;
    border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(14,34,48,.06); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; color: var(--muted); font-size: .72rem; font-weight: 500; line-height: 1.2; }
  .bottombar a .ic { width: 22px; height: 22px; }
  .bottombar a.on { color: var(--ice); }
  .bottombar a.on .ic { stroke-width: 2.2; }
  kbd { display: none; }
}

/* ============================ Page header ============================ */
.ph { display: flex; align-items: center; gap: 14px; margin: 2px 0 22px; }
.ph-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--ice); border: 1px solid var(--line); box-shadow: var(--sh-1); flex: none; }
.ph-ic .ic { width: 23px; height: 23px; }
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.3; color: var(--ink); }
html[dir=rtl] h1 { line-height: 1.9; }
h2 { font-size: 1.12rem; font-weight: 600; margin: 30px 0 12px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 8px; }
.sub { color: var(--muted); margin: 2px 0 0; font-size: .94rem; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-weight: 500; font-size: .92rem; color: var(--muted); }
.back:hover { color: var(--ice); }
html[dir=rtl] .back .ic, html[dir=rtl] .btn .ic-flip { transform: scaleX(-1); }

/* ============================ Buttons ============================ */
.btn { --b: var(--ice); --bd: var(--ice-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--bd); background: var(--b); color: #fff; font: 600 .95rem/1 var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 1px 2px rgba(14,34,48,.16); transition: background .12s, box-shadow .12s, transform .06s; text-decoration: none; }
.btn:hover { background: var(--bd); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(0,0,0,.15); }
.btn .ic { width: 18px; height: 18px; stroke-width: 2; }
.btn.green { --b: var(--in); --bd: #0B6449; }
.btn.red { --b: var(--out); --bd: #964620; }
.btn.blue { --b: var(--pay); --bd: #31409A; }
.btn.wa { --b: var(--wa); --bd: #0E713B; }
.btn.gray { background: #fff; color: var(--text); border-color: var(--line-2); box-shadow: var(--sh-1); }
.btn.gray:hover { background: var(--surface-2); color: var(--text); border-color: #AFC1CE; }
.btn.gray .ic { color: var(--muted); }
.btn.ghost { background: #fff; color: var(--danger); border-color: #F0C2BC; box-shadow: none; }
.btn.ghost:hover { background: var(--danger-l); color: var(--danger); }
.btn.sm { height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 8px; gap: 6px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.xl { width: 100%; height: 56px; font-size: 1.05rem; border-radius: 12px; }
.btn.xl .ic { width: 21px; height: 21px; }
.btn[disabled], .btn.is-loading { opacity: .85; cursor: progress; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.gray .spin { border-color: var(--line-2); border-top-color: var(--ice); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }

/* ============================ Forms ============================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px; margin-bottom: 18px; box-shadow: var(--sh-1); }
.form { display: grid; gap: 20px; }
.row2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > .lbl, .lbl { font-weight: 600; font-size: .9rem; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.lbl .ic { color: var(--muted); }
.hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font: 600 .78rem var(--font); flex: none; }

input, select, textarea { font: 400 1rem var(--font); color: var(--text); width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: #fff; transition: border-color .12s, box-shadow .12s; }
html[dir=rtl] input, html[dir=rtl] select { font-family: var(--font-ur), var(--font); }
html[dir=rtl] input[type=number], html[dir=rtl] input[type=date] { font-family: var(--font); }
textarea { height: auto; padding: 10px 14px; }
input::placeholder { color: #93A4B1; }
input:hover, select:hover { border-color: #A9BCCA; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ice); box-shadow: 0 0 0 3px rgba(31,111,168,.16); }
select { appearance: none; padding-inline-end: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235B6F80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
html[dir=rtl] select { background-position: left 12px center; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
input.huge { height: 64px; font: 600 2rem/1 var(--font-c); letter-spacing: .01em; padding: 0 16px; }

details.more { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 0 16px; background: var(--surface-2); }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--ice); padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; font-size: .92rem; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] { padding-bottom: 16px; background: #fff; }

/* choice cards */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { position: relative; display: block; }
.choice > input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: block; height: 100%; padding: 13px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer;
  font-weight: 600; transition: border-color .12s, background .12s, box-shadow .12s; }
.choice > span .ic { color: var(--muted); margin-inline-end: 2px; }
.choice > span small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.choice > span:hover { border-color: #A9BCCA; }
.choices.two > label > span { text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; font-size: 1rem; }
.choice > input:checked + span { border-color: var(--ice); background: var(--ice-l); box-shadow: inset 0 0 0 1px var(--ice); }
.choice > input:checked + span .ic { color: var(--ice); }
.choice > input:checked + span::after { content: ""; position: absolute; top: 9px; inset-inline-end: 9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ice) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; }
.choice > input:focus-visible + span { outline: 3px solid rgba(31,111,168,.45); outline-offset: 2px; }
.choice > input:disabled + span { opacity: .45; cursor: not-allowed; }

/* searchable dropdown */
.combo { position: relative; }
.combo select { position: absolute; opacity: 0; pointer-events: none; height: 1px; width: 1px; bottom: 0; }
.combo > input { padding-inline-end: 40px; }
.combo .list { position: absolute; z-index: 25; inset-inline: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line-2); border-radius: 12px;
  max-height: 320px; overflow: auto; display: none; box-shadow: var(--sh-3); padding: 6px; }
.combo.open .list { display: block; }
.combo .opt { padding: 10px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.combo .opt small { color: var(--muted); font-size: .82rem; }
.combo .opt.act, .combo .opt:hover { background: var(--ice-l); }
.combo .empty { padding: 12px; color: var(--muted); }
.combo .combo-x { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: none; place-items: center; font-size: 1.2rem; line-height: 1; }
.combo .combo-x:hover { background: var(--surface-2); color: var(--text); }
.combo.has .combo-x { display: grid; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #C5D2DC; position: relative; flex: none;
  cursor: pointer; transition: background .15s; border: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(14,34,48,.3); transition: inset-inline-start .15s; }
.switch input:checked { background: var(--in); }
.switch input:checked::after { inset-inline-start: 21px; }
.switch input:focus-visible { box-shadow: 0 0 0 3px rgba(31,111,168,.3); }

/* labour / charges / admin boxes */
.labour, .charges { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.labour.on { border-color: #A9D8C3; background: #F3FAF6; }
.labour-body { display: none; margin-top: 14px; gap: 14px; }
.labour.on .labour-body { display: grid; }
.labour-total { font-size: .95rem; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.labour-total b { font: 600 1.25rem var(--font-c); }
.charges { display: grid; gap: 10px; }
.charge-row { display: grid; grid-template-columns: minmax(160px, 1.4fr) 92px 14px 104px 92px; gap: 8px; align-items: center; }
.charge-row input[type=number] { height: 40px; }
.charge-row .c-amt { text-align: end; font: 600 1.05rem var(--font-c); }
.charge-row:not(.on) .c-qty, .charge-row:not(.on) .c-rate { opacity: .45; }
@media (max-width: 560px) { .charge-row { grid-template-columns: 1fr 72px 12px 84px; } .charge-row .c-amt { grid-column: 1 / -1; } }
.adminonly { border: 1px dashed #C9B8EE; border-radius: 12px; padding: 12px 14px; background: #F7F3FE; }
.adminonly .lbl .ic, .adminline { color: #6B3FB8; }

/* live calculation — like a till receipt */
.calc { background: #FCFDFE; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.calc .line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.calc .line:last-child { border-bottom: 0; }
.calc .line b { font-family: var(--font-c); font-weight: 600; font-size: 1.05rem; }
.calc .tot { font-weight: 600; font-size: 1.02rem; }
.calc .tot .num { font: 700 1.6rem/1 var(--font-c); color: var(--ink); }
.calc .formula { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.calc.owes b { color: var(--danger); } .calc.clear b { color: var(--in); }

/* ============================ Feedback ============================ */
.toasts { position: fixed; top: 74px; inset-inline-end: 22px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100vw - 28px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--in);
  border-radius: 12px; padding: 13px 12px 13px 14px; box-shadow: var(--sh-3); font-weight: 500; animation: toast-in .28s cubic-bezier(.2,.9,.3,1.2); }
.toast > .ic { color: var(--in); width: 21px; height: 21px; margin-top: 1px; }
.toast > span { flex: 1; }
.toast.error { border-inline-start-color: var(--danger); }
.toast.error > .ic { color: var(--danger); }
.toast-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.toast-x:hover { background: var(--surface-2); }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 960px) { .toasts { top: 70px; inset-inline-end: 14px; } }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--in-l); color: var(--in); }
.flash.error { background: var(--danger-l); color: var(--danger); }

/* "kaam ho gaya" panel */
.success { display: flex; gap: 18px; align-items: flex-start; background: #F2FAF6; border: 1px solid #B9E0CD; border-radius: var(--r-l); padding: 20px 22px; margin-bottom: 20px; }
.success-body { flex: 1; min-width: 0; }
.success h2 { margin: 2px 0 2px; color: #0B5E45; font-size: 1.25rem; }
.success p { margin: 0 0 14px; font-size: .9rem; }
.success .actions { margin: 0; }
.tick-anim { width: 52px; height: 52px; flex: none; fill: none; stroke: var(--in); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tick-anim circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .55s ease-out forwards; opacity: .9; }
.tick-anim path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .35s .45s ease-out forwards; stroke-width: 3.6; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (max-width: 560px) { .success { flex-direction: column; gap: 10px; } }

.empty-state { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty-state .i { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty-state .i .ic { width: 26px; height: 26px; }
.empty-state p { margin: 0 0 14px; }

/* ============================ Dashboard ============================ */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-bottom: 26px; }
.tile { --c: var(--ice); --cl: var(--ice-l); position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 96px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); color: var(--text); box-shadow: var(--sh-1); transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: var(--c); box-shadow: var(--sh-2); color: var(--text); }
.tile > .i { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--cl); color: var(--c); flex: none; }
.tile > .i .ic { width: 24px; height: 24px; }
.tile > span:not(.i) { font-weight: 600; font-size: 1.04rem; line-height: 1.3; }
.tile small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; margin-top: 3px; line-height: 1.4; }
.tile kbd { position: absolute; top: 10px; inset-inline-end: 10px; }
.t-green { --c: var(--in); --cl: var(--in-l); }
.t-red { --c: var(--out); --cl: var(--out-l); }
.t-blue { --c: var(--pay); --cl: var(--pay-l); }
.t-purple { --c: #6B3FB8; --cl: #EFE8FB; }
.t-yellow { --c: var(--warn); --cl: var(--warn-l); }
.t-teal { --c: #0E7C86; --cl: #DFF3F4; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 18px; color: var(--text); box-shadow: var(--sh-1); position: relative; }
a.stat:hover { border-color: var(--line-2); color: var(--text); }
.stat .lbl { color: var(--muted); font-weight: 500; font-size: .86rem; }
.stat .val { font: 600 1.9rem/1.2 var(--font-c); color: var(--ink); margin-top: 4px; letter-spacing: .005em; }
.stat .val small { font: 500 .85rem var(--font); color: var(--muted); }
.stat.green { box-shadow: inset 3px 0 0 var(--in), var(--sh-1); }
.stat.red { box-shadow: inset 3px 0 0 var(--out), var(--sh-1); }
html[dir=rtl] .stat.green { box-shadow: inset -3px 0 0 var(--in), var(--sh-1); }
html[dir=rtl] .stat.red { box-shadow: inset -3px 0 0 var(--out), var(--sh-1); }
.val.owes, .stat .owes { color: var(--danger); }

/* setup checklist (a real sequence) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); font-weight: 500; background: #fff; }
.steps a:hover { border-color: var(--ice); color: var(--text); }
.steps .no { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); display: grid; place-items: center; font-weight: 600; flex: none; }
.steps li.done a { color: var(--muted); }
.steps li.done .no { background: var(--in); border-color: var(--in); color: #fff; }
.steps li.next a { border-color: var(--ice); box-shadow: 0 0 0 3px var(--ice-l); }
.steps li.next .no { background: var(--ice); border-color: var(--ice); color: #fff; }

/* chambers / racks */
.chambers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.chamber { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; color: var(--text); box-shadow: var(--sh-1); }
a.chamber:hover { border-color: var(--ice); color: var(--text); box-shadow: var(--sh-2); }
.chamber b { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.chamber b .ic { color: var(--ice); }
.chamber .num { font-size: .9rem; }
.bar { height: 8px; background: #E3EAF0; border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.bar span { display: block; height: 100%; background: var(--ice); border-radius: 99px; }
.bar span.full { background: var(--danger); }

/* ============================ Lists ============================ */
.items { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; color: var(--text); box-shadow: var(--sh-1); }
a.item:hover { border-color: var(--line-2); box-shadow: var(--sh-2); color: var(--text); }
.item .av { width: 42px; height: 42px; border-radius: 11px; background: var(--ice-l); color: var(--ice); display: grid; place-items: center; font-weight: 700; flex: none; }
.item .av .ic { width: 21px; height: 21px; }
.item .main { flex: 1; min-width: 0; }
.item .main b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.item .main small { color: var(--muted); font-size: .85rem; }
.item .end { text-align: end; }
.item .end b { display: block; font: 600 1.15rem var(--font-c); }
.item .end small { color: var(--muted); font-size: .78rem; }
.item .end.qty b { font-size: 1.45rem; line-height: 1.1; color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 3px; }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }
.meta .ic { width: 14px; height: 14px; }

/* lot number — the stencilled crate mark */
.lotno { display: inline-flex; align-items: center; font: 600 .82rem/1 var(--font-c); letter-spacing: .04em; color: var(--ink);
  border: 1.5px solid currentColor; border-radius: 4px; padding: 3px 6px 2px; direction: ltr; unicode-bidi: isolate; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font: 600 .74rem/1.5 var(--font); background: var(--ice-l); color: var(--ice-d); }
.badge.peti { background: var(--warn-l); color: var(--warn); }

/* segmented tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; margin-bottom: 16px; background: #E4EBF0; border-radius: 11px; }
.tabs a { padding: 7px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); font-weight: 600; }
.big-tabs a { padding: 10px 18px; font-size: 1rem; }

.chip { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line-2); border-radius: 99px; padding: 6px 14px; color: var(--text); background: #fff; }
.chip:hover { border-color: var(--ice); color: var(--text); }
.chip .ic { color: var(--ice); }
.placechips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* ============================ Tables ============================ */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 18px; background: #fff; box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 14px; border-bottom: 1px solid #E8EEF2; text-align: start; vertical-align: middle; }
th { background: var(--surface-2); font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #FAFCFD; }
td.n, th.n { text-align: end; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); }
tr.subtotal td { background: #FBFCFD; font-weight: 600; color: var(--muted); }
.tablewrap .ic { width: 16px; height: 16px; }

/* report / document blocks */
.bigstats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 4px 0 18px; }
.bigstats > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.bigstats > div.g { background: #F2FAF6; border-color: #C3E5D5; }
.bigstats > div.r { background: #FDF5F0; border-color: #F0D3C2; }
.bigstats small { display: block; color: var(--muted); font-size: .82rem; }
.bigstats b { font: 600 1.7rem/1.25 var(--font-c); color: var(--ink); }
.reportbar { display: grid; gap: 12px; margin-bottom: 16px; }
.langsw { display: inline-flex; align-items: center; gap: 2px; background: #E4EBF0; border-radius: 10px; padding: 3px; font-size: .85rem; }
.langsw > .muted { padding: 0 8px; }
.langsw a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.langsw a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.ratesgrid input { min-width: 96px; height: 40px; }
.ratesgrid th.off, .ratesgrid td.off { opacity: .4; }

/* ============================ Bills (screen + print) ============================ */
.receipt { max-width: 760px; margin: 0 auto 20px; padding: 30px 34px; }
.rhead { text-align: center; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 2px solid var(--ink); }
.rhead h2 { display: block; margin: 0; font-size: 1.35rem; color: var(--ink); }
.rhead small { color: var(--muted); }
.doctitle { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 9px 14px; background: var(--ink); color: #fff; border-radius: 8px; font-weight: 600; }
.doctitle .num b { font-family: var(--font-c); letter-spacing: .04em; font-size: 1.05rem; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid #E8EEF2; padding: 8px 0; }
.kv span:first-child { color: var(--muted); font-size: .9rem; }
.kv b { font-weight: 600; text-align: end; }
.kv b.big { font: 700 1.5rem/1 var(--font-c); }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .receipt { padding: 20px 16px; } }
.receipt table { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 60px; }
.sign div { border-top: 1px solid var(--ink); padding-top: 6px; width: 40%; text-align: center; font-size: .85rem; color: var(--muted); }
.sign.three div { width: 28%; }
.printfoot { text-align: center; color: var(--muted); font-size: .76rem; margin: 18px 0 0; }
.transfer-flow { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.transfer-flow > div:not(.arrow) { flex: 1; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; background: var(--surface-2); }
.transfer-flow small { display: block; color: var(--muted); font-size: .8rem; }
.transfer-flow b { display: block; font-size: 1.1rem; font-weight: 600; }
.transfer-flow .arrow { font-size: 1.6rem; color: var(--ice); }
html[dir=rtl] .transfer-flow .arrow, .doc[dir=rtl] .transfer-flow .arrow { transform: scaleX(-1); }
.gatepass { border-style: dashed; }

/* bill in its own language */
.doc[dir=rtl] { font-family: var(--font-ur), var(--font); line-height: 2.05; text-align: right; }
.doc[dir=ltr] { font-family: var(--font); line-height: 1.55; text-align: left; }
.doc[dir=rtl] .num, .doc[dir=rtl] .n { font-family: var(--font); direction: ltr; unicode-bidi: isolate; }
.doc th, .doc td { text-align: start; }
.doc td.n, .doc th.n { text-align: end; }
.doc .ur { line-height: inherit; }

/* login */
.login .card { padding: 30px 28px; box-shadow: var(--sh-2); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand .brand-mark { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 12px; background: var(--ink); color: #9FD3F5; }
.login-brand .brand-mark .ic { width: 28px; height: 28px; }
.login-brand h1 { font-size: 1.35rem; }
body.installer { background: var(--frost); }
body.installer main { margin: 6vh auto; padding: 0 16px; }

/* ============================ Print ============================ */
@media print {
  @page { margin: 12mm; }
  .no-print, .side, .topbar, .bottombar, .toasts, .success, .side-scrim { display: none !important; }
  body { background: #fff; }
  .app, .col { display: block; }
  .page { padding: 0; max-width: none; }
  .card, .receipt, .tablewrap { border: 0; box-shadow: none; padding: 0; }
  .receipt { max-width: none; }
  .doctitle { background: none; color: #000; border: 1.5px solid #000; }
  body[data-print=bill] .part-gp, body[data-print=gp] .part-bill { display: none !important; }
  .gatepass { margin-top: 28px; border: 1px dashed #000 !important; padding: 14px !important; }
  a { color: inherit; }
  tr:hover td { background: none; }
}

/* ============================ Dashboard hero ============================ */
.hero { display: flex; justify-content: space-between; align-items: stretch; gap: 24px; flex-wrap: wrap; background: var(--ink); color: #fff;
  border-radius: 18px; padding: 26px 28px; margin-bottom: 20px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 220px; height: 220px; opacity: .07; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10 20-1.25-2.5L6 18M10 4 8.75 6.5 6 6M14 20l1.25-2.5L18 18M14 4l1.25 2.5L18 6M17 21l-3-6h-4M17 3l-3 6 1.5 3M2 12h6.5L10 9M20 10l-1.5 2 1.5 2M22 12h-6.5L14 15M4 10l1.5 2L4 14M7 21l3-6-1.5-3M7 3l3 6h4'/%3E%3C/svg%3E") center/contain no-repeat; }
.hero h1 { color: #fff; font-size: 1.65rem; }
.hero-date { margin: 0 0 6px; color: #9FC3DB; font-size: .88rem; display: flex; align-items: center; gap: 7px; }
.hero-sub { margin: 4px 0 0; color: #B9CBD8; }
.hero-l { min-width: 240px; align-self: center; }
.hero-r { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-num { display: flex; flex-direction: column; justify-content: center; min-width: 132px; padding: 12px 18px; border-radius: 12px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10); color: #fff; }
.hero-num:hover { background: rgba(255,255,255,.10); color: #fff; }
.hero-num b { font: 700 2.4rem/1 var(--font-c); letter-spacing: .01em; }
.hero-num span { color: #A9C0D0; font-size: .84rem; margin-top: 4px; }
.hero-fill { min-width: 170px; padding: 12px 18px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10);
  display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 2px 10px; }
.hero-fill span { color: #A9C0D0; font-size: .84rem; }
.hero-fill b { font: 700 1.3rem/1 var(--font-c); }
.hero-fill .bar { grid-column: 1 / -1; background: rgba(255,255,255,.14); margin: 8px 0 0; }
.hero-fill .bar span { background: #6CC0F2; }
@media (max-width: 700px) { .hero { padding: 20px; } .hero-num { flex: 1; min-width: 120px; } .hero-num b { font-size: 2rem; } }

.primary-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.pa { --c: var(--ice); position: relative; display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 16px; background: #fff;
  border: 1px solid var(--line); color: var(--text); box-shadow: var(--sh-1); transition: box-shadow .12s, border-color .12s, transform .12s; }
.pa:hover { color: var(--text); border-color: var(--c); box-shadow: var(--sh-2); transform: translateY(-1px); }
.pa-ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--c); color: #fff; flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 10px -4px var(--c); }
.pa-ic .ic { width: 28px; height: 28px; stroke-width: 2; }
.pa-t { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
.pa-t small { display: block; font-size: .84rem; font-weight: 400; color: var(--muted); margin-top: 3px; }
.pa kbd { position: absolute; top: 12px; inset-inline-end: 12px; }
.pa-in { --c: var(--in); } .pa-out { --c: var(--out); } .pa-pay { --c: var(--pay); }
@media (max-width: 860px) { .primary-actions { grid-template-columns: 1fr; } }
.small-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.small-tiles .tile { min-height: 78px; padding: 14px 16px; }
.small-tiles .tile > .i { width: 40px; height: 40px; border-radius: 10px; }
.small-tiles .tile > .i .ic { width: 20px; height: 20px; }
.small-tiles .tile > span:not(.i) { font-size: .98rem; }
.ch-n { margin-top: 6px; }
.ch-n b { font: 700 1.6rem/1 var(--font-c); color: var(--ink); }
.ch-n small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.shortcuts { margin-top: 26px; font-size: .85rem; }

/* fixes */
.topbar .menu-btn { display: none; }
@media (max-width: 960px) { .topbar .menu-btn { display: inline-flex; } }
.chamber .ch-n b.num { font: 700 1.6rem/1 var(--font-c); color: var(--ink); }
.grid { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
@media (max-width: 560px) {
  .charge-row { grid-template-columns: 1fr 12px 1fr auto; }
  .charge-row .switch { grid-column: 1 / -1; }
  .charge-row .c-amt { grid-column: auto; min-width: 64px; }
}

/* ============================ Login: chalta hua cold storage icon ============================ */
body.no-app { background: linear-gradient(180deg, #E3EDF3 0%, var(--frost) 45%); min-height: 100vh; overflow-x: hidden; }
.login { position: relative; z-index: 1; }
.frost-logo { width: 104px; height: 104px; margin: -4px auto 14px; filter: drop-shadow(0 10px 18px rgba(14,34,48,.28)); }
.frost-logo svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fl-flake { transform-origin: 60px 54px; animation: fl-spin 14s linear infinite; }
.fl-ring { transform-origin: 60px 54px; animation: fl-spin 6s linear infinite reverse; opacity: .8; }
.fl-core { transform-origin: 60px 54px; animation: fl-pulse 2.4s ease-in-out infinite; }
.fl-air path { animation: fl-air 3.2s linear infinite; opacity: .55; }
.fl-air path + path { animation-duration: 4.4s; opacity: .35; }
.fl-snow circle { animation: fl-fall 3.6s linear infinite; }
.fl-snow circle:nth-child(2) { animation-duration: 4.6s; animation-delay: -1.2s; }
.fl-snow circle:nth-child(3) { animation-duration: 3.1s; animation-delay: -2.1s; }
.fl-snow circle:nth-child(4) { animation-duration: 5.2s; animation-delay: -.6s; }
.fl-snow circle:nth-child(5) { animation-duration: 4.1s; animation-delay: -3s; }
.fl-snow circle:nth-child(6) { animation-duration: 3.8s; animation-delay: -1.8s; }
@keyframes fl-spin { to { transform: rotate(360deg); } }
@keyframes fl-pulse { 50% { transform: scale(1.6); opacity: .55; } }
@keyframes fl-air { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes fl-fall { from { transform: translate(0, -4px); opacity: 0; } 15% { opacity: 1; } to { transform: translate(-6px, 122px); opacity: 0; } }

/* pas-manzar mein halki barf */
.frost-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.frost-bg i { position: absolute; top: -12px; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0;
  box-shadow: 0 0 6px rgba(159,211,245,.9); animation: fb-fall 14s linear infinite; }
.frost-bg i:nth-child(1)  { left: 6%;  animation-delay: 0s;   animation-duration: 13s; }
.frost-bg i:nth-child(2)  { left: 14%; animation-delay: -6s;  width: 4px; height: 4px; }
.frost-bg i:nth-child(3)  { left: 23%; animation-delay: -3s;  animation-duration: 17s; }
.frost-bg i:nth-child(4)  { left: 31%; animation-delay: -9s;  width: 3px; height: 3px; }
.frost-bg i:nth-child(5)  { left: 42%; animation-delay: -1s;  animation-duration: 16s; }
.frost-bg i:nth-child(6)  { left: 55%; animation-delay: -11s; width: 5px; height: 5px; }
.frost-bg i:nth-child(7)  { left: 63%; animation-delay: -4s;  animation-duration: 12s; }
.frost-bg i:nth-child(8)  { left: 71%; animation-delay: -8s;  width: 3px; height: 3px; }
.frost-bg i:nth-child(9)  { left: 79%; animation-delay: -2s;  animation-duration: 18s; }
.frost-bg i:nth-child(10) { left: 86%; animation-delay: -12s; width: 4px; height: 4px; }
.frost-bg i:nth-child(11) { left: 93%; animation-delay: -5s;  animation-duration: 15s; }
.frost-bg i:nth-child(12) { left: 49%; animation-delay: -7s;  width: 3px; height: 3px; animation-duration: 19s; }
@keyframes fb-fall {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: .9; }
  50%  { transform: translate(24px, 50vh); }
  90%  { opacity: .7; }
  100% { transform: translate(-10px, 104vh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .frost-bg { display: none; } }

/* ============================ Login: split screen ============================ */
body.login-page { background: #F1F5F8; }
body.login-page .page { max-width: none; padding: 0; }
.auth { display: grid; grid-template-columns: minmax(420px, 1.08fr) 1fr; min-height: 100vh; }

/* left: brand panel */
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 34px 44px 26px; display: flex; flex-direction: column; gap: 22px;
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(108,192,242,.18), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(14,124,134,.35), transparent 60%),
    linear-gradient(160deg, #0F2A3E 0%, #0E2230 55%, #0B3A44 100%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo-mark { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, #1F6FA8, #0E7C86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -6px rgba(14,124,134,.8); }
.auth-logo-mark .ic { width: 22px; height: 22px; color: #fff; }
.auth-logo b { display: block; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.auth-logo small { color: #A9C3D4; font-size: .8rem; }

.chamber-art { width: 100%; max-width: 480px; height: auto; display: block; margin: 4px 0 0; filter: drop-shadow(0 20px 30px rgba(0,0,0,.35)); }
.ca-fan { animation: ca-spin 1.6s linear infinite; transform-origin: 0 0; }
.ca-fan2 { animation-duration: 1.9s; }
.ca-led { animation: ca-blink 2s ease-in-out infinite; }
.ca-air path { stroke-dasharray: 6 8; animation: ca-air 1.4s linear infinite; opacity: .75; }
.ca-air path:nth-child(2) { animation-delay: -.5s; } .ca-air path:nth-child(3) { animation-delay: -.9s; }
.ca-flake { animation: ca-spin 12s linear infinite; transform-origin: 0 0; }
.ca-mercury { animation: ca-merc 6s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
.ca-snow circle { animation: ca-fall 4s linear infinite; }
.ca-snow circle:nth-child(2) { animation-duration: 5.2s; animation-delay: -1.6s; }
.ca-snow circle:nth-child(3) { animation-duration: 3.6s; animation-delay: -2.4s; }
.ca-snow circle:nth-child(4) { animation-duration: 4.8s; animation-delay: -.8s; }
.ca-snow circle:nth-child(5) { animation-duration: 4.4s; animation-delay: -3.2s; }
.ca-snow circle:nth-child(6) { animation-duration: 5.6s; animation-delay: -2s; }
.ca-snow circle:nth-child(7) { animation-duration: 3.9s; animation-delay: -1.1s; }
@keyframes ca-spin { to { transform: rotate(360deg); } }
@keyframes ca-blink { 50% { opacity: .35; } }
@keyframes ca-air { to { stroke-dashoffset: -28; } }
@keyframes ca-merc { 50% { transform: scaleY(.82); } }
@keyframes ca-fall { from { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } to { transform: translate(-8px, 190px); opacity: 0; } }

.auth-copy h1 { color: #fff; font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.22; font-weight: 700; max-width: 18ch; letter-spacing: -.01em; }
.auth-copy h1 em { font-style: normal; color: #7FD6D9; }
html[dir=rtl] .auth-copy h1 { line-height: 1.9; max-width: 22ch; }
.auth-copy p { color: #B9CDDA; margin: 10px 0 0; max-width: 46ch; }
.auth-kicker { display: flex; align-items: center; gap: 10px; color: #7FD6D9; font-weight: 600; font-size: .86rem; margin: 0 0 12px; }
.auth-kicker .bar { width: 22px; height: 2px; background: #E0B04C; border-radius: 2px; }
.auth-features { list-style: none; padding: 0; margin: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.auth-features li { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(4px); }
.auth-features .ic { width: 20px; height: 20px; color: #9FD3F5; display: block; margin-bottom: 8px; }
.auth-features b { display: block; font-size: .92rem; }
.auth-features small { color: #A9C3D4; font-size: .8rem; }
.auth-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: #8FA9BB; font-size: .8rem; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.08); }
.auth-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; margin-inline-end: 8px; box-shadow: 0 0 0 3px rgba(74,222,128,.18); }

/* falling snow over the panel */
.auth-snow { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; }
.auth-snow i { position: absolute; top: -10px; width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: 0; animation: fb-fall 13s linear infinite; }
.auth-snow i:nth-child(1) { left: 8%; } .auth-snow i:nth-child(2) { left: 18%; animation-delay: -5s; width: 3px; height: 3px; }
.auth-snow i:nth-child(3) { left: 29%; animation-delay: -9s; animation-duration: 16s; } .auth-snow i:nth-child(4) { left: 41%; animation-delay: -2s; width: 5px; height: 5px; }
.auth-snow i:nth-child(5) { left: 52%; animation-delay: -11s; } .auth-snow i:nth-child(6) { left: 63%; animation-delay: -7s; animation-duration: 18s; }
.auth-snow i:nth-child(7) { left: 72%; animation-delay: -3s; width: 3px; height: 3px; } .auth-snow i:nth-child(8) { left: 81%; animation-delay: -12s; }
.auth-snow i:nth-child(9) { left: 90%; animation-delay: -6s; animation-duration: 15s; } .auth-snow i:nth-child(10) { left: 35%; animation-delay: -14s; width: 2px; height: 2px; }

/* right: sign-in card */
.auth-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; gap: 16px;
  background: radial-gradient(600px 400px at 70% 20%, #FFFFFF, transparent 70%), #EEF3F6; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 24px; position: relative;
  box-shadow: 0 24px 50px -24px rgba(14,34,48,.35), 0 2px 6px rgba(14,34,48,.05); }
.auth-card::before { content: ""; position: absolute; top: -1px; inset-inline: 18px; height: 4px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #1F6FA8, #0E7C86 60%, #E0B04C); }
.auth-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: #E3F4F4; color: #0B6B73; font-weight: 600; font-size: .78rem; }
.auth-badge .ic { width: 15px; height: 15px; }
.auth-card h2 { display: block; margin: 14px 0 4px; font-size: 1.45rem; color: var(--ink); }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: .92rem; }
.auth-form { display: grid; gap: 16px; }
.inp-ic { position: relative; display: block; }
.inp-ic > .ic { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: #8CA0AF; width: 18px; height: 18px; pointer-events: none; }
.inp-ic input { padding-inline-start: 42px; background: #F8FAFC; }
.inp-ic input:focus { background: #fff; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: #8CA0AF;
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.pw-eye:hover { background: var(--surface-2); color: var(--text); }
.pw-eye .ic:last-child { display: none; } .pw-eye.on .ic:first-child { display: none; } .pw-eye.on .ic:last-child { display: block; }
#pw { padding-inline-end: 46px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; margin-top: -4px; }
.auth-row .ic { width: 15px; height: 15px; }
.linkbtn { border: 0; background: none; color: var(--ice); font: 600 .84rem var(--font); cursor: pointer; padding: 4px; border-radius: 6px; }
.linkbtn:hover { text-decoration: underline; }
.auth-hint { margin: -6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--ice-l); color: var(--ice-d); font-size: .86rem; }
.btn.auth-submit { background: linear-gradient(135deg, #15365C 0%, #0E7C86 100%); border-color: #123B5C; box-shadow: 0 10px 22px -10px rgba(14,124,134,.8), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.auth-submit:hover { background: linear-gradient(135deg, #102C4C 0%, #0B6A73 100%); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: #8CA0AF; font-size: .78rem; font-weight: 600; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.auth-alt .btn { height: 42px; font-weight: 600; }
.auth-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 16px 0 0; }
.auth-help { color: var(--muted); font-size: .84rem; margin: 0; text-align: center; }
body.login-page .toasts { top: 20px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 22px 20px 18px; gap: 14px; }
  .chamber-art { max-width: 320px; margin-inline: auto; }
  .auth-copy p, .auth-features, .auth-foot { display: none; }
  .auth-copy h1 { font-size: 1.4rem; }
  .auth-side { padding: 22px 14px 40px; }
  .auth-card { padding: 24px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) { .auth-snow { display: none; } }
.auth-kicker > .ur, .auth-kicker { white-space: nowrap; line-height: 2; }
html[dir=rtl] .auth-copy h1 { max-width: none; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 2; }
html[dir=rtl] .auth-copy h1 .ur { line-height: 2; }

/* ============================ Login: illustration + badalta maal ============================ */
.auth-art { margin: 0; max-width: 500px; }
.auth-window { position: relative; border-radius: 18px; padding: 18px 18px 10px; overflow: hidden;
  background: linear-gradient(180deg, #EAF4FA 0%, #D9EAF4 100%); border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 24px 40px -18px rgba(0,0,0,.55), inset 0 0 0 6px rgba(255,255,255,.18); }
.auth-window::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(90deg, transparent 0 46px, rgba(14,34,48,.04) 46px 48px); }
.art-svg { width: 100%; height: auto; display: block; position: relative; }
.art-load { opacity: 0; animation: art-cycle 12s infinite; animation-delay: calc(var(--i) * 3s); }
@keyframes art-cycle {
  0% { opacity: 0; transform: translateY(-14px); }
  5%, 22% { opacity: 1; transform: none; }
  27%, 100% { opacity: 0; transform: translateY(0); }
}
.art-snow circle { animation: ca-fall2 5s linear infinite; opacity: 0; }
.art-snow circle:nth-child(2) { animation-delay: -1.5s; animation-duration: 6s; }
.art-snow circle:nth-child(3) { animation-delay: -3s; } .art-snow circle:nth-child(4) { animation-delay: -.7s; animation-duration: 6.5s; }
.art-snow circle:nth-child(5) { animation-delay: -2.2s; } .art-snow circle:nth-child(6) { animation-delay: -4s; animation-duration: 5.5s; }
@keyframes ca-fall2 { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: .95; } to { transform: translate(-20px, 420px); opacity: 0; } }
.art-cap { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 9px 14px; border-radius: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.art-cap-l { color: #A9C3D4; display: inline-flex; align-items: center; gap: 7px; }
.art-cap-l .ic { color: #9FD3F5; }
.art-names { position: relative; display: grid; min-width: 90px; text-align: end; }
.art-names b { grid-area: 1 / 1; color: #fff; font-weight: 700; opacity: 0; animation: art-cycle 12s infinite; animation-delay: calc(var(--i) * 3s); }
@media (prefers-reduced-motion: reduce) { .art-load:first-of-type, .art-names b:first-child { opacity: 1; } }
@media (max-width: 900px) { .auth-art { max-width: 360px; margin-inline: auto; } .art-cap { display: none; } }

/* ============================ Store map ============================ */
.prod-ic { display: inline-block; vertical-align: middle; flex: none; overflow: visible; }
.art-choices { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.art-choices .choice > span { display: flex; align-items: center; gap: 8px; }
.map-tools { display: grid; grid-template-columns: 1fr minmax(220px, 280px); gap: 18px; align-items: end; }
@media (max-width: 860px) { .map-tools { grid-template-columns: 1fr; } }
.map-filter .lbl { margin-bottom: 8px; }
.map-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.map-chips .chip { cursor: pointer; font: 500 .9rem var(--font); height: 38px; }
.map-chips .chip b { font-family: var(--font-c); font-weight: 600; color: var(--muted); }
.map-chips .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.map-chips .chip.on b { color: #A9C3D4; }

.map-chamber { background: #fff; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 20px; overflow: hidden; box-shadow: var(--sh-1); }
.map-ch-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: linear-gradient(90deg, var(--ink), #15405A); color: #fff; }
.map-ch-head h2 { margin: 0; color: #fff; font-size: 1.12rem; }
.map-ch-head small { color: #A9C3D4; }
.map-door { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #9FD3F5; }
.map-cold { margin-inline-start: auto; color: #9FD3F5; opacity: .7; }
.map-cold .ic { width: 26px; height: 26px; animation: ca-spin 14s linear infinite; }
.map-racks { display: grid; gap: 14px; padding: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  background: repeating-linear-gradient(90deg, #F7FAFC 0 38px, #F2F7FA 38px 40px); }
.map-rack { position: relative; display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--text);
  transition: opacity .2s, box-shadow .15s, border-color .15s, transform .15s; }
.map-rack:hover { border-color: var(--ice); box-shadow: var(--sh-2); color: var(--text); transform: translateY(-1px); }
.map-rack.dim { opacity: .28; }
.map-rack.hit { border-color: var(--in); box-shadow: 0 0 0 3px var(--in-l), var(--sh-2); }
.map-rack-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-rack-head b { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.map-rack-head b .ic { color: var(--ice); }
.map-pct { font: 700 .82rem var(--font-c); background: var(--ice-l); color: var(--ice-d); padding: 2px 8px; border-radius: 99px; }
.map-pct.hi { background: var(--danger-l); color: var(--danger); }
.rack-svg { width: 100%; height: auto; display: block; }
.map-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.map-items li { display: flex; align-items: center; gap: 7px; }
.map-items li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-items li b { font: 600 .95rem var(--font-c); }
.map-empty { margin: 0; color: var(--muted); font-size: .86rem; }
.map-free { color: var(--muted); font-size: .8rem; }
.map-mine { position: absolute; top: 44px; inset-inline-start: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--in); color: #fff; font-weight: 600;
  font-size: .8rem; padding: 4px 10px; border-radius: 99px; box-shadow: var(--sh-2); }
html[dir=rtl] .map-mine { transform: translateX(50%); }
