
:root {
  --pos-primary: #2563eb;
  --pos-primary-hover: #1d4ed8;
  --pos-primary-soft: #eff6ff;
  --pos-sidebar: #0f172a;
  --pos-sidebar-secondary: #1e293b;
  --pos-background: #f5f7fb;
  --pos-surface: #ffffff;
  --pos-border: #e2e8f0;
  --pos-text: #172033;
  --pos-text-muted: #64748b;
  --pos-success: #15803d;
  --pos-success-soft: #ecfdf3;
  --pos-warning: #d97706;
  --pos-warning-soft: #fffbeb;
  --pos-danger: #dc2626;
  --pos-danger-soft: #fef2f2;
  --pos-info: #0284c7;
  --pos-info-soft: #f0f9ff;
  --pos-radius-sm: .5rem;
  --pos-radius-md: .75rem;
  --pos-radius-lg: 1rem;
  --pos-shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --pos-shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
  --sidebar-width: 264px;
  --sidebar-collapsed: 76px;
  --topbar-height: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--pos-text);
  background: var(--pos-background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .875rem;
  line-height: 1.5;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
a { color: var(--pos-primary); text-decoration: none; }
a:hover { color: var(--pos-primary-hover); }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 3000; background: #fff; padding: .7rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.text-muted { color: var(--pos-text-muted) !important; }
.text-sm { font-size: .78rem; }
.fw-semibold { font-weight: 600 !important; }
.icon-btn {
  width: 40px; height: 40px; border: 1px solid var(--pos-border); border-radius: .65rem;
  display: inline-grid; place-items: center; color: var(--pos-text-muted); background: #fff;
}
.icon-btn:hover { background: #f8fafc; color: var(--pos-primary); }
.btn { border-radius: .6rem; font-weight: 600; padding: .56rem .9rem; font-size: .84rem; }
.btn-primary { background: var(--pos-primary); border-color: var(--pos-primary); }
.btn-primary:hover { background: var(--pos-primary-hover); border-color: var(--pos-primary-hover); }
.btn-light { background: #fff; border-color: var(--pos-border); color: var(--pos-text); }
.btn-light:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-success { background: var(--pos-success); border-color: var(--pos-success); }
.btn-danger-soft { background: var(--pos-danger-soft); color: var(--pos-danger); border: 1px solid #fecaca; }
.form-control, .form-select {
  min-height: 42px; border-color: var(--pos-border); border-radius: .6rem; color: var(--pos-text); font-size: .84rem;
}
.form-control:focus, .form-select:focus { border-color: #93b4fb; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .12); }
.form-label { margin-bottom: .4rem; font-size: .8rem; color: #334155; font-weight: 600; }
.form-text { font-size: .72rem; color: var(--pos-text-muted); }
.required::after { content: " *"; color: var(--pos-danger); }
.input-group-text { border-color: var(--pos-border); background: #f8fafc; font-size: .82rem; }

/* Application shell */
.brand-logo { display: inline-block; max-width: 100%; line-height: 0; vertical-align: middle; }
.brand-logo > img { display: block; width: 100%; height: auto; object-fit: contain; }
.brand-logo--sidebar { width: 190px; }
.brand-logo--sidebar-compact { display: none; width: 42px; }
.brand-logo--auth { width: min(280px, 100%); }
.brand-logo--auth-card { width: min(220px, 78%); }
.brand-logo--setup { width: min(205px, 48vw); }
.brand-logo--scanner { width: min(190px, 52vw); }
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
  .brand-logo--inverse {
    background-color: var(--brand-logo-color, #fff);
    -webkit-mask-image: var(--brand-logo-mask);
    mask-image: var(--brand-logo-mask);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
  }
  .brand-logo--inverse > img { opacity: 0; }
}
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 1040; inset: 0 auto 0 0; width: var(--sidebar-width);
  background: var(--pos-sidebar); color: #cbd5e1; display: flex; flex-direction: column;
  transition: width .2s ease, transform .2s ease;
}
.sidebar-brand { height: var(--topbar-height); padding: 0 1.1rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: .75rem; display: grid; place-items: center;
  color: #fff; font-size: 1.15rem; background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 5px 14px rgba(37,99,235,.35);
}
.brand-copy { min-width: 0; white-space: nowrap; }
.brand-copy strong { display: block; color: #fff; font-size: .98rem; line-height: 1.2; letter-spacing: -.02em; }
.brand-copy small { color: #94a3b8; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-scroll { overflow: auto; padding: .75rem .7rem 1rem; scrollbar-width: thin; }
.nav-section { margin: .85rem .55rem .35rem; color: #64748b; font-size: .62rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: .18rem; }
.sidebar-link {
  min-height: 42px; padding: .58rem .72rem; display: flex; align-items: center; gap: .78rem; color: #aebbd0;
  border-radius: .55rem; white-space: nowrap; transition: background .14s, color .14s;
}
.sidebar-link i { flex: 0 0 20px; font-size: 1.02rem; text-align: center; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-link.active { color: #fff; background: #2563eb; box-shadow: 0 5px 14px rgba(37,99,235,.2); }
.sidebar-footer { margin-top: auto; padding: .8rem; border-top: 1px solid rgba(255,255,255,.08); }
.register-pill { padding: .7rem; background: rgba(255,255,255,.06); border-radius: .65rem; display: flex; gap: .6rem; align-items: center; white-space: nowrap; overflow: hidden; }
.register-dot { width: 9px; height: 9px; background: #4ade80; border-radius: 99px; box-shadow: 0 0 0 4px rgba(74,222,128,.12); flex: 0 0 auto; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); transition: margin-left .2s ease; }
.topbar {
  height: var(--topbar-height); padding: 0 1.5rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--pos-border);
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; backdrop-filter: blur(10px);
}
.topbar-search {
  width: min(360px, 35vw); height: 40px; display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--pos-border); border-radius: .65rem; color: var(--pos-text-muted); background: #f8fafc; padding: 0 .8rem;
}
.topbar-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { margin-left: auto; padding: .08rem .35rem; border: 1px solid #cbd5e1; border-bottom-width: 2px; border-radius: .3rem; background: #fff; color: #64748b; font-size: .67rem; }
.selector-btn { height: 40px; border: 1px solid var(--pos-border); background: #fff; border-radius: .65rem; padding: 0 .75rem; display: flex; align-items: center; gap: .5rem; color: #334155; }
.topbar-spacer { flex: 1; }
.topbar-avatar { width: 36px; height: 36px; border-radius: 50%; background: #dbeafe; color: #1d4ed8; display: grid; place-items: center; font-weight: 700; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--pos-danger); border: 2px solid #fff; }
.content { padding: 1.35rem 1.5rem 2.5rem; max-width: 1800px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.breadcrumb { margin: 0 0 .35rem; font-size: .73rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }
.page-title { margin: 0; font-size: 1.45rem; line-height: 1.25; font-weight: 700; letter-spacing: -.035em; }
.page-subtitle { margin: .3rem 0 0; color: var(--pos-text-muted); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-section, .sidebar-collapsed .sidebar-link span, .sidebar-collapsed .register-pill > div { display: none; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar-collapsed .brand-logo--sidebar { display: none; }
.sidebar-collapsed .brand-logo--sidebar-compact { display: inline-block; }

/* Cards, stats, badges */
.card {
  border: 1px solid var(--pos-border); border-radius: var(--pos-radius-md); background: var(--pos-surface); box-shadow: var(--pos-shadow-sm);
}
.card-header { padding: 1rem 1.1rem; background: transparent; border-bottom-color: var(--pos-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-header h2, .card-header h3 { margin: 0; font-size: .92rem; font-weight: 700; }
.card-body { padding: 1.1rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi-card { padding: 1rem; position: relative; overflow: hidden; }
.kpi-top { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.kpi-icon { width: 40px; height: 40px; border-radius: .7rem; display: grid; place-items: center; font-size: 1rem; }
.kpi-icon.primary { background: var(--pos-primary-soft); color: var(--pos-primary); }
.kpi-icon.success { background: var(--pos-success-soft); color: var(--pos-success); }
.kpi-icon.warning { background: var(--pos-warning-soft); color: var(--pos-warning); }
.kpi-icon.danger { background: var(--pos-danger-soft); color: var(--pos-danger); }
.kpi-label { color: var(--pos-text-muted); font-size: .76rem; font-weight: 500; }
.kpi-value { margin: .35rem 0 .18rem; font-size: 1.45rem; line-height: 1.2; font-weight: 700; letter-spacing: -.04em; }
.kpi-trend { font-size: .7rem; color: var(--pos-text-muted); }
.trend-up { color: var(--pos-success); font-weight: 600; }
.trend-down { color: var(--pos-danger); font-weight: 600; }
.badge-status { display: inline-flex; align-items: center; gap: .33rem; padding: .28rem .52rem; border-radius: 99px; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.badge-status i { font-size: .64rem; }
.status-success { color: #166534; background: #dcfce7; }
.status-warning { color: #92400e; background: #fef3c7; }
.status-danger { color: #991b1b; background: #fee2e2; }
.status-info { color: #075985; background: #e0f2fe; }
.status-neutral { color: #475569; background: #f1f5f9; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: #e0e7ff; color: #4338ca; font-size: .72rem; font-weight: 700; flex: 0 0 auto; }
.avatar.square { border-radius: .55rem; }
.stacked-cell { display: flex; gap: .65rem; align-items: center; min-width: 170px; }
.stacked-cell small { display: block; color: var(--pos-text-muted); font-size: .69rem; }
.progress-thin { height: 5px; border-radius: 9px; background: #e2e8f0; overflow: hidden; }
.progress-thin > span { display: block; height: 100%; border-radius: inherit; background: var(--pos-primary); }

/* Tables and toolbars */
.table-card { overflow: hidden; }
.table-toolbar { padding: .85rem 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; border-bottom: 1px solid var(--pos-border); }
.toolbar-search { position: relative; width: min(300px, 100%); }
.toolbar-search i { position: absolute; left: .75rem; top: 50%; translate: 0 -50%; color: #94a3b8; }
.toolbar-search .form-control { padding-left: 2.2rem; }
.toolbar-spacer { flex: 1; }
.table-responsive { scrollbar-width: thin; }
.table { margin: 0; font-size: .77rem; vertical-align: middle; }
.table > :not(caption) > * > * { padding: .78rem 1rem; border-bottom-color: #edf1f6; }
.table thead th { color: #64748b; background: #f8fafc; font-size: .68rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover { background: #fafcff; }
.table td { color: #334155; }
.table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-pagination { min-height: 58px; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--pos-border); color: var(--pos-text-muted); font-size: .73rem; }
.pagination { margin: 0; }
.page-link { color: #475569; border-color: var(--pos-border); font-size: .74rem; }
.page-item.active .page-link { background: var(--pos-primary); border-color: var(--pos-primary); }
.row-actions .dropdown-toggle::after { display: none; }
.sortable::after { content: "\F229"; font-family: "bootstrap-icons"; margin-left: .35rem; color: #cbd5e1; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto .9rem; display: grid; place-items: center; border-radius: 1rem; background: #f1f5f9; color: #64748b; font-size: 1.4rem; }
.empty-state h3 { font-size: .95rem; margin-bottom: .3rem; }
.empty-state p { color: var(--pos-text-muted); margin: 0 auto .9rem; max-width: 410px; }

/* Users & permissions tables */
.accounts-table-card { overflow: visible; }
.accounts-table-wrap, .users-table-wrap { position: relative; overflow-x: auto; overflow-y: visible; }
.accounts-table { min-width: 760px; }
.users-table { min-width: 1040px; }
.accounts-table > :not(caption) > * > * { padding: .82rem 1rem; vertical-align: middle; }
.accounts-table thead th { height: 48px; }
.accounts-table tbody tr { transition: background-color .12s ease; }
.accounts-table tbody tr:hover { background: #f8fbff; }
.accounts-table .select-cell { width: 44px; padding-right: .25rem; text-align: center; }
.accounts-table .actions-cell { width: 94px; }
.accounts-table .user-primary { display: inline-flex; flex-direction: column; gap: .12rem; min-width: 170px; color: var(--pos-text); }
.accounts-table .user-primary strong { font-weight: 650; }
.accounts-table .user-primary small { color: var(--pos-text-muted); font-size: .7rem; }
.accounts-table .accounts-truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounts-table .role-chip { display: inline-block; margin: .1rem .2rem .1rem 0; padding: .2rem .45rem; border-radius: .35rem; background: var(--pos-primary-soft); color: #1d4ed8; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.accounts-table .metric-value { color: var(--pos-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.row-action-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.accounts-table .dropdown-menu { z-index: 1080; min-width: 180px; box-shadow: var(--pos-shadow-md); }
.accounts-toolbar, .users-filter-row { background: #fff; }
.users-bulk-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.users-record-summary { display: flex; align-items: baseline; gap: .5rem; min-width: 170px; }
.users-record-summary [data-selected-count] { font-size: .75rem; }
.users-columns-dropdown { margin-left: auto; }
.users-columns-dropdown .dropdown-menu { min-width: 190px; z-index: 1080; }
.users-columns-dropdown .dropdown-item { cursor: pointer; font-size: .78rem; }
.users-bulk-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.users-bulk-controls .form-select { width: auto; min-width: 155px; }
.accounts-pagination { min-height: 58px; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--pos-text-muted); font-size: .73rem; }
.permissions-module .permission-group { border-color: var(--pos-border) !important; background: #fbfdff; }
.permissions-module .permission-option { display: flex; align-items: flex-start; gap: .55rem; min-height: 38px; padding: .55rem .65rem; border: 1px solid transparent; border-radius: .5rem; cursor: pointer; }
.permissions-module .permission-option:hover { border-color: var(--pos-border); background: #fff; }

/* User form controls */
.user-form-card { overflow: visible; }
.user-form-section { padding: 1.1rem; border-bottom: 1px solid var(--pos-border); }
.user-form-section:last-of-type { border-bottom: 0; }
.user-form-section h3 { margin: 0 0 .2rem; font-size: .9rem; }
.user-form-section > p { margin: 0 0 1rem; color: var(--pos-text-muted); font-size: .76rem; }
.password-field .input-group .form-control { border-right: 0; }
.password-field .input-group .btn { border-color: var(--pos-border); background: #fff; color: var(--pos-text-muted); }
.accounts-groups-select { min-height: 150px; }
.user-form-checks { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; padding-top: .45rem; }
.user-form-check { display: flex; align-items: center; gap: .5rem; }
.user-form-check .form-check-input { margin: 0; }
.skeleton { position: relative; overflow: hidden; background: #e9eef5; border-radius: .3rem; }
.skeleton::after { content: ""; position: absolute; inset: 0; translate: -100% 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { translate: 100% 0; } }

/* Dashboard and general page components */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 1rem; margin-bottom: 1rem; }
.chart-wrap { position: relative; height: 285px; }
.chart-wrap.sm { height: 235px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.quick-action { padding: .8rem; border: 1px solid var(--pos-border); border-radius: .65rem; display: flex; align-items: center; gap: .65rem; color: #334155; background: #fff; }
.quick-action:hover { border-color: #93b4fb; background: var(--pos-primary-soft); color: var(--pos-primary); }
.quick-action i { width: 32px; height: 32px; border-radius: .5rem; display: grid; place-items: center; background: #f1f5f9; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.panel-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 1rem 1.55rem; }
.timeline li::before { content: ""; position: absolute; left: .2rem; top: .35rem; width: 8px; height: 8px; background: var(--pos-primary); border-radius: 50%; box-shadow: 0 0 0 4px #dbeafe; }
.timeline li::after { content: ""; position: absolute; left: .42rem; top: .85rem; bottom: -.1rem; border-left: 1px solid var(--pos-border); }
.timeline li:last-child::after { display: none; }
.timeline p { margin: 0; font-size: .78rem; }
.timeline time { color: var(--pos-text-muted); font-size: .68rem; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.25rem; }
.detail-list dt { color: var(--pos-text-muted); font-size: .7rem; font-weight: 500; }
.detail-list dd { margin: .15rem 0 0; font-weight: 600; color: #334155; }
.section-title { margin: 0 0 .85rem; font-size: .95rem; font-weight: 700; }
.filter-strip { padding: .85rem; margin-bottom: 1rem; display: grid; grid-template-columns: repeat(3, max-content) 1fr; gap: .65rem; align-items: center; }
.filter-strip .form-control, .filter-strip .form-select { width: auto; min-width: 145px; }
.tabs-modern { border-bottom: 1px solid var(--pos-border); gap: .3rem; }
.tabs-modern .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--pos-text-muted); padding: .8rem 1rem; font-weight: 600; font-size: .8rem; }
.tabs-modern .nav-link.active { color: var(--pos-primary); border-color: var(--pos-primary); background: transparent; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.report-card { padding: 1rem; display: flex; gap: .8rem; align-items: start; color: var(--pos-text); }
.report-card:hover { border-color: #93b4fb; box-shadow: var(--pos-shadow-md); }
.report-card i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: .65rem; color: var(--pos-primary); background: var(--pos-primary-soft); flex: 0 0 auto; }
.report-card h3 { font-size: .82rem; margin: .05rem 0 .22rem; }
.report-card p { font-size: .7rem; color: var(--pos-text-muted); margin: 0; }

/* POS terminal */
.pos-page .content { max-width: none; padding: 1rem; }
.pos-page .page-head { display: none; }
.pos-statusbar {
  height: 45px; margin-bottom: .8rem; padding: 0 .9rem; background: #fff; border: 1px solid var(--pos-border);
  border-radius: .7rem; display: flex; align-items: center; gap: 1.2rem; box-shadow: var(--pos-shadow-sm); font-size: .74rem;
}
.pos-statusbar .status-item { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.pos-layout { height: calc(100vh - var(--topbar-height) - 78px); min-height: 610px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(390px, .8fr); gap: .8rem; }
.product-panel, .cart-panel { min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--pos-border); border-radius: .8rem; box-shadow: var(--pos-shadow-sm); overflow: hidden; }
.pos-search { padding: .85rem; border-bottom: 1px solid var(--pos-border); }
.pos-search .form-control { height: 48px; font-size: .9rem; padding-left: 2.5rem; }
.pos-search-wrap { position: relative; }
.pos-search-wrap > i { position: absolute; left: .85rem; top: 50%; translate: 0 -50%; color: #64748b; z-index: 5; font-size: 1rem; }
.category-row { padding: .7rem .85rem; display: flex; gap: .45rem; overflow: auto; border-bottom: 1px solid var(--pos-border); scrollbar-width: none; }
.category-chip { border: 1px solid var(--pos-border); border-radius: 99px; padding: .38rem .7rem; background: #fff; color: #475569; white-space: nowrap; font-size: .73rem; font-weight: 600; }
.category-chip.active { color: #fff; border-color: var(--pos-primary); background: var(--pos-primary); }
.product-grid { padding: .8rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; overflow-y: auto; align-content: start; }
.product-card { position: relative; min-width: 0; border: 1px solid var(--pos-border); border-radius: .7rem; overflow: hidden; cursor: pointer; background: #fff; transition: border-color .12s, translate .12s, box-shadow .12s; }
.product-card:hover { border-color: #93b4fb; translate: 0 -2px; box-shadow: 0 7px 18px rgba(15,23,42,.09); }
.product-card:active { translate: 0 0; }
.product-thumb { height: 92px; display: grid; place-items: center; font-size: 2rem; background: linear-gradient(145deg, #f8fafc, #eef2f7); }
.product-info { padding: .65rem; }
.product-name { min-height: 35px; margin: 0 0 .35rem; font-size: .75rem; font-weight: 700; line-height: 1.35; }
.product-meta { display: flex; justify-content: space-between; gap: .5rem; color: var(--pos-text-muted); font-size: .64rem; }
.product-price { margin-top: .35rem; color: var(--pos-primary); font-weight: 700; }
.stock-warning { position: absolute; right: .4rem; top: .4rem; padding: .18rem .35rem; border-radius: .3rem; background: #fef3c7; color: #92400e; font-size: .57rem; font-weight: 700; }
.cart-head { padding: .75rem .85rem; border-bottom: 1px solid var(--pos-border); }
.customer-select { display: flex; gap: .5rem; }
.customer-select .form-select { flex: 1; }
.cart-items { flex: 1; min-height: 110px; overflow-y: auto; padding: .15rem .75rem; }
.cart-item { padding: .7rem 0; border-bottom: 1px solid #edf1f6; }
.cart-item-top { display: flex; align-items: start; justify-content: space-between; gap: .6rem; }
.cart-item-name { min-width: 0; font-size: .75rem; font-weight: 600; }
.cart-item-name small { display: block; color: var(--pos-text-muted); font-weight: 400; font-size: .63rem; }
.cart-item-price { font-weight: 700; white-space: nowrap; font-size: .75rem; }
.cart-item-bottom { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-top: .55rem; }
.qty-control { display: inline-flex; height: 30px; border: 1px solid var(--pos-border); border-radius: .45rem; overflow: hidden; }
.qty-control button { width: 29px; border: 0; background: #f8fafc; color: #475569; }
.qty-control input { width: 39px; border: 0; text-align: center; font-weight: 600; font-size: .72rem; }
.cart-summary { padding: .75rem .85rem; border-top: 1px solid var(--pos-border); background: #fbfcfe; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .18rem 0; font-size: .74rem; color: #475569; }
.summary-total { margin-top: .45rem; padding-top: .55rem; border-top: 1px dashed #cbd5e1; align-items: end; color: var(--pos-text); font-weight: 700; }
.summary-total strong { font-size: 1.6rem; line-height: 1; letter-spacing: -.05em; color: var(--pos-primary); }
.cart-actions { display: grid; grid-template-columns: .8fr .8fr 1.5fr; gap: .5rem; padding: .75rem .85rem; border-top: 1px solid var(--pos-border); }
.cart-actions .btn { min-height: 48px; }
.mobile-cart-fab { display: none; position: fixed; z-index: 1025; right: 1rem; bottom: 1rem; border-radius: 99px; box-shadow: 0 10px 25px rgba(37,99,235,.3); }
.shortcut-bar { display: flex; gap: .7rem; color: var(--pos-text-muted); font-size: .65rem; }
.shortcut-bar b { color: #475569; }
.payment-total { text-align: center; padding: 1rem; background: var(--pos-primary-soft); border-radius: .8rem; margin-bottom: 1rem; }
.payment-total small { color: var(--pos-text-muted); }
.payment-total strong { display: block; color: var(--pos-primary); font-size: 2rem; letter-spacing: -.05em; }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1rem; }
.payment-method { padding: .7rem .4rem; border: 1px solid var(--pos-border); border-radius: .6rem; text-align: center; background: #fff; cursor: pointer; font-size: .7rem; }
.payment-method i { display: block; margin-bottom: .25rem; font-size: 1.15rem; color: #64748b; }
.payment-method.active { border-color: var(--pos-primary); background: var(--pos-primary-soft); color: var(--pos-primary); }
.payment-method.active i { color: var(--pos-primary); }

/* Auth, setup and settings */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-branding { position: relative; padding: 4rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #fff; background: radial-gradient(circle at 80% 10%, #1d4ed8, transparent 35%), linear-gradient(145deg, #0f172a, #172554); }
.auth-branding::after { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -120px; bottom: -150px; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.02); }
.auth-brand { display: flex; align-items: center; gap: .8rem; position: relative; z-index: 1; }
.auth-card-brand { display: none; margin: 0 auto 1.5rem; text-align: center; }
.auth-card-brand--always { display: block; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-copy h1 { margin: 0 0 1rem; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; letter-spacing: -.055em; }
.auth-copy p { margin: 0; max-width: 450px; color: #cbd5e1; font-size: .95rem; }
.auth-features { display: flex; gap: 1.2rem; position: relative; z-index: 1; color: #cbd5e1; font-size: .72rem; }
.auth-features i { color: #60a5fa; margin-right: .3rem; }
.auth-main { display: grid; place-items: center; padding: 2rem; background: var(--pos-background); }
.auth-main--full { grid-column: 1 / -1; }
.auth-card { width: min(440px, 100%); padding: 2rem; }
.auth-card h2 { margin: 0 0 .35rem; font-size: 1.55rem; letter-spacing: -.04em; }
.auth-card > p { color: var(--pos-text-muted); margin-bottom: 1.5rem; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 2.8rem; }
.password-toggle { position: absolute; top: 50%; right: .35rem; translate: 0 -50%; width: 36px; height: 36px; border: 0; background: transparent; color: #64748b; }
.security-note { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--pos-border); display: flex; align-items: start; gap: .55rem; color: var(--pos-text-muted); font-size: .7rem; }
.setup-layout { min-height: 100vh; background: var(--pos-background); }
.setup-top { height: 68px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--pos-border); }
.setup-brand { display: flex; align-items: center; }
.setup-main { width: min(1050px, calc(100% - 2rem)); margin: 2.2rem auto; }
.setup-steps { display: flex; margin-bottom: 1.5rem; }
.setup-step { flex: 1; position: relative; display: flex; align-items: center; gap: .55rem; color: #94a3b8; font-size: .72rem; font-weight: 600; }
.setup-step::after { content: ""; height: 2px; background: #e2e8f0; flex: 1; }
.setup-step:last-child::after { display: none; }
.setup-step span { width: 28px; height: 28px; display: grid; place-items: center; background: #e2e8f0; border-radius: 50%; }
.setup-step.active, .setup-step.done { color: var(--pos-primary); }
.setup-step.active span { color: #fff; background: var(--pos-primary); box-shadow: 0 0 0 4px #dbeafe; }
.setup-step.done span { color: #166534; background: #dcfce7; }
.setup-card { display: grid; grid-template-columns: minmax(0, 1fr) 280px; overflow: hidden; }
.setup-form { padding: 1.5rem; }
.setup-summary { padding: 1.5rem; background: #f8fafc; border-left: 1px solid var(--pos-border); }
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 1rem); align-self: start; padding: .5rem; }
.settings-link { display: block; padding: .58rem .7rem; color: #475569; border-radius: .5rem; font-size: .76rem; }
.settings-link:hover, .settings-link.active { color: var(--pos-primary); background: var(--pos-primary-soft); }
.settings-section { padding: 1.2rem; margin-bottom: 1rem; }
.settings-section h2 { font-size: .98rem; margin-bottom: .25rem; }
.settings-section > p { color: var(--pos-text-muted); font-size: .73rem; padding-bottom: 1rem; border-bottom: 1px solid var(--pos-border); }
.switch-row { display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #edf1f6; }
.switch-row:last-child { border: 0; }
.switch-row label { font-weight: 600; font-size: .78rem; }
.switch-row p { margin: .15rem 0 0; color: var(--pos-text-muted); font-size: .69rem; }

/* Business settings forms and tables */
.settings-card { padding: 0; overflow: visible; }
.settings-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.2rem 1rem; border-bottom: 1px solid var(--pos-border); }
.settings-card-header h2 { margin: 0; font-size: .98rem; }
.settings-card-header p { margin: .3rem 0 0; color: var(--pos-text-muted); font-size: .74rem; }
.settings-form { padding: 1.2rem; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.settings-form-grid-wide .settings-form-field:nth-child(6), .settings-form-grid-wide .settings-form-field:nth-child(7), .settings-form-grid-wide .settings-form-field:nth-child(8) { grid-column: 1 / -1; }
.settings-form-field { min-width: 0; }
.settings-form-field .form-control, .settings-form-field .form-select { width: 100%; }
.settings-form-field textarea.form-control { min-height: 96px; resize: vertical; }
.settings-form-field input[type="file"].form-control { padding: .45rem .65rem; }
.settings-form-field.has-error .form-control, .settings-form-field.has-error .form-select { border-color: var(--pos-danger); }
.settings-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; padding: .75rem .9rem; border: 1px solid var(--pos-border); border-radius: .65rem; background: #fbfdff; }
.settings-toggle-row p { margin: .2rem 0 0; color: var(--pos-text-muted); font-size: .7rem; }
.settings-toggle-label { display: block; color: #334155; font-size: .8rem; font-weight: 600; cursor: pointer; }
.settings-switch { margin: 0; flex: 0 0 auto; }
.settings-switch .form-check-input { width: 2.35rem; height: 1.25rem; margin: 0; cursor: pointer; }
.settings-form-actions { display: flex; justify-content: flex-end; gap: .55rem; margin: 1.2rem -1.2rem -1.2rem; padding: .9rem 1.2rem; border-top: 1px solid var(--pos-border); background: #fbfcfe; }
.settings-notice { margin: 1rem 1.2rem 0; padding: .7rem .85rem; border: 1px solid #bfdbfe; border-radius: .55rem; background: #eff6ff; color: #1e40af; font-size: .74rem; }
.settings-notice-warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.settings-subheading { margin: 1.2rem 1.2rem .6rem; font-size: .82rem; }
.settings-list-filter { display: flex; gap: .55rem; padding: 1rem 1.2rem 0; max-width: 560px; }
.settings-table-wrapper { overflow-x: auto; overflow-y: visible; padding: 0 1.2rem 1.2rem; }
.settings-table { min-width: 680px; margin: 1rem 0 0; font-size: .78rem; }
.settings-table > :not(caption) > * > * { padding: .78rem .8rem; vertical-align: middle; }
.settings-table thead th { color: #64748b; background: #f8fafc; font-size: .68rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.settings-table tbody tr { transition: background-color .12s ease; }
.settings-table tbody tr:hover { background: #f8fbff; }
.settings-empty-state { padding: 2.2rem 1rem; text-align: center; color: var(--pos-text-muted); }
.settings-empty-state > i { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto .7rem; border-radius: .75rem; background: var(--pos-primary-soft); color: var(--pos-primary); font-size: 1.2rem; }
.settings-empty-state h3 { margin: 0 0 .25rem; color: var(--pos-text); font-size: .86rem; }
.settings-empty-state p { margin: 0 auto .85rem; max-width: 360px; font-size: .74rem; }

/* Print */
.print-sheet { width: 210mm; min-height: 297mm; margin: 1.5rem auto; padding: 16mm; background: #fff; box-shadow: var(--pos-shadow-md); }
.receipt-sheet { width: 80mm; min-height: 170mm; margin: 1.5rem auto; padding: 5mm; background: #fff; box-shadow: var(--pos-shadow-md); color: #111; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.print-header { display: flex; justify-content: space-between; gap: 2rem; padding-bottom: 1.2rem; border-bottom: 2px solid #0f172a; }
.print-logo { display: flex; gap: .7rem; align-items: center; }
.print-logo .brand-mark { print-color-adjust: exact; }
.receipt-sheet .print-logo { display: block; text-align: center; }
.receipt-sheet .brand-mark { margin: 0 auto .4rem; }
.receipt-divider { margin: .55rem 0; border-top: 1px dashed #111; }
.receipt-row { display: flex; justify-content: space-between; gap: .5rem; }
.receipt-products { width: 100%; }
.receipt-products td { padding: .17rem 0; vertical-align: top; }
.barcode-placeholder { margin: .7rem auto .3rem; width: 160px; height: 40px; background: repeating-linear-gradient(90deg,#111 0 2px,#fff 2px 4px,#111 4px 5px,#fff 5px 8px); }

/* Responsive */
@media (max-width: 1199.98px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: minmax(0, 1.4fr) minmax(350px, .8fr); }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: min(290px, 88vw); }
  .app-main, .sidebar-collapsed .app-main { margin-left: 0; }
  .mobile-nav-open .sidebar { transform: none; box-shadow: 20px 0 40px rgba(15,23,42,.22); }
  .mobile-nav-open::after { content: ""; position: fixed; z-index: 1035; inset: 0; background: rgba(15,23,42,.42); }
  .sidebar-collapsed .brand-copy, .sidebar-collapsed .nav-section, .sidebar-collapsed .sidebar-link span, .sidebar-collapsed .register-pill > div { display: block; }
  .sidebar-collapsed .sidebar-link { justify-content: flex-start; padding: .58rem .72rem; }
  .sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding: 0 1.1rem; }
  .sidebar-collapsed .brand-logo--sidebar { display: inline-block; }
  .sidebar-collapsed .brand-logo--sidebar-compact { display: none; }
  .topbar { padding: 0 1rem; }
  .topbar-search { width: auto; flex: 1; max-width: 280px; }
  .topbar-search .kbd { display: none; }
  .content { padding: 1.1rem 1rem 2rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-grid.three { grid-template-columns: repeat(2, 1fr); }
  .pos-page .topbar { display: none; }
  .pos-page .content { padding: .65rem; }
  .pos-layout { height: calc(100vh - 58px); grid-template-columns: 1fr; min-height: 560px; }
  .cart-panel { position: fixed; z-index: 1050; right: 0; inset-block: 0; width: min(430px, 100%); border-radius: 0; translate: 100% 0; transition: translate .2s; box-shadow: -15px 0 35px rgba(15,23,42,.2); }
  .cart-open .cart-panel { translate: 0; }
  .mobile-cart-fab { display: inline-flex; align-items: center; gap: .5rem; min-height: 50px; }
  .pos-statusbar { height: 46px; overflow-x: auto; margin-bottom: .55rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-branding { display: none; }
  .auth-card-brand { display: block; }
  .setup-card { grid-template-columns: 1fr; }
  .setup-summary { border-left: 0; border-top: 1px solid var(--pos-border); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-link { white-space: nowrap; }
  .settings-card-header { flex-direction: column; }
  .settings-card-header > .btn { align-self: flex-start; }
}
@media (max-width: 767.98px) {
  .topbar .selector-btn, .topbar .quick-create, .profile-copy { display: none; }
  .topbar-search span { display: none; }
  .topbar-search { flex: 0 0 40px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .page-title { font-size: 1.25rem; }
  .kpi-grid, .panel-grid, .panel-grid.three { grid-template-columns: 1fr; }
  .table-toolbar > .btn span { display: none; }
  .toolbar-search { flex: 1; min-width: 180px; }
  .table-pagination { align-items: flex-start; flex-direction: column; }
  .users-bulk-row, .accounts-pagination { align-items: stretch; flex-direction: column; }
  .users-columns-dropdown { margin-left: 0; }
  .users-bulk-controls { width: 100%; }
  .users-bulk-controls .form-select, .users-bulk-controls .btn { flex: 1 1 140px; }
  .accounts-pagination nav { max-width: 100%; overflow-x: auto; }
  .accounts-pagination .pagination { flex-wrap: nowrap; }
  .report-grid { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .filter-strip { grid-template-columns: 1fr; }
  .filter-strip .form-control, .filter-strip .form-select { width: 100%; }
  .filter-strip .ms-auto { margin-left: 0 !important; }
  .setup-main { margin-top: 1rem; }
  .setup-step { font-size: 0; }
  .setup-step::after { margin-right: .4rem; }
  .setup-form, .setup-summary { padding: 1rem; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .settings-form-grid-wide .settings-form-field:nth-child(6), .settings-form-grid-wide .settings-form-field:nth-child(7), .settings-form-grid-wide .settings-form-field:nth-child(8) { grid-column: auto; }
  .settings-form-actions { margin-inline: -1rem; padding-inline: 1rem; flex-wrap: wrap; }
  .settings-form-actions .btn { flex: 1 1 140px; }
  .settings-list-filter { max-width: none; padding-inline: 1rem; }
  .settings-table-wrapper { padding-inline: 1rem; }
  .print-sheet { width: 100%; min-height: 0; margin: 0; padding: 1rem; }
  .print-header { flex-direction: column; }
}
@media (max-width: 424.98px) {
  .kpi-grid { gap: .7rem; }
  .kpi-card { padding: .85rem; }
  .kpi-value { font-size: 1.25rem; }
  .content { padding-inline: .75rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .55rem; gap: .5rem; }
  .product-thumb { height: 76px; }
  .category-row, .pos-search { padding: .55rem; }
  .pos-statusbar .status-item:nth-of-type(2), .pos-statusbar .status-item:nth-of-type(3) { display: none; }
  .auth-main { padding: 1rem; }
  .auth-card { padding: 1.3rem; }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  @page { margin: 10mm; }
  body { background: #fff !important; color: #000; }
  .no-print, .sidebar, .topbar, .page-head, .app-main > .content > :not(.print-sheet):not(.receipt-sheet) { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .print-sheet, .receipt-sheet { margin: 0 auto; box-shadow: none; }
  .print-sheet { width: 100%; min-height: 0; padding: 0; }
  .receipt-sheet { width: 80mm; padding: 0; }
  .card { box-shadow: none; }
  .table thead th { background: #eee !important; print-color-adjust: exact; }
}
