/* Staff dashboards: calm and neutral, role color in the top bar */
body.staff { background: #FAF7F1; }
.topbar { background: var(--role); color: var(--role-on); }
.topbar-inner { display: flex; align-items: center; gap: var(--space-4); min-height: 64px; padding: 0 var(--space-5); }
.topbar .brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.topbar .brand img { height: 38px; width: auto; background: #fff; border-radius: 10px; padding: 3px 8px; }
.role-chip { font-size: .8rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .28); }
[data-role="admin"] .role-chip { background: rgba(255, 255, 255, .14); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .9rem; font-weight: 600; }
.topbar a, .topbar button { color: inherit; }
.topbar .tool { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1.5px solid currentColor; border-radius: 999px; padding: 4px 12px; font: 600 .85rem var(--font-body); text-decoration: none; cursor: pointer; opacity: .9; }
.topbar .tool:hover { opacity: 1; }

.layout { display: grid; grid-template-columns: 264px 1fr; min-height: calc(100vh - 64px); }
.sidebar { background: #fff; border-inline-end: 1px solid var(--line); padding: var(--space-4) var(--space-3); }
.nav-links a { display: flex; align-items: center; gap: var(--space-3); padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.nav-links a:hover { background: #F5F0E7; color: var(--ink); }
.nav-links a.active { background: var(--role-tint); color: var(--ink); }
.nav-links a.active .icon { color: var(--ink); }
.main { padding: var(--space-6); min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.page-head h1 { font-size: 1.7rem; margin: 0; }
.muted { color: var(--ink-muted); }

/* Panels and metrics */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); margin-bottom: var(--space-5); }
.panel h2 { font-size: 1.15rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.metric { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.metric .label { font-size: .85rem; color: var(--ink-muted); font-weight: 600; }
.metric .value { font: 700 1.7rem/1.3 var(--font-body); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.pill-ok { background: var(--success-tint); color: var(--success); }
.pill-off { background: #EFEAE2; color: var(--ink-soft); }
.pill-warn { background: var(--warning-tint); color: var(--warning); }
.pill-next { background: var(--role-tint); color: var(--ink); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: start; font-size: .8rem; color: var(--ink-muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; direction: ltr; unicode-bidi: isolate; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-5); align-items: start; }
.roadmap li { margin-bottom: 6px; }

/* Front desk POS: big color-coded tiles, one red Pay button */
.pos { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-5); align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); }
.tile { border: 0; border-radius: var(--radius); padding: var(--space-5) var(--space-4); text-align: start; font: 700 1.1rem var(--font-body); min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.tile .icon { width: 30px; height: 30px; }
.tile small { font-weight: 500; font-size: .8rem; opacity: .8; }
.tile-entry { background: var(--gold-tint); color: var(--gold-text); }
.tile-party { background: var(--pink-tint); color: var(--pink-text); }
.tile-cafe { background: var(--orange-tint); color: var(--orange-text); }
.tile-addons { background: var(--mint-tint); color: var(--mint-text); }
.tile:hover { filter: brightness(.97); }
.cart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); position: sticky; top: var(--space-4); }
.cart .empty { text-align: center; color: var(--ink-muted); padding: var(--space-6) 0; border: 2px dashed var(--line); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.cart .row { display: flex; justify-content: space-between; padding: 6px 0; font-variant-numeric: tabular-nums; }
.cart .total { font-weight: 800; font-size: 1.3rem; border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 10px; }
.btn-pay { width: 100%; min-height: 60px; font-size: 1.25rem; margin-top: var(--space-4); border-radius: var(--radius); }
.shift-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); background: var(--warning-tint); color: var(--warning); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-5); font-weight: 600; }

/* Marketing editor */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }

/* Login */
body.login { background: var(--cream); min-height: 100vh; display: grid; place-items: center; padding: var(--space-5); }
.login-card { width: min(420px, 100%); background: #fff; border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.login-card img { width: 210px; margin: 0 auto var(--space-5); }
.login-card h1 { text-align: center; font-size: 1.5rem; margin-bottom: var(--space-1); }
.login-card .sub { text-align: center; color: var(--ink-muted); margin: 0 0 var(--space-5); }
.login-card .btn { width: 100%; margin-top: var(--space-2); }
.login-foot { display: flex; justify-content: space-between; margin-top: var(--space-5); font-size: .9rem; }
.login-foot a { color: var(--ink-soft); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .layout > * { min-width: 0; }
  .sidebar { border-inline-end: 0; border-bottom: 1px solid var(--line); padding: var(--space-2); }
  .nav-links { display: flex; overflow-x: auto; gap: 4px; }
  .nav-links a { white-space: nowrap; margin: 0; }
  .pos, .grid-2, .settings-grid { grid-template-columns: 1fr; }
  .main { padding: var(--space-4); }
  .topbar .who { display: none; }
}
.nowrap, table.data td.mono { white-space: nowrap; }

/* Sidebar groups */
.nav-group { font-size: .72rem; font-weight: 700; color: var(--ink-muted); padding: 14px 14px 4px; letter-spacing: .02em; }
.nav-group:first-child { padding-top: 4px; }

/* Content editor */
.panel h2 { display: flex; align-items: center; gap: 8px; }
.content-row { padding: 14px 0; border-top: 1px solid var(--line); }
.content-row:first-of-type { border-top: 0; padding-top: 4px; }
.content-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.content-row .field { margin-bottom: 0; }
.sub-label { font-size: .78rem !important; color: var(--ink-muted); font-weight: 600 !important; }
.hero-edit { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-5); align-items: start; }
.hero-thumb { margin: 0; }
.hero-thumb img { width: 200px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 4px solid #fff; box-shadow: var(--shadow-soft); }
.hero-thumb figcaption { font-size: .8rem; margin-top: 6px; text-align: center; }
.save-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-5); box-shadow: 0 -6px 18px rgba(43,33,24,.06); }
.save-bar .muted { font-size: .85rem; }

/* Card manager */
.card-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-item { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.card-item:last-child { border-bottom: 0; }
.card-item.is-hidden .card-thumb, .card-item.is-hidden .card-info strong { opacity: .5; }
.card-thumb { width: 56px; height: 56px; flex: none; border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.card-thumb .icon { width: 26px; height: 26px; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-info .muted { font-size: .85rem; }
.card-info .pill { align-self: flex-start; display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; }
.card-info .pill .icon { width: 14px; height: 14px; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-actions form { margin: 0; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { background: var(--cream); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; background: #fff; }
.icon-btn.danger:hover { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }

/* Card form: icon and color pickers */
.choice-set { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.choice-set legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; }
.choice span .icon { width: 22px; height: 22px; }
.choice.swatch span { border-color: transparent; }
.choice input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.choice input:focus-visible + span { box-shadow: var(--focus); }

/* Card preview: mirrors the website card */
.preview-panel { position: sticky; top: var(--space-4); background: var(--cream); }
.site-card { background: #fff; border-radius: 22px; padding: var(--space-5); border: 1px solid var(--line); }
.site-card h3 { font-size: 1.25rem; margin: 0 0 6px; }
.site-card p { margin: 0; color: var(--ink-soft); white-space: pre-line; }
.pv-media { margin-bottom: var(--space-4); }
.pv-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.pv-badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.pv-badge .icon { width: 26px; height: 26px; }
.pv-badge span { display: grid; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .nav-group { display: none; }
  .hero-edit { grid-template-columns: 1fr; }
  .card-item { flex-wrap: wrap; }
  .card-actions { width: 100%; justify-content: flex-end; }
  .save-bar .muted { display: none; }
}
.site-card .pv-photo { width: calc(100% + 48px); max-width: none; margin: -24px -24px 0; border-radius: 22px 22px 0 0; }
.choice.swatch span.tint-gold   { background: var(--gold-tint); }
.choice.swatch span.tint-pink   { background: var(--pink-tint); }
.choice.swatch span.tint-mint   { background: var(--mint-tint); }
.choice.swatch span.tint-orange { background: var(--orange-tint); }
.choice.swatch span.tint-blue   { background: var(--blue-tint); }
.choice.swatch span.tint-coral  { background: var(--coral-tint); }

/* ---------- numbers and small helpers ---------- */
.num { font-variant-numeric: tabular-nums; }
.input-lg { min-height: 54px; font-size: 1.25rem; letter-spacing: .03em; }
.btn-wa { background: #1F9D55; color: #fff; }
.btn-wa:hover { background: #17834A; }
.pill-free { background: var(--mint-tint); color: var(--mint-text); }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "▾"; color: var(--ink-muted); margin-inline-start: auto; }
details[open] > summary::after { content: "▴"; }

/* ---------- active children panel (sidebar) ---------- */
.active-panel { margin-top: var(--space-4); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; }
.ap-head h2 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: 6px; }
.ap-count { background: var(--star-gold); color: #4A2E00; border-radius: 999px; font: 700 .75rem/1 var(--font-body); padding: 4px 8px; }
.ap-alerts { border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; font: 600 .7rem var(--font-body); padding: 3px 8px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--ink-soft); }
.ap-alerts .icon { width: 14px; height: 14px; }
.ap-alerts.is-on { background: var(--success-tint); color: var(--success); border-color: transparent; }
.ap-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 8px; }
.ap-empty { font-size: .85rem; padding: 0 4px; }
.ap-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.ap-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ap-child { font-weight: 700; text-decoration: none; color: var(--ink); }
.ap-timer { font: 700 1.05rem var(--font-body); color: var(--success); white-space: nowrap; direction: ltr; }
.ap-meta { font-size: .78rem; color: var(--ink-muted); }
.ap-notes { font-size: .78rem; background: var(--warning-tint); color: var(--warning); border-radius: 6px; padding: 2px 6px; margin-top: 4px; }
.ap-bar { height: 5px; background: #F0EBE2; border-radius: 99px; margin: 8px 0; overflow: hidden; }
.ap-bar span { display: block; height: 100%; background: var(--mint); border-radius: 99px; transition: width 1s linear; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-btn { font: 600 .72rem var(--font-body); border-radius: 999px; padding: 4px 9px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.ap-btn:hover { background: var(--cream); }
.ap-wa { background: #E7F6EC; border-color: transparent; color: #17602F; }
.ap-out { background: var(--ink); color: var(--cream); border-color: transparent; }
.ap-out:hover { background: #46382B; }
.ap-sent { font-size: .72rem; color: var(--success); margin-top: 4px; }
.ap-item.is-soon { border-color: var(--star-gold); background: var(--gold-tint); }
.ap-item.is-soon .ap-timer { color: var(--warning); }
.ap-item.is-soon .ap-bar span { background: var(--star-gold); }
.ap-item.is-done { border-color: var(--danger); background: var(--danger-tint); animation: ap-pulse 1.6s ease-in-out infinite; }
.ap-item.is-done .ap-timer { color: var(--danger); font-size: .85rem; }
.ap-item.is-done .ap-bar span { background: var(--danger); }
@keyframes ap-pulse { 50% { box-shadow: 0 0 0 4px rgba(180, 35, 24, .15); } }
@media (prefers-reduced-motion: reduce) { .ap-item.is-done { animation: none; } }

/* ---------- time's-up alerts: a strip at the top of the page that stays visible while scrolling ---------- */
.toast-area { position: sticky; top: 8px; z-index: 20; display: grid; gap: 6px; }
.toast-area:not(:empty) { margin-bottom: var(--space-4); }
.toast { background: #fff; border: 2px solid var(--danger); border-radius: 12px; padding: 8px 12px; box-shadow: 0 6px 18px rgba(43,33,24,.12);
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.toast strong { color: var(--danger); font-size: .98rem; }
.toast-sub { font-size: .85rem; color: var(--ink-soft); }
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }

/* ---------- search and check-in ---------- */
.phone-search label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 1.05rem; }
.phone-row { display: flex; gap: 8px; }
.phone-row .input { flex: 1; }
.receipt-find { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--line); }
.receipt-find label { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: 6px; }
.receipt-find .input { max-width: 16rem; }
.new-guardian { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px dashed var(--line-strong); }
.new-guardian .settings-grid { align-items: end; }
.kid-list { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: 8px; }
.kid { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.kid.is-picked { border-color: var(--ink); background: var(--cream-light); }
.kid.is-inside { opacity: .65; background: #FAF7F1; }
.kid-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; }
.kid-pick input { width: 20px; height: 20px; accent-color: var(--circus-red); }
.kid-name { font-weight: 700; font-size: 1.05rem; }
.kid-age { font-size: .85rem; }
.kid-notes { font-size: .82rem; background: var(--warning-tint); color: var(--warning); border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; gap: 6px; }
.kid-notes .icon { width: 14px; height: 14px; }
.checkin-total { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--cream); border-radius: 12px; font-size: 1.05rem; }
.checkin-total strong { font-size: 1.4rem; }
.kid-edit { border-bottom: 1px solid var(--line); padding: 8px 0; }
.kid-edit form { margin-top: 10px; }

/* ---------- invoice page ---------- */
.invoice-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--space-5); align-items: start; }
.invoice-actions { display: grid; gap: 8px; align-content: start; }
.invoice-actions .btn { width: 100%; }
.inv-visits { font-size: .9rem; display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .active-panel { margin-top: var(--space-2); }
  .ap-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .invoice-layout { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .sidebar, .no-print, .flash { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
}

/* ---------- targets ---------- */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.fd-targets { margin-bottom: var(--space-5); }
.tg-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4) var(--space-5); display: grid; gap: 6px; }
.tg-card.is-done { border-color: var(--success); background: var(--success-tint); }
.tg-card.is-paused { opacity: .6; }
.tg-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tg-scope { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; }
.tg-scope .icon { width: 16px; height: 16px; color: var(--ink-muted); }
.tg-metric { font-size: .85rem; color: var(--ink-muted); font-weight: 600; }
.tg-nums strong { font-size: 1.5rem; }
.tg-bar { height: 10px; background: #F0EBE2; border-radius: 99px; overflow: hidden; }
.tg-bar span { display: block; height: 100%; background: var(--star-gold); border-radius: 99px; transition: width .6s ease; }
.tg-card.is-done .tg-bar span, .st-row.is-done .tg-bar span { background: var(--success); }
.tg-foot { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--ink-soft); }
.tg-foot b { color: var(--ink); }
.tg-win { color: var(--success); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.tg-win .icon { width: 18px; height: 18px; }
.tg-admin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.tg-admin form { margin: 0; }
.tg-edit { display: flex; gap: 6px; }
.tg-edit .input { width: 110px; min-height: 34px; }
.side-targets { margin-top: var(--space-4); border-top: 1px solid var(--line); padding: var(--space-3) 4px 0; }
.side-targets h2 { font-size: .95rem; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.st-row { margin-bottom: 8px; }
.st-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); margin-bottom: 3px; }
.tg-bar-sm { height: 6px; }
.topbar .tool.is-current { background: rgba(255, 255, 255, .25); }
.kv { margin: 0; display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.kv dt { color: var(--ink-muted); font-weight: 600; font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; text-align: end; }
.contact-cell { font-size: .85rem; } .contact-cell span { display: block; text-align: start; }

/* ---------- admin dashboard ---------- */
.dash-kpis .metric small { font-size: .85rem; font-weight: 600; }
.metric .sub { font-size: .8rem; margin-top: 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.dash-section { margin-bottom: var(--space-5); }
.dash-section h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist a { color: var(--ink); font-weight: 600; text-decoration: none; }
.checklist a:hover { text-decoration: underline; }
.checklist .pill { display: inline-flex; align-items: center; gap: 4px; }
.checklist .pill .icon { width: 13px; height: 13px; }
.left-timer { font-weight: 700; color: var(--success); }
.left-timer.is-soon { color: var(--warning); }
.left-timer.is-over { color: var(--danger); }
.sub-head { font-size: 1rem; margin: 20px 0 10px; display: flex; align-items: center; gap: 6px; }
.staff-targets { min-width: 120px; }
.staff-targets .st-row { margin: 0 0 4px; }

/* Bar chart: one series, thin bars with a gap, rounded top on a flat baseline */
.chart-wrap { position: relative; }
.bar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bar-chart .grid { stroke: #EFE8DC; stroke-width: 1; }
.bar-chart .axis { stroke: #CDBFA6; stroke-width: 1; }
.bar-chart .ytick, .bar-chart .xtick { font: 500 11px var(--font-body); fill: var(--ink-muted); }
.bar-chart .xtick.is-today { fill: var(--ink); font-weight: 700; }
.bar-chart .vlabel { font: 700 11px var(--font-body); fill: var(--ink); }
.bar-chart .bar path { fill: #3F7CC4; transition: opacity .15s; }
.bar-chart .bar .hit { fill: transparent; }
.bar-chart .bar:focus { outline: none; }
.bar-chart:hover .bar path, .bar-chart:focus-within .bar path { opacity: .45; }
.bar-chart .bar.is-hover path { opacity: 1; }
.bar-chart .bar.is-hover .hit, .bar-chart .bar:focus .hit { fill: rgba(63, 124, 196, .07); }
.chart-tip { position: absolute; top: -6px; transform: translateX(-50%); background: var(--ink); color: #fff; font: 600 .8rem var(--font-body);
  padding: 4px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.table-view { margin-top: 10px; font-size: .88rem; }
.table-view summary { color: var(--ink-soft); font-weight: 600; }
.table-view table { margin-top: 8px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbar-label { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.hbar { height: 10px; background: #F0EBE2; border-radius: 4px; }
.hbar span { display: block; height: 100%; min-width: 4px; background: #3F7CC4; border-radius: 0 4px 4px 0; }
html[dir="rtl"] .hbar span { border-radius: 4px 0 0 4px; margin-inline-start: 0; }
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tg-nums strong { white-space: nowrap; }
.settings-grid { align-items: start; }
.ap-error { font-size: .72rem; color: var(--danger); background: var(--danger-tint); border-radius: 6px; padding: 2px 6px; margin-top: 4px; }

/* ---------- integrations ---------- */
.int-panel h3 { font-size: 1rem; margin: 18px 0 10px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.mode-card:has(input:checked) { border-color: var(--ink); background: var(--cream-light); }
.mode-card input { margin-top: 4px; accent-color: var(--circus-red); width: 18px; height: 18px; flex: none; }
.mode-card span { display: grid; gap: 4px; }
.mode-card small { color: var(--ink-soft); font-size: .84rem; line-height: 1.6; }
.api-box { border-top: 1px dashed var(--line-strong); margin-top: 8px; }
.tpl-help { display: grid; gap: 8px; }
.tpl-help details { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.tpl-help pre { white-space: pre-wrap; background: var(--cream-light); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font: .88rem/1.7 var(--font-body); }
.test-row { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.steps { list-style: none; counter-reset: s; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.steps li { counter-increment: s; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.steps li span:first-child::before { content: counter(s) ". "; font-weight: 700; color: var(--ink-muted); }
.steps li.done { background: var(--success-tint); border-color: transparent; }
.otp-box { display: grid; gap: 6px; margin-bottom: 12px; }
.otp-box .input-lg { letter-spacing: .4em; text-align: center; }
@media (max-width: 980px) { .mode-cards { grid-template-columns: 1fr; } }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }  /* passwords are typed left to right */
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--cream); color: var(--ink-soft);
  font: 600 .78rem var(--font-body); border-radius: 8px; padding: 4px 8px; cursor: pointer; }

/* ---------- shifts, refunds, day closing ---------- */
.narrow-panel { max-width: 560px; }
.text-danger { color: var(--danger); font-weight: 600; }
.tight-list { list-style: none; margin: 8px 0; padding: 0; font-size: .85rem; display: grid; gap: 4px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.inv-more { border-top: 1px solid var(--line); padding-top: 10px; }
.inv-more > summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.inv-more form { margin-top: 8px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; }
.kv-grid dt { font-size: .8rem; color: var(--ink-soft); }
.kv-grid dd { margin: 0; font-weight: 600; }
.cert-checks { margin: 6px 0 0; padding-inline-start: 1.2em; font-size: .85rem; }

/* Phones: top bar tools become icon buttons so nothing is pushed off-screen */
@media (max-width: 600px) {
  .topbar-inner { gap: 8px; padding: 0 12px; }
  .topbar .role-chip { display: none; }
  .topbar .tool { padding: 7px 9px; }
  .topbar .tool .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- café sale ---------- */
.cafe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cafe-item { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cafe-item.is-picked { border-color: var(--role); box-shadow: 0 0 0 2px var(--role-tint); }
.cafe-name { display: flex; flex-direction: column; gap: 2px; }
.cafe-stock { font-size: .8rem; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty .input { width: 64px; text-align: center; font-size: 1.1rem; font-weight: 700; }
.qty-btn { min-width: 44px; min-height: 44px; font-size: 1.3rem; padding: 0; justify-content: center; }
.vis-users { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- payment statistics (categorical slots 1-3, validated on the white panel) ---------- */
.bar-chart.stacked .bar path.seg-cash, .sw-cash { fill: #2a78d6; background: #2a78d6; }
.bar-chart.stacked .bar path.seg-mada, .sw-mada { fill: #eb6834; background: #eb6834; }
.bar-chart.stacked .bar path.seg-card, .sw-card { fill: #1baf7a; background: #1baf7a; }
.pay-chart-tip, .chart-wrap .chart-tip { max-width: min(320px, 90vw); white-space: normal; text-align: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: .85rem; color: var(--ink-soft); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.pay-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--ink); text-decoration: none; background: #fff; }
.chip:hover { border-color: var(--ink-soft); }
.chip.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
tr.muted td { color: var(--ink-muted); }
.vis-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-4); }
.vis-fieldset legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.metrics.pay-today { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
