/* Aasan app — one stylesheet. Themes are CSS variables; a business picks one in Settings. */
:root, [data-theme="orange"] {
  --brand: #C2410C; --brand-ink: #9A3412; --brand-soft: #FFEFE3; --ground: #FFF8F2; --on-brand: #FFFFFF;
  --card: #FFFFFF; --line: #ECE6E0; --line2: #E4DED8; --text: #22190F; --text2: #3F352B; --muted: #5E5248; --hover: #F7F1EB;
  --ok: #15803D; --ok-soft: #E5F5EA; --warn: #A16207; --warn-soft: #FEF6DA; --bad: #B91C1C; --bad-soft: #FDECEC; --info: #1D4ED8; --info-soft: #E6EEFD;
  --shadow: 0 8px 28px rgba(60, 30, 10, .06); --shadow2: 0 18px 50px rgba(34, 25, 15, .22); --overlay: rgba(34, 25, 15, .42);
  --r: 18px; --r2: 12px;
}
[data-theme="blue"] { --brand: #1D4ED8; --brand-ink: #1E40AF; --brand-soft: #E6EEFD; --ground: #F5F8FF; --hover: #EEF3FD; --shadow: 0 8px 28px rgba(15, 30, 80, .06); }
[data-theme="green"] { --brand: #15803D; --brand-ink: #166534; --brand-soft: #E5F5EA; --ground: #F4FAF6; --hover: #ECF6EF; --shadow: 0 8px 28px rgba(10, 50, 25, .06); }
[data-theme="purple"] { --brand: #6D28D9; --brand-ink: #5B21B6; --brand-soft: #EFE8FC; --ground: #F7F4FD; --hover: #F1ECFB; --shadow: 0 8px 28px rgba(60, 20, 120, .06); }
[data-theme="dark"] {
  --brand: #FB923C; --brand-ink: #FDBA74; --brand-soft: #3A2414; --ground: #14110E; --on-brand: #1A0F05;
  --card: #1F1B17; --line: #2F2924; --line2: #3A332D; --text: #F4EEE8; --text2: #DDD3CA; --muted: #B3A79C; --hover: #29231E;
  --ok: #4ADE80; --ok-soft: #14301E; --warn: #FACC15; --warn-soft: #332A0C; --bad: #F87171; --bad-soft: #3A1717; --info: #93B4FF; --info-soft: #172442;
  --shadow: 0 8px 28px rgba(0, 0, 0, .35); --shadow2: 0 18px 50px rgba(0, 0, 0, .6); --overlay: rgba(0, 0, 0, .6);
}
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
html[data-font="s"] { font-size: 14px; } html[data-font="l"] { font-size: 16.5px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--text); font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .87rem; } .tiny { font-size: .8rem; } .b { font-weight: 700; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 12px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font-weight: 600; font-size: .95rem; white-space: nowrap; transition: transform .06s, background .15s; }
.btn:hover { background: var(--hover); } .btn:active { transform: scale(.98); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .btn.pri:hover { filter: brightness(1.06); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.danger { color: var(--bad); } .btn.sm { height: 36px; padding: 0 14px; font-size: .87rem; } .btn.block { width: 100%; } .btn.sq { width: 44px; padding: 0; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--text2); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn:hover { background: var(--hover); }
.dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.field { display: flex; flex-direction: column; gap: 6px; } .field > span { font-size: .87rem; font-weight: 600; color: var(--text2); }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input { width: 100%; height: 46px; border: 1px solid var(--line2); border-radius: var(--r2); padding: 0 13px; background: var(--card); font-size: .97rem; outline: 0; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.big { height: 52px; font-size: 1.05rem; }
.prefix { display: flex; align-items: stretch; border: 1px solid var(--line2); border-radius: var(--r2); overflow: hidden; background: var(--card); }
.prefix > span { display: flex; align-items: center; padding: 0 10px; background: var(--hover); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.prefix > input { border: 0; border-radius: 0; flex: 1; min-width: 0; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.chk input { width: 20px; height: 20px; accent-color: var(--brand); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.seg button { height: 42px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--text2); }
.seg button.on { background: var(--brand); color: var(--on-brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); font-size: .87rem; font-weight: 600; color: var(--text2); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
kbd { font: 600 .75rem/1 inherit; border: 1px solid var(--line2); background: var(--card); border-radius: 6px; padding: 3px 6px; color: var(--text2); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card h2, .h2 { margin: 0; font-size: 1.06rem; font-weight: 700; }
.h1 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.3px; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 56px; color: var(--text); }
a.li:hover { background: var(--hover); margin: 0 -10px; padding: 12px 10px; border-radius: 12px; }
.ava { width: 40px; height: 40px; flex: none; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.ava.sq { border-radius: 13px; } .ava img { width: 100%; height: 100%; object-fit: cover; }
.ico { width: 42px; height: 42px; flex: none; border-radius: 13px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.hero { background: var(--brand); color: var(--on-brand); border-radius: 22px; padding: 20px; box-shadow: 0 14px 32px color-mix(in srgb, var(--brand) 30%, transparent); }
.bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; } .bar > i { display: block; height: 100%; background: currentColor; border-radius: 999px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--info-soft); color: var(--info); font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: var(--warn); } .notice.bad { background: var(--bad-soft); color: var(--bad); } .notice.ok { background: var(--ok-soft); color: var(--ok); }
.skel { background: linear-gradient(90deg, var(--hover), var(--line), var(--hover)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 14px; min-height: 90px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- app shell ---------- */
.shell { display: flex; gap: 18px; padding: 18px; min-height: 100vh; }
.side { width: 246px; flex: none; background: var(--card); border-radius: 22px; padding: 18px 12px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); position: sticky; top: 18px; height: calc(100vh - 36px); overflow: auto; }
.biz { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 14px; border: 0; background: transparent; text-align: left; width: 100%; }
.biz:hover { background: var(--hover); }
.biz .ava { border-radius: 13px; background: var(--brand); color: var(--on-brand); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--text2); font-size: .95rem; }
.nav a:hover { background: var(--hover); }
.nav a.on { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.nav a kbd { margin-left: auto; }
.nav a.on kbd { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); }
.nav .soon { margin-left: auto; font-size: .7rem; opacity: .75; }
.navh { font-size: .75rem; font-weight: 700; color: var(--muted); padding: 10px 14px 4px; letter-spacing: .3px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.top { background: var(--card); border-radius: 20px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.searchbtn { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--ground); border: 0; color: var(--muted); text-align: left; font-size: .95rem; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; background: transparent; border-radius: 999px; }
.me-chip:hover { background: var(--hover); }
.view { display: flex; flex-direction: column; gap: 18px; padding-bottom: 30px; }
.mtop, .bnav { display: none; }
@media (max-width: 1023px) {
  .shell { padding: 0; gap: 0; display: block; }
  .side { display: none; }
  .top { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; position: sticky; top: 0; z-index: 20; background: var(--ground); }
  .mtop .icon-btn { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
  .main { padding: 4px 14px 110px; gap: 14px; }
  .view { gap: 14px; }
  .bnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); height: 68px; background: var(--card); border-radius: 24px; box-shadow: 0 12px 30px rgba(0, 0, 0, .14); z-index: 30; }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; color: var(--muted); }
  .bnav a.on { color: var(--brand-ink); font-weight: 700; }
  .bnav .fab { justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 999px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 40%, transparent); }
  .h1 { font-size: 1.35rem; }
}
.drawer { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: flex; }
.drawer > div { width: min(320px, 86vw); background: var(--card); height: 100%; overflow: auto; padding: 18px 12px; display: flex; flex-direction: column; gap: 14px; animation: slin .18s ease-out; }
@keyframes slin { from { transform: translateX(-30px); opacity: .4; } }

/* ---------- sheets, toasts, search ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 18px; }
.sheet { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--card); border-radius: 22px; box-shadow: var(--shadow2); display: flex; flex-direction: column; }
.sheet > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.sheet > header b { flex: 1; font-size: 1.05rem; }
.sheet > section { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.sheet > footer { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--card); }
@media (max-width: 640px) { .sheet-bg { align-items: flex-end; padding: 0; } .sheet { border-radius: 22px 22px 0 0; max-height: 92vh; } }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 28px; } }
.toast { background: var(--text); color: var(--card); padding: 11px 18px; border-radius: 14px; font-size: .92rem; font-weight: 600; box-shadow: var(--shadow2); max-width: 90vw; animation: tin .18s ease-out; }
.toast.bad { background: var(--bad); color: #FFFFFF; } .toast.ok { background: var(--ok); color: #FFFFFF; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.pal-bg { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: flex; justify-content: center; padding: 10vh 14px 14px; }
.pal { width: min(700px, 100%); max-height: 76vh; background: var(--card); border-radius: 22px; box-shadow: var(--shadow2); display: flex; flex-direction: column; overflow: hidden; }
.pal label { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--brand); }
.pal label input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1.15rem; color: var(--text); }
.pal .res { overflow: auto; padding: 8px 10px 12px; }
.pal .grp { font-size: .78rem; font-weight: 700; color: var(--muted); padding: 10px 12px 4px; }
.pal .it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text); }
.pal .it.on { background: var(--brand-soft); }
.pal .it .ico { width: 36px; height: 36px; border-radius: 11px; background: var(--hover); color: var(--text2); }
.pal .it.on .ico { background: var(--card); color: var(--brand-ink); }
.pal footer { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
@media (max-width: 640px) { .pal footer { display: none; } .pal-bg { padding-top: 12px; } }
mark { background: transparent; color: var(--brand-ink); font-weight: 800; }

/* ---------- settings ---------- */
.set { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.set-nav { width: 220px; flex: none; background: var(--card); border-radius: 20px; padding: 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); position: sticky; top: 18px; }
.set-nav a { padding: 11px 12px; border-radius: 12px; color: var(--text2); font-size: .94rem; display: flex; align-items: center; gap: 10px; }
.set-nav a:hover { background: var(--hover); } .set-nav a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.set-body { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.set-side { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 18px; }
@media (max-width: 1023px) { .set-nav { display: none; } .set-side { position: static; } }
.upl { height: 132px; border-radius: 16px; border: 1.5px dashed var(--line2); background: var(--ground); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: .87rem; position: relative; overflow: hidden; width: 100%; }
.upl img { max-width: 86%; max-height: 80px; object-fit: contain; }
.upl .chkd { position: absolute; top: 8px; right: 8px; }
.pad { width: 100%; height: 180px; border: 1.5px dashed var(--line2); border-radius: 14px; background: #FFFFFF; touch-action: none; }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.sw { height: 64px; border-radius: 14px; border: 2px solid transparent; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: .75rem; font-weight: 700; color: #FFFFFF; }
.sw.on { border-color: var(--text); box-shadow: 0 0 0 3px var(--card) inset; }
.slab { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; align-items: center; }

/* ---------- bill preview ---------- */
.bill { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: .82rem; background: #FFFFFF; color: #22190F; }
.bill .bh { display: flex; gap: 10px; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.bill .lg { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden; flex: none; }
.bill .lg img { width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.bill .st { display: flex; gap: 8px; align-items: flex-end; }
.bill .box { width: 60px; height: 60px; border: 1px dashed #8A7F75; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: #5E5248; overflow: hidden; }
.bill .box img { max-width: 100%; max-height: 100%; }

/* ---------- auth and public pages ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-in { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; }
.brandmark { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.brandmark .lg { width: 60px; height: 60px; border-radius: 19px; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.6rem; box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 30%, transparent); }
.brandmark h1 { margin: 4px 0 0; font-size: 1.9rem; font-weight: 800; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .87rem; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.shop { max-width: 920px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 16px; }
.shop-hero { border-radius: 26px; padding: 28px 22px; background: var(--brand); color: var(--on-brand); display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.shop-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, #FFFFFF 12%, transparent); }
.shop-hero .lg { width: 76px; height: 76px; border-radius: 22px; background: #FFFFFF; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 2rem; overflow: hidden; }
.shop-hero .lg img { width: 100%; height: 100%; object-fit: contain; }
.shop-hero h1 { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.4px; }
.shop-hero .btn { background: #FFFFFF; color: var(--brand-ink); border-color: transparent; }
.shop-hero .btn.ghost { background: transparent; color: #FFFFFF; border-color: color-mix(in srgb, #FFFFFF 60%, transparent); }
.soc { display: flex; flex-wrap: wrap; gap: 10px; }
.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 10px; }
@media print { .side, .top, .mtop, .bnav, .toasts { display: none !important; } body { background: #FFFFFF; } }
