:root {
  --gold: #b07d2b;
  --gold-dark: #8a5f1c;
  --gold-soft: #f6ecd9;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #f5f4f2;
  --side: #161412;
  --bs-primary: #8a5f1c;
  --bs-primary-rgb: 138, 95, 28;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --bs-link-color: #8a5f1c;
  --bs-link-color-rgb: 138, 95, 28;
}
body { background: var(--bg); color: var(--ink); font-size: .9rem; }
h1, h2, h3, h4, h5, .font-display { font-family: 'Outfit', sans-serif; }
a { color: var(--gold-dark); }
.btn-primary { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-bg: #000; --bs-btn-disabled-bg: #57534e; --bs-btn-disabled-border-color: #57534e; }
.btn-gold { --bs-btn-color: #fff; --bs-btn-bg: var(--gold-dark); --bs-btn-border-color: var(--gold-dark); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #6f4c15; --bs-btn-hover-border-color: #6f4c15; --bs-btn-active-bg: #6f4c15; --bs-btn-active-color: #fff; }
.btn-outline-gold { --bs-btn-color: var(--gold-dark); --bs-btn-border-color: var(--gold); --bs-btn-hover-bg: var(--gold-dark); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--gold-dark); }
.text-gold { color: var(--gold-dark) !important; }
.bg-gold-soft { background: var(--gold-soft) !important; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(176,125,43,.18); }
.form-label { font-weight: 600; font-size: .78rem; color: #44403c; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--gold-dark); border-color: var(--gold-dark); }

/* layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 256px; background: var(--side) url('img/sidebar-vein.svg') bottom / 100% auto no-repeat; color: #d6d3d1; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .2s; scrollbar-width: thin; scrollbar-color: #3a3632 transparent; }
.sidebar .brand { display: flex; gap: .75rem; align-items: center; padding: 1.1rem 1.15rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 42px; height: 42px; flex: none; }
.sidebar .brand strong { display: block; font-family: 'Outfit'; font-size: 1rem; line-height: 1.15; letter-spacing: .01em; }
.sidebar .brand small { color: #d9b26a; font-size: .7rem; letter-spacing: .04em; }
.sidebar nav { padding: .5rem .7rem 2rem; }
.nav-section { text-transform: uppercase; font-size: .64rem; letter-spacing: .1em; color: #78716c; padding: 1rem .75rem .35rem; font-weight: 700; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #d6d3d1; padding: .5rem .75rem; border-radius: 10px; font-weight: 500; font-size: .86rem; }
.sidebar .nav-link i { font-size: 1.02rem; opacity: .8; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: linear-gradient(135deg, #c99a4a, #8a5f1c); color: #fff; box-shadow: 0 6px 18px rgba(176,125,43,.3); }
.sidebar .nav-link.active i { opacity: 1; }
.nav-badge { margin-left: auto; background: #dc2626; color: #fff; font-size: .66rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.main { flex: 1; margin-left: 256px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 1.15rem; border: 1px solid var(--line); background: #fff; }
.user-chip { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .25rem .6rem .25rem .3rem; font-size: .82rem; }
.user-chip small { color: var(--muted); font-size: .7rem; }
.avatar-text { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg,#c99a4a,#8a5f1c); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .75rem; flex: none; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .76rem; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(12,10,9,.55); z-index: 1035; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
}

/* components */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-head p { color: var(--muted); margin: .15rem 0 0; }
.card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(28,25,23,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: .85rem 1.2rem; font-weight: 700; border-radius: 16px 16px 0 0 !important; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-family: 'Outfit'; font-size: .98rem; }
.card-body { padding: 1.2rem; }
.stat { display: flex; flex-direction: row; gap: .9rem; align-items: center; padding: 1rem 1.15rem; height: 100%; }
.stat .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.stat .lbl { color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .val { font-family: 'Outfit'; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.stat .sub { font-size: .74rem; color: var(--muted); }
.ico-gold { background: #f6ecd9; color: #8a5f1c; } .ico-blue { background: #dbeafe; color: #1d4ed8; }
.ico-green { background: #dcfce7; color: #15803d; } .ico-red { background: #fee2e2; color: #b91c1c; }
.ico-violet { background: #ede9fe; color: #6d28d9; } .ico-stone { background: #e7e5e4; color: #44403c; }
.ico-teal { background: #ccfbf1; color: #0f766e; } .ico-amber { background: #fef3c7; color: #b45309; }
.table { --bs-table-bg: transparent; vertical-align: middle; margin: 0; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafaf9; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.table td { border-color: #f1efed; }
.table tfoot td, .table tfoot th { background: #fafaf9; font-weight: 700; border-top: 2px solid var(--line); }
.table-hover tbody tr:hover td { background: #fbf8f2; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: #eee; }
.thumb-lg { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 600; background: #f5f5f4; color: #44403c; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .5; }
.filters { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filters .form-control, .filters .form-select { min-width: 140px; }
.badge { font-weight: 600; }

/* product cards */
.p-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; height: 100%; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.p-card:hover { box-shadow: 0 10px 30px rgba(28,25,23,.1); transform: translateY(-2px); }
.p-card .ph { position: relative; aspect-ratio: 4/3; background: #eee; }
.p-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.p-card .ph .cat { position: absolute; top: .6rem; left: .6rem; background: rgba(22,20,18,.75); color: #fff; backdrop-filter: blur(4px); border-radius: 99px; font-size: .68rem; padding: .2rem .6rem; font-weight: 600; }
.p-card .ph .low { position: absolute; top: .6rem; right: .6rem; }
.p-card .bd { padding: .85rem 1rem; flex: 1; display: flex; flex-direction: column; }
.p-card h6 { font-family: 'Outfit'; font-weight: 600; margin: 0 0 .15rem; font-size: .98rem; }
.p-card .price { font-family: 'Outfit'; font-weight: 700; color: var(--gold-dark); font-size: 1.05rem; }

/* items editor */
.items-table td { padding: .4rem; }
.items-table .form-control, .items-table .form-select { font-size: .85rem; }
.totals { max-width: 380px; margin-left: auto; }
.totals .row-t { display: flex; justify-content: space-between; padding: .35rem 0; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .6rem; font-family: 'Outfit'; font-size: 1.25rem; font-weight: 700; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art { position: relative; background: #111 url('img/login-quarry.jpg') center / cover; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem; }
.login-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,10,9,.55), rgba(12,10,9,.2) 40%, rgba(12,10,9,.85)); }
.login-art > * { position: relative; }
.login-art h1 { font-size: clamp(2rem, 3.4vw, 3.1rem); font-weight: 700; line-height: 1.08; }
.login-art .tags span { display: inline-block; border: 1px solid rgba(255,255,255,.35); border-radius: 99px; padding: .3rem .8rem; font-size: .78rem; margin: 0 .35rem .4rem 0; backdrop-filter: blur(4px); background: rgba(255,255,255,.08); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-form .inner { width: 100%; max-width: 400px; }
.demo-box { border: 1px dashed var(--gold); background: #fffaf0; border-radius: 14px; padding: .9rem; }
.demo-btn { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .6rem .75rem; transition: border-color .15s, box-shadow .15s; }
.demo-btn:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(176,125,43,.15); }
.demo-btn code { color: var(--gold-dark); font-size: .74rem; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { min-height: 260px; } }

/* POS */
body.pos-mode .content { padding: 0; }
body.pos-mode .app-footer { display: none; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - 59px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 1rem 1.25rem; }
.pos-cats { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: none; }
.pos-cats button { white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .4rem .9rem; font-size: .82rem; font-weight: 600; color: #44403c; }
.pos-cats button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); grid-auto-rows: max-content; gap: .8rem; align-content: start; padding: .25rem .1rem 1rem; }
.pos-item { border: 1px solid var(--line); background: #fff; border-radius: 14px; cursor: pointer; display: block; width: 100%; text-align: left; padding: 0; transition: box-shadow .12s, transform .12s; }
.pos-item:hover { box-shadow: 0 8px 22px rgba(28,25,23,.12); transform: translateY(-2px); }
.pos-item:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.pos-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; border-radius: 13px 13px 0 0; }
.pos-item .t { padding: .5rem .65rem .6rem; }
.pos-item .n { font-weight: 600; font-size: .82rem; line-height: 1.2; height: 2.4em; overflow: hidden; }
.pos-item .p { font-family: 'Outfit'; font-weight: 700; color: var(--gold-dark); }
.pos-item .s { font-size: .7rem; color: var(--muted); }
.pos-right { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pos-cart { flex: 1; overflow-y: auto; padding: .5rem 1rem; }
.cart-row { display: grid; grid-template-columns: 1fr auto; gap: .3rem .6rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.cart-row .nm { font-weight: 600; font-size: .84rem; }
.cart-row .ctrls { display: flex; gap: .35rem; align-items: center; grid-column: 1 / -1; }
.cart-row input { width: 86px; text-align: right; }
.pos-sum { border-top: 1px solid var(--line); padding: .9rem 1rem; background: #fafaf9; }
.pos-sum .grand { font-family: 'Outfit'; font-size: 1.6rem; font-weight: 800; }
@media (max-width: 991.98px) { .pos { grid-template-columns: 1fr; height: auto; } .pos-grid { max-height: 60vh; } }

/* documents / print */
.doc { background: #fff; max-width: 860px; margin: 0 auto; border-radius: 14px; border: 1px solid var(--line); padding: 2.2rem; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.doc-head img { width: 58px; height: 58px; }
.doc h2 { font-weight: 800; letter-spacing: .02em; margin: 0; }
.doc .meta td { padding: .15rem .6rem .15rem 0; font-size: .85rem; }
.doc .stamp { border: 2px solid; border-radius: 8px; padding: .2rem .7rem; font-weight: 800; letter-spacing: .1em; display: inline-block; transform: rotate(-6deg); }
.thermal { width: 80mm; margin: 0 auto; background: #fff; padding: 4mm; font-family: 'Courier New', monospace; font-size: 12px; color: #000; }
.thermal table { width: 100%; }
.thermal .c { text-align: center; }
.thermal hr { border-top: 1px dashed #000; opacity: 1; margin: 4px 0; }
@media print {
  .no-print, .sidebar, .topbar, .app-footer { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff; }
  .doc { border: 0; padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  a { text-decoration: none; color: inherit; }
}

/* Tom Select tune */
.ts-control { border-radius: var(--bs-border-radius); min-height: 38px; }
.ts-wrapper.form-select-sm .ts-control { min-height: 31px; padding-top: .25rem; padding-bottom: .25rem; }
.ts-dropdown .option img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; margin-right: .5rem; }
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 1.25rem; }
  .page-head > div:last-child { width: 100%; }
  .page-head .btn { font-size: .8rem; padding: .35rem .6rem; }
  .stat { padding: .8rem .9rem; }
  .stat .val { font-size: 1.15rem; }
  .doc { padding: 1rem; }
  .doc-head { flex-direction: column; }
  .doc-head .text-end { text-align: left !important; }
  .doc-head .meta { margin-left: 0 !important; }
}
