/* Layout + shell chrome (plain CSS – not processed by Tailwind) */
:root { --tb-h: 64px; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--c-bg); color: var(--c-ink); min-height: 100vh; }
.bn-main { padding: calc(var(--tb-h) + 20px) 16px 40px; min-height: 100vh; transition: padding-left .2s ease; }
@media (min-width: 1024px) { .bn-main { padding-left: calc(var(--sb-w) + 28px); padding-right: 28px; } }
.bn-page { max-width: 1480px; margin: 0 auto; }
.bn-boot { display: flex; gap: 8px; padding: 40px; justify-content: center; }
.bn-boot i { width: 10px; height: 10px; border-radius: 99px; background: #83c929; animation: bnb 1s infinite ease-in-out; }
.bn-boot i:nth-child(2) { animation-delay: .15s } .bn-boot i:nth-child(3) { animation-delay: .3s }
@keyframes bnb { 0%,80%,100% { transform: scale(.5); opacity: .4 } 40% { transform: scale(1); opacity: 1 } }

/* icons */
.ms { font-family: "Material Symbols Rounded"; font-weight: 400; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal;
      text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; width: 1em; height: 1em; overflow: hidden;
      font-variation-settings: "FILL" 0, "wght" 400, "opsz" 24; -webkit-font-smoothing: antialiased; flex: none; user-select: none; }
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "opsz" 24; }

/* ── Sidebar ── */
.bn-sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sb-w); background: var(--sb-bg); color: var(--sb-fg);
  display: flex; flex-direction: column; border-right: 1px solid var(--sb-line); transition: transform .25s ease, width .2s ease; transform: translateX(-100%); }
.bn-sidebar.is-open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.5); }
@media (min-width: 1024px) { .bn-sidebar { transform: none; box-shadow: none; } }
.sb-logo { display: flex; align-items: center; gap: 10px; height: var(--tb-h); padding: 0 20px; text-decoration: none; color: var(--sb-fg); flex: none; }
.sb-logo .word { font-size: 20px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.sb-logo .word b { color: #83c929; font-weight: 800; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--sb-line) transparent; }
.sb-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-mute); padding: 18px 10px 6px; white-space: nowrap; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 12px; color: var(--sb-fg); opacity: .82;
  text-decoration: none; font-size: 13.5px; font-weight: 600; transition: background .15s, opacity .15s; position: relative; white-space: nowrap; }
.sb-item:hover { background: var(--sb-hover); opacity: 1; }
.sb-item .ms { font-size: 21px; }
.sb-item.active { background: var(--sb-active); color: var(--sb-active-fg); opacity: 1; box-shadow: 0 6px 18px -8px var(--sb-active); }
.sb-item.active .ms { font-variation-settings: "FILL" 1, "wght" 500, "opsz" 24; }
.sb-item .pill { margin-left: auto; background: #83c929; color: #0b0d0c; font-size: 10.5px; font-weight: 800; border-radius: 99px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sb-item.active .pill { background: var(--sb-active-fg); color: var(--sb-active); }
.sb-item.locked { opacity: .45; }
.sb-foot { padding: 12px; border-top: 1px solid var(--sb-line); flex: none; }
.sb-plan { border-radius: 14px; padding: 12px; background: var(--sb-hover); font-size: 12px; }
.sb-plan b { display: block; font-size: 13px; }
.sb-plan .bar { height: 5px; border-radius: 9px; background: var(--sb-line); margin-top: 8px; overflow: hidden; }
.sb-plan .bar i { display: block; height: 100%; background: #83c929; border-radius: 9px; }
html[data-sb="collapsed"] .bn-sidebar .word, html[data-sb="collapsed"] .bn-sidebar .label, html[data-sb="collapsed"] .bn-sidebar .pill,
html[data-sb="collapsed"] .bn-sidebar .sb-label, html[data-sb="collapsed"] .bn-sidebar .sb-plan { display: none; }
html[data-sb="collapsed"] .bn-sidebar .sb-item { justify-content: center; padding: 11px; }
html[data-sb="collapsed"] .bn-sidebar .sb-logo { padding: 0; justify-content: center; }
@media (max-width: 1023px) { html[data-sb="collapsed"] { --sb-w: 264px; }
  html[data-sb="collapsed"] .bn-sidebar .word, html[data-sb="collapsed"] .bn-sidebar .label, html[data-sb="collapsed"] .bn-sidebar .sb-label { display: initial; } }

/* ── Top bar (black bar + white round buttons) ── */
.bn-topbar { position: fixed; z-index: 40; top: 0; right: 0; left: 0; height: var(--tb-h); background: #0b0d0c; color: #fff; display: flex; align-items: center;
  gap: 10px; padding: 0 14px; border-bottom: 2px solid #83c929; transition: left .2s ease; }
html.dark .bn-topbar { background: #0e110f; }
@media (min-width: 1024px) { .bn-topbar { left: var(--sb-w); padding: 0 28px; } }
.tb-title { font-weight: 800; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-round { position: relative; width: 40px; height: 40px; border-radius: 99px; background: #fff; color: #4b5560; display: grid; place-items: center;
  border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s; flex: none; text-decoration: none; }
.tb-round:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(131,201,41,.7); }
.tb-round .ms { font-size: 21px; }
.tb-round.dark-mode-on { background: #83c929; color: #0b0d0c; }
.tb-badge { position: absolute; right: -3px; bottom: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #ef5b6b; color: #fff;
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid #0b0d0c; }
.tb-avatar { width: 40px; height: 40px; border-radius: 99px; overflow: hidden; border: 2px solid #83c929; background: #b8dd8c; display: grid; place-items: center;
  cursor: pointer; color: #1d3a05; font-weight: 800; font-size: 14px; flex: none; padding: 0; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-cta { background: #83c929; color: #0b0d0c; font-weight: 800; font-size: 13px; letter-spacing: .02em; border-radius: 10px; padding: 0 20px; height: 40px;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; text-transform: uppercase; transition: filter .15s, transform .15s; }
.tb-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.pop { position: absolute; right: 0; top: calc(100% + 12px); width: 340px; max-width: calc(100vw - 24px); background: var(--c-card); color: var(--c-ink);
  border: 1px solid var(--c-line); border-radius: 18px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.4); overflow: hidden; z-index: 60; }
@media (max-width: 480px) { .pop { position: fixed; right: 12px; left: 12px; width: auto; top: calc(var(--tb-h) + 8px); } }

/* ── Toasts ── */
.toasts { position: fixed; z-index: 100; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  background: #0b0d0c; color: #fff; box-shadow: 0 16px 40px -10px rgba(0,0,0,.45); border-left: 4px solid #83c929; animation: toastin .25s ease; }
.toast.error { border-left-color: #ef5b6b; } .toast.warn { border-left-color: #f0b04a; }
html.dark .toast { background: #1c211e; border: 1px solid #2a312c; border-left-width: 4px; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (max-width: 640px) { .toasts { left: 14px; right: 14px; bottom: 14px; } .toast { max-width: none; } }

/* ── Modal ── */
.bn-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(6,9,7,.6); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade .15s ease; }
@media (min-width: 640px) { .bn-overlay { align-items: center; padding: 24px; } }
.bn-modal { background: var(--c-card); color: var(--c-ink); width: 100%; max-height: 92vh; display: flex; flex-direction: column; border: 1px solid var(--c-line);
  border-radius: 22px 22px 0 0; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: rise .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 640px) { .bn-modal { border-radius: 22px; } }
.bn-overlay.side { align-items: stretch; justify-content: flex-end; padding: 0; }
.bn-overlay.side .bn-modal { max-height: none; height: 100%; border-radius: 0; animation: slide .25s cubic-bezier(.2,.8,.2,1); border-width: 0 0 0 1px; }
@keyframes fade { from { opacity: 0 } } @keyframes rise { from { transform: translateY(24px) scale(.98); opacity: 0 } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }

/* toggle */
.tgl { width: 42px; height: 24px; border-radius: 99px; background: var(--c-line); position: relative; transition: background .2s; flex: none; cursor: pointer; border: 0; padding: 0; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 99px; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.tgl.on { background: #83c929; } .tgl.on::after { transform: translateX(18px); }

/* scrollbars */
.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--c-line) transparent; }
.no-scrollbar { scrollbar-width: none; } .no-scrollbar::-webkit-scrollbar { display: none; }

/* print (receipts / invoices) */
.print-only { display: none; }
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; background: #fff !important; color: #000 !important; border: 0 !important; box-shadow: none !important; }
  .print-only { display: block; } .no-print { display: none !important; }
}

/* small screens: keep the top bar to menu · theme · messages · bell · avatar */
@media (max-width: 639px) { .tb-cta, .tb-round.hidden { display: none !important; } .bn-topbar { gap: 8px; } }
