/* MosesPOS back-office design system: light surface, orange accent */
:root {
  --brand: #f97316; --brand-dark: #ea580c; --brand-soft: #fff3e8;
  --ink: #111827; --muted: #6b7280; --line: #ececec; --bg: #f7f7f8; --card: #ffffff;
  --ok: #10b981; --warn: #f59e0b; --bad: #ef4444; --radius: 14px;
  --side-w: 256px;
}
* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { color: var(--brand); }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: 0 0 var(--side-w); background: #fff; border-right: 1px solid var(--line); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.02em; border-bottom: 1px solid var(--line); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 17px; }
.brand b { color: var(--brand); }
.side-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 16px; scrollbar-width: thin; }
.nav-title { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; color: #9ca3af; text-transform: uppercase; padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #374151; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.nav-item i { font-size: 16px; color: #6b7280; width: 18px; text-align: center; }
.nav-item:hover { background: #f3f4f6; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item.active i { color: var(--brand); }
.nav-item .chev { margin-left: auto; font-size: 11px; transition: transform .15s; }
.nav-item[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-sub { margin: 2px 0 4px 18px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-sub .nav-item { font-size: 13px; padding: 6px 10px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px #d1fae5; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.crumbs { font-size: 13px; color: var(--muted); white-space: nowrap; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs span.sep { margin: 0 6px; color: #d1d5db; }
.top-search { flex: 1; max-width: 420px; position: relative; margin-left: 12px; }
.top-search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #f9fafb; padding: 0 12px 0 36px; font-size: 13px; }
.top-search i { position: absolute; left: 12px; top: 10px; color: #9ca3af; }
.top-chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; color: var(--ink); }
.top-chip small { display: block; font-size: 9.5px; letter-spacing: .06em; color: #9ca3af; text-transform: uppercase; line-height: 1; }
.top-chip span { line-height: 1.15; font-weight: 500; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: #4b5563; position: relative; }
.icon-btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn.brand:hover { background: var(--brand-dark); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; display: grid; place-items: center; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box .u-name { font-weight: 600; font-size: 13px; line-height: 1.1; }
.user-box .u-role { font-size: 11px; color: var(--muted); }
.content { padding: 24px; max-width: 1500px; width: 100%; }
.menu-toggle { display: none; }

/* ---------- page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1, .content h3 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .value.ok { color: var(--ok); } .stat .value.warn { color: var(--warn); } .stat .value.bad { color: var(--bad); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h6, .panel .panel-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.filters label, .form-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.empty i { font-size: 30px; display: block; margin-bottom: 8px; color: #d1d5db; }

/* ---------- bootstrap overrides ---------- */
.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; padding: 8px 14px; }
.btn-primary, .btn-success { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-success:hover, .btn-primary:focus, .btn-success:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-primary, .btn-outline-success { color: var(--brand-dark); border-color: #fdba74; background: #fff; }
.btn-outline-primary:hover, .btn-outline-success:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.btn-outline-secondary { color: #374151; border-color: #e5e7eb; background: #fff; }
.btn-outline-secondary:hover { background: #f3f4f6; color: var(--ink); border-color: #d1d5db; }
.btn-outline-danger { border-color: #fecaca; color: #dc2626; background: #fff; }
.btn-outline-danger:hover { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.btn-outline-warning { border-color: #fde68a; color: #b45309; background: #fff; }
.btn-outline-warning:hover { background: #fffbeb; color: #92400e; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.form-control, .form-select { border-radius: 10px; border-color: #e5e7eb; font-size: 13.5px; padding: 8px 12px; }
.form-control-sm, .form-select-sm { padding: 5px 9px; font-size: 13px; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.table { background: #fff; margin-bottom: 0; --bs-table-bg: #fff; }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: #f1f1f3; vertical-align: middle; }
.table thead th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; font-weight: 700; background: #f9fafb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-bordered { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-collapse: separate; border-spacing: 0; }
.table-bordered > :not(caption) > * { border-width: 0; }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px 0; }
.table-bordered tbody tr:last-child > * { border-bottom: 0; }
.table-hover tbody tr:hover > * { background: #fffaf5; }
.table-responsive-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.table-responsive-card .table { border: 0; }
.badge { border-radius: 999px; font-weight: 600; font-size: 11.5px; padding: 5px 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; background: #f3f4f6; color: #4b5563; }
.pill.ok { background: #d1fae5; color: #047857; } .pill.warn { background: #fef3c7; color: #b45309; }
.pill.bad { background: #fee2e2; color: #b91c1c; } .pill.brand { background: var(--brand-soft); color: var(--brand-dark); }
.alert { border-radius: 12px; border: 0; font-size: 13.5px; }
.alert-success { background: #ecfdf5; color: #047857; } .alert-danger { background: #fef2f2; color: #b91c1c; }
.alert-info { background: #eff6ff; color: #1d4ed8; } .alert-warning { background: #fffbeb; color: #b45309; }
.text-success { color: var(--ok) !important; } .text-danger { color: var(--bad) !important; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.08); font-size: 13.5px; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* product tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile .thumb { height: 120px; background: #f3f4f6; display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #9ca3af; overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .body { padding: 12px 14px; }
.tile .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sku { font-size: 11.5px; color: var(--muted); }
.tile .price { font-weight: 700; margin-top: 6px; }
.thumb-sm { width: 40px; height: 40px; border-radius: 9px; background: #f3f4f6; display: inline-grid; place-items: center; font-weight: 700; color: #9ca3af; overflow: hidden; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(135deg, #f97316, #fb923c 55%, #fdba74); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.login-art li { margin-bottom: 10px; }
.login-card { display: grid; place-items: center; padding: 30px; background: #fff; }
.login-card form { width: 100%; max-width: 360px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

@media (max-width: 991px) {
  .sidebar { position: fixed; left: -280px; transition: left .2s; }
  body.side-open .sidebar { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .menu-toggle { display: grid; }
  .top-search, .top-chip.hide-sm { display: none; }
  .content { padding: 16px; }
}
@media print { .sidebar, .topbar, .no-print { display: none !important; } .content { padding: 0; } }

/* scanner setup page (v5.1) */
.scan-test-box { border: 2px dashed #d1d5db; border-radius: 12px; padding: 18px; text-align: center; background: #f9fafb; }
.scan-test-box .code { font-family: ui-monospace, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .04em; }
.guide .panel-title { font-weight: 700; }
