:root {
  --bg: #FBF7EF;
  --bg-2: #F5EEDF;
  --card: #FFFFFF;
  --gold: #C29A3F;
  --gold-deep: #9C7524;
  --gold-soft: #F7EDD3;
  --gold-line: #EBDDB8;
  --brown: #3A2A1C;
  --brown-2: #5E4A37;
  --muted: #8B7763;
  --line: #EFE6D4;
  --grey: #5F5B55; --grey-bg: #EFEDE9;
  --blue: #2C5C9A; --blue-bg: #E4EDF9;
  --green: #2B7A4B; --green-bg: #E2F3E8;
  --red: #B23A2E; --red-bg: #FBE6E2;
  --amber: #A9661B; --amber-bg: #FCEFD9;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(58, 42, 28, .04), 0 6px 20px rgba(58, 42, 28, .06);
  --shadow-lift: 0 2px 4px rgba(58, 42, 28, .05), 0 12px 28px rgba(58, 42, 28, .10);
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: Montserrat, Inter, system-ui, sans-serif;
  --tabbar-h: 68px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--brown); font: 16px/1.5 var(--sans); font-variant-numeric: tabular-nums lining-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5rem; color: var(--brown); }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
h2 .i { width: 20px; height: 20px; color: var(--gold); }
h3 { font-size: 1rem; }
a { color: var(--brown); }
p { margin: 0 0 .6rem; }
.i { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid #E3C77A; outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden-label { display: none; }

/* ---------- brand */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(140deg, #E7C977, #C29A3F); color: #fff; display: grid; place-items: center; font-size: 1.05rem; box-shadow: 0 3px 10px rgba(194, 154, 63, .35); flex: 0 0 auto; }
.brand-name { display: block; font-family: Cinzel, Georgia, serif; font-weight: 700; color: var(--brown); letter-spacing: .08em; font-size: .92rem; line-height: 1.1; }
.brand-sub { display: block; font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; color: var(--gold-deep); font-size: 1rem; line-height: 1.1; }

/* ---------- top bar (phone) */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(251, 247, 239, .9); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.top-right { display: flex; align-items: center; gap: 10px; }
.whoami { font-size: .82rem; color: var(--muted); text-align: right; }
.whoami:empty { display: none; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--gold-deep); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

.demo-pill { position: relative; }
.demo-pill summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.demo-pill summary::-webkit-details-marker { display: none; }
.demo-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #E3B53F; }
.demo-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-lift); font-size: .86rem; color: var(--brown-2); z-index: 30; }

/* ---------- sidebar (desktop) */
.sidebar { display: none; }
.main-col { min-width: 0; }

/* ---------- bottom tab bar (phone) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(6, 1fr); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(58, 42, 28, .05); }
.tabbar[hidden] { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 14px; }
.tabbar a .ico { display: grid; place-items: center; width: 46px; height: 30px; border-radius: 999px; transition: background .15s; }
.tabbar a .i { width: 23px; height: 23px; }
.tabbar a.active { color: var(--brown); }
.tabbar a.active .ico { background: var(--gold-soft); color: var(--gold-deep); }
body.has-nav .wrap { padding-bottom: calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom)); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 8px 16px 48px; }
.wrap:focus { outline: none; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; background: var(--gold); color: #fff; font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(194, 154, 63, .28); transition: transform .08s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: #B48C33; }
.btn:active { transform: scale(.98); }
.btn .i { width: 19px; height: 19px; }
.btn.small { min-height: 42px; padding: 0 14px; font-size: .88rem; border-radius: 12px; }
.btn.secondary { background: var(--card); color: var(--brown); border-color: var(--gold-line); box-shadow: none; }
.btn.secondary:hover { background: var(--gold-soft); }
.btn.ghost { background: transparent; color: var(--brown-2); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.dark { background: var(--brown); box-shadow: 0 2px 8px rgba(58, 42, 28, .22); }
.btn.dark:hover { background: #4b3726; }
.btn.danger-ghost { background: transparent; color: var(--red); border-color: #F0CFC9; box-shadow: none; }
.btn.danger-ghost:hover { background: var(--red-bg); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- headings */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.page-head h1 { margin: 0; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub .i { width: 17px; height: 17px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 10px -4px; padding: 8px 6px; color: var(--gold-deep); font-weight: 600; text-decoration: none; font-size: .95rem; min-height: 44px; }
.back .i { width: 20px; height: 20px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); font-size: .8rem; font-weight: 700; }

/* ---------- greeting + hero cards */
.greet { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 8px 0 18px; }
.greet h1 { font-size: 1.75rem; margin: 0; }
.greet-date { margin: 0 0 2px; color: var(--gold-deep); font-weight: 600; font-size: .85rem; letter-spacing: .02em; }
.heroes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.hero { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--brown); min-height: 138px; overflow: hidden; transition: transform .12s, box-shadow .15s; }
.hero:hover { box-shadow: var(--shadow-lift); }
.hero:active { transform: scale(.985); }
.hero-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; margin-bottom: 8px; }
.hero-ico .i { width: 21px; height: 21px; }
.hero .label { font-size: .84rem; font-weight: 600; color: var(--brown-2); }
.hero .value { font-family: var(--sans); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero .hint { font-size: .78rem; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.h-gold { background: linear-gradient(150deg, #FFF8E6 0%, #FFFFFF 70%); }
.h-gold .hero-ico { background: var(--gold-soft); color: var(--gold-deep); }
.h-amber .hero-ico { background: var(--amber-bg); color: var(--amber); }
.h-blue .hero-ico { background: var(--blue-bg); color: var(--blue); }
.h-green .hero-ico { background: var(--green-bg); color: var(--green); }
.show-sm { }
.hide-sm { display: none; }

.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 14px; }
.mini { background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.mini .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.mini .value { font-size: 1.18rem; font-weight: 700; }
.mini .hint { font-size: .74rem; color: var(--muted); }
.export-row .btn { flex: 1 1 220px; }

.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini-row { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.mini-row-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.mini-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-row .amt { text-align: right; font-weight: 700; display: flex; flex-direction: column; }
.mini-row .btn { width: 100%; }

/* ---------- cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.flush { padding: 6px; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; font-size: .9rem; color: var(--brown-2); }
.notice .i { color: var(--gold-deep); margin-top: 1px; }
.notice.soft { background: #FFF9EC; border: 1px solid var(--gold-line); }
.notice.warn { background: var(--red-bg); color: var(--red); }
.help { color: var(--muted); font-size: .85rem; margin: 6px 0 10px; }
.help .i { width: 16px; height: 16px; }

.empty { text-align: center; padding: 22px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; background: var(--gold-soft); color: var(--gold-deep); margin-bottom: 8px; }
.empty-ico .i { width: 28px; height: 28px; }
.empty-title { font-family: var(--head); font-weight: 700; font-size: 1.05rem; margin: 0; }
.empty .muted { max-width: 30ch; font-size: .9rem; margin: 0 0 10px; }

/* ---------- pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--grey-bg); color: var(--grey); line-height: 1.3; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.inquiry { background: var(--grey-bg); color: var(--grey); }
.pill.confirmed { background: var(--blue-bg); color: var(--blue); }
.pill.completed { background: var(--green-bg); color: var(--green); }
.pill.cancelled { background: var(--red-bg); color: var(--red); }
.pill.collected { background: var(--gold-soft); color: var(--gold-deep); }
.pill.notcollected { background: var(--amber-bg); color: var(--amber); }
.pill.pay-eligible { background: var(--amber-bg); color: var(--amber); }
.pill.pay-paid { background: var(--green-bg); color: var(--green); }
.pill.pay-unpaid { background: var(--grey-bg); color: var(--grey); }
.pill.n-simulated, .pill.n-queued { background: var(--grey-bg); color: var(--grey); }
.pill.n-sent { background: var(--green-bg); color: var(--green); }
.pill.n-failed { background: var(--red-bg); color: var(--red); }

/* ---------- avatars */
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--sans); font-weight: 700; font-size: .9rem; color: #4A3826; flex: 0 0 auto; letter-spacing: .02em; }
.avatar.xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar.sm { width: 36px; height: 36px; font-size: .8rem; }
.avatar.lg { width: 50px; height: 50px; font-size: 1.05rem; }
.avatar.xl { width: 68px; height: 68px; font-size: 1.4rem; }

/* ---------- search + chips */
.search { position: relative; margin-bottom: 12px; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 44px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--brown-2); font: 600 .88rem var(--sans); cursor: pointer; }
.chip .n { font-size: .74rem; color: var(--muted); background: var(--bg-2); padding: 1px 7px; border-radius: 999px; }
.chip.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.chip.on .n { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------- booking cards */
.bk-cards { display: flex; flex-direction: column; gap: 12px; }
.bk-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-left: 4px solid var(--grey-bg); }
.bk-card.st-confirmed { border-left-color: #A9C2E6; }
.bk-card.st-completed { border-left-color: #9ED0B0; }
.bk-card.st-cancelled { border-left-color: #EDB3AA; opacity: .85; }
.bk-card.st-inquiry { border-left-color: #D6D2CA; }
.bk-link { display: block; padding: 14px 14px 10px; text-decoration: none; color: inherit; }
.bk-top { display: flex; align-items: flex-start; gap: 12px; }
.bk-date { flex: 0 0 auto; width: 48px; height: 52px; border-radius: 13px; background: var(--gold-soft); color: var(--gold-deep); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.bk-date .m { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bk-date .d { font-size: 1.3rem; font-weight: 700; color: var(--brown); margin-top: 3px; }
.bk-main { flex: 1; min-width: 0; }
.bk-main h3 { margin: 2px 0 2px; font-size: 1.02rem; overflow-wrap: anywhere; }
.bk-sub { margin: 0; color: var(--muted); font-size: .82rem; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 2px; font-size: .86rem; color: var(--brown-2); }
.bk-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bk-meta .i { width: 17px; height: 17px; color: var(--gold); }
.bk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 14px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.bk-amt { display: flex; flex-direction: column; font-weight: 700; font-size: 1.05rem; }
.bk-amt .k { font-size: .72rem; font-weight: 600; color: var(--muted); }
.bk-amt.muted-amt { color: var(--brown-2); }
.all-done { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: .9rem; }
.all-done .i { width: 18px; height: 18px; }

/* ---------- progress tracker */
.tracker { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: 12px 0 2px; padding: 0; }
.tracker li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.tracker li::before { content: ''; position: absolute; top: 10px; left: calc(-50% + 12px); right: calc(50% + 12px); height: 3px; border-radius: 3px; background: var(--line); }
.tracker li:first-child::before { display: none; }
.tracker li.done::before { background: #D9BC6E; }
.tracker .dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.tracker .dot .i { width: 13px; height: 13px; stroke-width: 3; }
.tracker li.done .dot { background: var(--gold); border-color: var(--gold); }
.tracker li.current .dot { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(194, 154, 63, .18); }
.tracker .lbl { font-size: .68rem; font-weight: 600; color: var(--muted); }
.tracker li.done .lbl { color: var(--brown-2); }
.tracker li.current .lbl { color: var(--gold-deep); }
.tracker.big { margin-top: 18px; }
.tracker.big .dot { width: 28px; height: 28px; }
.tracker.big li::before { top: 13px; left: calc(-50% + 15px); right: calc(50% + 15px); }
.tracker.big .dot .i { width: 16px; height: 16px; }
.tracker.big .lbl { font-size: .7rem; letter-spacing: -.01em; }
.tracker.cancelled { display: flex; align-items: center; gap: 8px; color: var(--red); font-size: .85rem; font-weight: 600; background: var(--red-bg); border-radius: 12px; padding: 8px 12px; margin: 12px 0 2px; }
.tracker.cancelled .i { width: 17px; height: 17px; }

/* ---------- desktop table */
.tbl-card { display: none; padding: 6px 6px 2px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FFFBF1; }
.tbl .num { text-align: right; font-weight: 600; white-space: nowrap; }
.tbl .nowrap { white-space: nowrap; }
.tbl-link { font-weight: 600; text-decoration: none; }
.tbl-link:hover { color: var(--gold-deep); text-decoration: underline; }
.tbl .avatar { vertical-align: middle; margin-right: 4px; }
.mini-prog { display: inline-flex; gap: 3px; }
.mini-prog i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.mini-prog i.on { background: var(--gold); }

/* ---------- detail */
.detail-hero h1 { font-size: 1.4rem; margin: 0; overflow-wrap: anywhere; }
.dh-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dh-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.meta-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 999px; padding: 5px 12px 5px 8px; font-size: .86rem; color: var(--brown-2); text-decoration: none; }
.meta-chip .i { width: 17px; height: 17px; color: var(--gold); }
.next-card { background: linear-gradient(160deg, #FFF8E6, #FFFFFF 75%); border: 1px solid var(--gold-line); }
.next-card .help { margin-top: -2px; }
.two-col { display: grid; gap: 0 18px; }
.split .line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.split .line:last-child { border-bottom: 0; }
.split .line .k { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.split .line .v { font-weight: 600; white-space: nowrap; }
.split .line.total { font-weight: 700; }
.split .line.total .v { font-size: 1.05rem; }
.split .line.gold { background: var(--gold-soft); margin: 6px -10px 0; padding: 12px 10px; border-radius: 12px; border: 0; }
.split .line.gold .v { color: var(--gold-deep); }
.stamp { text-align: center; }
.hist-card summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; min-height: 30px; }
.hist-card summary::-webkit-details-marker { display: none; }
.hist-card summary h2 { margin: 0; }
.chev { color: var(--muted); transition: transform .15s; }
details[open] > summary .chev { transform: rotate(90deg); }
.collect-flash, form.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(194, 154, 63, .55), var(--shadow); } 100% { box-shadow: 0 0 0 0 rgba(194, 154, 63, 0), var(--shadow); } }

/* ---------- payouts */
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-top { display: flex; gap: 12px; align-items: center; }
.pay-top .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-top .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pay-note { margin: 6px 0 0 48px; }
.ev-link { text-decoration: none; }
.ev-link:hover { text-decoration: underline; }
.pay-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0 48px; padding: 10px; background: var(--bg); border-radius: 14px; }
.pay-form label { font-size: .82rem; font-weight: 600; color: var(--brown-2); }
.pay-form input { width: auto; flex: 1 1 140px; min-height: 42px; }
.pay-form .btn { flex: 1 1 140px; }
.total-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.total-head h2 { margin: 0; }
.amount { font-weight: 700; white-space: nowrap; }
.amount.big { font-size: 1.35rem; }
.chips.seg { margin-bottom: 8px; }

/* ---------- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; text-decoration: none; color: inherit; border-radius: 12px; min-height: 56px; }
a.row:hover { background: #FFFBF1; }
.row.selected { background: var(--gold-soft); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--bg); color: var(--gold-deep); flex: 0 0 auto; }
.row-ico .i { width: 19px; height: 19px; }
.row-ico.s-paid, .row-ico.s-eligible { background: var(--green-bg); color: var(--green); }
.row-ico.s-cancelled { background: var(--red-bg); color: var(--red); }
.row-ico.s-confirmed { background: var(--blue-bg); color: var(--blue); }
.title { font-weight: 600; }
.meta { color: var(--muted); font-size: .82rem; }
.hist-row { display: flex; gap: 12px; padding: 12px 4px; }
.hist-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-top: 7px; flex: 0 0 auto; box-shadow: 0 0 0 4px var(--gold-soft); }
.audit-changes { font-size: .84rem; color: var(--brown-2); margin-top: 3px; overflow-wrap: anywhere; }

/* ---------- agents */
.ag-grid { display: grid; gap: 12px; margin-top: 12px; }
.ag-card { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.ag-card:hover { box-shadow: var(--shadow-lift); }
.ag-card.inactive { opacity: .65; }
.ag-top { display: flex; align-items: center; gap: 12px; }
.ag-name { flex: 1; min-width: 0; }
.ag-name h3 { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ag-name .meta { margin: 0; }
.ag-name strong { color: var(--brown-2); }
.ag-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.ag-stats > div { background: var(--bg); border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; }
.ag-stats .v { font-weight: 700; font-size: 1rem; }
.ag-stats .k { font-size: .72rem; color: var(--muted); font-weight: 600; }
.ag-stats .owed { background: var(--amber-bg); }
.ag-stats .owed .v { color: var(--amber); }
.ag-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.chan { display: inline-flex; gap: 6px; color: var(--gold-deep); }
.chan .i { width: 19px; height: 19px; }
.ag-hero { display: flex; align-items: center; gap: 16px; }
.ag-hero h1 { margin: 0; }
.minis.four { margin-top: 0; }

/* ---------- forms */
.form-card h2 { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl-spacer { font-size: .86rem; font-weight: 600; color: var(--brown-2); }
.lbl-spacer { display: none; }
input, select, textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #FFFEFB; font: 400 1rem var(--sans); color: var(--brown); font-variant-numeric: tabular-nums lining-nums; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(194, 154, 63, .18); }
input:disabled, select:disabled { background: var(--bg-2); color: var(--muted); }
select { appearance: none; -webkit-appearance: none; 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='%239C7524' stroke-width='2' stroke-linecap='round' stroke-linejoin='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 { min-height: 96px; resize: vertical; }
input[type="date"] { -webkit-appearance: none; appearance: none; }
.check { display: flex; align-items: center; gap: 12px; font-size: .95rem; cursor: pointer; min-height: 48px; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--gold); flex: 0 0 auto; }
.toggle input { appearance: none; -webkit-appearance: none; position: relative; width: 46px; height: 28px; border-radius: 999px; background: #E3DACA; border: 0; padding: 0; transition: background .15s; cursor: pointer; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.toggle input:checked { background: var(--gold); }
.toggle input:checked::after { transform: translateX(18px); }
.toggle input:disabled { opacity: .5; }
.toggles { gap: 2px; }
.calc { background: var(--bg); border-radius: 16px; padding: 14px; margin-top: 4px; }
.calc h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.calc h3 .i { color: var(--gold); width: 19px; height: 19px; }
.calc .split .line.gold { margin: 6px -6px 0; padding: 10px 6px; background: #fff; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); background: rgba(251, 247, 239, .94); backdrop-filter: blur(8px); padding: 10px 0; z-index: 5; }
.sticky-actions .btn { flex: 1; }
.filter-box { padding: 0; }
.filter-box summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; min-height: 52px; }
.filter-box summary::-webkit-details-marker { display: none; }
.filter-box summary > span { flex: 1; }
.filter-box summary .i:first-child { color: var(--gold); }
.filter-box .count { font-size: .76rem; background: var(--gold-soft); color: var(--gold-deep); padding: 2px 8px; border-radius: 999px; margin-left: 4px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 0 16px 8px; }

/* ---------- updates */
.updates .upd-preview { order: -1; }
.preview-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.subject { margin: 0 0 10px; font-weight: 600; font-size: .93rem; }
.subject .muted { font-weight: 500; margin-right: 6px; }
.sms-bubble { background: #E9E9EB; color: #111; padding: 12px 15px; border-radius: 20px 20px 20px 6px; max-width: 320px; font-size: .95rem; line-height: 1.4; }

/* ---------- more */
.more-list { display: flex; flex-direction: column; }
.more-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; min-height: 64px; text-decoration: none; color: inherit; border: 0; background: none; font: inherit; text-align: left; width: 100%; cursor: pointer; border-radius: 14px; }
.more-item + .more-item { border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.more-item:hover { background: #FFFBF1; }
.more-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--gold-soft); color: var(--gold-deep); flex: 0 0 auto; }
.more-item .main { flex: 1; display: flex; flex-direction: column; }

/* ---------- login */
.login { max-width: 420px; margin: 40px auto; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

/* ---------- toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; background: var(--brown); color: #fff; padding: 12px 18px 12px 14px; border-radius: 16px; font-weight: 600; font-size: .94rem; box-shadow: 0 10px 30px rgba(58, 42, 28, .3); width: max-content; max-width: calc(100vw - 32px); animation: pop .22s ease-out; }
.toast .i { width: 22px; height: 22px; background: #5FB27E; border-radius: 50%; padding: 3px; stroke-width: 3; color: #fff; }
.toast.error { background: var(--red); }
.toast.error .i { background: rgba(255, 255, 255, .2); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- tablet / desktop */
@media (min-width: 640px) {
  .heroes { grid-template-columns: repeat(4, 1fr); }
  .minis { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .full { grid-column: 1 / -1; }
  .lbl-spacer { display: block; }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .ag-grid { grid-template-columns: 1fr 1fr; }
  .mini-row { flex-direction: row; align-items: center; }
  .mini-row-link { flex: 1; min-width: 0; }
  .mini-row .btn { width: auto; }
  .hide-sm { display: inline-flex; }
  .show-sm { display: none !important; }
  .sticky-actions .btn { flex: 0 0 auto; }
}
@media (min-width: 1000px) {
  body.has-nav .sidebar { display: flex; flex-direction: column; gap: 8px; position: fixed; inset: 0 auto 0 0; width: 256px; padding: 24px 16px; background: var(--card); border-right: 1px solid var(--line); z-index: 20; }
  body.has-nav .main-col { margin-left: 256px; }
  body.has-nav .tabbar { display: none; }
  body.has-nav .brand-mobile { visibility: hidden; }
  body.has-nav .wrap { padding: 8px 32px 60px; }
  .topbar { padding: 14px 32px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; }
  .sidebar .brand { padding: 0 8px 20px; }
  .side-links { display: flex; flex-direction: column; gap: 4px; }
  .side-links a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: var(--brown-2); font-weight: 600; font-size: .95rem; }
  .side-links a .ico { display: grid; color: var(--muted); }
  .side-links a:hover { background: var(--bg); }
  .side-links a.active { background: var(--gold-soft); color: var(--brown); }
  .side-links a.active .ico { color: var(--gold-deep); }
  .side-cta { margin-top: 16px; }
  .toast { bottom: 28px; left: calc(50% + 128px); }
  .sticky-actions { bottom: 0; }
  .bk-cards { display: none; }
  .tbl-card { display: block; }
  .two-col { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .updates.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .updates .upd-preview { order: 0; position: sticky; top: 20px; }
  .ag-grid { grid-template-columns: repeat(3, 1fr); }
  .greet h1 { font-size: 2rem; }
  .hero .value { font-size: 1.9rem; }
  .hero { padding: 20px; min-height: 160px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- entertainers (several per booking, each pays its own commission) ---------- */
.pill.ln-paid { background: var(--green-bg); color: var(--green); }
.pill.ln-partly { background: var(--amber-bg); color: var(--amber); }
.pill.ln-notpaid { background: var(--red-bg); color: var(--red); }
.pill.partcollected { background: var(--amber-bg); color: var(--amber); }
.paid-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.bk-meta .paid-chip .i, .paid-chip .i { width: 14px; height: 14px; }
.paid-chip.all { background: var(--green-bg); color: var(--green); }
.paid-chip.some { background: var(--amber-bg); color: var(--amber); }
.paid-chip.none { background: var(--red-bg); color: var(--red); }
.ent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ent-head h2 { margin: 0; }
.paid-count { font-weight: 700; font-size: .85rem; padding: 4px 11px; border-radius: 999px; }
.paid-count.all { background: var(--green-bg); color: var(--green); }
.paid-count.some { background: var(--amber-bg); color: var(--amber); }
.paid-count.none { background: var(--red-bg); color: var(--red); }
.ln-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ln-row { border: 1px solid var(--gold-line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 12px; background: var(--card); }
.ln-row.ln-paid { border-left-color: var(--green); }
.ln-row.ln-partly { border-left-color: var(--amber); }
.ln-row.ln-not_paid { border-left-color: var(--red); }
.ln-top { display: flex; align-items: flex-start; gap: 10px; }
.ln-top .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ln-top .title { font-weight: 700; }
.ln-top .meta { font-size: .82rem; color: var(--muted); }
.ln-note { font-style: italic; }
.ln-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-deep); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ln-ico .i { width: 18px; height: 18px; }
.ln-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ln-act > summary { list-style: none; cursor: pointer; }
.ln-act > summary::-webkit-details-marker { display: none; }
.ln-act[open] { flex-basis: 100%; }
.ln-act[open] > summary { margin-bottom: 8px; }
.ln-form { background: var(--cream, #FBF7EF); border-radius: 12px; padding: 12px; }
.ln-form .form-grid { margin-bottom: 8px; }
.ln-form.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ln-form.inline input { max-width: 140px; }
.ent-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin: 12px 0 4px; font-size: .9rem; }
.ent-total .owe { color: var(--red); font-weight: 600; }
.ent-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.link-btn { color: var(--gold-deep); font-size: .88rem; padding: 6px 0; }
.owes { display: flex; gap: 5px; align-items: flex-start; font-size: .8rem; color: var(--red); margin-top: 3px; }
.owes .i { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.owes b { font-weight: 600; }
.ent-row { display: grid; grid-template-columns: 1fr; gap: 0 10px; padding: 10px 0; border-bottom: 1px dashed var(--gold-line); position: relative; }
.ent-row .icon-btn { position: absolute; top: 6px; right: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gold-line); background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn .i { width: 16px; height: 16px; }
#ent-add-row { margin-top: 10px; }
.ln-mini { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.ln-mini li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.static-val { margin: 4px 0 0; font-weight: 600; }
.lbl { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
@media (min-width: 720px) {
  .ent-row { grid-template-columns: 2fr 1.3fr 1fr 1.1fr 40px; align-items: end; }
  .ent-row input { min-width: 0; width: 100%; }
  .ent-row .icon-btn { position: static; margin-bottom: 14px; }
}

/* ---------- Direct bookings (no agent) ---------- */
.direct-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px; background: #F1E6FA; color: #6B3E91; font-weight: 700; font-size: .78rem; line-height: 1.2; letter-spacing: .01em; white-space: nowrap; }
.direct-chip .i { width: 14px !important; height: 14px !important; color: #8A55B5 !important; fill: #E3CFF3; }
.direct-chip.meta-chip { padding: 6px 12px 6px 9px; font-size: .85rem; }
.avatar.direct-av { background: #F1E6FA; color: #8A55B5; }
.avatar.direct-av .i { width: 18px; height: 18px; fill: #E3CFF3; }
.chip.c-direct.on { background: #6B3E91; border-color: #6B3E91; color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 10px; border: 1.5px solid var(--gold-line); border-radius: 14px; background: var(--card); font-weight: 600; font-size: .92rem; text-align: center; color: var(--brown); transition: background .15s, border-color .15s; }
.seg-opt span .i { width: 18px; height: 18px; color: var(--gold); flex: 0 0 auto; }
.seg-opt input:checked + span { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(194, 154, 63, .15); }
.seg-opt input[value=direct]:checked + span { border-color: #8A55B5; background: #F1E6FA; color: #6B3E91; box-shadow: 0 0 0 3px rgba(138, 85, 181, .14); }
.seg-opt input[value=direct]:checked + span .i { color: #8A55B5; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.seg-opt input:disabled + span { opacity: .6; cursor: not-allowed; }
#src-help:empty { display: none; }
.done-banner { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--green-bg); color: var(--green); font-size: .92rem; line-height: 1.4; }
.done-banner .i { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; }
.done-banner b { color: var(--green); }

/* ---------- commission rates ---------- */
.rate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rate-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); border: 1px solid var(--gold-line); font: 700 .78rem var(--sans); white-space: nowrap; }
.rate-chip .i { width: 13px; height: 13px; }
.rate-chip.rc-rec { background: #EEF3FA; color: #2F5E93; border-color: #C9D9EE; }
.rate-tag { display: inline-block; vertical-align: 1px; padding: 0 7px; border-radius: 999px; font: 700 .68rem/1.6 var(--sans); letter-spacing: .02em; text-transform: uppercase; background: var(--bg-2); color: var(--muted); }
.rate-tag.rt-custom { background: var(--gold-soft); color: var(--gold-deep); }
.rate-tag.rt-manual { background: #F1E6FA; color: #6B3E91; }
.rate-card { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.rate-field { margin-bottom: 14px; }
.rate-in { display: flex; align-items: center; gap: 8px; margin-top: 10px; max-width: 200px; }
.rate-in input { flex: 1; font-size: 1.15rem; font-weight: 700; }
.rate-in[hidden] { display: none; }
.pct-suffix { font-weight: 700; color: var(--brown-2); font-size: 1.1rem; }
.rate-box { margin-top: 12px; display: grid; gap: 10px; }
.rate-box .help .i { width: 14px; height: 14px; vertical-align: -2px; }
.rate-update { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--gold-line); font-size: .92rem; }
.rate-update > span { display: flex; gap: 8px; align-items: flex-start; }
.rate-update > span .i { width: 18px; height: 18px; color: var(--gold-deep); flex: 0 0 auto; margin-top: 2px; }
.rate-update .btn { justify-self: start; }
.rate-note { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- reports ---------- */
.report-head { align-items: flex-start; }
.r-range { padding: 12px; }
.seg.seg4 { grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; }
.seg.seg4 .seg-opt span { min-height: 44px; font-size: .82rem; padding: 6px 4px; }
.r-custom { margin-top: 12px; }
.r-section { margin-top: 18px; }
.r-section.card { padding-bottom: 14px; }
.r-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.r-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.r-head h2 .i { width: 20px; height: 20px; color: var(--gold-deep); }
.r-head .help { margin: 4px 0 0; }
.r-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.r-card { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; }
.r-card.wide { grid-column: 1 / -1; }
.r-card .r-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--bg-2); color: var(--brown-2); margin-bottom: 4px; }
.r-card .r-ico .i { width: 19px; height: 19px; }
.r-card .label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.r-card .value { font-family: var(--sans); font-size: 1.32rem; font-weight: 800; color: var(--brown); letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; }
.r-card .value .of { font-size: .9rem; font-weight: 600; color: var(--muted); }
.r-card .hint { font-size: .76rem; color: var(--muted); }
.r-card.gold .r-ico { background: var(--gold-soft); color: var(--gold-deep); }
.r-card.green .r-ico { background: #E5F3EA; color: #2F7A4A; }
.r-card.amber .r-ico { background: #FCEFD9; color: #A9661A; }
.meter { display: block; height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin: 6px 0 2px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); border-radius: 999px; }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .bar { fill: var(--gold); }
.bar-chart .axis { stroke: var(--line); stroke-width: 1; }
.bar-chart .bar-v { font: 700 9px var(--sans); fill: var(--brown-2); text-anchor: middle; }
.bar-chart .bar-l { font: 600 10px var(--sans); fill: var(--muted); text-anchor: middle; }
.r-table-wrap { overflow-x: auto; margin: 0 -6px; -webkit-overflow-scrolling: touch; }
.r-table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums lining-nums; }
.r-table th { text-align: left; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.r-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.r-table td a { color: var(--brown); font-weight: 600; text-decoration: none; }
.r-table .n { text-align: right; white-space: nowrap; }
.r-table td.owed { color: #A9661A; font-weight: 700; }
.r-table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--gold-line); }
.r-table tr.direct-row td { background: #FAF5FD; }
.r-table .block { display: block; }
.r-sub { display: flex; align-items: center; gap: 8px; font-size: .95rem; margin: 14px 0 6px; }
.r-list .amt { font-weight: 700; white-space: nowrap; }
.print-only { display: none; }
@media (max-width: 420px) {
  .r-table { font-size: .8rem; }
  .r-table th, .r-table td { padding-left: 4px; padding-right: 4px; }
}
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .sidebar, .tabbar, .topbar, .no-print, .toast, .skip, .back { display: none !important; }
  .print-only { display: block !important; }
  .print-title { font-size: 12px; margin-bottom: 8px; color: #333; }
  .main-col, .wrap { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card, .r-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .r-section { break-inside: avoid; }
  .r-table-wrap { overflow: visible; }
  .r-cards { grid-template-columns: repeat(4, 1fr); }
  .r-card.wide { grid-column: span 2; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* phones: each table row becomes a small card (name on top, figures in a grid) */
@media (max-width: 640px) {
  .r-table-wrap { overflow: visible; margin: 0; }
  .r-table thead { display: none; }
  .r-table, .r-table tbody, .r-table tfoot { display: block; }
  .r-table tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
  .r-table td { display: flex; flex-direction: column; align-items: flex-start; padding: 0; border: 0; font-size: .9rem; }
  .r-table td.n { text-align: left; }
  .r-table td.nm { grid-column: 1 / -1; font-size: 1rem; font-weight: 700; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .r-table td.nm .block { flex-basis: 100%; font-weight: 500; }
  .r-table td[data-label]::before { content: attr(data-label); font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .r-table td.empty-cell { display: none; }
  .r-table tr.direct-row { background: #FAF5FD; border-radius: 12px; }
  .r-table tr.direct-row td { background: transparent; }
  .r-table tfoot tr { border-top: 2px solid var(--gold-line); border-bottom: 0; }
  .r-table tfoot td { border-top: 0; }
}
@media print { .r-table thead { display: table-header-group !important; } .r-table, .r-table tbody, .r-table tfoot { display: table-row-group; } .r-table { display: table !important; } .r-table tr { display: table-row !important; } .r-table td { display: table-cell !important; } .r-table td[data-label]::before { content: none !important; } }

/* ---------- clients, client payments, invoices, client updates, WhatsApp ---------- */
.pill.inv-draft { background: var(--grey-bg); color: var(--grey); }
.pill.inv-sent { background: var(--blue-bg); color: var(--blue); }
.pill.inv-partly_paid { background: var(--amber-bg); color: var(--amber); }
.pill.inv-paid { background: var(--green-bg); color: var(--green); }
.client-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.client-top .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.client-top .title { font-weight: 700; }
.client-top .meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.avatar.cl-av { background: var(--gold-soft); color: var(--gold-deep); }
.line-kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.line-kv span { color: var(--muted); }
.line-kv b { text-align: right; }
.cu-toggle { margin-top: 10px; }
.cu-box { border-top: 1px solid var(--line); margin-top: 6px; }
.cu-lbl { min-width: 0; overflow-wrap: anywhere; }
.cu-off { margin: -4px 0 6px 58px; }
.cu-chans { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 2px 0 6px 58px; }
.cu-by { flex-basis: 100%; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.cu-chan { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: .92rem; cursor: pointer; }
.cu-chan input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--gold); flex: 0 0 auto; }
.cu-box.is-off .cu-chans { opacity: .6; }
.cu-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 8px 12px; margin: 6px 0 4px 58px; font-size: .86rem; }
.cu-warn .i { width: 16px; height: 16px; flex: 0 0 auto; }
.cu-warn span { flex: 1 1 12ch; min-width: 0; }
.cu-warn .link-btn { color: var(--red); padding: 2px 0; }
@media (max-width: 420px) { .cu-off, .cu-chans, .cu-warn { margin-left: 0; } }
.cp-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.cp-sum > div { background: var(--cream, #FBF7EF); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; min-width: 0; }
.cp-sum .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cp-sum .v { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.cp-sum .v.owe { color: var(--amber); }
.cp-list li, .ep-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cp-list .main, .ep-list .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-list .title, .ep-list .title { font-weight: 600; }
.cp-list .meta, .ep-list .meta { font-size: .82rem; color: var(--muted); }
.cp-ico { color: var(--green); display: inline-flex; }
.cp-add { margin-top: 10px; }
.ep-list .btn { white-space: nowrap; }
.r-sub { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 18px 0 4px; }
.inv-card .ent-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cu-list .row { display: flex; align-items: center; gap: 10px; }
.cu-list .row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.cu-manual { margin-top: 10px; }
.cu-manual-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.cu-m-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.btn.wa-btn { background: #1F8F4E; border-color: #1F8F4E; color: #fff; }
.btn.wa-btn:hover { background: #17733e; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.inv-frame { width: 100%; min-height: 520px; border: 0; border-radius: 18px; background: transparent; display: block; }
.inv-head .sub .pill { margin-left: 4px; }
details.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
details.tpl summary { cursor: pointer; font-weight: 600; }
details.tpl .field { margin-top: 10px; }
.field textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-strong, #E3D3AC); border-radius: 12px; background: #fff; resize: vertical; }
.r-owe .side b { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .cp-sum { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .cp-sum .v { font-size: .92rem; }
  .ep-list li { flex-wrap: wrap; }
  .inv-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* entertainer commission rules */
.rate-rule { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-deep); font-weight: 600; font-size: .76rem; }
.rate-rule.manual { background: var(--grey-bg); color: var(--grey); }
.rate-hint { display: block; margin-top: 4px; min-height: 1em; }
.er-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.er-row .main { flex: 1; display: flex; flex-direction: column; }
.er-row .title { font-weight: 600; }
.er-row .meta { font-size: .82rem; color: var(--muted); }
.er-add { display: grid; grid-template-columns: 1fr 110px auto; gap: 10px; align-items: end; margin-top: 12px; }
@media (max-width: 520px) { .er-add { grid-template-columns: 1fr 90px; } .er-add .btn { grid-column: 1 / -1; } }

.cu-list .wa-btn, .cu-m-row .wa-btn { padding: 6px 12px; min-height: 34px; font-size: .82rem; flex: 0 0 auto; }
.cu-list .row { padding: 10px 0; }
.cu-list .title { font-weight: 600; }
.cu-list .meta { font-size: .82rem; color: var(--muted); }
