/* =====================================================================
   Coffee Shop v2 — neumorphic UI. One stylesheet for the whole app.
   Palette: cream surfaces, espresso ink, caramel + ember accents.
   ===================================================================== */
:root {
  --bg: #ece3d8;
  --surface: #ece3d8;
  --surface-2: #f3ece3;
  --hi: rgba(255, 255, 255, .78);      /* light shadow */
  --lo: rgba(150, 120, 92, .34);       /* dark shadow  */
  --ink: #2b1e16;
  --ink-2: #4b3628;
  --muted: #8b7969;
  --line: rgba(111, 78, 55, .14);
  --espresso: #3b2618;
  --coffee: #6f4e37;
  --caramel: #b8763a;
  --cream: #f7f1ea;
  --ember: #d9481c;
  --ok: #3f7d4e;
  --warn: #c48a12;
  --bad: #b8382a;
  --info: #3d6f8f;
  --r: 18px;
  --r-sm: 12px;
  --raise: 6px 6px 14px var(--lo), -6px -6px 14px var(--hi);
  --raise-sm: 3px 3px 7px var(--lo), -3px -3px 7px var(--hi);
  --inset: inset 3px 3px 7px var(--lo), inset -3px -3px 7px var(--hi);
  --inset-lg: inset 5px 5px 12px var(--lo), inset -5px -5px 12px var(--hi);
  --font: 'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--coffee); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: 0 0 .4em; letter-spacing: -.01em; color: var(--espresso); }
h2 { font-size: 1.25rem; } h3 { font-size: 1.08rem; } h4 { font-size: .98rem; }
p { margin: 0 0 .7em; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 238px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 16px; background: var(--surface); box-shadow: 6px 0 18px -10px var(--lo); z-index: 40; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px 10px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--cream); background: linear-gradient(145deg, var(--coffee), var(--espresso)); box-shadow: var(--raise-sm); font-size: 1.15rem; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.02rem; color: var(--espresso); line-height: 1.15; }
.brand-sub { font-size: .74rem; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; color: var(--ink-2); font-weight: 500; transition: box-shadow .18s, color .18s; }
.nav a i { width: 18px; text-align: center; color: var(--muted); }
.nav a:hover { box-shadow: var(--raise-sm); }
.nav a.active { box-shadow: var(--inset); color: var(--espresso); font-weight: 700; }
.nav a.active i { color: var(--caramel); }
.side-foot { margin-top: auto; padding: 4px; }
.shift-pill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; box-shadow: var(--inset); font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.shift-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.shift-pill.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(63, 125, 78, .18); }
.shift-pill.stage-opening .dot, .shift-pill.stage-closing .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(196, 138, 18, .2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 26px; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.page-title { font-size: 1.45rem; margin: 0; flex: 1; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.content { padding: 6px 26px 40px; display: flex; flex-direction: column; gap: 20px; }
.user-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 30px; box-shadow: var(--raise-sm); cursor: pointer; outline: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--caramel), var(--coffee)); color: var(--cream); font-weight: 700; }
.uname { font-weight: 700; font-size: .85rem; } .urole { font-size: .72rem; color: var(--muted); }
.user-chip .menu { display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 190px; padding: 8px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--raise); }
.user-chip:focus-within .menu, .user-chip.open .menu { display: block; }
.user-chip .menu button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; font: inherit; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.user-chip .menu button:hover { box-shadow: var(--inset); }
/* ---------- POS: slim top bar instead of the sidebar (more room for menu items) */
.shell-top { min-height: 100vh; display: flex; flex-direction: column; }
.posbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 8px 18px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); box-shadow: 0 6px 14px -10px var(--lo); }
.pb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark.sm { width: 36px; height: 36px; font-size: .95rem; border-radius: 12px; }
.pb-shop { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pb-shop b { font-family: var(--display); color: var(--espresso); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.pb-shop span { font-size: .74rem; color: var(--caramel); font-weight: 700; white-space: nowrap; }
.shift-pill.sm { padding: 7px 12px; font-size: .76rem; }
.pb-menu { position: relative; outline: none; }
.pb-menu .menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 8px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--raise); z-index: 60; }
.pb-menu:focus-within .menu, .pb-menu.open .menu { display: block; }
.pb-menu .menu a, .pb-menu .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font: 600 .88rem var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.pb-menu .menu a i, .pb-menu .menu button i { width: 18px; color: var(--muted); }
.pb-menu .menu a:hover, .pb-menu .menu button:hover { box-shadow: var(--inset); }
.pb-menu .menu hr { margin: 6px 0; }
.pb-user { display: flex; align-items: center; gap: 8px; }
.pb-logout { padding: 10px 16px; }
.layout-top .content { padding: 12px 18px 24px; gap: 12px; }
.layout-top .pos { grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.layout-top .menu-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.layout-top .cart { top: 70px; max-height: calc(100vh - 90px); }
@media (max-width: 760px) {
  .posbar { padding: 8px 10px; gap: 8px; flex-wrap: wrap; } .pb-shop b { max-width: 130px; } .posbar .shift-pill { order: 9; width: 100%; justify-content: center; }
  .layout-top .pos { grid-template-columns: minmax(0, 1fr); }
  .layout-top .menu-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
/* idle logout warning */
.idle-warn { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 200; padding: 14px 22px; border-radius: 16px; background: var(--espresso); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.idle-warn b { font-size: 1.2rem; }
/* after-sale screen */
.after-sale { text-align: center; }
.after-sale .big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.after-sale .big-actions .btn { padding: 22px 12px; font-size: 1.05rem; flex-direction: column; gap: 6px; }
.after-sale .big-actions .btn i { font-size: 1.5rem; }
.after-sale .countdown { margin-top: 12px; font-weight: 700; color: var(--bad); }
/* PIN login */
.pin-wrap { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; max-height: 70vh; overflow: auto; padding: 6px; }
.tile { border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--raise-sm); padding: 16px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 .9rem var(--font); color: var(--ink); }
.tile .avatar { width: 52px; height: 52px; font-size: 1.3rem; }
.tile small { color: var(--muted); font-weight: 500; }
.tile.on { box-shadow: var(--inset); color: var(--espresso); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--raise-sm); padding: 18px 0; font: 700 1.4rem var(--font); color: var(--espresso); cursor: pointer; }
.pinpad button:active { box-shadow: var(--inset); }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 18px; }
.pindots span { width: 16px; height: 16px; border-radius: 50%; box-shadow: var(--inset); }
.pindots span.f { background: var(--espresso); box-shadow: none; }
@media (max-width: 760px) { .pin-wrap { grid-template-columns: 1fr; } .tiles { max-height: none; } }
/* permissions grid */
.pgrid { border-collapse: collapse; font-size: .84rem; }
.pgrid th, .pgrid td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.pgrid th:first-child, .pgrid td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.pgrid thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; white-space: nowrap; }
.pgrid tr.grp td { background: var(--surface-2); font-weight: 700; text-align: left; color: var(--espresso); }
.pgrid input { width: 18px; height: 18px; }
.pgrid td.changed { box-shadow: inset 0 0 0 2px var(--caramel); border-radius: 6px; }

/* branch chip + switcher */
.branch-chip { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 30px; box-shadow: var(--inset); font-weight: 700; font-size: .84rem; color: var(--espresso); outline: none; max-width: 240px; }
.branch-chip > i.fa-store { color: var(--caramel); }
.branch-chip .bname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.branch-chip.can-switch { box-shadow: var(--raise-sm); cursor: pointer; }
.branch-chip .caret { font-size: .7rem; color: var(--muted); }
.branch-chip .menu { display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px; border-radius: 16px; background: var(--surface-2); box-shadow: var(--raise); z-index: 50; }
.branch-chip .menu-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 12px; font-weight: 600; }
.branch-chip.can-switch:focus-within .menu, .branch-chip.open .menu { display: block; }
.branch-chip .menu button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; font: 600 .88rem var(--font); color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.branch-chip .menu button i { color: var(--muted); width: 16px; }
.branch-chip .menu button.on { box-shadow: var(--inset); } .branch-chip .menu button.on i { color: var(--ok); }
.branch-chip .menu button:hover { box-shadow: var(--inset); }
.pill-branch { margin-left: auto; font-size: .7rem; font-weight: 700; color: var(--caramel); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
@media (max-width: 640px) { .branch-chip { max-width: 140px; padding: 8px 10px; } }
.scrim { display: none; }
.only-mobile { display: none !important; }

/* ---------- surfaces */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--raise); padding: 20px; min-width: 0; }
.card.flat { box-shadow: none; background: transparent; padding: 0; }
.inset { box-shadow: var(--inset); border-radius: var(--r-sm); padding: 14px; background: var(--surface); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; min-width: 160px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- stats */
.stat { display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; box-shadow: var(--inset); color: var(--caramel); font-size: 1.1rem; flex: none; }
.stat .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-family: var(--display); font-size: 1.45rem; font-weight: 700; color: var(--espresso); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .sub { font-size: .78rem; color: var(--muted); }
.stat.ok .ico { color: var(--ok); } .stat.bad .ico { color: var(--bad); } .stat.warn .ico { color: var(--warn); } .stat.info .ico { color: var(--info); }

/* ---------- buttons */
.btn { --b: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 14px; font: 600 .9rem var(--font); color: var(--ink-2); background: var(--b); box-shadow: var(--raise-sm); cursor: pointer; transition: box-shadow .15s, transform .05s, opacity .15s; white-space: nowrap; user-select: none; }
.btn:hover { box-shadow: 4px 4px 10px var(--lo), -4px -4px 10px var(--hi); }
.btn:active, .btn.pressed { box-shadow: var(--inset); transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { color: var(--cream); background: linear-gradient(145deg, #50352a, var(--espresso)); }
.btn.accent { color: #fff; background: linear-gradient(145deg, #e45a2c, var(--ember)); }
.btn.ok { color: #fff; background: linear-gradient(145deg, #4d9160, var(--ok)); }
.btn.danger { color: #fff; background: linear-gradient(145deg, #c94a3b, var(--bad)); }
.btn.soft { background: var(--surface); }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.ghost:hover { box-shadow: var(--raise-sm); }
.btn.sm { padding: 7px 12px; font-size: .8rem; border-radius: 11px; }
.btn.lg { padding: 14px 24px; font-size: 1rem; }
.btn.icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; }
.btn.icon.sm { width: 30px; height: 30px; border-radius: 9px; font-size: .78rem; }
.btn.block { width: 100%; }
.btn .spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: .76rem; }
.input, input:not([type]), input[type=text], input[type=month], input[type=url], input[type=time], input[type=number], input[type=password], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=email], select, textarea {
  width: 100%; font: 500 .92rem var(--font); color: var(--ink); background: var(--surface); border: 0; border-radius: 12px; padding: 11px 14px; box-shadow: var(--inset); outline: none; transition: box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { box-shadow: var(--inset), 0 0 0 2px rgba(184, 118, 58, .45); }
input.invalid, select.invalid, textarea.invalid { box-shadow: var(--inset), 0 0 0 2px rgba(184, 56, 42, .55); }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; padding-right: 38px; line-height: 1.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236f4e37' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
select::-ms-expand { display: none; }
select:disabled, input:disabled { opacity: .6; cursor: not-allowed; }
select[multiple], select[size] { background-image: none; padding-right: 14px; white-space: normal; }
select option, select optgroup { background: #fbf7f2; color: var(--ink); font-weight: 500; }
select optgroup { font-weight: 700; color: var(--coffee); }
input[type=file] { width: 100%; font: 500 .85rem var(--font); color: var(--muted); padding: 8px; border-radius: 12px; box-shadow: var(--inset); background: var(--surface); }
input[type=file]::file-selector-button { font: 600 .82rem var(--font); color: var(--ink-2); border: 0; border-radius: 10px; padding: 8px 14px; margin-right: 12px; background: var(--surface); box-shadow: var(--raise-sm); cursor: pointer; }
input[type=date], input[type=month] { min-width: 150px; }
.img-preview { position: relative; width: 88px; height: 88px; border-radius: 14px; background: linear-gradient(145deg, #e3d4c4, #d7c3ae) center/cover no-repeat; box-shadow: var(--raise-sm); flex: none; display: grid; place-items: center; color: rgba(59,38,24,.35); font-size: 1.6rem; overflow: hidden; }
.img-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.recipe-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(70px, .8fr) minmax(90px, 1fr) auto; gap: 8px; align-items: center; }
.print-frame { position: fixed; width: 0; height: 0; border: 0; right: 0; bottom: 0; visibility: hidden; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.input-group { display: flex; gap: 8px; } .input-group > * { flex: 1; } .input-group > .btn, .input-group > select.unit { flex: 0 0 auto; width: auto; }
.check { display: flex; align-items: center; gap: 10px; font-size: .88rem; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; border-radius: 6px; box-shadow: var(--inset); background: var(--surface); flex: none; cursor: pointer; display: grid; place-items: center; margin: 0; }
.check input:checked { background: var(--caramel); box-shadow: inset 2px 2px 4px rgba(0, 0, 0, .2); }
.check input:checked::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .88rem; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 20px; box-shadow: var(--inset); background: var(--surface); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); box-shadow: var(--raise-sm); transition: left .2s; }
.switch input:checked { background: rgba(63, 125, 78, .28); }
.switch input:checked::after { left: 23px; background: var(--ok); }

/* ---------- tabs / segmented */
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 16px; box-shadow: var(--inset); flex-wrap: wrap; max-width: 100%; }
.tabs button { border: 0; background: transparent; font: 600 .86rem var(--font); color: var(--muted); padding: 9px 16px; border-radius: 12px; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--surface); color: var(--espresso); box-shadow: var(--raise-sm); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

/* ---------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); box-shadow: var(--inset); padding: 4px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; }
table.t th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); cursor: default; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--espresso); }
table.t th .arrow { opacity: .6; margin-left: 4px; }
table.t td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: rgba(255, 255, 255, .25); }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.c, table.t th.c { text-align: center; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
table.t .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.table-tools .search { max-width: 280px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: .82rem; color: var(--muted); }
.empty-row td { text-align: center; padding: 30px; color: var(--muted); }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; box-shadow: var(--raise-sm); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.bad { color: var(--bad); } .badge.warn { color: var(--warn); } .badge.info { color: var(--info); } .badge.dark { color: var(--cream); background: var(--espresso); }
.pos-num { color: var(--ok); } .neg-num { color: var(--bad); }

/* ---------- modal */
.modal-back { position: fixed; inset: 0; background: rgba(43, 30, 22, .35); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: 14px 14px 34px rgba(60, 40, 25, .35), -8px -8px 22px rgba(255, 255, 255, .35); animation: pop .18s; }
.modal.wide { width: min(860px, 100%); } .modal.xwide { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 8px; }
.modal-head h3 { margin: 0; flex: 1; font-size: 1.15rem; }
.modal-body { padding: 10px 22px 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* ---------- drawer (guides) */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 100%); background: var(--surface-2); box-shadow: -12px 0 30px rgba(60, 40, 25, .25); transform: translateX(105%); transition: transform .25s ease; z-index: 90; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; padding: 18px 20px 6px; } .drawer-head h3 { flex: 1; margin: 0; }
.drawer-body { padding: 8px 22px 30px; overflow-y: auto; }
.guide .lead { color: var(--ink-2); }
.guide h4 { margin-top: 18px; color: var(--coffee); }
.guide ol { padding-left: 20px; margin: 0; } .guide li { margin-bottom: 8px; }
.guide .tip { margin-top: 18px; padding: 14px 16px; border-radius: 14px; box-shadow: var(--inset); font-size: .86rem; }
.guide .tip ul { margin: 6px 0 0; padding-left: 18px; }
.guide kbd, kbd { font: 600 .78rem var(--font); padding: 1px 7px; border-radius: 6px; box-shadow: var(--raise-sm); background: var(--surface); }

/* inline guide callout inside forms */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; box-shadow: var(--inset); font-size: .84rem; color: var(--ink-2); }
.callout i { color: var(--caramel); margin-top: 2px; }
.callout.warn i { color: var(--warn); } .callout.bad i { color: var(--bad); } .callout.ok i { color: var(--ok); }
.steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.steps span { font-size: .76rem; font-weight: 700; padding: 6px 12px; border-radius: 20px; color: var(--muted); box-shadow: var(--inset); }
.steps span.on { color: var(--espresso); box-shadow: var(--raise-sm); }

/* ---------- toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); box-shadow: 8px 8px 22px rgba(60, 40, 25, .3), -4px -4px 12px rgba(255, 255, 255, .5); animation: pop .2s; font-size: .88rem; }
.toast i { margin-top: 2px; font-size: 1.05rem; }
.toast.ok i { color: var(--ok); } .toast.bad i { color: var(--bad); } .toast.warn i { color: var(--warn); } .toast.info i { color: var(--info); }
.toast .x { margin-left: auto; cursor: pointer; color: var(--muted); }

/* ---------- empty / loading */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state > i { font-size: 2.2rem; color: var(--caramel); margin-bottom: 12px; }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, rgba(0,0,0,.04), rgba(255,255,255,.5), rgba(0,0,0,.04)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 12px; scrollbar-width: thin; }
.pos-cats button { border: 0; font: 600 .82rem var(--font); padding: 9px 16px; border-radius: 30px; background: var(--surface); box-shadow: var(--raise-sm); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.pos-cats button.active { box-shadow: var(--inset); color: var(--espresso); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.mi { position: relative; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); box-shadow: var(--raise-sm); cursor: pointer; overflow: hidden; transition: box-shadow .15s, transform .1s; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; }
.mi:hover { box-shadow: var(--raise); } .mi:active { box-shadow: var(--inset); transform: scale(.99); }
.mi .img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mi .img { position: relative; overflow: hidden; height: 100px; background: linear-gradient(145deg, #e3d4c4, #d7c3ae) center/cover no-repeat; display: grid; place-items: center; color: rgba(59, 38, 24, .35); font-size: 1.8rem; }
.mi .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.mi .name { font-weight: 700; font-size: .87rem; line-height: 1.2; text-transform: capitalize; }
.mi .price { font-family: var(--display); font-weight: 700; color: var(--coffee); }
.mi .avail { position: absolute; top: 8px; right: 8px; font-size: .68rem; }
.mi.out { opacity: .5; cursor: not-allowed; }
.mi .qty-dot { position: absolute; top: 8px; left: 8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--ember); color: #fff; font-weight: 700; font-size: .78rem; display: grid; place-items: center; padding: 0 6px; }
.cart { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 110px); }
.cart-lines { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 10px; min-height: 120px; }
.cl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border-radius: 14px; box-shadow: var(--inset); }
.cl .n { font-weight: 600; font-size: .86rem; text-transform: capitalize; }
.cl .p { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.cl .ctl { display: flex; gap: 6px; align-items: center; }
.cl .ctl .q { min-width: 26px; text-align: center; font-weight: 700; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px; border-top: 1px dashed var(--line); }
.cart-total .v { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--espresso); }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; box-shadow: var(--inset); font-weight: 500; flex-wrap: wrap; }
.banner i { color: var(--warn); font-size: 1.2rem; }
.banner.bad i { color: var(--bad); } .banner.ok i { color: var(--ok); }

/* ---------- permission matrix */
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); height: 120px; text-align: left; }
.perm-group { margin-bottom: 16px; }
.perm-group h4 { margin: 0 0 8px; color: var(--coffee); }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }

/* ---------- statement */
.statement { max-width: 760px; }
.statement .line { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.statement .line.indent { padding-left: 24px; color: var(--ink-2); }
.statement .line.total { font-weight: 700; border-bottom: 2px solid var(--line); }
.statement .line.grand { font-family: var(--display); font-size: 1.25rem; font-weight: 700; border-bottom: 3px double var(--coffee); color: var(--espresso); }
.statement .section { margin-top: 18px; font-weight: 700; text-transform: uppercase; font-size: .76rem; letter-spacing: .07em; color: var(--muted); }

/* ---------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #f4ece2 0, var(--bg) 45%), var(--bg); }
.login-card { width: min(420px, 100%); padding: 36px 32px; }
.login-card .brand-mark { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 20px; margin: 0 auto 16px; }
.login-card h1 { text-align: center; font-size: 1.7rem; margin-bottom: 4px; }
.login-card .tag { text-align: center; color: var(--muted); margin-bottom: 26px; }

/* ---------- misc */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .w100 { width: 100%; }
.hidden { display: none !important; }

/* ---------- responsive */
@media (max-width: 1180px) { .pos { grid-template-columns: minmax(0, 1fr) 330px; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform .25s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(43, 30, 22, .3); z-index: 35; }
  .only-mobile { display: inline-flex !important; }
  .pos { grid-template-columns: minmax(0, 1fr); }
  #repGrid, #accGrid, #recvGrid, #expGrid, #row2 { grid-template-columns: minmax(0, 1fr) !important; }
  .cart { position: static; max-height: none; }
  .g3 { grid-template-columns: 1fr; } .g2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; } .content { padding: 4px 16px 30px; }
  .g4 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; } .page-title { font-size: 1.2rem; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { padding: 16px; }
}

/* ---------- print */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .toasts, .drawer, .btn, .tabs, .table-tools, .pager { display: none !important; }
  .shell { display: block; } .content { padding: 0; }
  .card, .inset, .table-wrap { box-shadow: none !important; padding: 0; background: #fff; }
  table.t th { background: #fff; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.tab-panel.active.stack { display: flex; }

/* ---------- searchable select */
.ss { position: relative; min-width: 0; }
.ss .ss-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.ss-btn { width: 100%; display: flex; align-items: center; text-align: left; font: 500 .92rem var(--font); color: var(--ink); background: var(--surface); border: 0; border-radius: 12px; padding: 11px 38px 11px 14px; box-shadow: var(--inset); cursor: pointer; position: relative; min-height: 42px; line-height: 1.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236f4e37' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
.ss-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ss-btn.placeholder span { color: var(--muted); }
.ss-btn:focus { outline: none; box-shadow: var(--inset), 0 0 0 2px rgba(184, 118, 58, .45); }
.ss-btn[aria-expanded="true"] { box-shadow: var(--inset), 0 0 0 2px rgba(184, 118, 58, .45); }
.ss-btn.invalid { box-shadow: var(--inset), 0 0 0 2px rgba(184, 56, 42, .55); }
.ss-btn:disabled { opacity: .6; cursor: not-allowed; }
.ss-panel { position: fixed; z-index: 300; background: var(--surface-2); border-radius: 16px; box-shadow: 10px 10px 28px rgba(60, 40, 25, .3), -6px -6px 16px rgba(255, 255, 255, .55); padding: 8px; display: flex; flex-direction: column; max-height: 340px; animation: pop .12s; }
.ss-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 11px; box-shadow: var(--inset); background: var(--surface); margin-bottom: 6px; flex: none; }
.ss-search i { color: var(--muted); font-size: .8rem; }
.ss-search input { box-shadow: none !important; background: transparent; padding: 10px 0; border-radius: 0; }
.ss-list { overflow-y: auto; min-height: 0; padding: 2px; }
.ss-opt { padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .9rem; color: var(--ink); }
.ss-opt.act { background: var(--surface); box-shadow: var(--raise-sm); }
.ss-opt.sel { font-weight: 700; color: var(--espresso); }
.ss-opt.sel::after { content: ' ✓'; color: var(--caramel); }
.ss-opt.ph { color: var(--muted); font-style: italic; }
.ss-opt.dis { opacity: .45; cursor: not-allowed; }
.ss-opt mark { background: rgba(184, 118, 58, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
.ss-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--coffee); padding: 10px 12px 4px; }
.ss-empty { padding: 14px 12px; color: var(--muted); font-size: .86rem; text-align: center; }
.input-group > .ss { flex: 1; }
.input-group > .ss.unit { flex: 0 0 auto; width: auto; }
.ss-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* growth reports */
.heat { display: inline-block; min-width: 46px; padding: 4px 8px; border-radius: 8px; background: rgba(120, 72, 38, var(--a, 0)); font-variant-numeric: tabular-nums; }
.gx-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.gx-card h3 { margin: 0 0 8px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.gx-card h3 a { margin-left: auto; font-size: .78rem; font-weight: 600; }
.gx-big { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.gx-sub { font-size: .82rem; }
.gx-list { list-style: none; margin: 0; padding: 0; }
.gx-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,.08); font-size: .9rem; }
.gx-list li:last-child { border-bottom: 0; }
.gx-quad { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gx-quad > div { padding: 10px; border-radius: 12px; box-shadow: var(--inset); }
.gx-quad b { font-size: 1.3rem; display: block; }

/* ---------- icons-only menu ("rail"): automatic on Reports, switchable everywhere */
.nav a .ini { display: none; width: 22px; text-align: center; font-size: .72rem; letter-spacing: .02em; color: var(--muted); }
.no-fa .sidebar .nav a i { display: none; } .no-fa .sidebar .nav a .ini { display: inline-block; }
.no-fa [data-open-sidebar]::after { content: "\2630"; font-size: 1.2rem; line-height: 1; }
.rail-toggle { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; padding: 9px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 600 .8rem var(--font); cursor: pointer; transition: box-shadow .18s, color .18s; }
.rail-toggle:hover { box-shadow: var(--raise-sm); color: var(--espresso); }
.rail-toggle svg { flex: none; transition: transform .25s; }
.rail-tip { position: fixed; z-index: 200; pointer-events: none; padding: 7px 12px; border-radius: 10px; background: var(--espresso); color: var(--cream); font: 600 .82rem var(--font); white-space: nowrap; box-shadow: 0 10px 24px -8px rgba(43, 30, 22, .45); opacity: 0; transform: translateX(-6px); transition: opacity .14s, transform .14s; }
.rail-tip.show { opacity: 1; transform: none; }
.rail-tip::before { content: ''; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 0; border-right-color: var(--espresso); }
@media (min-width: 641px) {
  body.rail .shell { grid-template-columns: 80px minmax(0, 1fr); }
  body.rail .sidebar { padding: 16px 10px; align-items: center; transition: padding .2s; }
  body.rail .brand { padding: 0 0 6px; justify-content: center; }
  body.rail .brand > div:not(.brand-mark) { display: none; }
  body.rail .sidebar .nav { padding: 2px; align-items: center; scrollbar-width: none; }
  body.rail .sidebar .nav::-webkit-scrollbar { display: none; }
  body.rail .sidebar .nav a { justify-content: center; width: 54px; height: 50px; padding: 0; gap: 0; }
  body.rail .sidebar .nav a i { font-size: 1.12rem; width: auto; }
  body.rail .sidebar .nav a span { display: none; }
  body.rail .sidebar .nav a:hover i, body.rail .sidebar .nav a:focus-visible i { color: var(--caramel); transform: scale(1.12); }
  body.rail .sidebar .nav a i { transition: transform .15s, color .15s; }
  body.rail .side-foot { width: 100%; display: flex; flex-direction: column; align-items: center; }
  body.rail .rail-toggle { width: 54px; justify-content: center; padding: 10px 0; }
  body.rail .rail-toggle span { display: none; }
  body.rail .rail-toggle svg { transform: rotate(180deg); }
  body.rail .shift-pill { width: 54px; height: 40px; padding: 0; justify-content: center; font-size: 0; }
  body.rail .shift-pill .pill-branch { display: none; }
}
/* touch screens (Android tablets): no hover, so the label sits under the icon like an Android navigation rail */
@media (min-width: 641px) and (hover: none) {
  body.rail .shell { grid-template-columns: 88px minmax(0, 1fr); }
  body.rail .sidebar .nav a { flex-direction: column; width: 72px; height: auto; min-height: 58px; padding: 8px 2px; gap: 4px; }
  body.rail .sidebar .nav a span { display: block; font-size: .64rem; font-weight: 600; line-height: 1.1; text-align: center; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.rail .sidebar .nav a.active span { color: var(--espresso); }
}
/* tablets 641–960 px: the menu becomes the icon rail instead of a hidden drawer */
@media (min-width: 641px) and (max-width: 960px) {
  body:not(.layout-top) .shell { grid-template-columns: 80px minmax(0, 1fr); }
  body:not(.layout-top) .sidebar { position: sticky; transform: none; width: auto; }
  body:not(.layout-top) [data-open-sidebar] { display: none !important; }
  body:not(.layout-top) .rail-toggle { display: none; }
}
/* phones: full-label drawer with bigger touch targets */
@media (max-width: 640px) {
  .rail-toggle { display: none; }
  .sidebar { width: min(300px, 86vw) !important; }
  .nav a { padding: 13px 14px; font-size: 1rem; }
}
/* reports: on tablets/phones the long report list becomes one picker */
#repPickWrap { display: none; }
@media (max-width: 960px) {
  #repList { display: none; }
  #repPickWrap { display: block; margin-bottom: 10px; }
  #repPick { width: 100%; font-weight: 600; }
}

/* ---------- payments by method (all kinds) */
.paytiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.paytile { padding: 14px 14px 12px; border-radius: var(--r-sm); box-shadow: var(--raise-sm); display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.paytile .pt-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.paytile .pt-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; box-shadow: var(--inset); color: var(--ok); flex: none; }
.paytile .pt-name { font-weight: 700; font-size: .86rem; color: var(--ink-2); line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.paytile .pt-name small { display: block; font-weight: 600; font-size: .7rem; color: var(--muted); }
.paytile .pt-amt { font-family: var(--display); font-weight: 700; font-size: 1.32rem; color: var(--espresso); }
.paytile .pt-sub { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); font-weight: 600; }
.paytile .pt-bar { height: 6px; border-radius: 6px; box-shadow: var(--inset); overflow: hidden; }
.paytile .pt-bar i { display: block; height: 100%; border-radius: 6px; background: var(--ok); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.paytile.k-inhouse .pt-ico { color: var(--warn); } .paytile.k-inhouse .pt-bar i { background: var(--warn); }
.paytile.k-payroll .pt-ico { color: var(--info); } .paytile.k-payroll .pt-bar i { background: var(--info); }
.paytile.k-inhouse::after, .paytile.k-payroll::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--warn); }
.paytile.k-payroll::after { background: var(--info); }
.payfoot { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .84rem; color: var(--muted); font-weight: 600; }
.payfoot b { color: var(--espresso); margin-left: 4px; } .payfoot .k-inhouse b { color: var(--warn); } .payfoot .k-payroll b { color: var(--info); }
.payfoot .all { margin-left: auto; color: var(--ink-2); } .payfoot .all b { font-family: var(--display); font-size: 1.05rem; }
.paychips { display: flex; flex-wrap: wrap; gap: 8px; }
.paychip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 20px; box-shadow: var(--raise-sm); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.paychip i { color: var(--ok); } .paychip.k-inhouse i { color: var(--warn); } .paychip.k-payroll i { color: var(--info); }
.paychip b { color: var(--espresso); }
.paymix-empty { padding: 14px 4px; font-size: .88rem; }
.pivot td.num, .pivot th.num { text-align: right; } .pivot tfoot td { font-weight: 800; }
.pivot th.k-inhouse { color: var(--warn); } .pivot th.k-payroll { color: var(--info); }

/* ---------- Branches page */
.br-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.br-card { display: flex; flex-direction: column; gap: 14px; position: relative; }
.br-card.is-here { box-shadow: var(--raise), inset 0 0 0 2px rgba(63, 125, 78, .35); }
.br-card.is-off { opacity: .6; }
.br-head { display: flex; gap: 12px; align-items: center; }
.br-mark { width: 50px; height: 50px; border-radius: 16px; flex: none; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .04em; color: var(--cream); background: linear-gradient(145deg, var(--caramel), var(--coffee)); box-shadow: var(--raise-sm); }
.br-title { min-width: 0; flex: 1; } .br-title h3 { margin: 0; } .br-title .muted { font-size: .82rem; }
.br-flags { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.br-shift { font-size: .84rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: brPulse 1.6s ease-in-out infinite; }
@keyframes brPulse { 50% { opacity: .25; transform: scale(.7); } }
.br-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.br-kpis > div { padding: 10px 12px; border-radius: var(--r-sm); box-shadow: var(--inset); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.br-kpis span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.br-kpis b { font-family: var(--display); font-size: 1.12rem; color: var(--espresso); } .br-kpis b small { font-family: var(--font); font-size: .7rem; color: var(--muted); font-weight: 600; }
.br-kpis .bad b { color: var(--bad); }
.br-kpis.big b { font-size: 1.35rem; }
.br-trend { display: flex; gap: 14px; align-items: center; }
.br-spark { flex: 1; height: 46px; min-width: 0; } .br-spark.empty { font-size: .8rem; display: flex; align-items: center; }
.br-spark .area { fill: rgba(184, 118, 58, .16); } .br-spark .line { fill: none; stroke: var(--caramel); stroke-width: 2.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; } .br-spark .dot { fill: var(--ember); }
.br-trend-txt { display: flex; flex-direction: column; align-items: flex-end; font-size: .78rem; } .br-trend-txt b { font-family: var(--display); font-size: 1.05rem; }
.br-sec-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.br-note { font-size: .78rem; margin-top: 6px; }
.br-receipt { padding: 14px; border-radius: var(--r-sm); box-shadow: var(--inset); background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(111, 78, 55, .04) 22px 23px); }
.br-r-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; } .br-r-head i { color: var(--caramel); }
.br-r-name { font-family: var(--display); font-weight: 700; font-size: 1.02rem; margin-top: 4px; color: var(--espresso); }
.br-r-sub { font-size: .78rem; margin-bottom: 6px; }
.br-r-pay li { align-items: center; padding: 6px 2px; font-size: .86rem; } .br-r-pay li i { color: var(--ok); width: 18px; } .br-r-pay li b { margin-left: auto; }
.callout.sm { padding: 8px 10px; font-size: .8rem; margin-top: 8px; }
.callout.bad { color: var(--bad); }
.br-staff { display: flex; flex-wrap: wrap; gap: 6px; } .br-staff span { padding: 4px 10px; border-radius: 14px; box-shadow: var(--raise-sm); font-size: .76rem; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.br-staff .more { color: var(--muted); }
.br-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.br-summary { display: flex; flex-direction: column; gap: 14px; }
