/* ---------- Brand tokens (client colour: red) ---------- */
:root {
  --brand: #c8102e;
  --brand-dark: #9b0c23;
  --brand-deep: #5e0614;
  --brand-soft: #fdecee;
  --brand-rgb: 200, 16, 46;
  --ink: #1d1b1f;
  --ink-2: #4a4650;
  --muted: #8a8590;
  --line: #ebe7e8;
  --surface: #ffffff;
  --canvas: #f7f5f5;
  --side: #17121a;
  --side-2: #241c27;
  --radius: 14px;
  --shadow: none;
  --shadow-lg: none;
  --accent: var(--brand);

  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: var(--brand-dark);
  --bs-link-hover-color-rgb: 155, 12, 35;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-body-font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-focus-ring-color: rgba(var(--brand-rgb), .2);
}

body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; font-size: .925rem; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1.55rem; }
h6 { font-size: .95rem; margin-bottom: .9rem; }
a { text-decoration: none; }
::selection { background: rgba(var(--brand-rgb), .18); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; letter-spacing: .005em; }
.btn-lg { border-radius: 12px; padding: .7rem 1.3rem; font-size: 1rem; }
.btn-sm { border-radius: 8px; }
.btn-primary, .btn-brand {
  --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand-deep);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  box-shadow: none;
}
.btn-dark {
  --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .35);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
}
.btn-outline-secondary, .btn-outline-dark {
  --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-bg: #fff;
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #f3f0f1; --bs-btn-hover-border-color: #ddd7d9;
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: #ece8e9; --bs-btn-active-border-color: #ddd7d9;
}
.btn-link { --bs-btn-color: var(--brand); --bs-btn-hover-color: var(--brand-dark); font-weight: 600; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--line); background-color: #fff; }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--brand-rgb), .55); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .12); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: rgba(var(--brand-rgb), .55); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .12); }
.form-label { font-weight: 600; color: var(--ink-2); font-size: .8rem; margin-bottom: .3rem; }

/* ---------- Cards, tables, badges ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card > h5, .card > h6, .card .d-flex > h6 { font-weight: 700; }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #faf6f7; --bs-table-border-color: var(--line); margin-bottom: 0; }
.table td, .table th { vertical-align: middle; padding-top: .6rem; padding-bottom: .6rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; border-bottom-width: 1px; background: transparent; }
.table td.text-end, .table th.text-end { white-space: nowrap; }
.table > :not(caption) > * > * { border-bottom-color: var(--line); }
.table tbody tr:last-child td { border-bottom: 0; }
.badge { font-weight: 600; border-radius: 999px; padding: .38em .7em; letter-spacing: .01em; }
.badge.bg-danger { background: var(--brand-soft) !important; color: var(--brand) !important; }
.badge.bg-warning { background: #fff4dc !important; color: #8a5a00 !important; }
.badge.bg-success { background: #e6f6ec !important; color: #157347 !important; }
.badge.bg-light { background: #f2eff0 !important; color: var(--ink-2) !important; }
.badge.bg-primary { background: var(--brand) !important; }
.badge.bg-dark { background: var(--ink) !important; }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.text-muted { color: var(--muted) !important; }
.alert { border: 0; border-radius: 12px; box-shadow: var(--shadow); }
.alert-success { background: #e8f7ee; color: #12633b; }
.alert-danger { background: var(--brand-soft); color: var(--brand-dark); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { color: var(--brand); }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex-shrink: 0; background: var(--side); color: #cfc8d2;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; height: 100%; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.35rem 1.25rem 1.1rem; color: #fff; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, #ef3349, var(--brand) 55%, var(--brand-deep)); color: #fff; font-size: 1.15rem;
  box-shadow: none;
}
.brand-name { font-weight: 700; font-size: .98rem; line-height: 1.15; color: #fff; }
.brand-sub { font-size: .72rem; color: #9a90a0; text-transform: uppercase; letter-spacing: .08em; }
.side-section { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #6f6574; padding: 1rem 1.4rem .4rem; font-weight: 700; }
.sidebar .nav { padding: 0 .75rem; }
.sidebar .nav-link {
  color: #c4bcc8; border-radius: 10px; padding: .58rem .8rem; margin-bottom: 2px; font-weight: 500;
  display: flex; align-items: center; gap: .7rem; transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.02rem; width: 1.2rem; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: var(--side-2); color: #fff; }
.sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff;
  box-shadow: none;
}
.sidebar .nav-link.active i { opacity: 1; }
.sidebar .back-link { margin: .25rem .75rem .25rem; background: var(--side-2); color: #fff; font-weight: 600; }
.sidebar .back-link:hover { background: #2f2533; }
.shop-chip { margin: 0 .75rem .5rem; padding: .7rem .85rem; border-radius: 12px; background: var(--side-2); display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; font-size: .88rem; }
.side-foot { margin-top: auto; padding: 1rem .75rem 1.1rem; border-top: 1px solid rgba(255,255,255,.06); }
.side-user { display: flex; align-items: center; gap: .65rem; padding: .5rem .55rem; border-radius: 12px; color: #fff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(var(--brand-rgb), .18); color: #ff8a98; font-weight: 700; font-size: .85rem;
}
.side-user .who { font-weight: 600; font-size: .86rem; line-height: 1.1; }
.side-user .role { font-size: .72rem; color: #9a90a0; }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; background: rgba(247, 245, 245, .85);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; display: flex; align-items: center; gap: .75rem;
}
.topbar .crumb { font-size: .78rem; color: var(--muted); line-height: 1.1; }
.topbar .crumb-title { font-weight: 700; color: var(--ink); font-size: 1rem; }
.topbar .btn-light { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.topbar .btn-light:hover { background: #fff; border-color: #d9d2d4; }
.content { padding: 1.75rem 1.5rem 2.5rem; min-width: 0; }
@media (min-width: 1200px) { .content { padding: 2rem 2.25rem 3rem; } .topbar { padding: .75rem 2.25rem; } }

/* ---------- Page header & stats ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); font-weight: 700; }
.stat { padding: 1.2rem 1.25rem !important; position: relative; overflow: hidden; }
.stat .label { font-size: .74rem; text-transform: uppercase; color: var(--muted); letter-spacing: .07em; font-weight: 700; }
.stat .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: .35rem 0 .15rem; color: var(--ink); }
.stat .value a { color: inherit; }
.stat .value a.text-danger { color: var(--brand) !important; }
.stat .stat-icon {
  position: absolute; top: 1.1rem; right: 1.1rem; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 1.1rem;
}
.stat.featured { background: linear-gradient(140deg, #e3263f 0%, var(--brand) 45%, var(--brand-deep) 100%); border: 0; box-shadow: var(--shadow-lg); }
.stat.featured .label, .stat.featured .small, .stat.featured .text-muted { color: rgba(255,255,255,.75) !important; }
.stat.featured .value { color: #fff; }
.stat.featured .stat-icon { background: rgba(255,255,255,.16); color: #fff; }
.stat.featured::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.07); }

.shop-card { border-top: 0; overflow: hidden; }
.shop-card::before { content: ""; display: block; height: 4px; background: var(--shop, var(--brand)); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; }

/* ---------- POS ---------- */
.pos-products { max-height: 66vh; overflow-y: auto; padding: 2px; }
.pos-item {
  cursor: pointer; transition: transform .08s, border-color .15s;
  border: 1px solid var(--line) !important; border-radius: 12px !important; padding: .8rem !important;
}
.pos-item:hover { border-color: rgba(var(--brand-rgb), .45) !important; }
.pos-item:active { transform: scale(.98); }
.pos-item.disabled { opacity: .45; pointer-events: none; }
.pos-item .fw-semibold { line-height: 1.25; margin: .15rem 0 .35rem; }
.pos-item .d-flex > span:first-child { color: var(--brand); font-weight: 700; }
.pos-cart { position: sticky; top: 84px; }
.pos-total { background: var(--brand-soft); border-radius: 12px; padding: .75rem 1rem; color: var(--brand-deep); }
.pos-total span:last-child { color: var(--brand); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, #ef3349 0%, var(--brand) 35%, var(--brand-deep) 80%, #2b030a 100%);
}
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); }
.login-hero::before { width: 520px; height: 520px; right: -180px; bottom: -200px; }
.login-hero::after { width: 340px; height: 340px; right: -90px; bottom: -110px; background: rgba(255,255,255,.04); }
.login-hero h1 { color: #fff; font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; max-width: 440px; }
.login-hero p { color: rgba(255,255,255,.78); max-width: 420px; }
.login-hero .brand-mark { background: rgba(255,255,255,.15); }
.hero-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px; background: rgba(255,255,255,.12); font-size: .82rem; margin: 0 .4rem .5rem 0; backdrop-filter: blur(6px); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.login-form .inner { width: 100%; max-width: 380px; }
.login-form .form-control { padding: .75rem .95rem; }
.login-form .input-icon { position: relative; }
.login-form .input-icon i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-form .input-icon .form-control { padding-left: 2.6rem; }
@media (max-width: 991.98px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem 1.5rem; min-height: 0; }
  .login-hero h1 { font-size: 1.7rem; }
  .login-hero .hero-bottom { display: none; }
}

/* ---------- Responsive shell ---------- */
@media (max-width: 991.98px) {
  .sidebar { position: fixed; height: 100vh; background: var(--side); }
  .sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--side); --bs-offcanvas-width: 280px; }
  .topbar { padding: .6rem 1rem; }
  .content { padding: 1.25rem 1rem 2rem; }
  .pos-cart { position: static; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar { display: none !important; }
  .content { padding: 0 !important; }
  .card { box-shadow: none; border: 0; }
}
.min-w-0 { min-width: 0; }
.stat .stat-icon + .label { min-height: 40px; padding-right: 52px; display: flex; align-items: center; margin-top: -.1rem; }
.stat .stat-icon { top: 1.1rem; }
.sidebar.offcanvas-lg, .sidebar .offcanvas-body { background-color: var(--side) !important; }
.login-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-hero, .login-form { min-width: 0; }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Admin: roles, settings ---------- */
.role-item { display: flex; align-items: center; gap: .85rem; padding: .8rem .85rem; border-radius: 12px; color: var(--ink); }
.role-item + .role-item { margin-top: 2px; }
.role-item:hover { background: #faf6f7; color: var(--ink); }
.role-item.active { background: var(--brand-soft); }
.role-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand); font-size: 1.05rem; }
.role-item.active .role-icon { background: var(--brand); color: #fff; }
.perm-group { border-top: 1px solid var(--line); padding: 1rem 0 .9rem; }
.perm { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.perm:hover { border-color: rgba(var(--brand-rgb), .35); }
.perm:has(input:checked) { border-color: rgba(var(--brand-rgb), .5); background: #fff8f9; }
.perm .form-check-input { margin-top: .2rem; flex-shrink: 0; }
.danger-zone { border-color: rgba(var(--brand-rgb), .3); }
.btn-outline-danger { --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .4); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
.form-text { color: var(--muted); font-size: .78rem; }

/* ---------- Reports ---------- */
.report-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.report-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .9rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.report-tabs a:hover { color: var(--ink); }
.report-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.period-pills { display: flex; flex-wrap: wrap; gap: .25rem; background: #f3f0f1; padding: .25rem; border-radius: 10px; }
.period-pills a { padding: .35rem .75rem; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .83rem; }
.period-pills a:hover { color: var(--ink); }
.period-pills a.active { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.delta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 700; font-size: .76rem; padding: .12rem .45rem; border-radius: 999px; }
.delta.up { background: #e6f6ec; color: #157347; }
.delta.down { background: var(--brand-soft); color: var(--brand); }
.delta.flat { background: #f2eff0; color: var(--muted); }
.stat.featured .delta { background: rgba(255,255,255,.18); color: #fff; }
.mini-stat { display: flex; gap: .7rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .85rem .9rem; height: 100%; }
.mini-stat > i { color: var(--brand); font-size: 1.05rem; margin-top: .1rem; }
.mini-stat .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.mini-stat .value { font-weight: 800; font-size: 1.02rem; }
.pl-row, .pl-total { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; }
.pl-row { border-bottom: 1px dashed var(--line); }
.pl-row.sub { color: var(--muted); font-size: .86rem; }
.pl-row.strong { font-weight: 700; }
.pl-total { margin-top: .6rem; padding: .85rem 1rem; border-radius: 12px; background: #e8f7ee; color: #12633b; font-weight: 800; font-size: 1.12rem; }
.pl-total.neg { background: var(--brand-soft); color: var(--brand); }
.rank-row { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank { width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.rank-row:first-child .rank { background: var(--brand); color: #fff; }
.bar { height: 6px; background: #f3f0f1; border-radius: 999px; margin: .35rem 0 .25rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem .5rem; font-size: .88rem; }
.report-table tfoot td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.pct { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.report-table td { font-variant-numeric: tabular-nums; }
@media print { .report-tabs, .period-pills { display: none !important; } canvas { max-width: 100%; } }

/* ---------- Activity log ---------- */
.log-day { position: sticky; top: 62px; z-index: 1; background: #faf8f8; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .45rem 1.5rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.log-row { display: flex; gap: .9rem; align-items: flex-start; padding: .85rem 1.5rem; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: #fcfafa; }
.log-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: #f2eff0; color: var(--ink-2); }
.log-icon.danger { background: var(--brand-soft); color: var(--brand); }
.log-text { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.log-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.log-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }
a.card.stat:hover { border-color: rgba(var(--brand-rgb), .35); }

/* ---------- Inactivity warning ---------- */
.idle-box { border: 0; border-radius: 18px; }
.idle-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 1.5rem; }
.idle-count { font-size: 2.8rem; font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.idle-count small { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: .3rem; }
.modal-backdrop.show { opacity: .55; }

/* ---------- Account card & log out ---------- */
.side-card { background: var(--side-2); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: .55rem; }
.side-card .side-user { padding: .35rem .35rem .6rem; }
.avatar { position: relative; }
.avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--side-2); }
.logout-btn {
  width: 100%; display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: #e9e3ec; font-weight: 600; font-size: .88rem;
  transition: background .2s, border-color .2s, color .2s;
}
.logout-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(var(--brand-rgb), .18); color: #ff7d8c; transition: background .2s, color .2s; }
.logout-arrow { opacity: .45; transition: transform .2s, opacity .2s; }
.logout-btn:hover, .logout-btn:focus-visible { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); border-color: transparent; color: #fff; outline: none; }
.logout-btn:hover .logout-icon, .logout-btn:focus-visible .logout-icon { background: rgba(255,255,255,.18); color: #fff; }
.logout-btn:hover .logout-arrow, .logout-btn:focus-visible .logout-arrow { opacity: 1; transform: translateX(3px); }
.logout-btn:active { transform: scale(.985); }

.account-menu { min-width: 250px; padding: .45rem; }
.account-head { display: flex; align-items: center; gap: .7rem; padding: .6rem .6rem .75rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }
.account-head .avatar.online::after { border-color: #fff; }
.account-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.menu-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f3f0f1; color: var(--ink-2); flex-shrink: 0; }
.account-menu .dropdown-item:hover .menu-icon { background: #ebe6e8; }
.logout-item { color: var(--brand); font-weight: 600 !important; }
.logout-item .menu-icon { background: var(--brand-soft); color: var(--brand); }
.logout-item:hover, .logout-item:focus { background: var(--brand-soft); color: var(--brand-dark); }
.logout-item:hover .menu-icon { background: var(--brand); color: #fff; }
.account-menu .dropdown-divider { margin: .3rem .2rem; border-color: var(--line); }
/* keep the account card pinned to the bottom; only the menu list scrolls on short screens */
.sidebar .offcanvas-body { overflow: hidden; }
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; flex-wrap: nowrap; padding-bottom: .5rem; scrollbar-width: thin; scrollbar-color: #3a2f3e transparent; }
.side-foot { flex-shrink: 0; padding-top: .75rem; }

/* ---------- Password recovery ---------- */
.recovery-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: .08em; text-align: center; padding: .9rem 1rem; border-radius: 12px; background: #faf6f7; border: 1.5px dashed rgba(var(--brand-rgb), .45); color: var(--brand-deep); user-select: all; }
.staff-note { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; background: #f6f3f4; font-size: .86rem; color: var(--ink-2); }
.staff-note > i { color: var(--brand); font-size: 1.1rem; }

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
  /* date filters: the two dates share a row, buttons drop below when needed */
  .date-filter { width: 100%; }
  .date-filter input[type=date] { flex: 1 1 130px; width: auto !important; min-width: 0; }
  .date-filter > span { display: none; }
  .period-pills { width: 100%; }
  .period-pills a { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 575.98px) {
  /* tables scroll sideways instead of squashing text into tall cells */
  .table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
  .content { padding-bottom: 5.5rem; }
}
@media (max-width: 991.98px) {
  /* POS: product grid flows with the page (no box-in-a-box scrolling); price above stock on small tiles */
  .pos-products { max-height: none; overflow: visible; }
  .pos-item .d-flex.justify-content-between { flex-direction: column; align-items: flex-start !important; gap: .25rem; }
  .cart-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1030; display: flex; align-items: center; gap: .75rem;
    padding: .8rem 1rem; border-radius: 14px; color: #fff; font-weight: 600;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  }
  .cart-bar[hidden] { display: none; }
  .cart-bar:hover { color: #fff; }
  .cart-bar-count { min-width: 28px; height: 28px; padding: 0 .4rem; border-radius: 999px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: .85rem; }
}

/* ---------- Receipts ---------- */
.receipt-list { max-height: 72vh; overflow-y: auto; }
.receipt-row { display: flex; gap: .8rem; align-items: center; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.receipt-row:last-child { border-bottom: 0; }
.receipt-row:hover { background: #fcf8f9; color: var(--ink); }
.receipt-row.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.rr-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: #f2eff0; color: var(--ink-2); }
.receipt-row.active .rr-icon { background: var(--brand); color: #fff; }
.rr-icon.void { background: var(--brand-soft); color: var(--brand); }
.receipt-preview { position: sticky; top: 84px; }
.receipt-preview iframe { width: 100%; height: 66vh; border: 0; border-radius: 10px; background: #e9e6e7; }
@media (max-width: 991.98px) { .receipt-list { max-height: none; } }
.pos-item.no-price { opacity: .55; background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #faf6f7 8px, #faf6f7 16px) !important; }

/* ---------- Quick price & stock entry ---------- */
.bulk-table input.form-control { width: 110px; display: inline-block; font-variant-numeric: tabular-nums; }
.bulk-table td .unit { min-width: 2.2rem; text-align: left; }
.bulk-table tr.no-price > td { background: #fffaf0; }
.bulk-table tr.no-price input.sell { border-color: #f0c36d; background: #fffdf6; }
.bulk-table tr.changed > td { background: #f2fbf5; }
.bulk-table tr.changed > td:first-child { box-shadow: inset 3px 0 0 #198754; }
.bulk-table input[readonly] { background: #f6f3f4; color: var(--muted); }
.bulk-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-weight: 600; }
.bulk-bar.active { border-color: rgba(var(--brand-rgb), .4); color: var(--ink); }
kbd { background: #f2eff0; color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: .05rem .35rem; font-size: .78em; }

/* ---------- Per-user modules ---------- */
.modules-box { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; background: #fcfbfb; }
.modules-box.is-custom { border-color: rgba(var(--brand-rgb), .35); background: #fff; }
.mod-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; background: #f3f0f1; padding: .25rem; border-radius: 10px; }
.mod-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mod-switch span { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .5rem; border-radius: 8px; font-weight: 600; font-size: .84rem; color: var(--ink-2); cursor: pointer; }
.mod-switch input:checked + span { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.mod-switch input:focus-visible + span { outline: 2px solid rgba(var(--brand-rgb), .4); }
.mod-group { padding: .5rem 0 .25rem; border-top: 1px dashed var(--line); }
.mod-group:first-child { border-top: 0; padding-top: 0; }
.mod-item { display: flex; align-items: center; gap: .55rem; padding: .3rem .1rem; font-size: .88rem; cursor: pointer; }
.mod-item input:disabled + span { color: var(--ink-2); }
.mod-item input:disabled { opacity: .8; }
@media (min-width: 576px) { .mod-group { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; } .mod-group > div:first-child { grid-column: 1 / -1; } }
/* user list: the last-login column only where there's room beside the form (sidebar + form take ~900px) */
.narrow-only { display: inline; }
.wide-only { display: none; }
@media (min-width: 1680px) { .narrow-only { display: none; } .wide-only { display: table-cell; } }
