/* 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: #16448f;
  --accent-2: #1e56b3;
  --accent-dark: #0e2f68;
  --blue: #3d6cb5;
  --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: block;
  min-height: 100vh;
  max-width: 100%;
  position: relative;
}

.sidebar-toggle { display: none; }
.sidebar-overlay { display: none; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--panel2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  z-index: 50;
  overflow: hidden;
  overscroll-behavior: contain;
}

.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(22, 68, 143, 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 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.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(22, 68, 143, 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 {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  max-width: calc(100% - var(--sidebar-w));
  min-height: 100vh;
  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(22, 68, 143, 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(22, 68, 143, 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);
  box-shadow: none;
}

.btn-ok {
  background: rgba(55, 211, 153, 0.14);
  border: 1px solid rgba(55, 211, 153, 0.38);
  color: #1a9a6a;
  box-shadow: none;
}

.btn-ok:hover {
  background: rgba(55, 211, 153, 0.22);
  border-color: rgba(55, 211, 153, 0.55);
  color: #147a54;
  filter: none;
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.78rem; border-radius: 9px; }
.btn-block { width: 100%; }

.po-receive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}

.po-receive-wh {
  width: auto;
  min-width: 132px;
  max-width: 168px;
  height: 34px;
  padding: 0 2rem 0 0.65rem;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 650;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
}

.po-receive .btn-ok {
  height: 34px;
  min-width: 5.5rem;
  padding: 0 1rem;
}

/* ?? 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.js-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(22, 68, 143, 0.55);
  box-shadow: 0 0 0 3px rgba(22, 68, 143, 0.12);
}

.hx-input-readonly,
input.hx-input-readonly {
  background: color-mix(in srgb, var(--panel2) 80%, #000 8%);
  color: var(--muted);
  cursor: default;
}
input.hx-input-readonly:focus {
  border-color: var(--border);
  box-shadow: none;
}

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; }

.gx-barcode-block {
  margin-bottom: 0.85rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel2);
}
.gx-barcode-block > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.gx-barcode-block > label span:first-child { font-weight: 750; color: var(--muted); font-size: 12px; }
.gx-barcode-opt {
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.gx-barcode-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.gx-barcode-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.gx-barcode-row input.is-scanned {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}
.gx-barcode-scan,
.gx-barcode-clear {
  flex: 0 0 auto;
  width: 44px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gx-barcode-scan:hover,
.gx-barcode-clear:hover { background: var(--hover); }
.gx-barcode-scan.is-live {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}
.gx-barcode-clear { color: var(--muted); }
.gx-barcode-hint {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.gx-barcode-hint.is-err { color: var(--down); }
.gx-barcode-hint[hidden] { display: none !important; }

.gx-cam {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 16, 32, 0.72);
}
.gx-cam[hidden] { display: none !important; }
.gx-cam-card {
  width: min(420px, 100%);
  border-radius: 18px;
  overflow: hidden;
  background: #0b1220;
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.gx-cam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 800;
}
.gx-cam-close {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.gx-cam-view {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #000;
}
.gx-cam-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gx-cam-frame {
  position: absolute;
  inset: 18% 12%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.gx-cam-note {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.prod-code-line {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  font-family: var(--mono);
}

/* ?? 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(61, 108, 181, 0.12); color: #7B9CFF; border-color: rgba(61, 108, 181, 0.28); }
.badge-warn { background: rgba(22, 68, 143, 0.12); color: var(--accent-2); border-color: rgba(22, 68, 143, 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(22, 68, 143, 0.45);
  background: rgba(22, 68, 143, 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(22, 68, 143, 0.15);
  color: var(--accent-2);
  border-color: rgba(22, 68, 143, 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-left: 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(22, 68, 143,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(61, 108, 181,.14); color: #8fb0ff; }
.hx-pill-warn { background: rgba(22, 68, 143,.16); color: #16448f; }
.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; }
a.hx-pill { text-decoration: none; }

.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);
}
.prod-price-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.prod-stock-line {
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.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(22, 68, 143,.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: #16448f;
  border-right: 1px solid #0e2f68;
  color: #fff;
  display: flex !important;
  flex-direction: column;
  position: fixed !important;
  top: 0 !important;
  left: 0;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh;
  z-index: 50;
  overflow: hidden;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: #16448f;
  box-shadow: none;
}
.sidebar .brand-text,
.sidebar .brand-text .erp { color: #fff; }
.brand-text { font-size: 17px; letter-spacing: .5px; }
.brand-tag {
  font-size: 9px;
  color: rgba(255, 255, 255, .62);
  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(--accent), var(--accent-2));
  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;
  color: rgba(255, 255, 255, .62);
}
.nav-group:first-child .nav-group-label { padding-top: 10px; }
.sidebar .nav-link {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  gap: 12px;
  color: rgba(255, 255, 255, .9);
}
.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.sidebar .nav-link.active,
.sidebar .nav-link.active:hover {
  background: #fff;
  color: #16448f;
  border-left-color: transparent;
  box-shadow: none;
}
.sidebar .nav-link svg { width: 17px; height: 17px; stroke: currentColor; opacity: .92; }
.sidebar .nav-link.active svg { stroke: #16448f; color: #16448f; opacity: 1; }
.sidebar .nav-groups::-webkit-scrollbar { width: 8px; }
.sidebar .nav-groups::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .28);
  border-radius: 8px;
}

.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;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
}
.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.sidebar-help a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  line-height: 1.2;
}
.sidebar-help-wa {
  background: #1fad4e;
  color: #fff !important;
}
.sidebar-help-wa:hover { background: #189642; color: #fff !important; }
.sidebar-help-call {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff !important;
}
.sidebar-help-call:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff !important;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
  min-width: 0;
}
.user-avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 11px;
  flex-shrink: 0;
}
.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.sidebar-user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, .65);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout-form {
  margin: 0;
}
.sidebar .user-avatar {
  background: #fff;
  color: #16448f;
  box-shadow: none;
}
.sidebar .sidebar-logout {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: #ffd4cf;
}
.sidebar .sidebar-logout:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.sidebar-logout svg {
  opacity: 1;
}

.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: #16448f;
  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(22, 68, 143, .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(22, 68, 143,.14);
  border: 1px solid rgba(22, 68, 143,.22);
}
.tb-drop-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 6px 6px;
}
.tb-dropdown > form {
  margin: 0;
  display: block;
}
.tb-dropdown > form .tb-drop-item {
  width: 100%;
}

.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(22, 68, 143, .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,
  .tb-menu.tb-bell {
    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), #1e56b3);
  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(22, 68, 143,.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(22, 68, 143,.16), rgba(22, 68, 143,.03));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.co-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(22, 68, 143, .08), rgba(22, 68, 143, .02));
  border: 1px solid rgba(22, 68, 143, .14);
}
.co-photo {
  position: relative;
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px rgba(22, 68, 143, .28);
}
.co-photo img[hidden],
.co-initials[hidden] { display: none !important; }
.co-photo img,
.co-initials {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.co-photo input { display: none; }
.co-photo-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 0 5px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(14, 47, 104, .72);
}
.co-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.co-store {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.co-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.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(22, 68, 143,.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); }
.pwa-bar {
  position: fixed;
  z-index: 360;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #16448f;
  color: #fff;
  box-shadow: 0 12px 30px rgba(14, 47, 104, .28);
}
.pwa-bar strong {
  font-size: 14px;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.pwa-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.pwa-bar .btn,
.pwa-bar .btn-accent,
.pwa-bar .btn-ghost {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  font: 700 12.5px var(--font);
  box-shadow: none;
}
.pwa-bar .btn-accent {
  background: #fff !important;
  color: #16448f !important;
  border: 0;
}
.pwa-bar .btn-accent:hover {
  filter: none;
  background: #eef3fb !important;
  color: #0e2f68 !important;
}
.pwa-bar .btn-ghost {
  background: rgba(255, 255, 255, .18) !important;
  border: 1px solid rgba(255, 255, 255, .55) !important;
  color: #fff !important;
}
.pwa-bar .btn-ghost:hover {
  background: rgba(255, 255, 255, .3) !important;
  color: #fff !important;
}
.pos-net {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef3fb;
  color: #16448f;
  font-size: 12.5px;
  font-weight: 700;
}
.pos-net.is-bad { background: #fdecec; color: #a8382a; }
.pos-paid[readonly] {
  background: var(--elev);
  color: var(--text);
  cursor: not-allowed;
}
.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), #1e56b3);
  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(22, 68, 143, .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: #16448f;
  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(22, 68, 143, 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-hint {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.dash-kpi-hint a {
  color: var(--accent);
  font-weight: 750;
  text-decoration: none;
}
.dash-kpi-hint a:hover { text-decoration: underline; }
.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-icon.is-ok {
  background: rgba(22, 68, 143, .12);
  color: var(--accent, #1e56b3);
  border-color: rgba(22, 68, 143, .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); }
.hx-modal-confirm .btn-accent {
  border-radius: 11px;
  padding: 10px 16px;
  font: 700 13px var(--font);
}

/* ?? 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(22, 68, 143, 0.08);
  border-color: rgba(22, 68, 143, 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: #3d6cb5; }
.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-thanks {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 7, 16, .72);
  backdrop-filter: blur(6px);
}
.pos-thanks-card {
  width: min(420px, 100%);
  padding: 28px 22px 20px;
  border-radius: 18px;
  text-align: center;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 28px 64px rgba(0, 0, 0, .28);
}
.pos-thanks-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 68, 143, .28);
  animation: pos-thanks-pop .42s cubic-bezier(.2, .85, .2, 1) both;
}
.pos-thanks-mark svg {
  width: 36px;
  height: 36px;
  overflow: visible;
}
.pos-thanks-tick {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: pos-thanks-draw .42s .28s ease forwards;
}
@keyframes pos-thanks-pop {
  0% { transform: scale(.55); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pos-thanks-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pos-thanks-mark,
  .pos-thanks-tick { animation: none; }
  .pos-thanks-tick { stroke-dashoffset: 0; }
}
.pos-thanks h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  letter-spacing: -.03em;
}
.pos-thanks-kicker {
  margin: 4px 0 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.pos-thanks-no {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.pos-thanks-note {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
}
.pos-thanks-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.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; }
}

/* Bulk product Excel import */
.hx-import-steps {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hx-import-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.hx-import-steps .n {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(22, 68, 143, .16);
  color: var(--accent-2);
}
.hx-import-steps strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.hx-import-steps p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}
.hx-template-download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 80%, var(--accent) 6%);
  color: var(--text);
  text-decoration: none;
  margin-bottom: 14px;
}
.hx-template-download:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}
.hx-template-download strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.hx-template-download small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.hx-col-guide {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.hx-col-guide-title {
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--panel) 70%, #000 8%);
}
.hx-col-guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.hx-col-guide th,
.hx-col-guide td {
  text-align: left;
  padding: 7px 12px;
  border-top: 1px solid var(--border);
}
.hx-col-guide th {
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 800;
}
.hx-file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}
.hx-file-drop:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}
.hx-file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.hx-file-drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(22, 68, 143, .14);
  color: var(--accent-2);
  flex-shrink: 0;
}
.hx-file-drop-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
}
.hx-file-drop-copy small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.hx-import-errors ul {
  margin: 0;
  padding-left: 1.1rem;
  max-height: 160px;
  overflow: auto;
}

/* ===== Dashboard layout polish (role-aware panels) ===== */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.dash-header-copy {
  min-width: min(100%, 240px);
  flex: 1 1 260px;
}
.dash-page-title {
  font-size: 19px !important;
  margin: 0;
  line-height: 1.2;
}
.dash-header-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 420px;
  min-width: min(100%, 300px);
}
.dash-header-controls .dash-branch {
  background: var(--bg);
}
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.dash-period {
  background: var(--bg);
  padding: 3px;
  border-radius: 10px;
}
.dash-period a {
  padding: 7px 12px;
  font-size: 12px;
}
.dash-export a,
.dash-export button {
  background: var(--bg);
  padding: 7px 10px;
  font-size: 11.5px;
  gap: 5px;
}
.dash-role-meta { margin-top: 8px; gap: 8px; }
.dash-role-pill { padding: 3px 9px; font-size: 11px; }
.dash-kpis {
  display: grid !important;
  grid-template-columns: repeat(var(--dash-kpi-count, 4), minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.dash-kpi {
  min-height: 128px !important;
  border-radius: 14px !important;
  padding: 13px 14px 0 !important;
}
.dash-kpi-val { font-size: 21px !important; margin-top: 6px !important; }
.dash-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.dash-panels > .dash-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  padding: 15px 15px 13px;
}
.dash-card-head { margin-bottom: 10px; }
.dash-card-title { font-size: 14.5px; }
.dash-card-sub { font-size: 11.5px; }
.dash-metrics-4,
.dash-metrics-2 {
  gap: 8px;
  margin-bottom: 10px;
}
.dash-metrics-4 .m-val,
.dash-metrics-2 .m-val {
  font-size: 14.5px;
}
.dash-chart-empty {
  height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 72%, var(--panel));
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
}
.dash-legend-inline {
  display: flex;
  flex-direction: row;
  gap: 14px;
  margin-top: 8px;
}
.dash-donut-row {
  gap: 16px;
  margin-top: 2px;
}
.dash-axis { margin-top: 4px; font-size: 10.5px; }

@media (max-width: 1100px) {
  .dash-panels { grid-template-columns: 1fr; }
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .dash-header-controls { align-items: stretch; }
  .dash-toolbar { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .dash-kpis { grid-template-columns: 1fr !important; }
  .support-banner { margin: 10px 12px 0; }
  .dash-header { padding: 12px; }
  .dash-metrics-4,
  .dash-metrics-2 {
    grid-template-columns: 1fr 1fr !important;
  }
}

.support-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 26px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(22, 68, 143, .12);
  border: 1px solid rgba(22, 68, 143, .35);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}
.support-banner form { margin: 0; }
.support-banner button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: 700 12px var(--font);
  padding: 7px 12px;
  cursor: pointer;
}
.news-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 26px 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
}
.news-banner strong { display: block; font-size: 13.5px; }
.news-banner span { display: block; margin-top: 2px; font-weight: 600; }
.news-banner.is-info { background: rgba(47, 111, 237, .1); border: 1px solid rgba(47, 111, 237, .28); }
.news-banner.is-warning { background: rgba(22, 68, 143, .12); border: 1px solid rgba(22, 68, 143, .35); }
.news-banner form { margin: 0; }
.news-banner button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 750 12px var(--font);
  padding: 7px 10px;
  cursor: pointer;
}
.bill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 26px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(12, 18, 34, .04);
  font-size: 13px;
  font-weight: 650;
}
.bill-banner strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.bill-banner span { display: block; margin-top: 3px; font-weight: 600; color: var(--muted); max-width: 720px; }
.bill-banner.is-overdue { border-color: rgba(224, 68, 73, .4); }
.bill-banner.is-due { border-color: rgba(22, 68, 143, .28); }
.bill-banner-pay {
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 800 13px var(--font);
  padding: 10px 16px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(22, 68, 143, .28);
}
.bill-banner.is-overdue .bill-banner-pay {
  background: var(--down);
  box-shadow: 0 6px 16px rgba(224, 68, 73, .22);
}
.tb-bell .tb-icon-btn { position: relative; }
.tb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.tb-notes {
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 24px));
  min-width: 280px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}
.tb-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}
.tb-notes-clear {
  margin: 0;
}
.tb-notes-clear button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
}
.tb-notes-clear button:hover { color: var(--accent); }
.tb-notes-body {
  display: flex;
  flex-direction: column;
  max-height: min(320px, 50vh);
  overflow-x: hidden;
  overflow-y: auto;
}
.tb-notes-all {
  display: block;
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  text-decoration: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
}
.tb-notes-all:hover { background: var(--hover); }
.tb-notes-empty {
  margin: 0;
  padding: 18px 16px 20px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}
a.tb-note,
div.tb-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--border);
}
a.tb-note:first-child,
div.tb-note:first-child {
  border-top: 0;
}
a.tb-note:hover { background: var(--hover); }
.tb-note-copy {
  display: block;
  flex: 1;
  min-width: 0;
}
.tb-note-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.tb-note-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.tb-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 99px;
  flex-shrink: 0;
  background: var(--blue);
}
.tb-dot.up { background: var(--up); }
.tb-dot.warn { background: var(--amber); }
.tb-dot.down { background: var(--down); }
.tb-dot.info,
.tb-dot.pay { background: var(--accent); }

.notes-page {
  margin-top: 4px;
  padding: 0;
  overflow: hidden;
}
.notes-page-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}
a.notes-page-row,
div.notes-page-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: transparent;
}
a.notes-page-row:first-child,
div.notes-page-row:first-child {
  border-top: 0;
}
a.notes-page-row:hover {
  background: var(--hover);
}
div.notes-page-row.is-static:hover {
  background: transparent;
}
.notes-page-row.is-read {
  opacity: 0.78;
}
.notes-page-copy {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}
.notes-page-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}
.notes-page-body {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.notes-page-state {
  flex: 0 0 auto;
  margin-top: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.notes-page-go {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--muted);
}
.notes-page-empty {
  padding: 40px 24px;
  text-align: center;
}
.notes-page-empty strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.notes-page-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.pf-settings { width: 100%; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 16px; align-items: start; }
.pf-news-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.pf-news-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.pf-news-actions { display: flex; gap: 8px; align-items: flex-start; flex-shrink: 0; }
@media (max-width: 980px) {
  .pf-settings { grid-template-columns: 1fr; }
  .news-banner, .bill-banner { margin: 10px 12px 0; }
}
form.dash-card label.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
form.dash-card .field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.pf { display: flex; flex-direction: column; gap: 14px; }
.pf-head, .pf-kpis, .pf-charts { display: flex; gap: 14px; }
.pf-head { align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.pf-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; min-width: min(100%, 280px); color: var(--muted);
}
.pf-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; width: 100%; }
.pf-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pf-kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.pf-kpi span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pf-kpi strong { font-family: var(--mono); font-size: 22px; letter-spacing: -.03em; line-height: 1.1; }
.pf-kpi em { font-style: normal; font-size: 11px; color: var(--faint); font-weight: 650; }
.pf-kpi.is-accent { background: linear-gradient(160deg, rgba(22, 68, 143,.16), var(--panel) 55%); border-color: rgba(22, 68, 143,.28); }
.pf-charts { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; align-items: stretch; }
.pf-bars { display: flex; align-items: flex-end; gap: 10px; min-height: 160px; padding-top: 8px; }
.pf-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.pf-bar-stack { display: flex; align-items: flex-end; gap: 3px; height: 128px; }
.pf-bar-stack span { width: 8px; border-radius: 4px 4px 2px 2px; display: block; }
.pf-bar-col small { font-size: 11px; color: var(--muted); font-weight: 700; }
.pf-legend, .pf-status-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pf-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.pf-method { margin-bottom: 12px; }
.pf-method-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.pf-method-top em { font-style: normal; color: var(--muted); font-weight: 650; margin-left: 6px; font-size: 11px; }
.pf-method-track { margin-top: 6px; height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.pf-method-track span { display: block; height: 100%; border-radius: 99px; }
.pf-empty { color: var(--muted); font-size: 13px; font-weight: 650; padding: 12px 0; }
.pf-name { font-weight: 750; color: inherit; }
.pf-sub { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: capitalize; }
.pf-see-all { font-size: 12.5px; font-weight: 750; color: var(--accent-2); white-space: nowrap; }
.pf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 14px;
}
.pf-toolbar .hx-search { background: var(--panel2); }
.pf-date-pill { padding: 0 10px; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pf-date-pill input[type="date"] {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}
.pf-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
.pf-foot .pagination-wrap { margin: 0; }
.pf-kpis.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-kpis.is-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pf-map-card .dash-card-head { margin-bottom: 0; }
.pf-shop-map {
  width: 100%;
  height: min(68vh, 640px);
  min-height: 420px;
  border-top: 1px solid var(--border);
  background: #e8eef6;
  z-index: 0;
}
.pf-shop-map .leaflet-popup-content { font-family: var(--font); margin: 10px 12px; }
.pf-shop-map .leaflet-popup-content a { color: var(--accent); font-weight: 750; text-decoration: none; }
.settings-map {
  width: 100%;
  height: 280px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: 10px;
  background: #e8eef6;
  z-index: 0;
}
.settings-map-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-kpis.is-4, .pf-kpis.is-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pf-kpis { grid-template-columns: 1fr 1fr; }
}

.co-create {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - var(--topbar-h) - 3.4rem);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.co-create-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.co-form { flex: 1; display: flex; min-height: 0; }
.co-split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}
.co-main, .co-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.co-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-login-note {
  margin: 0;
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}
.co-plan-card { display: flex; flex-direction: column; height: 100%; }
.co-plan-card .co-plans { flex: 1; }
.co-plan-card .co-actions { margin-top: auto; padding-top: 16px; }
.co-trial-chip {
  background: rgba(22, 68, 143,.12); color: var(--accent-dark); border: 1px solid rgba(22, 68, 143,.28);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.co-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 16px; }
.co-main .co-card:last-child { flex: 1; }
.co-step { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-bottom: 14px; }
.co-step span {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(22, 68, 143,.14); color: var(--accent-dark); font-size: 12px;
}
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.co-span { grid-column: 1 / -1; }
.co-card label.field span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.co-card .field-hint, .bill-charge .field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.bill-charge .field { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.bill-charge .field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.bill-charge input { width: 100%; }
.co-plans { display: flex; flex-direction: column; gap: 10px; }
.co-plan { cursor: pointer; }
.co-plan input { position: absolute; opacity: 0; pointer-events: none; }
.co-plan-body {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 12px;
  align-items: center; min-height: 72px;
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  background: var(--bg); transition: border-color .15s, box-shadow .15s, background .15s;
}
.co-plan-body strong { font-size: 15px; }
.co-plan-body em { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; }
.co-plan-body em { font-style: normal; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.co-plan-body em span { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 650; margin-left: 4px; }
.co-plan-body small { grid-column: 1; color: var(--muted); font-size: 12px; font-weight: 650; }
.co-plan input:checked + .co-plan-body,
.co-plan:hover .co-plan-body {
  border-color: var(--accent); background: rgba(22, 68, 143,.08); box-shadow: 0 0 0 3px rgba(22, 68, 143,.12);
}
.co-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.co-actions { display: flex; gap: 10px; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { width: 100%; padding-right: 4.4rem; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer;
}
.owner-login-once { margin-bottom: 16px; }
.owner-login-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.owner-login-row span { color: var(--muted); font-weight: 700; }
@media (max-width: 980px) {
  .co-split, .co-grid, .co-grid-3 { grid-template-columns: 1fr; }
  .co-plan-body em { grid-column: 1; grid-row: auto; text-align: left; }
}
