/* ───────────── Qasr Laban Collabs — design tokens ───────────── */
:root {
  --brand: #000ade;
  --brand-600: #0008b8;
  --brand-700: #00068f;
  --brand-50: #eef0ff;
  --brand-100: #dde1ff;
  --navy: #0a0f6e;          /* deep brand blue: used where black used to be */
  --navy-2: #121a8f;
  --ink: #0f1235;
  --ink-2: #41456b;
  --muted: #80849f;
  --line: #e8e9f2;
  --line-2: #f1f2f8;
  --bg: #f5f6fb;
  --card: #ffffff;
  --green: #0f9d6b; --green-bg: #e6f7f0;
  --amber: #c27a00; --amber-bg: #fff4dc;
  --red: #d93848;   --red-bg: #fde9eb;
  --violet: #6b3fd6; --violet-bg: #f0eaff;
  --sky: #0a7fc2;   --sky-bg: #e3f3fc;
  --gray-bg: #eff0f5;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(11, 13, 46, .03);
  --shadow-lg: 0 12px 40px rgba(11, 13, 46, .18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.xs { width: 14px; height: 14px; }
.hidden { display: none !important; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--brand); }
.boot img { width: 140px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.97); } }

/* ───────────── shell ───────────── */
.shell { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245, 246, 251, .9); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); padding: calc(var(--safe-t) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px; }
.topbar .wordmark { height: 30px; width: auto; flex: none; order: 2; }
.topbar h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.avatar.ink { background: var(--navy); color: #fff; }

main.page { padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1100px; margin: 0 auto; }

.bottomnav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: stretch; }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.bottomnav a.on { color: var(--brand); }
.bottomnav a.on svg { stroke-width: 2.4; }
.bottomnav .fab-slot { flex: 1; display: grid; place-items: center; }
.fab { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 5px #fff, 0 8px 20px rgba(0, 10, 222, .28); transform: translateY(-14px); transition: transform .15s; }
.fab:active { transform: translateY(-12px) scale(.96); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }

.sidebar { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 260px 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--brand); color: #fff; padding: 26px 16px; gap: 4px; }
  .sidebar .brand { padding: 0 10px 22px; }
  .sidebar .brand img { width: 120px; }
  .sidebar a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: rgba(255, 255, 255, .78); font-weight: 600; }
  .sidebar a.nav:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .sidebar a.nav.on { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #fff; }
  .sidebar .new-btn { margin: 4px 0 14px; background: #fff; color: var(--brand); justify-content: center; }
  .sidebar .grow { flex: 1; }
  .sidebar .me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); color: #fff; }
  .sidebar .me .avatar { background: #fff; }
  .sidebar .me small { display: block; color: rgba(255, 255, 255, .7); font-size: 12px; text-transform: capitalize; }
  .bottomnav { display: none; }
  .topbar { padding: 22px 32px 14px; }
  .topbar .wordmark { display: none; }
  .topbar h1 { font-size: 26px; }
  main.page { padding: 4px 32px 48px; }
}

/* ───────────── primitives ───────────── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.section { margin-top: 22px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 10px; }
.section-h h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.section-h a, .section-h button.link { font-size: 13px; font-weight: 600; color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 15px; background: var(--brand); color: #fff; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--brand-600); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--brand-50); color: var(--brand); }
.btn.ghost:hover { background: var(--brand-100); }
.btn.light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.light:hover { background: var(--line-2); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.green { background: var(--green); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); background: #fff; box-shadow: inset 0 0 0 1px var(--line); flex: none; }
.icon-btn:hover { background: var(--line-2); }
.icon-btn.plain { background: transparent; box-shadow: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-bg); color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.brand { background: var(--brand-50); color: var(--brand); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.sky { background: var(--sky-bg); color: var(--sky); }
.pill.solid { background: var(--brand); color: #fff; }
.pill.paid { background: #fff1d6; color: #9a5b00; }

/* chips / segmented */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 36px; padding: 0 14px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex: none; }
.chip.on { background: var(--navy); color: #fff; box-shadow: none; }
.chip .count { font-size: 11px; opacity: .7; }
.seg { display: flex; background: var(--line-2); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 38px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(11, 13, 46, .1); }

/* forms */
.field { display: block; }
.field + .field, .field + .grid2, .grid2 + .field, .grid2 + .grid2 { margin-top: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 2px 6px; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 48px; border-radius: 13px; border: 1px solid var(--line); background: #fff; padding: 0 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237a7e9e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > .field + .field { margin-top: 0; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 42px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.toggle-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle-chips button { height: 38px; padding: 0 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; }
.toggle-chips button.on { background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }

/* ───────────── date strip ───────────── */
.datestrip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x proximity; }
.datestrip::-webkit-scrollbar { display: none; }
.day { flex: none; width: 54px; height: 72px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; scroll-snap-align: center; position: relative; }
.day .dw { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day .dn { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.day .dots { height: 6px; display: flex; gap: 3px; margin-top: 2px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.day.today .dw { color: var(--brand); }
.day.on { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(0, 10, 222, .22); }
.day.on .dw { color: rgba(255, 255, 255, .8); }
.day.on .dots i { background: #fff; }
@media (min-width: 960px) { .datestrip { margin: 0; padding-left: 2px; padding-right: 2px; } }

/* ───────────── collab card ───────────── */
.collab { display: flex; gap: 14px; min-width: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 14px 14px; text-align: left; width: 100%; transition: box-shadow .15s, transform .1s; }
.collab:active { transform: scale(.995); }
.collab:hover { box-shadow: 0 0 0 1px var(--brand-100), 0 6px 20px rgba(10, 15, 110, .06); }
.collab + .collab { margin-top: 10px; }
.collab.cancelled, .collab.no_show { opacity: .55; }
.collab .c-time { flex: none; width: 54px; padding-right: 12px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: flex-start; }
.collab .c-time b { font-size: 16px; font-weight: 700; color: var(--brand); letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.collab .c-time span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.collab .c-time.none b { color: var(--muted); }
.collab .c-body { flex: 1; min-width: 0; }
.collab .c-head { display: flex; align-items: flex-start; gap: 8px; }
.collab .c-name { flex: 1; min-width: 0; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collab .c-sub { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collab .c-prod { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.collab .c-prod.warn { color: var(--amber); }
.collab .c-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.collab .c-type { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.collab .c-type.paid { color: #9a5b00; }

.grid-cards { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.grid-cards .collab + .collab { margin-top: 0; }
@media (min-width: 720px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.date-h { display: flex; align-items: baseline; gap: 8px; margin: 22px 2px 10px; }
.date-h:first-child { margin-top: 6px; }
.date-h b { font-size: 15px; font-weight: 700; }
.date-h span { font-size: 13px; color: var(--muted); font-weight: 600; }

/* ───────────── hero / stats ───────────── */
.hero { background: var(--brand); color: #fff; border-radius: 22px; padding: 22px 20px 20px; position: relative; overflow: hidden; }
.hero .greet { font-size: 13px; font-weight: 600; opacity: .75; letter-spacing: .01em; }
.hero .big { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin: 4px 0 20px; line-height: 1.12; position: relative; }
.hero .hstats { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; z-index: 1; border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 14px; }
.hero .hstat { padding: 0 12px; border-left: 1px solid rgba(255, 255, 255, .16); }
.hero .hstat:first-child { padding-left: 0; border-left: 0; }
.hero .hstat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hero .hstat span { font-size: 12px; font-weight: 500; opacity: .72; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat.accent { background: var(--navy); color: #fff; box-shadow: none; }
.stat.accent .k, .stat.accent .s { color: rgba(255, 255, 255, .65); }

.attn { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2px 16px; }
.attn a { display: flex; align-items: center; gap: 12px; padding: 13px 0; color: var(--ink); font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.attn a:last-child { border-bottom: 0; }
.attn .n { min-width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--amber-bg); color: var(--amber); }
.attn .n.brand { background: var(--brand-50); color: var(--brand); }
.attn svg { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.alert { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--amber-bg); color: #7a4d00; font-weight: 600; font-size: 14px; }
.alert + .alert { margin-top: 10px; }
.alert.brand { background: var(--brand-50); color: var(--brand-700); }
.alert .grow { min-width: 0; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .lbl { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 10px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 6px; background: var(--brand); }
.bar-row .val { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.vbars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.vbars .vb { flex: 1; min-width: 4px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.vbars .vb i { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--brand); min-height: 3px; }
.vbars .vb:hover i { background: var(--brand-600); }
.vbars .vb.zero i { background: var(--line); }
.vbars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.stackbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 800; border-top: 1px solid var(--line); }

/* list items */
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; }
.li:last-child { border-bottom: 0; }
.li .t1 { font-weight: 600; }
.li .t2 { font-size: 13px; color: var(--muted); font-weight: 500; }
.list-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 16px; }
.list-card + .list-card { margin-top: 12px; }
.cat-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; color: var(--muted); margin: 20px 4px 8px; display: flex; justify-content: space-between; }

/* empty */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; border-radius: 22px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty .ico svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 4px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

/* ───────────── sheet (bottom sheet on mobile, modal on desktop) ───────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(11, 13, 46, .42); opacity: 0; transition: opacity .22s; }
.sheet { position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 94dvh; background: var(--bg); border-radius: 26px 26px 0 0; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow-lg); }
.sheet.open { transform: none; }
.sheet-backdrop.open { opacity: 1; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #d4d6e4; margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; flex: 1; min-width: 0; }
.sheet-body { overflow-y: auto; padding: 0 16px 20px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; display: flex; gap: 10px; flex: none; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(620px, calc(100vw - 48px)); max-height: 88dvh; border-radius: 24px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.wide { width: min(860px, calc(100vw - 48px)); }
  .sheet .grab { display: none; }
  .sheet-head { padding-top: 18px; }
  .sheet-foot { border-radius: 0 0 24px 24px; }
}

/* detail */
.d-hero { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; gap: 14px; align-items: center; }
.d-hero .grow b { display: block; font-size: 17px; font-weight: 700; }
.d-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 4px; }
.d-name { font-size: 22px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.d-sub { color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 2px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2px 16px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 6px; font-weight: 700; }
.prow { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.prow:last-child { border-bottom: 0; }
.prow > span:first-child { color: var(--muted); font-weight: 500; flex: none; }
.prow > b, .prow > span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.prow.stacked { flex-direction: column; gap: 4px; }
.prow.stacked > span:last-child { text-align: left; font-weight: 500; white-space: pre-wrap; }
.status-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.status-row::-webkit-scrollbar { display: none; }
.status-row button { flex: none; height: 34px; padding: 0 13px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.status-row button.on { background: var(--brand); color: #fff; box-shadow: none; }
details.history { padding: 0 2px; }
details.history summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 0; }
details.history summary::-webkit-details-marker { display: none; }
.timeline { font-size: 13px; }
.timeline .ev { display: flex; gap: 10px; padding: 7px 0; }
.timeline .ev i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-top: 7px; flex: none; }
.timeline .ev b { font-weight: 600; }

/* product picker */
.pp-cat { margin-top: 16px; }
.pp-cat h4 { margin: 0 4px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; display: flex; justify-content: space-between; }
.pp-item { display: flex; align-items: center; gap: 10px; background: #fff; padding: 10px 10px 10px 14px; border-radius: 14px; box-shadow: var(--shadow); }
.pp-item + .pp-item { margin-top: 6px; }
.pp-item.sel { box-shadow: inset 0 0 0 1.5px var(--brand), var(--shadow); }
.pp-item .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.pp-item .pr { font-size: 12px; color: var(--muted); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--line-2); border-radius: 11px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--ink-2); }
.stepper button:hover { background: #fff; }
.stepper b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.pp-item:not(.sel) .stepper .minus, .pp-item:not(.sel) .stepper b { display: none; }
.pp-item:not(.sel) .stepper { background: var(--brand-50); }
.pp-item:not(.sel) .stepper .plus { color: var(--brand); }
.pp-sum { position: sticky; bottom: 0; }

.subcard { background: #fff; border-radius: 16px; padding: 14px; box-shadow: inset 0 0 0 1px var(--line); margin-top: 10px; }

/* toast */
#toast-root { position: fixed; z-index: 80; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; animation: tin .25s ease; max-width: 480px; }
.toast.err { background: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
@media (min-width: 960px) { #toast-root { bottom: 24px; } }

/* ───────────── login ───────────── */
/* Phones: brand panel on top, form below. Desktop: brand panel left, form right. */
.login { min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.login-brand { background: var(--brand); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(var(--safe-t) + 36px) 24px 40px; }
.login-brand .badge { width: 168px; height: auto; }
.login-copy h1 { margin: 6px 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.login-copy p { margin: 0 auto; max-width: 300px; font-size: 14px; line-height: 1.5; opacity: .78; }
.login form { flex: 1; background: #fff; color: var(--ink); padding: 32px 24px calc(32px + var(--safe-b)); width: 100%; max-width: 440px; margin: 0 auto; }
.login form h2 { margin: 0 0 6px; font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.login-sub { margin: 0 0 26px; color: var(--muted); font-size: 15px; }
.login form .field > span { color: var(--ink-2); }
.login form .input { height: 52px; background: var(--bg); border-color: transparent; }
.login form .input:focus { background: #fff; border-color: var(--brand); }
.login form .btn { height: 52px; font-size: 16px; }
.login form .err { color: var(--red); font-weight: 600; font-size: 14px; min-height: 20px; margin: 12px 2px 0; }
.login-help { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
@media (min-width: 900px) {
  .login { flex-direction: row; }
  .login-brand { flex: 0 0 46%; padding: 48px; }
  .login-brand .badge { width: 260px; }
  .login-copy h1 { font-size: 28px; margin-top: 10px; }
  .login-copy p { font-size: 16px; max-width: 360px; }
  .login form { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: none; padding: 48px max(48px, calc((54vw - 400px) / 2)); }
  .login form > * { width: 100%; max-width: 400px; }
}

/* share page */
.share-head { background: var(--brand); color: #fff; padding: calc(var(--safe-t) + 18px) 16px 22px; border-radius: 0 0 26px 26px; }
.share-head img { width: 96px; }
.share-head h1 { margin: 14px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.share-head p { margin: 0; opacity: .8; font-weight: 600; font-size: 14px; }
.share-main { padding: 16px 16px 40px; max-width: 760px; margin: 0 auto; }

/* menu images */
.menu-imgs { display: grid; gap: 12px; }
@media (min-width: 720px) { .menu-imgs { grid-template-columns: 1fr 1fr; } }
.menu-imgs img { border-radius: 16px; }

/* ───────────── print (reports → PDF) ───────────── */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .bottomnav, .topbar, .no-print, #toast-root, #sheet-root { display: none !important; }
  .shell { display: block; }
  main.page { padding: 0; max-width: none; }
  .print-only { display: block; }
  .card, .stat, .list-card { box-shadow: none; border: 1px solid #e3e4ee; break-inside: avoid; }
  .stat.accent { background: #fff; color: var(--ink); }
  .stat.accent .k, .stat.accent .s { color: var(--muted); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .section { break-inside: avoid-page; }
  .print-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
  .print-head img { width: 90px; }
  .print-sheet { break-after: page; }
  .print-sheet:last-child { break-after: auto; }
  .ps-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
  .print-sheet table.t { font-size: 12px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* name suggestions appear while typing; hide the browser dropdown arrow */
input[list]::-webkit-calendar-picker-indicator { display: none !important; }
