/* Salon Pro - visual system. Colors are tokens on :root; dark mode redefines them. */
:root {
  --brand: #b5476b;
  --brand-2: #c99a3c;
  --brand-deep: #7b2d52;
  --brand-soft: #fbe7ee;
  --ink: #2a1a22;
  --muted: #7d6a73;
  --bg: #fdf7f5;
  --card: #ffffff;
  --line: #f0e3e8;
  --ok: #2e9e6a;
  --info: #4c7ef3;
  --warn: #d68a1a;
  --danger: #d64545;
  --shadow: 0 10px 30px -12px rgba(123, 45, 82, .25);
  --radius: 18px;
  --sidebar-w: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: #3a1f2b;
    --ink: #f7eef1;
    --muted: #b7a3ab;
    --bg: #171115;
    --card: #221820;
    --line: #36262f;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --brand-soft: #3a1f2b;
  --ink: #f7eef1;
  --muted: #b7a3ab;
  --bg: #171115;
  --card: #221820;
  --line: #36262f;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
a { color: var(--brand); }
.urdu { font-family: 'Noto Nastaliq Urdu', serif; direction: rtl; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty i { font-size: 42px; display: block; margin-bottom: 8px; color: var(--brand-2); }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 30% 20%, #c9557a, #7b2d52 55%, #3d1729);
  color: #fff; transition: opacity .5s ease, visibility .5s;
}
.splash.gone { opacity: 0; visibility: hidden; }
.splash-mark {
  width: 96px; height: 96px; border-radius: 30px; background: rgba(255,255,255,.14);
  display: grid; place-items: center; font-size: 46px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: splashIn .9s cubic-bezier(.2,1.4,.4,1) both;
}
.splash-mark i { animation: spinIn 1.2s .2s cubic-bezier(.2,1,.3,1) both; }
.splash-name { font-size: 26px; font-weight: 800; animation: fadeUp .8s .3s both; }
.splash-urdu { font-family: 'Noto Nastaliq Urdu', serif; font-size: 22px; opacity: .85; animation: fadeUp .8s .45s both; }
.splash-bar { width: 140px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 14px; }
.splash-bar span { display: block; height: 100%; width: 40%; background: #fff; border-radius: 4px; animation: slide 1.2s ease-in-out infinite; }
@keyframes splashIn { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spinIn { from { transform: rotate(-180deg) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(181,71,107,.6); } 50% { box-shadow: 0 0 0 7px rgba(181,71,107,0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: none; } }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand-deep), #4a1830 70%);
  color: #fff; padding: 22px 14px; overflow-y: auto; z-index: 40;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 22px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3); animation: pop .6s both;
}
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 12px; opacity: .7; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  color: rgba(255,255,255,.78); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background .2s, transform .2s, color .2s;
}
.nav-link i { font-size: 17px; width: 22px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(3px); }
.nav-link.active { background: #fff; color: var(--brand-deep); font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.side-foot { margin-top: auto; font-size: 12px; opacity: .65; padding: 14px 8px 0; }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.title-wrap { flex: 1; min-width: 0; }
.crumb { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.page-title { font-size: 22px; }
.chip {
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.menu-btn { display: none; }
.view { padding: 22px 24px 40px; max-width: 1280px; width: 100%; }
.view.enter { animation: fadeUp .45s cubic-bezier(.2,.7,.2,1) both; }
.view.enter > * { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }

.bottom-nav { display: none; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--brand), #d0607f); color: #fff; border-color: transparent; }
.btn-gold { background: linear-gradient(135deg, var(--brand-2), #e7b65a); color: #2a1a10; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: #fdecec; color: var(--danger); border-color: transparent; }
.btn-ok { background: #e6f6ee; color: var(--ok); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); display: grid; place-items: center; font-size: 18px; cursor: pointer; flex: none;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 74px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(181,71,107,.15); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.search { position: relative; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 36px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .search { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .2s;
}
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }

/* ---------- Cards & stats ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; animation: pop .4s both;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.card-head h3 { font-size: 16px; }
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 820px) {
  .stat-value { font-size: 21px; }
  .grid-stats[style*="repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-stats[style*="repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; }
}
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stat {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep)); animation-delay: calc(var(--i, 0) * 80ms);
}
.stat:nth-child(2) { background: linear-gradient(135deg, #d4a84b, #b7792a); }
.stat:nth-child(3) { background: linear-gradient(135deg, #3f8fd1, #2c5fa8); }
.stat:nth-child(4) { background: linear-gradient(135deg, #3aa27a, #1f7656); }
.stat::after {
  content: ''; position: absolute; width: 120px; height: 120px; right: -30px; top: -40px;
  border-radius: 50%; background: rgba(255,255,255,.12); transition: transform .6s;
}
.stat:hover::after { transform: scale(1.4); }
.stat-label { font-size: 13px; opacity: .85; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-icon { position: absolute; right: 16px; bottom: 12px; font-size: 34px; opacity: .25; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar-fill {
  width: 100%; max-width: 46px; border-radius: 12px 12px 6px 6px; min-height: 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); transform-origin: bottom;
  animation: growY .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 90ms);
  box-shadow: 0 8px 16px -8px var(--brand);
}
.bar-val { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar-day { font-size: 11.5px; color: var(--muted); }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); transition: transform .2s, box-shadow .2s;
  animation: fadeUp .4s both; animation-delay: calc(var(--i, 0) * 45ms); cursor: pointer;
}
.list-item:hover { transform: translateX(3px); box-shadow: var(--shadow); }
.avatar {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.avatar.lg { width: 60px; height: 60px; border-radius: 20px; font-size: 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-deep); white-space: nowrap;
}
.tag.ok { background: #e6f6ee; color: var(--ok); }
.tag.info { background: #e8effe; color: var(--info); }
.tag.warn { background: #fff3df; color: var(--warn); }
.tag.danger { background: #fdecec; color: var(--danger); }
.tag.mute { background: #eee; color: #666; }
.pulse { animation: pulse 2s infinite; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .15s; }
.tbl tr.click:hover { background: var(--brand-soft); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Modal & toasts ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,8,14,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .2s both;
}
.modal {
  width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  animation: pop .3s cubic-bezier(.2,1,.3,1) both; overflow: hidden;
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-size: 14px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.5); animation: toastIn .35s both; max-width: 340px;
  transition: opacity .4s, transform .4s;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- Calendar ---------- */
.cal-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.cal-date { font-weight: 700; font-size: 16px; min-width: 210px; text-align: center; }
.day-grid { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.day-head, .day-body { display: grid; min-width: 100%; }
.day-head { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
.tcol { width: 62px; font-size: 11.5px; color: var(--muted); }
.day-head .hcell { padding: 12px 10px; display: flex; align-items: center; gap: 10px; border-left: 1px solid var(--line); min-width: 170px; }
.hcell .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 13px; }
.hcell small { display: block; color: var(--muted); font-size: 11.5px; }
.time-col { position: relative; }
.time-col div { position: absolute; left: 0; right: 0; transform: translateY(-7px); padding-right: 8px; text-align: right; white-space: nowrap; }
.lane { position: relative; border-left: 1px solid var(--line); cursor: copy; min-width: 170px; background:
  repeating-linear-gradient(to bottom, transparent 0, transparent 71px, var(--line) 71px, var(--line) 72px); }
.lane.off { background: repeating-linear-gradient(45deg, transparent 0 8px, color-mix(in srgb, var(--line) 60%, transparent) 8px 9px); cursor: default; }
.slot-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; box-shadow: 0 0 8px rgba(214,69,69,.6); pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
.appt {
  position: absolute; left: 6px; right: 6px; border-radius: 12px; padding: 7px 9px; overflow: hidden; cursor: pointer;
  color: #fff; font-size: 12px; line-height: 1.3; box-shadow: 0 8px 18px -10px rgba(0,0,0,.5);
  transition: transform .15s, box-shadow .2s; animation: pop .35s both; z-index: 2;
  border-left: 4px solid rgba(0,0,0,.2);
}
.appt:hover { transform: scale(1.02); box-shadow: 0 14px 26px -12px rgba(0,0,0,.6); z-index: 4; }
.appt b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt span { opacity: .9; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-booked { background: linear-gradient(135deg, #4c7ef3, #3561d0); }
.st-arrived { background: linear-gradient(135deg, #d4a84b, #b7792a); }
.st-done { background: linear-gradient(135deg, #3aa27a, #1f7656); }
.st-cancelled { background: linear-gradient(135deg, #9a9a9a, #6b6b6b); opacity: .7; text-decoration: line-through; }
.st-noshow { background: linear-gradient(135deg, #e0655f, #b53a35); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.week-col { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-height: 260px; animation: fadeUp .4s both; animation-delay: calc(var(--i) * 40ms); }
.week-col.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.week-col h4 { font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; cursor: pointer; }
.week-col .appt { position: relative; left: 0; right: 0; margin-bottom: 8px; animation: none; }
.week-col .appt:hover { transform: translateY(-2px); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

.visit { border: 1px dashed var(--brand); border-radius: 16px; padding: 14px; background: var(--brand-soft); animation: pop .3s both; }
.visit + .visit { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); font-size: 13px; transition: all .2s; user-select: none;
}
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--brand); color: #fff; border-color: var(--brand); transform: scale(1.03); }
.chips small { opacity: .75; }

/* ---------- Billing ---------- */
.bill-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.svc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.svc-btn {
  text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  font: inherit; color: var(--ink); cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s;
  animation: fadeUp .35s both; animation-delay: calc(var(--i, 0) * 25ms);
}
.svc-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); }
.svc-btn b { display: block; font-size: 13.5px; }
.svc-btn span { font-size: 12px; color: var(--muted); }
.svc-btn .money { display: block; margin-top: 6px; color: var(--brand); }
.cart-line { display: grid; grid-template-columns: 1fr 64px 92px 36px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); animation: fadeUp .3s both; }
.cart-line .input { padding: 8px 9px; text-align: center; }
.cart-line .n b { font-size: 14px; display: block; }
.cart-line .n span { font-size: 11.5px; color: var(--muted); }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totals .grand { font-size: 20px; font-weight: 800; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; color: var(--brand-deep); }
.totals .grand span:last-child { animation: pop .4s both; }
.balance-due { color: var(--danger); font-weight: 700; }
.balance-ok { color: var(--ok); font-weight: 700; }

/* ---------- Invoice / receipt ---------- */
.receipt {
  max-width: 560px; margin: 0 auto; background: #fff; color: #222; border-radius: 18px; padding: 26px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; animation: pop .45s both;
}
.receipt::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand));
}
.receipt h2 { font-size: 20px; color: var(--brand-deep); }
.receipt table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.receipt th { text-align: left; font-size: 11.5px; text-transform: uppercase; color: #888; border-bottom: 1px solid #eee; padding: 8px 4px; }
.receipt td { padding: 8px 4px; border-bottom: 1px dashed #eee; }
.receipt .r { text-align: right; }
.receipt .sum td { border: 0; padding: 4px; }
.receipt .total td { font-size: 17px; font-weight: 800; color: var(--brand-deep); border-top: 2px solid #222; }
.stamp { display: inline-block; font-weight: 800; letter-spacing: .1em; padding: 6px 14px; border: 3px solid; border-radius: 10px; transform: rotate(-8deg); }
.stamp.paid { color: var(--ok); border-color: var(--ok); }
.stamp.partial { color: var(--warn); border-color: var(--warn); }
.stamp.unpaid { color: var(--danger); border-color: var(--danger); }
.stamp.void { color: #888; border-color: #888; }

/* ---------- Dashboard extras ---------- */
.hero {
  border-radius: 24px; padding: 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--brand-deep), var(--brand) 55%, var(--brand-2));
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 24px 50px -24px var(--brand-deep);
}
.hero h2 { font-size: 24px; }
.hero p { margin: 6px 0 0; opacity: .9; }
.hero .sparkle { position: absolute; font-size: 90px; opacity: .12; right: 30px; top: -10px; animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(8deg); } }
.hero .btn { border: 0; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick button {
  padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font: inherit;
  color: var(--ink); cursor: pointer; text-align: left; transition: transform .2s, box-shadow .2s;
}
.quick button:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick i { font-size: 22px; color: var(--brand); display: block; margin-bottom: 8px; }
.quick b { font-size: 14px; }

.pdf-note { font-size: 12px; color: var(--muted); }
.loading { height: 200px; display: grid; place-items: center; }
.loading::after { content: ''; width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Print ---------- */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area), .no-print { display: none !important; }
  body.printing #print-area { display: block; }
  #print-area .receipt { box-shadow: none; max-width: 100%; animation: none; }
  @page { margin: 10mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-2, .bill-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; height: 100dvh;
    transform: translateX(-102%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
    box-shadow: 20px 0 50px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 35; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 16px; }
  .page-title { font-size: 19px; }
  .chip { display: none; }
  .view { padding: 16px 16px 110px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; border-radius: 22px;
    background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px);
    border: 1px solid var(--line); box-shadow: 0 16px 40px -14px rgba(0,0,0,.45);
  }
  .bottom-nav button {
    border: 0; background: transparent; font: inherit; font-size: 11px; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 16px; cursor: pointer;
    transition: color .2s, background .2s;
  }
  .bottom-nav button i { font-size: 19px; transition: transform .3s cubic-bezier(.2,1.4,.4,1); }
  .bottom-nav button.active { color: var(--brand); font-weight: 700; background: var(--brand-soft); }
  .bottom-nav button.active i { transform: translateY(-2px) scale(1.12); }
  .form-grid { grid-template-columns: 1fr; }
  .bill-grid { grid-template-columns: 1fr; }
  .cart-line { grid-template-columns: 1fr 58px 80px 32px; gap: 6px; }
  .toasts { left: 12px; right: 12px; bottom: 96px; align-items: stretch; }
  .toast { max-width: none; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94vh; width: 100%; }
  .cal-date { min-width: 0; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
