:root { color-scheme: light; --green:#14532d; --ink:#17231d; --muted:#647067; --line:#d8ded9; --bg:#f7f8f5; --panel:#fff; --danger:#b42318; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, .button { border: 0; border-radius: 8px; background: var(--green); color: #fff; padding: 12px 16px; font-weight: 700; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
button.secondary, .button.secondary { background: #e8eee9; color: var(--green); }
button.danger { background: var(--danger); }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-height: 44px; font: inherit; background: #fff; }
label { display: grid; gap: 6px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--panel); padding: 28px; border: 1px solid var(--line); border-radius: 8px; }
.login-card form, .form-grid, .settings-list { display: grid; gap: 16px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 20px; display: grid; align-content: start; gap: 24px; }
.brand { font-size: 24px; font-weight: 800; color: var(--green); }
.sidebar nav, .bottom-nav { display: grid; gap: 8px; }
.sidebar a, .bottom-nav a { padding: 12px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.sidebar a.is-active, .bottom-nav a.is-active { background: #e8f3eb; color: var(--green); }
.main-content { padding: 24px; padding-bottom: 88px; }
.topbar { display: flex; justify-content: space-between; margin-bottom: 20px; color: var(--muted); }
.panel, .list-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head.compact { margin-bottom: 12px; }
.search-bar { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 14px; }
.list-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row span, .muted, .empty { color: var(--muted); }
.row-meta { text-align: right; display: grid; gap: 3px; }
.link-row { grid-template-columns: 1fr auto; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.scanner { width: 100%; height: calc(100vh - 92px); overflow: hidden; background: #000; }
.scanner video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanner-overlay { position: fixed; inset: 0; z-index: 1000; background: #050505; color: #fff; display: grid; grid-template-rows: auto auto 1fr; }
.scanner-overlay[hidden] { display: none; }
.scanner-toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #0b0f0d; }
.scanner-message { min-height: 36px; padding: 8px 14px; color: #d8ded9; background: #111; }
.scanning { overflow: hidden; }
.product-results, #cart-items { display: grid; gap: 10px; }
.product-card, .cart-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 8px; }
.cart-item { grid-template-columns: 1fr 92px auto; align-items: center; }
.total-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; font-size: 20px; }
.alert, .notice { border-radius: 8px; padding: 12px; background: #fff1f0; color: var(--danger); }
.notice { background: #e8f3eb; color: var(--green); }
.debug-output { white-space: pre-wrap; overflow: auto; padding: 12px; background: #111; color: #f8fafc; border-radius: 8px; font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 8px; }
.stat strong { font-size: 26px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow: auto; margin-top: 16px; }
td { border: 1px solid var(--line); padding: 8px; }
.mt { margin-top: 18px; }
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px; z-index: 10; }
.bottom-nav a { font-size: 12px; text-align: center; padding: 10px 4px; }
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .bottom-nav { display: grid; }
  .main-content { padding: 16px; padding-bottom: 90px; }
  .topbar { font-size: 14px; }
  .pos-grid { grid-template-columns: 1fr; }
  .cart-panel { position: sticky; bottom: 70px; }
  .list-row, .cart-item { grid-template-columns: 1fr; }
  .row-meta { text-align: left; }
  .page-head { align-items: flex-start; }
}
