/* GALEX ERP ? Design System (Hardex-inspired light theme) */
:root {
  --bg: #F3F5F9;
  --panel: #FFFFFF;
  --panel2: #F7F9FC;
  --elev: #EEF1F7;
  --border: rgba(12, 18, 34, 0.09);
  --border2: rgba(12, 18, 34, 0.16);
  --text: #0E1626;
  --muted: #5B6577;
  --faint: #8B93A3;
  --hover: rgba(12, 18, 34, 0.04);
  --hover-strong: rgba(12, 18, 34, 0.07);
  --grid: rgba(12, 18, 34, 0.08);
  --track: rgba(12, 18, 34, 0.08);
  --accent: #F07A1E;
  --accent-2: #E56E12;
  --accent-dark: #C55E10;
  --blue: #3B6BFF;
  --violet: #8B5CF6;
  --cyan: #0891B2;
  --up: #12A974;
  --down: #E04449;
  --amber: #F5A623;
  --warn: #F5A623;
  --sidebar-w: 246px;
  --topbar-h: 68px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 8px 28px rgba(12, 18, 34, 0.08);
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

/* ?? Typography ?? */
h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-accent { color: var(--accent); }
.small { font-size: 0.8rem; }
.tiny { font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* ?? App shell ?? */
.app-shell {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
}

.sidebar-toggle { display: none; }
.sidebar-overlay { display: none; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--panel2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(240, 122, 30, 0.35);
  flex-shrink: 0;
}

.brand-mark svg { width: 20px; height: 20px; }

.brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.brand-text .erp { color: var(--accent); }

.company-switcher {
  margin: 0.85rem 0.85rem 0.5rem;
  padding: 0.7rem 0.75rem;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.company-switcher .name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-switcher .branch {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.nav-groups { padding: 0.5rem 0.65rem 1.5rem; flex: 1; }

.nav-group { margin-bottom: 0.85rem; }

.nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.4rem 0.65rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  margin: 0.1rem 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-link.active {
  background: rgba(240, 122, 30, 0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
  overflow: visible;
}

.menu-btn {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
}

.topbar-search {
  flex: 0 1 280px;
}

.topbar-search input {
  width: 100%;
}

.content {
  padding: 1.15rem 1.25rem 2rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

/* ?? Flash ?? */
.flash {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(55, 211, 153, 0.1);
  border-color: rgba(55, 211, 153, 0.3);
  color: var(--up);
}

.flash-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--down);
}

.flash ul { margin: 0; padding-left: 1.1rem; }

/* ?? Cards / panels ?? */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-title {
  font-weight: 750;
  font-size: 0.95rem;
}

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ?? KPI ?? */
.kpi {
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 122, 30, 0.12), transparent 70%);
  pointer-events: none;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.kpi-hint {
  font-size: 0.75rem;
  color: var(--faint);
  margin-top: 0.35rem;
}

.kpi.accent .kpi-value { color: var(--accent-2); }
.kpi.up .kpi-value { color: var(--up); }
.kpi.blue .kpi-value { color: #7B9CFF; }
.kpi.violet .kpi-value { color: #A78BFA; }

/* ?? Buttons ?? */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: transform 0.1s, filter 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-dark) 100%);
  color: #1a0f05;
  box-shadow: 0 4px 14px rgba(240, 122, 30, 0.28);
}

.btn-primary:hover { filter: brightness(1.08); color: #1a0f05; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--down);
}

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }
.btn-block { width: 100%; }

/* ?? Forms ?? */
label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(240, 122, 30, 0.55);
  box-shadow: 0 0 0 3px rgba(240, 122, 30, 0.12);
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%238A93A6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 720px) {
  .form-row.cols-2,
  .form-row.cols-3,
  .form-row.cols-4 { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.field-check input { width: auto; }
.field-check label { margin: 0; color: var(--text); font-weight: 600; }

/* ?? Tables ?? */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:hover td { background: var(--hover); }

table.data .num {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: right;
  white-space: nowrap;
}

/* ?? Badges ?? */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-in { background: rgba(55, 211, 153, 0.12); color: var(--up); border-color: rgba(55, 211, 153, 0.25); }
.badge-low { background: rgba(251, 191, 36, 0.12); color: var(--warn); border-color: rgba(251, 191, 36, 0.28); }
.badge-out { background: rgba(248, 113, 113, 0.12); color: var(--down); border-color: rgba(248, 113, 113, 0.28); }
.badge-info { background: rgba(59, 107, 255, 0.12); color: #7B9CFF; border-color: rgba(59, 107, 255, 0.28); }
.badge-warn { background: rgba(240, 122, 30, 0.12); color: var(--accent-2); border-color: rgba(240, 122, 30, 0.28); }
.badge-muted { background: rgba(138, 147, 166, 0.12); color: var(--muted); border-color: rgba(138, 147, 166, 0.2); }

/* ?? Toolbar ?? */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar .grow { flex: 1; min-width: 160px; }

/* ?? Charts ?? */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 0.5rem;
}

.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.bar-chart .bar {
  width: 100%;
  max-width: 28px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: 4px 4px 2px 2px;
  min-height: 2px;
  opacity: 0.9;
}

.bar-chart .bar-label {
  font-size: 0.58rem;
  color: var(--faint);
  margin-top: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.list-row:last-child { border-bottom: 0; }

.progress {
  height: 6px;
  background: var(--hover-strong);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}

/* ?? Product cards ?? */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.product-card .sku {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
}

.product-card .price {
  font-family: var(--mono);
  font-weight: 650;
  color: var(--accent-2);
  margin-top: auto;
}

/* POS */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 980px) {
  .pos-layout { grid-template-columns: 1fr; }
}

.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
  gap: 0.65rem;
}

.pos-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.pos-tile:hover {
  border-color: rgba(240, 122, 30, 0.45);
  background: rgba(240, 122, 30, 0.06);
}

.pos-tile .name { font-weight: 700; font-size: 0.82rem; margin-bottom: 0.25rem; }
.pos-tile .meta { font-size: 0.68rem; color: var(--muted); }
.pos-tile .price { font-family: var(--mono); color: var(--accent-2); font-size: 0.8rem; margin-top: 0.4rem; }

.pos-cart {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 2.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}

.pos-cart-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 750;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  min-height: 96px;
  max-height: min(280px, 32vh);
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.cart-line .cname { font-weight: 650; }
.cart-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  grid-column: 1 / -1;
}

.cart-controls button {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.cart-controls .qty {
  font-family: var(--mono);
  min-width: 1.5rem;
  text-align: center;
}

.pos-cart-foot {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.totals-row.grand {
  color: var(--text);
  font-weight: 750;
  font-size: 1rem;
  margin: 0.55rem 0 0.75rem;
}

.totals-row.grand span:last-child {
  font-family: var(--mono);
  color: var(--accent-2);
}

/* ?? Login (styles live in auth/login.blade.php to match Hardex Login.dc.html) ?? */

/* ?? Misc ?? */
.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.stack-sm > * + * { margin-top: 0.75rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.pagination-wrap {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.pagination-wrap nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.pagination-wrap a:hover { color: var(--text); border-color: var(--accent); }
.pagination-wrap .active span,
.pagination-wrap [aria-current="page"] span {
  background: rgba(240, 122, 30, 0.15);
  color: var(--accent-2);
  border-color: rgba(240, 122, 30, 0.35);
}

.split-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}

@media (max-width: 1000px) {
  .split-2 { grid-template-columns: 1fr; }
}

/* ?? Mobile sidebar ?? */
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }

  .app-shell {
    display: block;
    width: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
    z-index: 40;
  }

  .sidebar-toggle:checked ~ .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle:checked ~ .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 34, 0.4);
    z-index: 35;
  }

  .main-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .content {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .topbar {
    padding: 0 0.85rem;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Minimal Bootstrap 5 pagination (no Bootstrap CSS loaded) */
.pagination { display: flex; gap: 0.35rem; list-style: none; padding: 0; margin: 1rem 0 0; flex-wrap: wrap; }
.page-item .page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 0.55rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel2); color: var(--muted); font-weight: 700; font-size: 0.8rem;
}
.page-item.active .page-link,
.page-item .page-link:hover { color: var(--text); border-color: var(--accent); background: rgba(240,122,30,0.12); }
.page-item.disabled .page-link { opacity: 0.4; pointer-events: none; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.grow { flex: 1; }

/* ?? Hardex page shell (match static .dc.html mockups) ?? */
.content {
  padding: 22px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-head { margin-bottom: 0; }
.page-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.page-crumb .sep { color: var(--faint); }
.page-crumb .here { color: var(--accent); }
.page-title-lg {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.hx-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.hx-kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}
.hx-kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.hx-kpi-value {
  font: 800 22px var(--mono);
  margin-top: 8px;
  letter-spacing: -0.4px;
}
.hx-kpi-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}
.hx-kpi-value.up { color: var(--up); }
.hx-kpi-value.down { color: var(--down); }
.hx-kpi-value.amber { color: var(--amber); }
.hx-kpi-value.accent { color: var(--accent-2); }

.hx-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.hx-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.hx-panel-title {
  font-size: 15px;
  font-weight: 800;
  margin-right: auto;
}
.hx-panel-body { padding: 16px 20px; }
.hx-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.hx-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  min-width: 180px;
}
.hx-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 12.5px;
  min-width: 0;
}
.hx-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0;
  overflow: hidden;
  max-width: 100%;
  flex-shrink: 1;
  min-width: 0;
}
.hx-select-pill select {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 28px 8px 12px !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  max-width: 100%;
  min-width: 0;
}

table.hx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-wrap table.hx-table {
  min-width: 640px;
}
table.hx-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.hx-table th:first-child,
table.hx-table td:first-child { padding-left: 20px; }
table.hx-table th:last-child,
table.hx-table td:last-child { padding-right: 20px; }
table.hx-table td {
  padding: 13px 12px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
table.hx-table .num {
  text-align: right;
  font-family: var(--mono);
  font-weight: 700;
}
table.hx-table .muted-num {
  text-align: right;
  font-family: var(--mono);
  color: var(--muted);
}
table.hx-table .mono { font-family: var(--mono); color: var(--muted); }
table.hx-table th .hx-th-sort {
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
}
table.hx-table th .hx-th-sort:hover,
table.hx-table th .hx-th-sort.is-active {
  color: var(--accent);
}

.hx-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.hx-pill-ok { background: rgba(55,211,153,.14); color: #63e0b4; }
.hx-pill-low { background: rgba(245,166,35,.16); color: #ffc266; }
.hx-pill-out { background: rgba(242,85,90,.16); color: #ff8f92; }
.hx-pill-info { background: rgba(59,107,255,.14); color: #8fb0ff; }
.hx-pill-warn { background: rgba(240,122,30,.16); color: #ffb26b; }
.hx-pill-violet { background: rgba(139,92,246,.16); color: #c4a8ff; }
.hx-pill-muted { background: rgba(138,147,166,.16); color: #c3cad6; }
.hx-pill-amber { background: rgba(245,166,35,.16); color: #ffc266; }
.hx-pill-cyan { background: rgba(34,211,238,.18); color: #7fe4f2; }

.hx-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.hx-avatar.lg { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }

.hx-person {
  display: flex;
  align-items: center;
  gap: 11px;
}
.hx-person .name { font-weight: 700; }
.hx-person .sub { font-size: 11px; color: var(--muted); margin-top: 1px; }

.hx-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 18px;
}
.hx-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 17px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hx-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 13px;
  gap: 10px;
}
.hx-card-meta-label {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}
.hx-card-meta-value {
  font: 800 18px var(--mono);
  letter-spacing: -0.5px;
  margin-top: 3px;
}
.hx-card-meta-value.sm {
  font: 700 14px var(--mono);
}

.hx-cat-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hx-cat-tab {
  flex: none;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 13px 18px;
  cursor: pointer;
  min-width: 150px;
  color: inherit;
  text-decoration: none;
  display: block;
}
.hx-cat-tab:hover { color: inherit; }
.hx-cat-tab.active {
  background: rgba(240,122,30,.14);
  border-color: var(--accent);
}
.hx-cat-tab .n { font-size: 13.5px; font-weight: 700; }
.hx-cat-tab.active .n { color: var(--accent); }
.hx-cat-tab .c { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.hx-cat-tab-add {
  border-style: dashed;
  background: var(--panel2);
  font: inherit;
}
.hx-cat-tab-add .n { color: var(--accent); }
.cat-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}
.cat-add-form .btn-accent {
  height: 42px;
  padding: 0 16px;
}
.cat-list-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.cat-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.cat-edit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cat-edit-form input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 560px) {
  .cat-add-form {
    grid-template-columns: 1fr;
  }
  .cat-add-form .btn-accent {
    width: 100%;
    justify-content: center;
  }
}

.hx-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
}
.hx-view-toggle a,
.hx-view-toggle button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font: 700 12.5px var(--font);
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}
.hx-view-toggle .active {
  background: var(--accent);
  color: #fff;
}

.hx-stepper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.hx-step {
  flex: 1;
  min-width: 120px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hx-step .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 800 12px var(--font);
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.hx-step.done .num { background: rgba(55,211,153,.16); color: var(--up); border-color: transparent; }
.hx-step.active .num { background: var(--accent); color: #fff; border-color: transparent; }
.hx-step .lbl { font-size: 13px; font-weight: 700; }
.hx-step .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.hx-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.prod-thumb {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  position: relative;
  flex: none;
}
.prod-barcode {
  height: 34px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--text) 0 1.5px,
    transparent 1.5px 3px,
    var(--text) 3px 4px,
    transparent 4px 7px,
    var(--text) 7px 9px,
    transparent 9px 11px,
    var(--text) 11px 12px,
    transparent 12px 15px
  );
  opacity: 0.9;
}

/* Sidebar / topbar ? closer to Hardex mockups */
.sidebar {
  width: var(--sidebar-w);
  background: var(--panel2);
  border-right: 1px solid var(--border);
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff9d4d);
  box-shadow: 0 4px 14px rgba(240,122,30,.35);
}
.brand-text { font-size: 17px; letter-spacing: .5px; }
.brand-tag {
  font-size: 9px;
  color: var(--faint);
  letter-spacing: 1.5px;
  margin-top: 3px;
  font-weight: 600;
}
.company-switcher {
  margin: 0 14px 12px;
  padding: 10px 11px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.company-switcher .ini {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), #6f93ff);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}
.company-switcher .name { font-size: 12.5px; }
.company-switcher .branch { font-size: 10.5px; }

.nav-group-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 14px 10px 6px;
}
.nav-group:first-child .nav-group-label { padding-top: 10px; }
.nav-link {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  gap: 12px;
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(240,122,30,.16), rgba(240,122,30,.03));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-link.active svg { stroke: var(--accent); color: var(--accent); }
.nav-link svg { width: 17px; height: 17px; }

.sidebar-status {
  margin-top: auto;
  padding: 14px 14px 18px;
}
.sidebar-status-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
}

.topbar {
  height: auto;
  min-height: var(--topbar-h);
  padding: 13px 26px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  gap: 14px;
  flex-wrap: nowrap;
  overflow: visible;
}
.topbar-search {
  flex: 1;
  max-width: 420px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 14px;
}
.topbar-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 13px;
}
.topbar .page-title { display: none; }
.topbar-spacer { flex: 1; }

/* ?? Topbar account / language ?? */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.tb-menu { position: relative; }
.tb-menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.tb-menu > summary::-webkit-details-marker { display: none; }
.tb-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .18s ease;
}
.tb-menu[open] > summary .tb-chevron { transform: rotate(180deg); }

.tb-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: 650 12px var(--font);
  letter-spacing: .02em;
  transition: border-color .15s ease, background .15s ease;
}
.tb-icon-btn:hover,
.tb-menu[open] > .tb-icon-btn {
  border-color: var(--border2);
  background: var(--panel2);
}
.tb-flag { font-size: 14px; line-height: 1; }
.tb-lang-code { font-weight: 700; color: var(--muted); }

.tb-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 3px 10px 3px 3px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease;
}
.tb-account-btn:hover,
.tb-menu[open] > .tb-account-btn {
  background: var(--panel);
  border-color: var(--border);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #F07A1E;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 12px;
  letter-spacing: .02em;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(240, 122, 30, .22);
}
.user-avatar.lg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
}
.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.2;
  text-align: left;
}
.user-meta .uname {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-meta .urole {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.tb-dropdown {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 8px);
  min-width: 196px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  z-index: 80;
  animation: tbDropIn .16s ease;
}
.tb-dropdown-account {
  min-width: 248px;
  width: max-content;
}
.tb-drop-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 10px 12px;
  min-width: 0;
}
.tb-drop-head > div {
  min-width: 0;
  flex: 1;
}
.tb-drop-head .uname {
  font-size: 13.5px;
  font-weight: 750;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.tb-drop-head .urole {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@keyframes tbDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.tb-role-pill {
  display: inline-flex;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
  background: rgba(240,122,30,.14);
  border: 1px solid rgba(240,122,30,.22);
}
.tb-drop-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 6px 6px;
}
.tb-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: 600 13px var(--font);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.tb-drop-item:hover:not(:disabled) {
  background: var(--hover);
}
.tb-drop-item:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.tb-drop-item.is-active { color: var(--text); }
.tb-drop-item .tb-check {
  margin-left: auto;
  color: var(--accent);
}
.tb-drop-item svg:first-child { color: var(--muted); flex-shrink: 0; }
.tb-drop-danger { color: #ff8b8f !important; }
.tb-drop-danger:hover { background: rgba(242,85,90,.12) !important; }
.tb-drop-danger svg { color: #ff8b8f !important; }
.tb-logout-form { margin: 0; }

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 12px;
    overflow: visible;
  }
  .topbar-spacer { display: none; }
  .topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding: 8px 10px;
  }
  .topbar-search input {
    font-size: 12.5px !important;
  }
  .topbar .btn-accent {
    padding: 9px 11px;
    font-size: 12px;
    box-shadow: 0 3px 10px rgba(240, 122, 30, .28);
  }
  .tb-account-btn .user-meta { display: none; }
  .tb-account-btn {
    padding: 2px;
    height: 38px;
    gap: 4px;
  }
  .tb-account-btn .tb-chevron { display: none; }
  .tb-lang-code { display: none; }
  .tb-icon-btn {
    height: 38px;
    padding: 0 8px;
    gap: 4px;
  }
  .topbar-actions {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    gap: 6px;
    flex-shrink: 0;
  }
  .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 11px;
  }
  /* Keep account/lang menus aligned to the right edge of the viewport */
  .tb-menu.tb-account,
  .tb-menu.tb-lang {
    position: static;
  }
  .tb-dropdown,
  .tb-dropdown-account {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    left: auto;
    width: min(280px, calc(100vw - 24px));
    min-width: 0;
    max-width: calc(100vw - 24px);
  }
  .main-wrap {
    overflow: visible;
  }
}

@media (max-width: 420px) {
  .topbar-search {
    display: none;
  }
  .topbar .btn-accent {
    flex: 1;
    justify-content: center;
  }
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #ff9646);
  border: 0;
  color: #fff !important;
  border-radius: 11px;
  padding: 11px 17px;
  font: 700 13.5px var(--font);
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(240,122,30,.32);
  white-space: nowrap;
  text-decoration: none;
}
.btn-accent:hover { filter: brightness(1.06); color: #fff !important; }
.btn-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

/* Settings nav */
.settings-layout {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 18px;
  align-items: start;
}
.settings-nav {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  position: sticky;
  top: 84px;
}
.settings-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.settings-nav a:hover { color: var(--text); }
.settings-nav a.active {
  background: linear-gradient(90deg, rgba(240,122,30,.16), rgba(240,122,30,.03));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.settings-section { margin-bottom: 22px; }
.settings-section h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 14px;
}

/* POS closer to mock */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
}
.pos-catalog {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
@media (max-width: 1100px) {
  .pos-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
}

.pos-cart {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: sticky;
  top: 84px;
  align-self: start;
  z-index: 2;
  min-width: 0;
  max-height: calc(100vh - 100px);
  overflow-x: hidden;
  overflow-y: auto;
}
.pos-cart-toggle {
  display: none;
}
.pos-cart-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 12px;
  width: 100%;
}
.pos-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.pos-tile:hover:not(:disabled) { border-color: var(--accent); }
.pos-tile:disabled { opacity: 0.45; cursor: not-allowed; }
.pos-tile .abbr {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(240,122,30,.14);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 10px;
}
.pos-tile .name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.pos-tile .meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.pos-tile .price { font: 800 14px var(--mono); margin-top: 8px; color: var(--accent); }
.pos-checkout-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}
.dot.off { background: var(--faint); box-shadow: none; }

.pl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.pl-track {
  flex: 1;
  height: 8px;
  background: var(--panel2);
  border-radius: 99px;
  overflow: hidden;
  max-width: 180px;
}
.pl-track > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff9646);
  border-radius: 99px;
}

@media (max-width: 860px) {
  .content { padding: 16px; gap: 16px; }
  .topbar { padding: 12px 14px; }
}

/* ?? Reports Dashboard ?? */
.dash-title-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-branch {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
.dash-branch:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 122, 30, .16);
}
.dash-branch .dot {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 1;
}
.dash-branch select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0 !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235B6577' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  box-shadow: none !important;
  padding: 10px 36px 10px 28px !important;
  margin: 0;
  font: 600 12.5px var(--font);
  color: var(--text);
  width: auto;
  min-width: 168px;
  max-width: 240px;
  line-height: 1.3;
  cursor: pointer;
  border-radius: 10px;
}
.dash-branch select:focus,
.dash-branch select:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.dash-branch select option {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  padding: 10px 12px;
}
.dash-branch select option:checked {
  background: #F07A1E;
  color: #fff;
}
.dash-branch.is-locked {
  padding: 10px 16px 10px 28px;
  cursor: default;
  pointer-events: none;
}
.dash-branch.is-locked:focus-within {
  border-color: var(--border);
  box-shadow: none;
}
.dash-branch-label {
  font: 600 12.5px var(--font);
  color: var(--text);
  white-space: nowrap;
}
.hx-select-pill.is-locked {
  pointer-events: none;
  opacity: .92;
  cursor: default;
}
.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.dash-period {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px;
}
.dash-period a {
  border: 0;
  border-radius: 8px;
  padding: 8px 15px;
  font: 700 12.5px var(--font);
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
}
.dash-period a:hover { color: var(--text); }
.dash-period-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.dash-export { display: flex; gap: 8px; }
.dash-export a,
.dash-export button {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 13px;
  text-decoration: none;
  font: 700 12px var(--font);
  cursor: pointer;
}
.dash-export a:hover { border-color: var(--border2); color: var(--text); }
.dash-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 4px 6px 4px 10px;
}
.dash-custom-range input[type="date"] {
  width: auto;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 6px 4px !important;
  color: var(--text);
  font: 600 12.5px var(--font);
  color-scheme: inherit;
}
.dash-custom-range .dash-range-sep {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.dash-custom-range button {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font: 700 12px var(--font);
  cursor: pointer;
}
.dash-sort {
  text-decoration: none;
  color: var(--muted);
  cursor: pointer;
}
.dash-sort:hover,
.dash-sort.active { color: var(--accent); }
.dash-top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.dash-top-head .label { margin-bottom: 0; }
.dash-sort-links {
  display: flex;
  gap: 10px;
}
.dash-sort-links a {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}
.dash-sort-links a:hover,
.dash-sort-links a.active { color: var(--accent); }

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.dash-role-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.dash-role-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(240, 122, 30, 0.12);
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .02em;
}
.dash-role-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.dash-row-adaptive {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.dash-kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 17px 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 158px;
}
.dash-kpi-net {
  background: linear-gradient(160deg, rgba(55,211,153,.12), var(--panel) 55%);
  border-color: rgba(55,211,153,.28);
}
.dash-kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.dash-kpi-top .ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.dash-kpi-val {
  font: 800 17px var(--mono);
  letter-spacing: -0.6px;
  margin-top: 12px;
}
.dash-kpi-delta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
}
.dash-kpi-delta.up { color: var(--up); }
.dash-kpi-delta.down { color: var(--down); }
.dash-kpi-delta .vs {
  color: var(--faint);
  font-weight: 500;
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-row-wide {
  grid-template-columns: 1.55fr 1fr;
}
@media (max-width: 1100px) {
  .dash-row,
  .dash-row-wide { grid-template-columns: 1fr; }
}

.dash-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
}
.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.dash-card-title { font-size: 15px; font-weight: 800; }
.dash-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 11px;
  font: 600 11.5px var(--font);
  white-space: nowrap;
}
.dash-metrics-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}
.dash-metrics-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin: 14px 0 16px;
}
@media (max-width: 700px) {
  .dash-metrics-4 { grid-template-columns: repeat(2, 1fr); }
}
.m-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.m-val { font: 700 17px var(--mono); margin-top: 3px; }
.dash-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--faint);
  font-weight: 600;
  margin-top: 8px;
}
.dash-axis.around { justify-content: space-around; }

.dash-donut-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}
.dash-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
  flex: 1;
}
.dash-legend > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex-shrink: 0;
}
.dash-legend .n {
  margin-left: auto;
  font-weight: 700;
  font-family: var(--mono);
}
.dash-top-items {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 12px;
}
.dash-top-items .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.dash-top-items .item {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 9px;
}
.dash-top-items .n {
  margin-left: auto;
  font-weight: 700;
  font-family: var(--mono);
}
.dash-top-items .u {
  color: var(--faint);
  margin-left: 5px;
  font-size: 11px;
}
.dash-cat-table {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 12px;
  font-size: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
}
.dash-cat-table .h {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.dash-cat-table .r { text-align: right; }
.dash-cat-table .mono { font-family: var(--mono); font-weight: 600; }
.dash-cat-table .muted { color: var(--muted); }

/* ?? Modal dialogs ?? */
.hx-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.hx-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.hx-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, .72);
  backdrop-filter: blur(6px);
}
.hx-modal-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 28px 64px rgba(0,0,0,.55);
  transform: translateY(10px) scale(.98);
  transition: transform .2s ease;
  overflow: hidden;
}
.hx-modal.is-open .hx-modal-dialog { transform: none; }
.hx-modal-dialog.wide { width: min(680px, 100%); }
/* Form wraps body + footer in most modals ? keep footer visible and scroll the body */
.hx-modal-dialog > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.hx-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hx-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.hx-modal-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 550;
  line-height: 1.4;
}
.hx-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.hx-modal-close:hover {
  color: var(--text);
  background: rgba(255,255,255,.05);
}
.hx-modal-body {
  padding: 18px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.hx-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0,0,0,.12);
}
body.hx-modal-lock { overflow: hidden; }

/* ?? Confirm delete modal ?? */
.hx-modal-confirm { width: min(420px, 100%); }
.hx-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  background: rgba(242,85,90,.14);
  color: #ff8b8f;
  border: 1px solid rgba(242,85,90,.22);
}
.hx-confirm-text {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 600;
}
.hx-modal-confirm .hx-modal-foot { justify-content: center; }
.hx-modal-confirm .btn-danger {
  background: linear-gradient(135deg, #e23d45, #f2555a);
  border: 0;
  color: #fff;
  border-radius: 11px;
  padding: 10px 16px;
  font: 700 13px var(--font);
  cursor: pointer;
}
.hx-modal-confirm .btn-danger:hover { filter: brightness(1.06); }

/* ?? Role edit page ?? */
.role-edit-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.role-edit-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}
.role-edit-card {
  margin: 0;
}
.role-edit-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}
.role-edit-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.role-edit input[type="text"] {
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 12px;
}
.role-edit input.is-locked {
  opacity: .72;
  cursor: not-allowed;
  background: var(--panel2);
}
.role-edit-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.role-edit-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.role-edit-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.role-edit-stat-val {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
  line-height: 1.1;
}
.role-edit-stat-lbl {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}
.role-edit-tip {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.role-edit-tip strong { color: var(--text); }
.role-edit-main-head {
  align-items: flex-start;
  gap: 12px;
}
.role-edit-main-head .hx-panel-title,
.role-edit-main-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.role-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.role-edit-body {
  padding-top: 8px !important;
}
.role-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.role-edit-group {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-edit-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.role-edit-group-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.2px;
  line-height: 1.2;
}
.role-edit-group-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--faint);
  font-weight: 600;
}
.role-edit-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.role-edit-group-toggle input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}
.role-edit-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.role-edit-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.role-edit-item:hover {
  background: var(--hover);
}
.role-edit-item.is-on {
  background: rgba(240, 122, 30, 0.08);
  border-color: rgba(240, 122, 30, 0.18);
}
.role-edit-item input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.role-edit-item-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.role-edit-item-text strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.role-edit-item-text small {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  line-height: 1.3;
}
.role-edit-foot {
  justify-content: flex-end;
  gap: 10px;
}
.page-crumb a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.page-crumb a:hover { color: var(--accent); }

@media (max-width: 980px) {
  .role-edit-layout { grid-template-columns: 1fr; }
  .role-edit-side { position: static; }
  .role-edit-grid { grid-template-columns: 1fr; }
}

/* Role permission picker (create-role modal) */
.role-perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.role-perm-group {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.role-perm-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 4px;
}
.role-perm-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
}
.role-perm-item:hover { background: var(--hover); }
.role-perm-item input { margin-top: 3px; accent-color: var(--accent); }
.role-perm-item strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.role-perm-item small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--mono);
}
@media (max-width: 720px) {
  .role-perm-grid { grid-template-columns: 1fr; }
}

/* POS filter bar */
.pos-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  min-height: 0;
}
.pos-filter {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex: 0 0 auto;
}
.pos-filter-search {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 44px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  cursor: text;
}
.pos-filter-search:focus-within {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgba(12, 18, 34, 0.06);
  color: var(--muted);
}
.pos-filter-search svg { flex-shrink: 0; }
.pos-filter-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0;
  font: 600 13.5px var(--font);
  color: var(--text);
}
.pos-filter-search input::placeholder {
  color: var(--muted);
  font-weight: 550;
}
.pos-filter-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}
.pos-filter-actions .hx-select-pill {
  align-self: stretch;
  display: inline-flex;
  min-height: 44px;
}
.pos-filter-actions .hx-select-pill select {
  height: 100%;
  min-height: 44px;
  padding: 0 32px 0 14px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  color: var(--text) !important;
}
.pos-filter-actions .btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 11px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .pos-filter-actions {
    flex: 1 1 100%;
  }
  .pos-filter-actions .hx-select-pill {
    flex: 1 1 auto;
  }
  .pos-filter-actions .hx-select-pill select {
    width: 100%;
  }
}

/* ?? Global mobile responsiveness ?? */
@media (max-width: 860px) {
  .page-title-lg { font-size: 1.25rem; }
  .hx-head-row {
    align-items: flex-start;
    gap: 10px;
  }
  .hx-panel { border-radius: 14px; }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  }
  .pos-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 76px;
    width: 100%;
    max-width: 100%;
  }
  .pos-catalog {
    order: 1;
    width: 100%;
    min-width: 0;
  }
  .pos-cart {
    order: 2;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    z-index: 28;
    max-height: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(12, 18, 34, .16);
    overflow: hidden;
  }
  .pos-cart-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 0;
    background: var(--panel);
    color: var(--text);
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
  }
  .pos-cart-toggle-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .pos-cart-toggle-left strong { font-size: 13.5px; }
  .pos-cart-toggle-left .muted { font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .pos-cart-toggle-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .pos-cart-toggle-right strong {
    font-size: 14px;
    color: var(--accent);
  }
  .pos-cart-panel {
    display: none;
    max-height: min(62vh, 520px);
    overflow: auto;
    border-top: 1px solid var(--border);
    background: var(--panel);
  }
  .pos-cart.is-open .pos-cart-panel {
    display: flex;
  }
  .pos-cart.is-open .pos-cart-toggle .tb-chevron {
    transform: rotate(180deg);
  }
  .pos-cart-head { display: none; }
  .pos-cart-items {
    max-height: 140px;
    overflow-y: auto;
  }
  .pos-cart-foot {
    padding: 12px 14px 14px;
  }
  .pos-cart-foot .form-row {
    margin-bottom: 0.55rem;
  }
  .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    width: 100%;
  }
  .pos-tile {
    padding: 12px;
    min-width: 0;
    width: 100%;
  }
  .pos-tile .name {
    font-size: 12.5px;
    overflow-wrap: anywhere;
  }
  .dash-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .dash-metrics-4 {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .grow {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 12px !important;
  }
  .pos-products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .dash-kpis {
    grid-template-columns: 1fr;
  }
  .dash-title-row {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-branch {
    width: 100%;
  }
  .dash-branch select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .dash-toolbar {
    gap: 10px;
  }
  .dash-period {
    width: 100%;
    overflow-x: auto;
  }
  .dash-export {
    width: 100%;
    flex-wrap: wrap;
  }
  .hx-cards {
    grid-template-columns: 1fr;
  }
  .hx-card-foot {
    flex-wrap: wrap;
  }
  .actions-inline {
    flex-wrap: wrap;
  }
  .btn-accent,
  .btn {
    max-width: 100%;
  }
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  input[type="tel"],
  select,
  textarea {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .pos-products {
    grid-template-columns: 1fr !important;
  }
}

/* ?? Accounting balances (even layout) ?? */
.acc-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.acc-balances {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.acc-balance-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  min-height: 102px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}
.acc-balance-card.is-profit {
  background: linear-gradient(160deg, rgba(55,211,153,.16) 0%, var(--panel) 62%);
  border-color: rgba(55,211,153,.34);
}
.acc-balance-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.acc-balance-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 14px;
}
.acc-balance-value.is-up { color: var(--up); }
.acc-balance-value.is-down { color: var(--down); }

.acc-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.acc-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
}
.acc-panel.acc-panel--pl {
  background: #0F131C;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 14px 36px rgba(8, 12, 24, 0.28);
}
.acc-panel.acc-panel--pl .acc-panel-head {
  padding: 20px 22px 0;
}
.acc-panel.acc-panel--pl .acc-panel-title {
  color: #F4F7FB;
  font-size: 15px;
}
.acc-panel.acc-panel--pl .acc-pl-label {
  color: rgba(232, 238, 248, 0.58);
}
.acc-panel.acc-panel--pl .acc-pl-track {
  background: rgba(255, 255, 255, 0.09);
}
.acc-panel-head {
  flex: 0 0 auto;
  padding: 18px 20px 0;
}
.acc-panel-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text);
}
.acc-pl,
.acc-coa {
  flex: 1 1 auto;
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
}
.acc-pl {
  justify-content: flex-start;
  gap: 20px;
  padding: 20px 22px 24px;
}
.acc-pl-row {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 0;
}
.acc-pl-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  line-height: 1.2;
}
.acc-pl-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(232, 238, 248, 0.58);
  letter-spacing: 0.01em;
}
.acc-pl-amount {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 7.5ch;
  line-height: 1.2;
}
.acc-pl-amount.is-up { color: #37d399; }
.acc-pl-amount.is-down { color: #f2555a; }
.acc-pl-amount.is-blue { color: #6b9bff; }
.acc-pl-amount.is-violet { color: #b57bff; }
.acc-pl-amount.is-muted { color: #F4F7FB; }
.acc-pl-track {
  height: 5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 99px;
  overflow: hidden;
}
.acc-pl-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 6px;
}
.acc-pl-fill.is-up { background: #37d399; }
.acc-pl-fill.is-down { background: #f2555a; }
.acc-pl-fill.is-blue { background: #3b6bff; }
.acc-pl-fill.is-violet { background: #8b5cf6; }

.acc-coa-row {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.acc-coa-row:last-child { border-bottom: 0; }
.acc-coa-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.acc-coa-meta { min-width: 0; }
.acc-coa-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.acc-coa-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}
.acc-coa-bal {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  min-width: 8ch;
}

.acc-expenses .acc-panel-head { padding: 18px 20px 10px; }
.acc-expenses .table-wrap { padding: 0 4px 4px; }
.acc-table { width: 100%; }
.acc-table thead th {
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.acc-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13.5px;
  vertical-align: middle;
}
.acc-table tbody tr:last-child td { border-bottom: 0; }
.acc-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.acc-muted { color: var(--muted); font-weight: 600; }
.acc-strong { font-weight: 700; color: var(--text); }
.acc-amount-down {
  color: var(--down) !important;
  font-weight: 700;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .acc-balances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-mid { grid-template-columns: 1fr; }
  .acc-pl { justify-content: flex-start; gap: 18px; }
  .acc-coa { justify-content: flex-start; gap: 4px; }
}
@media (max-width: 560px) {
  .acc-balances { grid-template-columns: 1fr; }
  .acc-balance-value { font-size: 22px; }
}

/* POS recent sales ? must NOT inherit acc-panel min-height:100% (crushes catalog) */
.pos-recent {
  margin-top: 4px;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible;
}
.pos-recent .acc-panel-head {
  padding: 16px 18px 8px;
}
.pos-recent .table-wrap {
  padding: 0 2px 6px;
  overflow-x: auto;
}
.pos-recent-table thead th {
  padding: 10px 14px;
}
.pos-recent-table tbody td {
  padding: 12px 14px;
}
.pos-rcp-link {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .02em;
}
.pos-rcp-link:hover { filter: brightness(1.1); text-decoration: underline; }
.pos-recent-total {
  font-family: var(--mono);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--up);
}
.pos-recent-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .pos-recent-table th:nth-child(3),
  .pos-recent-table td:nth-child(3) { display: none; }
}
