.rx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--rx-control-h); padding: 0 var(--rx-s3); border: 1px solid transparent; border-radius: var(--rx-radius);
  font-size: var(--rx-fs-md); font-weight: var(--rx-fw-medium); cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color .12s, border-color .12s;
}
.rx-btn:disabled { opacity: .55; cursor: not-allowed; }
.rx-btn--sm { height: var(--rx-control-h-sm); padding: 0 var(--rx-s2); font-size: var(--rx-fs-sm); }
.rx-btn--lg { height: var(--rx-control-h-lg); padding: 0 var(--rx-s4); font-size: var(--rx-fs-lg); }
.rx-btn--block { width: 100%; }
.rx-btn--primary { background: var(--rx-primary); color: var(--rx-text-inverse); }
.rx-btn--primary:hover:not(:disabled) { background: var(--rx-primary-hover); }
.rx-btn--success { background: var(--rx-success); color: var(--rx-text-inverse); }
.rx-btn--success:hover:not(:disabled) { background: var(--rx-success-hover); }
.rx-btn--danger { background: var(--rx-danger); color: var(--rx-text-inverse); }
.rx-btn--danger:hover:not(:disabled) { background: var(--rx-danger-hover); }
.rx-btn--secondary { background: var(--rx-bg); border-color: var(--rx-border-strong); color: var(--rx-text); }
.rx-btn--secondary:hover:not(:disabled) { background: var(--rx-surface); }
.rx-btn--ghost { background: transparent; color: var(--rx-text-2); }
.rx-btn--ghost:hover:not(:disabled) { background: var(--rx-surface-2); }
.rx-spin { animation: rx-spin 0.8s linear infinite; }
@keyframes rx-spin { to { transform: rotate(360deg); } }

.rx-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rx-field__label { font-size: var(--rx-fs-sm); font-weight: var(--rx-fw-medium); color: var(--rx-text-2); }
.rx-field__req { color: var(--rx-danger); }
.rx-field__hint { font-size: var(--rx-fs-xs); color: var(--rx-text-3); }
.rx-field__error { font-size: var(--rx-fs-xs); color: var(--rx-danger); }
.rx-input {
  height: var(--rx-control-h); width: 100%; padding: 0 var(--rx-s2); background: var(--rx-bg);
  border: 1px solid var(--rx-border-strong); border-radius: var(--rx-radius); font-size: var(--rx-fs-md);
}
.rx-input:focus { border-color: var(--rx-primary); box-shadow: var(--rx-focus); outline: none; }
.rx-input:disabled { background: var(--rx-surface); color: var(--rx-text-3); }
.rx-field--error .rx-input { border-color: var(--rx-danger); }
.rx-select { padding-right: var(--rx-s6); }
.rx-textarea { height: auto; min-height: 72px; padding: var(--rx-s2); resize: vertical; }
input[type="file"].rx-input { padding: 4px; height: auto; }
.rx-pw { position: relative; display: block; }
.rx-pw .rx-input { padding-right: 32px; }
.rx-pw__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--rx-text-3); padding: 4px; cursor: pointer; border-radius: var(--rx-radius-sm); display: inline-flex; }
.rx-pw__btn:hover { color: var(--rx-text); background: var(--rx-surface-2); }
.rx-select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%237a818c%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input[type="file"].rx-input::file-selector-button { border: 1px solid var(--rx-border-strong); background: var(--rx-surface); border-radius: var(--rx-radius-sm); padding: 3px 10px; margin-right: 8px; font-size: var(--rx-fs-sm); cursor: pointer; }

.rx-brand { display: inline-flex; align-items: center; gap: 8px; }
.rx-brand__text { font-weight: var(--rx-fw-semibold); font-size: var(--rx-fs-lg); letter-spacing: -.01em; }
.rx-brand--dark .rx-brand__text { color: var(--rx-text); }
.rx-brand--light .rx-brand__text { color: #fff; }

.rx-spinner { display: inline-flex; align-items: center; gap: 6px; color: var(--rx-text-3); font-size: var(--rx-fs-sm); }
.rx-page-loader { min-height: 40vh; display: grid; place-items: center; }
.rx-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--rx-s8) var(--rx-s4); text-align: center; color: var(--rx-text-2); }
.rx-state__icon { color: var(--rx-text-3); }
.rx-state--error .rx-state__icon { color: var(--rx-danger); }
.rx-state__title { font-weight: var(--rx-fw-semibold); color: var(--rx-text); }
.rx-state__text { font-size: var(--rx-fs-sm); max-width: 420px; }
.rx-alert { padding: var(--rx-s2) var(--rx-s3); border-radius: var(--rx-radius); font-size: var(--rx-fs-sm); border: 1px solid; }
.rx-alert--info { background: var(--rx-primary-soft); border-color: #d1d5db; color: #20437f; }
.rx-alert--success { background: var(--rx-success-soft); border-color: #c4e2d0; color: #1f6440; }
.rx-alert--warning { background: var(--rx-warning-soft); border-color: #efd9ae; color: #7a5212; }
.rx-alert--danger { background: var(--rx-danger-soft); border-color: #f0c8c4; color: #8c2a20; }
.rx-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--rx-radius-sm); font-size: var(--rx-fs-xs); font-weight: var(--rx-fw-medium); background: var(--rx-surface-2); color: var(--rx-text-2); }
.rx-badge--success { background: var(--rx-success-soft); color: var(--rx-success); }
.rx-badge--warning { background: var(--rx-warning-soft); color: var(--rx-warning); }
.rx-badge--danger { background: var(--rx-danger-soft); color: var(--rx-danger); }
.rx-badge--primary { background: var(--rx-primary-soft); color: var(--rx-primary); }

.rx-toasts { position: fixed; right: var(--rx-s4); bottom: var(--rx-s4); z-index: var(--rx-z-toast); display: flex; flex-direction: column; gap: var(--rx-s2); max-width: min(360px, calc(100vw - 32px)); }
.rx-toast { display: flex; align-items: flex-start; gap: var(--rx-s2); padding: var(--rx-s2) var(--rx-s3); background: var(--rx-bg); border: 1px solid var(--rx-border); border-left: 3px solid var(--rx-primary); border-radius: var(--rx-radius); box-shadow: var(--rx-shadow-2); font-size: var(--rx-fs-sm); }
.rx-toast > span { flex: 1; }
.rx-toast--success { border-left-color: var(--rx-success); }
.rx-toast--danger { border-left-color: var(--rx-danger); }
.rx-toast--warning { border-left-color: var(--rx-warning); }
.rx-toast__x { border: 0; background: transparent; cursor: pointer; color: var(--rx-text-3); padding: 2px; }

.rx-modal__backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .38); display: grid; place-items: center; z-index: var(--rx-z-modal); padding: var(--rx-s4); }
.rx-modal { background: var(--rx-bg); border-radius: var(--rx-radius-lg); box-shadow: var(--rx-shadow-2); width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.rx-modal--sm { max-width: 400px; } .rx-modal--md { max-width: 560px; } .rx-modal--lg { max-width: 860px; }
.rx-modal__head { display: flex; align-items: center; justify-content: space-between; padding: var(--rx-s3) var(--rx-s4); border-bottom: 1px solid var(--rx-border); }
.rx-modal__x { border: 0; background: transparent; cursor: pointer; color: var(--rx-text-3); padding: 4px; border-radius: var(--rx-radius); }
.rx-modal__x:hover { background: var(--rx-surface-2); }
.rx-modal__body { padding: var(--rx-s4); overflow: auto; }
.rx-modal__foot { display: flex; justify-content: flex-end; gap: var(--rx-s2); padding: var(--rx-s3) var(--rx-s4); border-top: 1px solid var(--rx-border); }

.rx-page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--rx-s4); }
.rx-page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--rx-s3); flex-wrap: wrap; }
.rx-crumbs { display: flex; align-items: center; gap: 2px; font-size: var(--rx-fs-xs); color: var(--rx-text-3); }
.rx-crumbs__item { display: inline-flex; align-items: center; gap: 2px; }
.rx-panel { background: var(--rx-bg); border: 1px solid var(--rx-border); border-radius: var(--rx-radius-lg); }
.rx-panel__head { display: flex; align-items: center; justify-content: space-between; padding: var(--rx-s2) var(--rx-s3); border-bottom: 1px solid var(--rx-border); min-height: 40px; }
.rx-panel__body { padding: var(--rx-s3); }
.rx-stat { padding: var(--rx-s2) var(--rx-s3); border: 1px solid var(--rx-border); border-radius: var(--rx-radius); background: var(--rx-bg); }
.rx-stat__label { font-size: var(--rx-fs-xs); color: var(--rx-text-3); text-transform: uppercase; letter-spacing: .03em; }
.rx-stat__value { font-size: var(--rx-fs-lg); font-weight: var(--rx-fw-semibold); }
.rx-stat__hint { font-size: var(--rx-fs-xs); color: var(--rx-text-3); }

.rx-lang { display: inline-flex; border: 1px solid var(--rx-border); border-radius: var(--rx-radius); overflow: hidden; }
.rx-lang button { border: 0; background: var(--rx-bg); padding: 2px 8px; font-size: var(--rx-fs-xs); cursor: pointer; color: var(--rx-text-2); }
.rx-lang button.is-on { background: var(--rx-primary-soft); color: var(--rx-primary); font-weight: var(--rx-fw-semibold); }

.rx-shell { display: grid; grid-template-columns: var(--rx-sidebar-w) 1fr; height: 100%; }
.rx-shell--collapsed { grid-template-columns: var(--rx-sidebar-w-collapsed) 1fr; }
.rx-side { display: flex; flex-direction: column; background: var(--rx-surface); border-right: 1px solid var(--rx-border); min-height: 0; }
.rx-side__brand { height: var(--rx-topbar-h); display: flex; align-items: center; padding: 0 var(--rx-s3); border-bottom: 1px solid var(--rx-border); font-weight: var(--rx-fw-semibold); overflow: hidden; white-space: nowrap; }
.rx-side__nav { flex: 1; overflow-y: auto; padding: var(--rx-s2); }
.rx-side__section + .rx-side__section { margin-top: var(--rx-s3); }
.rx-side__label { font-size: var(--rx-fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--rx-text-3); padding: 4px var(--rx-s2); white-space: nowrap; overflow: hidden; }
.rx-side__link { display: flex; align-items: center; gap: var(--rx-s2); height: 30px; padding: 0 var(--rx-s2); border-radius: var(--rx-radius); color: var(--rx-text-2); font-size: var(--rx-fs-md); white-space: nowrap; overflow: hidden; }
.rx-side__link:hover { background: var(--rx-surface-2); text-decoration: none; color: var(--rx-text); }
.rx-side__link.is-active { background: var(--rx-primary-soft); color: var(--rx-primary); font-weight: var(--rx-fw-medium); }
.rx-side__collapse { margin: var(--rx-s2); height: 28px; border: 1px solid var(--rx-border); background: var(--rx-bg); border-radius: var(--rx-radius); cursor: pointer; color: var(--rx-text-3); }
.rx-shell--collapsed .rx-side__link span, .rx-shell--collapsed .rx-side__label { display: none; }
.rx-shell--collapsed .rx-side__link { justify-content: center; }
.rx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rx-top { height: var(--rx-topbar-h); display: flex; align-items: center; gap: var(--rx-s3); padding: 0 var(--rx-s4); border-bottom: 1px solid var(--rx-border); background: var(--rx-bg); }
.rx-top__menu { display: none; border: 0; background: transparent; cursor: pointer; padding: 4px; }
.rx-top__slot { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--rx-s3); }
.rx-top__right { display: flex; align-items: center; gap: var(--rx-s2); }
.rx-top__user { font-size: var(--rx-fs-sm); color: var(--rx-text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-top__icon { border: 0; background: transparent; padding: 6px; border-radius: var(--rx-radius); cursor: pointer; color: var(--rx-text-2); display: inline-flex; }
.rx-top__icon:hover { background: var(--rx-surface-2); }
.rx-content { flex: 1; overflow: auto; padding: var(--rx-s4); background: var(--rx-bg); }
.rx-shell__scrim { display: none; }
@media (max-width: 900px) {
  .rx-shell, .rx-shell--collapsed { grid-template-columns: 1fr; }
  .rx-side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: var(--rx-z-drawer); transform: translateX(-100%); transition: transform .18s ease; }
  .rx-shell--drawer .rx-side { transform: none; }
  .rx-shell--drawer .rx-shell__scrim { display: block; position: fixed; inset: 0; background: rgba(17,24,39,.3); z-index: calc(var(--rx-z-drawer) - 1); }
  .rx-shell--collapsed .rx-side__link span, .rx-shell--collapsed .rx-side__label { display: initial; }
  .rx-side__collapse { display: none; }
  .rx-top__menu { display: inline-flex; }
  .rx-top__user { display: none; }
  .rx-content { padding: var(--rx-s3); }
}

/* ---------- base (no aside) ---------- */
.rx-auth { min-height: 100%; background: var(--rx-surface); display: flex; }
.rx-auth__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: var(--rx-s4) var(--rx-s5); gap: var(--rx-s5); overflow-y: auto; }
.rx-auth__top { width: 100%; max-width: 760px; display: flex; justify-content: space-between; align-items: center; }
.rx-auth__card { width: 100%; max-width: 360px; background: var(--rx-bg); border: 1px solid var(--rx-border); border-radius: 8px; padding: var(--rx-s6) var(--rx-s5); box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06); margin: auto 0; }
.rx-auth__card--wide { max-width: 680px; }
.rx-auth__head { margin-bottom: var(--rx-s4); display: flex; flex-direction: column; gap: 4px; }
.rx-auth__head h1 { font-size: 19px; letter-spacing: -.01em; }
.rx-auth__head p { font-size: var(--rx-fs-sm); color: var(--rx-text-3); }
.rx-auth__foot { margin-top: var(--rx-s4); padding-top: var(--rx-s3); border-top: 1px solid var(--rx-border); font-size: var(--rx-fs-sm); color: var(--rx-text-2); text-align: center; }
.rx-auth__mbrand { display: none; }

/* ---------- split ---------- */
.rx-auth--split { background: var(--rx-bg); }
.rx-auth--split .rx-auth__main { background: var(--rx-bg); }
.rx-auth--split .rx-auth__top { justify-content: flex-end; }
.rx-auth--split .rx-auth__card { border: 0; box-shadow: none; padding: 0; }
.rx-auth__aside {
  position: relative; overflow: hidden;
  width: clamp(300px, 36vw, 440px); flex-shrink: 0;
  display: flex; flex-direction: column; gap: var(--rx-s6);
  padding: var(--rx-s6) var(--rx-s6) var(--rx-s5);
  color: #e6edf8;
  background: linear-gradient(165deg, #152c55 0%, #1c3d78 55%, #24529c 100%);
}
.rx-auth__aside::after { /* faint dot grid, decorative only */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(#ffffff 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 45%, transparent 100%);
}
.rx-auth__aside > * { position: relative; z-index: 1; }
.rx-auth__pitch { margin-top: var(--rx-s6); display: flex; flex-direction: column; gap: 8px; }
.rx-auth__pitch h2 { color: #fff; font-size: 20px; line-height: 1.35; font-weight: var(--rx-fw-semibold); letter-spacing: -.01em; }
.rx-auth__pitch p { font-size: var(--rx-fs-sm); color: #b9c8e3; line-height: 1.55; }
.rx-auth__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rx-auth__features li { display: flex; gap: 10px; align-items: flex-start; }
.rx-auth__ficon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: #9fe0bd; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.rx-auth__features strong { display: block; font-size: var(--rx-fs-md); font-weight: var(--rx-fw-medium); color: #fff; }
.rx-auth__features small { display: block; font-size: var(--rx-fs-xs); color: #a9bad9; margin-top: 1px; }
.rx-auth__asidefoot { margin-top: auto; font-size: var(--rx-fs-xs); color: #8ea3c8; }

@media (max-width: 860px) {
  .rx-auth--split { flex-direction: column; }
  .rx-auth__aside { display: none; }
  .rx-auth--split .rx-auth__top { justify-content: space-between; }
  .rx-auth__mbrand { display: inline-flex; }
  .rx-auth--split .rx-auth__card { margin-top: var(--rx-s4); }
}
@media (max-width: 480px) {
  .rx-auth__main { padding: var(--rx-s3); }
  .rx-auth__card { padding: var(--rx-s4); }
}
/* auth forms: slightly taller controls for comfortable sign-in, still compact */
.rx-auth .rx-input { height: 36px; }
.rx-auth .rx-btn--primary { height: 36px; }
.rx-auth__row { display: flex; justify-content: space-between; align-items: center; }

.rx-table-wrap { overflow-x: auto; }
.rx-table { width: 100%; border-collapse: collapse; font-size: var(--rx-fs-md); }
.rx-table th { text-align: left; font-weight: var(--rx-fw-medium); font-size: var(--rx-fs-sm); color: var(--rx-text-3); background: var(--rx-surface); padding: 6px var(--rx-s3); border-bottom: 1px solid var(--rx-border); white-space: nowrap; }
.rx-table td { padding: 7px var(--rx-s3); border-bottom: 1px solid var(--rx-border); vertical-align: middle; }
.rx-table tbody tr:hover { background: var(--rx-surface); }
.rx-table .rx-num { text-align: right; font-variant-numeric: tabular-nums; }
.rx-table .rx-actions { text-align: right; white-space: nowrap; }
.rx-filters { display: flex; gap: var(--rx-s2); padding: var(--rx-s2) var(--rx-s3); border-bottom: 1px solid var(--rx-border); flex-wrap: wrap; align-items: center; }
.rx-filters .rx-input { max-width: 260px; }
.rx-filters .rx-select { max-width: 170px; }
.rx-pager { display: flex; justify-content: center; align-items: center; padding: var(--rx-s2); min-height: 40px; }
.rx-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--rx-fs-md); cursor: pointer; user-select: none; }
.rx-check input { width: 14px; height: 14px; accent-color: var(--rx-primary); cursor: pointer; margin: 0; }
.rx-check--disabled { opacity: .55; cursor: not-allowed; }
.rx-kv { display: grid; grid-template-columns: 150px 1fr; gap: var(--rx-s2); padding: 5px 0; border-bottom: 1px dashed var(--rx-border); }
.rx-kv:last-child { border-bottom: 0; }
.rx-kv__k { color: var(--rx-text-3); font-size: var(--rx-fs-sm); }
.rx-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--rx-s3); align-items: start; }
.rx-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--rx-s2); margin-bottom: var(--rx-s4); }
@media (max-width: 900px) { .rx-split { grid-template-columns: 1fr; } .rx-kv { grid-template-columns: 120px 1fr; } }
.rx-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.rx-ph { display: flex; gap: var(--rx-s3); align-items: flex-start; padding: var(--rx-s2) 0; }
.rx-ph__icon { width: 32px; height: 32px; border-radius: var(--rx-radius); display: grid; place-items: center; background: var(--rx-warning-soft); color: var(--rx-warning); flex-shrink: 0; }
.rx-ph__body { display: flex; flex-direction: column; gap: var(--rx-s2); font-size: var(--rx-fs-md); color: var(--rx-text-2); }
.rx-ph__body ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px var(--rx-s4); font-size: var(--rx-fs-sm); color: var(--rx-text-3); }

.rx-chart { position: relative; }
.rx-chart__svg { width: 100%; display: block; overflow: visible; }
.rx-chart__grid { stroke: var(--rx-border); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.rx-chart__base { stroke: var(--rx-border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rx-chart__axis { font-size: 10px; fill: var(--rx-text-3); }
.rx-chart__bar { fill: var(--rx-primary); opacity: .85; transition: opacity .1s; }
.rx-chart__bar.is-hover { opacity: 1; }
.rx-chart__tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--rx-text); color: var(--rx-text-inverse); border-radius: var(--rx-radius); padding: 4px 8px; font-size: var(--rx-fs-xs); pointer-events: none; display: flex; flex-direction: column; align-items: center; white-space: nowrap; box-shadow: var(--rx-shadow-2); }
.rx-chart__tip strong { font-size: var(--rx-fs-sm); }
.rx-barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-barlist li { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: var(--rx-s2); align-items: center; font-size: var(--rx-fs-sm); }
.rx-barlist__label { color: var(--rx-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-barlist__track { height: 8px; background: var(--rx-surface-2); border-radius: 4px; overflow: hidden; }
.rx-barlist__fill { display: block; height: 100%; background: var(--rx-primary); border-radius: 4px; }
.rx-barlist__value { color: var(--rx-text); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

.rx-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rx-border); margin-bottom: var(--rx-s3); overflow-x: auto; }
.rx-tabs button { border: 0; background: none; padding: 8px 12px; font-size: var(--rx-fs-md); color: var(--rx-text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rx-tabs button:hover { color: var(--rx-text); }
.rx-tabs button.is-on { color: var(--rx-primary); border-bottom-color: var(--rx-primary); font-weight: var(--rx-fw-medium); }

.rx-range { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rx-range button { border: 1px solid var(--rx-border); background: var(--rx-bg); padding: 3px 8px; font-size: var(--rx-fs-xs); border-radius: var(--rx-radius); cursor: pointer; color: var(--rx-text-2); }
.rx-range button.is-on { background: var(--rx-primary-soft); color: var(--rx-primary); border-color: #d1d5db; }
.rx-range .rx-input { width: 132px; height: var(--rx-control-h-sm); font-size: var(--rx-fs-sm); }

/* RetailX design tokens — compact, neutral, enterprise. Shared by Admin and OS. */
:root {
  --rx-font: "Inter", "Segoe UI", "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, sans-serif;
  --rx-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;

  /* type scale (compact) */
  --rx-fs-xs: 11px; --rx-fs-sm: 12px; --rx-fs-md: 13px; --rx-fs-lg: 15px; --rx-fs-xl: 18px; --rx-fs-2xl: 22px;
  --rx-fw-normal: 400; --rx-fw-medium: 500; --rx-fw-semibold: 600;
  --rx-lh: 1.45;

  /* spacing (4px grid) */
  --rx-s1: 4px; --rx-s2: 8px; --rx-s3: 12px; --rx-s4: 16px; --rx-s5: 20px; --rx-s6: 24px; --rx-s8: 32px;

  /* neutrals */
  --rx-bg: #ffffff; --rx-surface: #f6f7f9; --rx-surface-2: #eef0f3; --rx-border: #dfe2e7; --rx-border-strong: #c9ced6;
  --rx-text: #1f2329; --rx-text-2: #4b525c; --rx-text-3: #7a818c; --rx-text-inverse: #ffffff;

  /* intent */
  --rx-primary: #2f5fb3; --rx-primary-hover: #284f96; --rx-primary-soft: #e9eff9;
  --rx-success: #2e8b57; --rx-success-hover: #26744a; --rx-success-soft: #e8f4ed;
  --rx-warning: #b7791f; --rx-warning-soft: #fbf3e4;
  --rx-danger: #c0392b; --rx-danger-hover: #a53125; --rx-danger-soft: #fbeceb;

  --rx-radius-sm: 3px; --rx-radius: 4px; --rx-radius-lg: 6px;
  --rx-shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06);
  --rx-shadow-2: 0 6px 20px rgba(16, 24, 40, 0.12);
  --rx-focus: 0 0 0 2px rgba(47, 95, 179, 0.28);

  --rx-control-h: 32px; --rx-control-h-sm: 26px; --rx-control-h-lg: 40px;
  --rx-sidebar-w: 224px; --rx-sidebar-w-collapsed: 56px; --rx-topbar-h: 48px;
  --rx-z-drawer: 40; --rx-z-modal: 50; --rx-z-toast: 60;
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0; font-family: var(--rx-font); font-size: var(--rx-fs-md); line-height: var(--rx-lh);
  color: var(--rx-text); background: var(--rx-bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: var(--rx-fw-semibold); color: var(--rx-text); }
h1 { font-size: var(--rx-fs-xl); } h2 { font-size: var(--rx-fs-lg); } h3 { font-size: var(--rx-fs-md); }
p { margin: 0; }
a { color: var(--rx-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--rx-focus); }
.rx-muted { color: var(--rx-text-3); }
.rx-mono { font-family: var(--rx-mono); }
.rx-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rx-stack { display: flex; flex-direction: column; gap: var(--rx-s3); }
.rx-row { display: flex; align-items: center; gap: var(--rx-s2); }
.rx-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--rx-s3); }
@media (max-width: 640px) { .rx-grid-2 { grid-template-columns: 1fr; } }
.rx-linkbtn { border: 0; background: none; padding: 0; color: var(--rx-primary); cursor: pointer; font-size: var(--rx-fs-sm); align-self: flex-start; }
.rx-linkbtn:hover { text-decoration: underline; }
.rx-row--wrap { flex-wrap: wrap; gap: var(--rx-s4); align-items: flex-end; }
.rx-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--rx-s2) var(--rx-s3); }
@media (max-width: 760px) { .rx-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rx-form-narrow { max-width: 560px; }
.rx-mt { margin-top: var(--rx-s3); }
.rx-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rx-s2) var(--rx-s3); }
@media (max-width: 760px) { .rx-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* RetailX OS app-level styles (tokens/base come from the engine). */
.rx-table { width: 100%; border-collapse: collapse; }
.rx-table th { text-align: left; font-weight: var(--rx-fw-medium); font-size: var(--rx-fs-sm); color: var(--rx-text-3); background: var(--rx-surface); padding: 6px var(--rx-s3); border-bottom: 1px solid var(--rx-border); }
.rx-table td { padding: 7px var(--rx-s3); border-bottom: 1px solid var(--rx-border); }
.os-amount { height: var(--rx-control-h); display: flex; align-items: center; font-weight: var(--rx-fw-semibold); font-variant-numeric: tabular-nums; }

/* =====================================================================
   RetailX OS — unified light theme (compact, slim, blue)
   Loaded after the engine's base.css, so these tokens override it for every page.
   ===================================================================== */
:root {
  --rx-primary: #1f2937; --rx-primary-soft: #f3f4f6; --rx-primary-hover: #111827; --rx-primary-strong: #111827;
  --rx-surface: #f4f6fa; --rx-surface-2: #e9edf4; --rx-bg: #ffffff;
  --rx-border: #e3e7ef; --rx-border-strong: #cbd3e1;
  --rx-text: #0f172a; --rx-text-2: #475569; --rx-text-3: #8492a8;
  --rx-radius: 8px; --rx-radius-sm: 6px; --rx-radius-lg: 12px;
  --rx-control-h: 32px; --rx-control-h-sm: 26px;
  --rx-fs-xs: 11px; --rx-fs-sm: 12px; --rx-fs-md: 13px; --rx-fs-lg: 16px; --rx-fs-xl: 20px;
  --os-grad: linear-gradient(135deg, #1f2937, #374151);
  --os-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 18px rgba(15,23,42,.04);
}
body { background: var(--rx-surface); color: var(--rx-text); font-size: 13px; }
.rx-main, .rx-content { background: var(--rx-surface); }

/* top bar + sidebar */
.rx-top { position: relative; background: #fff; border-bottom: 1px solid var(--rx-border); }
.rx-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--os-grad); }
.rx-side { background: #fff; border-right: 1px solid var(--rx-border); }
.rx-side a { border-radius: 8px; font-size: 12.5px; color: var(--rx-text-2); transition: background .12s, color .12s; }
.rx-side a:hover { background: var(--rx-primary-soft); color: var(--rx-primary); text-decoration: none; }
.rx-side a.active, .rx-side a[aria-current="page"], .rx-side a.is-active { background: var(--os-grad); color: #fff; font-weight: 600; box-shadow: 0 4px 10px rgba(31,41,55,.25); }
.rx-side a.active svg, .rx-side a[aria-current="page"] svg, .rx-side a.is-active svg { color: #fff; }

/* page header */
.rx-page-head :is(h1, h2) { font-size: 17px; font-weight: 700; letter-spacing: -.1px; color: var(--rx-text); }
.rx-crumbs { font-size: 11.5px; color: var(--rx-text-3); }

/* panels / cards */
.rx-panel { background: #fff; border: 1px solid var(--rx-border); border-radius: 12px; box-shadow: var(--os-shadow); overflow: hidden; }
.rx-panel :is(h2, h3) { font-size: 13px; font-weight: 600; }

/* tables */
.rx-table th { background: #f4f6fa; color: var(--rx-text-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 7px var(--rx-s3); }
.rx-table td { padding: 7px var(--rx-s3); font-size: 12.5px; border-bottom: 1px solid #eef1f6; }
.rx-table tbody tr { transition: background .1s; }
.rx-table tbody tr:hover td { background: #f5f6f8; }
.rx-table tr:last-child td { border-bottom: 0; }

/* form controls */
.rx-input, .rx-select, textarea.rx-input { border-radius: 8px; border: 1px solid var(--rx-border-strong); background: #fff; font-size: 13px; transition: border-color .12s, box-shadow .12s; }
.rx-input:focus, .rx-select:focus, textarea.rx-input:focus { outline: 0; border-color: var(--rx-primary); box-shadow: 0 0 0 3px rgba(31,41,55,.13); }
.rx-field label { font-size: 12px; font-weight: 600; color: var(--rx-text-2); }

/* buttons (engine <Button>) */
:is(.rx-btn, button.rx-btn) { border-radius: 8px; font-size: 12.5px; font-weight: 500; transition: all .12s; }
:is(.rx-btn--primary, .rx-btn-primary, .rx-btn.is-primary, .rx-btn[data-variant="primary"]) { background: var(--os-grad); border-color: transparent; color: #fff; box-shadow: 0 3px 8px rgba(31,41,55,.25); }
:is(.rx-btn--primary, .rx-btn-primary, .rx-btn.is-primary, .rx-btn[data-variant="primary"]):hover:not(:disabled) { filter: brightness(1.07); }

/* dashboard stat cards */
.os-dash__stats > * { background: #fff; border: 1px solid var(--rx-border); border-radius: 12px; box-shadow: inset 0 3px 0 var(--rx-primary), var(--os-shadow); }

/* helper shared with other pages */
.os-brand { font-weight: 700; }
.os-conn { font-size: 11px; }
.os-me:hover { background: var(--rx-primary-soft); color: var(--rx-primary); }
.os-bell__btn:hover { background: var(--rx-primary-soft); color: var(--rx-primary); }
.os-hub a:hover { background: var(--rx-primary-soft); }
.os-msg--tenant { border-color: #d1d5db; }
.os-pcard:hover { box-shadow: 0 8px 20px rgba(31,41,55,.14); }


/* ===== Neutral theme v3: white / dark grey / grey, touch-friendly. One accent (orange) for the main action only ===== */
:root {
  --os-accent: #ea580c; --os-accent-hover: #c2410c;
  --rx-success: #374151; --rx-success-soft: #f3f4f6; --rx-warning: #4b5563; --rx-warning-soft: #f3f4f6;
  --rx-control-h: 40px; --rx-control-h-sm: 34px; --rx-control-h-lg: 48px;
  --rx-fs-md: 14px; --rx-fs-sm: 13px; --rx-topbar-h: 52px;
}
html, body, #root { height: 100%; }
body { font-size: 14px; overflow: hidden; }
.rx-content { overflow-y: auto; overflow-x: hidden; padding: 14px; min-width: 0; }
.rx-main { min-width: 0; }
.rx-table-wrap { overflow-x: auto; max-width: 100%; }
.rx-top::after { background: #e5e7eb; height: 1px; }
.rx-side a, .rx-side__link { height: 40px; font-size: 13.5px; }
.rx-side__link.is-active { background: #1f2937; color: #fff; box-shadow: none; }
.rx-side__link:hover { background: #f3f4f6; color: #111827; }
.rx-side__brand { font-size: 15px; }
.rx-btn { min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; border-radius: 10px; background: #fff; border: 1px solid #d1d5db; color: #1f2937; }
.rx-btn:hover:not(:disabled) { background: #f3f4f6; }
.rx-btn--sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
:is(.rx-btn--primary, .rx-btn-primary, .rx-btn.is-primary, .rx-btn[data-variant="primary"]) { background: #1f2937; border-color: #1f2937; color: #fff; box-shadow: none; }
:is(.rx-btn--primary, .rx-btn-primary, .rx-btn.is-primary, .rx-btn[data-variant="primary"]):hover:not(:disabled) { background: #111827; filter: none; }
.rx-btn:disabled { background: #e5e7eb; border-color: #e5e7eb; color: #6b7280; opacity: 1; }
.rx-input, .rx-select, textarea.rx-input { min-height: 40px; font-size: 14px; border-color: #d1d5db; }
.rx-input:focus, .rx-select:focus, textarea.rx-input:focus { border-color: #1f2937; box-shadow: 0 0 0 3px rgba(31,41,55,.12); }
.rx-table td, .rx-table th { padding-top: 10px; padding-bottom: 10px; }
.rx-table td { font-size: 13.5px; }
.rx-table tbody tr:hover td { background: #f9fafb; }
.rx-side a.active, .rx-side a[aria-current="page"], .rx-side a.is-active { background: #1f2937; box-shadow: none; }
.os-dash__stats > * { box-shadow: inset 0 3px 0 #1f2937, var(--os-shadow); }
.os-pcard:hover { box-shadow: 0 8px 20px rgba(17,24,39,.12); }
/* badges / status: grey chips, text colour only */
.rx-badge, [class*="rx-badge"] { background: #f3f4f6 !important; color: #374151 !important; border: 1px solid #e5e7eb; }

/* header */
.os-hd { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.os-hd__brand { font-weight: 800; font-size: 15px; letter-spacing: .2px; color: #111827; white-space: nowrap; }
.os-hd__help { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #f3f4f6; color: #374151; font-size: 13px; white-space: nowrap; text-decoration: none; }
.os-hd__help b { font-weight: 700; color: #111827; }
.os-hd__shop { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #111827; min-width: 0; padding-left: 14px; border-left: 1px solid #e5e7eb; }
.os-hd__shop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-hd__shop img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
.os-hd__right { display: flex; align-items: center; gap: 10px; }
.os-me { height: 40px; padding: 0 12px; border: 1px solid #e5e7eb; background: #fff; font-size: 13.5px; }
.os-me small { color: #6b7280; }
.os-conn.is-on::before { background: #374151; }
@media (max-width: 1100px) { .os-hd__help span { display: none; } }
@media (max-width: 760px) { .os-hd__shop, .os-hd__help { display: none; } }


/* ===== header overflow fix ===== */
.rx-top { overflow: hidden; gap: 10px; padding: 0 12px; }
.rx-top__slot { flex: 1 1 0; min-width: 0; overflow: hidden; gap: 10px; }
.rx-top__right { flex: 0 0 auto; }
.os-hd { flex: 1 1 0; min-width: 0; overflow: hidden; gap: 10px; }
.os-hd__brand, .os-hd__help { flex: 0 0 auto; }
.os-hd__shop { flex: 0 1 auto; min-width: 0; padding-left: 10px; }
.os-hd__right { flex: 0 0 auto; min-width: 0; gap: 8px; }
.os-hd__right .os-branch { width: 150px; max-width: 150px; min-height: 36px; height: 36px; flex: 0 1 150px; }
.os-me { flex: 0 1 auto; min-width: 0; height: 36px; max-width: 200px; overflow: hidden; }
.os-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-me small { display: none; }
.os-hd__right .rx-badge { display: none; }
@media (min-width: 1500px) { .os-me small { display: inline; } .os-hd__right .rx-badge { display: inline-flex; } .os-hd__right .os-branch { width: 200px; max-width: 200px; flex-basis: 200px; } }
@media (max-width: 1250px) { .os-conn { display: none; } .os-hd__help span { display: none; } }
@media (max-width: 1000px) { .os-hd__shop { display: none; } .os-hd__right .os-branch { width: 120px; max-width: 120px; flex-basis: 120px; } }
@media (max-width: 760px) { .os-hd__help { display: none; } .os-me span { display: none; } .os-hd__right .os-branch { width: 100px; max-width: 100px; flex-basis: 100px; } }

/* sales row actions */
.os-act { white-space: nowrap; text-align: right; } .os-act-h { text-align: right; }
.os-act__b { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; margin-left: 5px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #374151; font-size: 12px; font-weight: 600; text-decoration: none; }
.os-act__b:hover { background: #f3f4f6; color: #111827; text-decoration: none; }
.os-act__b.is-danger { color: #dc2626; border-color: #f3c2c2; background: #fef2f2; } .os-act__b.is-danger:hover { background: #fee2e2; }
@media (max-width: 1300px) { .os-act__b span { display: none; } .os-act__b { padding: 0 9px; } }

/* ===== v5: shared polish for every remaining page (neutral, slim, touch friendly) ===== */
.rx-page-head { margin-bottom: 14px; }
.rx-page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; color: #111827; margin: 0; }
.rx-page-head p { color: #6b7280; font-size: 12.5px; margin: 2px 0 0; }
.rx-page-head__row .rx-btn-group, .rx-page-head__row > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }

.rx-panel { border-radius: 14px; border-color: #e5e7eb; box-shadow: 0 1px 2px rgba(17,24,39,.04); overflow: hidden; }
.rx-panel__head { background: #fff; padding: 10px 14px; min-height: 46px; }
.rx-panel__head h2, .rx-panel__head h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: #111827; }
.rx-panel__body { padding: 14px; }

.rx-stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.rx-stat { border-radius: 14px; border-color: #e5e7eb; padding: 12px 14px; box-shadow: 0 1px 2px rgba(17,24,39,.04); background: #fff; }
.rx-stat__label { font-size: 11px; font-weight: 600; letter-spacing: .5px; color: #6b7280; }
.rx-stat__value { font-size: 20px; font-weight: 700; color: #111827; margin-top: 2px; }

.rx-table th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; background: #f9fafb; padding: 10px 14px; }
.rx-table td { padding: 11px 14px; font-size: 13px; }
.rx-table tbody tr { transition: background .1s; }
.rx-table tbody tr:hover { background: #f9fafb; }
.rx-table tbody tr:last-child td { border-bottom: 0; }
.rx-table td a { color: #111827; font-weight: 600; } .rx-table td a:hover { color: #ea580c; text-decoration: none; }
.rx-table .rx-actions .rx-btn, .rx-table .rx-actions button { min-height: 32px; }

.rx-filters { padding: 10px 14px; gap: 8px; background: #fff; }
.rx-filters .rx-input, .rx-filters .rx-select { min-height: 40px; border-radius: 10px; }
.rx-pager { min-height: 52px; }

.rx-tabs { gap: 6px; border-bottom: 0; margin-bottom: 14px; padding: 4px; background: #e5e7eb; border-radius: 12px; width: fit-content; max-width: 100%; }
.rx-tabs button { padding: 0 16px; height: 36px; border: 0; border-radius: 9px; font-size: 13px; color: #4b5563; margin: 0; }
.rx-tabs button:hover { color: #111827; }
.rx-tabs button.is-on { background: #fff; color: #111827; font-weight: 700; box-shadow: 0 1px 3px rgba(17,24,39,.12); border: 0; }

.rx-modal__backdrop { background: rgba(17,24,39,.5); backdrop-filter: blur(2px); }
.rx-modal { border-radius: 16px; box-shadow: 0 24px 60px rgba(17,24,39,.3); }
.rx-modal__head { padding: 14px 18px; } .rx-modal__head h2, .rx-modal__head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.rx-modal__body { padding: 18px; } .rx-modal__foot { padding: 12px 18px; background: #f9fafb; border-radius: 0 0 16px 16px; }
.rx-modal__x { width: 34px; height: 34px; display: grid; place-items: center; }

.rx-kv { grid-template-columns: 160px 1fr; padding: 8px 0; }
.rx-kv__k { font-size: 12px; font-weight: 600; }
.rx-check input { width: 18px; height: 18px; accent-color: #1f2937; }
.rx-check { gap: 8px; min-height: 32px; }

.rx-input, .rx-select, .rx-textarea { border-radius: 10px; border-color: #d1d5db; }
.rx-input:focus, .rx-select:focus, .rx-textarea:focus { border-color: #1f2937; box-shadow: 0 0 0 3px rgba(31,41,55,.12); outline: 0; }
.rx-btn { border-radius: 10px; font-weight: 600; } .rx-btn:not(.rx-btn--sm) { min-height: 40px; }
.rx-btn--primary { background: #1f2937; border-color: #1f2937; color: #fff; } .rx-btn--primary:hover { background: #111827; }
.rx-empty, .rx-state { color: #6b7280; }
.rx-alert { border-radius: 12px; }

/* sidebar: slim, neutral active item */
.rx-side__link { border-radius: 10px; min-height: 40px; }
.rx-side__link.is-active { background: #1f2937; color: #fff; font-weight: 600; }
.rx-side__link.is-active svg { color: #fff; }
.rx-side__link:not(.is-active):hover { background: #f3f4f6; }

@media (max-width: 760px) {
  .rx-table th, .rx-table td { padding: 9px 10px; }
  .rx-page-head h1 { font-size: 18px; }
  .rx-tabs { width: 100%; overflow-x: auto; }
}
.os-pend { height: 30px; padding: 0 12px; border-radius: 999px; background: #ea580c; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; }
.os-pend:hover { color: #fff; text-decoration: none; background: #c2410c; }

/* ===== v6: slim scrollbars everywhere + refined header ===== */
* { scrollbar-width: thin; scrollbar-color: #d5d9e0 transparent; }
*:hover { scrollbar-color: #bfc5ce transparent; }
@supports not (scrollbar-width: thin) {
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: #bfc5ce; }
  ::-webkit-scrollbar-button { display: none; }
}
/* sidebar: scrollbar only shows while hovering the menu */
.rx-side__nav { scrollbar-width: thin; scrollbar-color: transparent transparent; scrollbar-gutter: auto; padding: 8px 10px; }
.rx-side__nav:hover { scrollbar-color: #cfd4dc transparent; }
.rx-side__label { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; color: #9ca3af; padding: 12px 10px 4px; }
.rx-side__link { height: 36px; font-size: 13px; gap: 10px; }

/* header */
.rx-top { height: 56px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid #eceef2; box-shadow: 0 1px 0 rgba(17,24,39,.02); }
.rx-side__brand { height: 56px; border-bottom: 1px solid #eceef2; }
.os-hd__brand { font-size: 15px; font-weight: 800; letter-spacing: -.2px; color: #111827; }
.os-hd__shop { height: 32px; padding: 0 12px 0 8px; margin-left: 4px; border: 0; border-left: 0; background: #f3f4f6; border-radius: 999px; gap: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.os-hd__shop img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.os-hd__right { gap: 10px; }
.os-hd__right .os-branch { height: 34px; min-height: 34px; border-radius: 999px; background-color: #f3f4f6; border: 0; font-size: 12.5px; font-weight: 600; padding-left: 14px; }
.os-hd__right .os-branch:focus { box-shadow: 0 0 0 3px rgba(31,41,55,.12); }
.os-conn { font-size: 12px; font-weight: 600; color: #6b7280; display: inline-flex; align-items: center; gap: 6px; }
.os-conn.is-off { color: #dc2626; }
.os-hd__right .rx-badge { height: 26px; padding: 0 10px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 11.5px; font-weight: 600; border: 0; }
.os-me { height: 38px; padding: 0 12px 0 6px; border: 0; background: transparent; border-radius: 999px; gap: 8px; color: #111827; font-weight: 600; }
.os-me:hover { background: #f3f4f6; text-decoration: none; }
.os-me svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: #1f2937; color: #fff; }
.rx-lang { border: 0; background: #f3f4f6; border-radius: 999px; padding: 2px; }
.rx-lang button { background: transparent; border-radius: 999px; height: 28px; padding: 0 11px; font-weight: 600; font-size: 12px; }
.rx-lang button.is-on { background: #1f2937; color: #fff; }
.rx-top__right button, .rx-top .rx-iconbtn { border-radius: 10px; }
.rx-top__icon { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #4b5563; display: grid; place-items: center; cursor: pointer; }
.rx-top__icon:hover { background: #f3f4f6; color: #111827; }
.rx-side__toggle, .rx-side__foot button { border-radius: 10px; }

/* ===== auth pages (register/login) must scroll: body is overflow:hidden for the app shell ===== */
.rx-auth { height: 100%; min-height: 0; overflow: hidden; }
.rx-auth__main { height: 100%; overflow-y: auto; overflow-x: hidden; }
.rx-auth__aside { height: 100%; overflow: hidden; }
.rx-auth__card { margin: auto 0; flex: 0 0 auto; }

.pinl { position: fixed; inset: 0; display: flex; flex-direction: column; background: #eef0f3; color: #111827; overflow: auto; }
.pinl__top { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 20px; background: #fff; border-bottom: 1px solid #e5e7eb; flex: 0 0 auto; }
.pinl__brand { font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.pinl__brand em { font-style: normal; font-size: 11px; letter-spacing: .8px; padding: 2px 8px; border-radius: 6px; background: #1f2937; color: #fff; }
.pinl__help { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: #f3f4f6; border: 1px solid #e5e7eb; color: #4b5563; font-size: 12.5px; text-decoration: none; }
.pinl__help b { color: #111827; }
.pinl__main { flex: 1; display: grid; place-items: center; padding: 20px; }
.pinl__card { width: min(560px, 100%); background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; padding: 24px 24px 22px; box-shadow: 0 18px 44px rgba(17,24,39,.1); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pinl__shop { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #374151; padding: 5px 14px; border-radius: 999px; background: #f3f4f6; }
.pinl__shop img { width: 22px; height: 22px; object-fit: contain; border-radius: 5px; }
.pinl h1 { margin: 4px 0 2px; font-size: 20px; font-weight: 700; }
.pinl__staff { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pinl__who { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px 8px; border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; cursor: pointer; font: inherit; transition: all .12s; }
.pinl__who:hover { border-color: #1f2937; box-shadow: 0 8px 18px rgba(17,24,39,.1); transform: translateY(-1px); }
.pinl__who strong { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinl__who small { color: #6b7280; font-size: 11.5px; }
.pinl__av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #1f2937; color: #fff; font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.pinl__av--lg { width: 60px; height: 60px; font-size: 24px; margin: 0; }
.pinl__empty { color: #6b7280; font-size: 13.5px; padding: 18px 8px; }
.pinl__link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #4b5563; font: inherit; font-size: 13px; cursor: pointer; padding: 8px 12px; border-radius: 10px; }
.pinl__link:hover { background: #f3f4f6; color: #111827; }
.pinl__msg { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 10px; color: #4b5563; }
.pinl__pad { width: 100%; max-width: 330px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.pinl__back { position: absolute; left: -6px; top: -4px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #6b7280; font: inherit; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.pinl__back:hover { background: #f3f4f6; color: #111827; }
.pinl__name { font-size: 17px; margin-top: 4px; } .pinl__role { color: #6b7280; font-size: 12px; }
.pinl__dots { display: flex; gap: 12px; margin: 12px 0 4px; height: 16px; align-items: center; }
.pinl__dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9ca3af; background: transparent; transition: all .1s; }
.pinl__dots i.on { background: #1f2937; border-color: #1f2937; transform: scale(1.1); }
.pinl__dots.is-err i { border-color: #dc2626; }
.pinl__err { min-height: 20px; font-size: 12.5px; color: #6b7280; margin-bottom: 6px; }
.pinl__dots.is-err + .pinl__err { color: #dc2626; font-weight: 600; }
.pinl__keys { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinl__k { height: 62px; border: 1px solid #d1d5db; border-radius: 16px; background: #fff; font: inherit; font-size: 24px; font-weight: 600; color: #111827; cursor: pointer; transition: background .08s, transform .05s; display: grid; place-items: center; }
.pinl__k:hover:not(:disabled) { background: #f3f4f6; }
.pinl__k:active:not(:disabled) { transform: scale(.95); background: #e5e7eb; }
.pinl__k.is-aux { background: #f3f4f6; font-size: 18px; color: #4b5563; }
.pinl__k:disabled { opacity: .5; }
.pinl__ok { width: 100%; height: 54px; margin-top: 12px; border: 0; border-radius: 14px; background: #ea580c; color: #fff; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 14px rgba(234,88,12,.28); }
.pinl__ok:hover:not(:disabled) { background: #c2410c; }
.pinl__ok:disabled { background: #d1d5db; color: #6b7280; box-shadow: none; cursor: default; }
@media (max-height: 700px) { .pinl__k { height: 52px; font-size: 21px; } .pinl__av--lg { width: 48px; height: 48px; font-size: 20px; } }

.rx-auth form { counter-reset: regsec; }
.os-reg__sec { border: 0; padding: 0; margin: 0; min-width: 0; counter-increment: regsec; }
.os-reg__sec + .os-reg__sec { padding-top: var(--rx-s4); border-top: 1px solid var(--rx-border); }
.os-reg__sec legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: var(--rx-s3); font-size: var(--rx-fs-md); font-weight: var(--rx-fw-semibold); color: var(--rx-text); }
.os-reg__sec legend::before {
  content: counter(regsec); width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: var(--rx-fs-xs); font-weight: var(--rx-fw-semibold); color: var(--rx-primary); background: var(--rx-primary-soft);
}
.os-reg__sec > .rx-grid-2 { clear: both; }

.os-bell { position: relative; }
.os-bell__btn { position: relative; border: 0; background: transparent; padding: 6px; border-radius: var(--rx-radius); cursor: pointer; color: var(--rx-text-2); display: inline-flex; }
.os-bell__btn:hover { background: var(--rx-surface-2); }
.os-bell__dot { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--rx-danger); color: #fff; font-size: 9px; line-height: 15px; text-align: center; }
.os-bell__panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(340px, 90vw); max-height: 420px; overflow-y: auto; background: var(--rx-bg); border: 1px solid var(--rx-border); border-radius: var(--rx-radius-lg); box-shadow: var(--rx-shadow-2); z-index: var(--rx-z-drawer); }
.os-bell__head { padding: 8px 12px; font-weight: var(--rx-fw-semibold); border-bottom: 1px solid var(--rx-border); font-size: var(--rx-fs-sm); }
.os-bell__empty { padding: 16px; color: var(--rx-text-3); font-size: var(--rx-fs-sm); text-align: center; }
.os-bell__item { padding: 8px 12px; border-bottom: 1px solid var(--rx-border); }
.os-bell__item.is-unread { background: var(--rx-primary-soft); }
.os-bell__title { font-weight: var(--rx-fw-medium); font-size: var(--rx-fs-md); }
.os-bell__body { font-size: var(--rx-fs-sm); color: var(--rx-text-2); white-space: pre-wrap; }
.os-bell__time { font-size: var(--rx-fs-xs); color: var(--rx-text-3); margin-top: 2px; }

.os-brand { display: inline-flex; align-items: center; gap: var(--rx-s2); overflow: hidden; text-overflow: ellipsis; }
.os-brand img { width: 24px; height: 24px; object-fit: contain; border-radius: var(--rx-radius-sm); }
.os-branch { max-width: 220px; height: var(--rx-control-h-sm); font-size: var(--rx-fs-sm); }
.os-conn { display: inline-flex; align-items: center; gap: 4px; font-size: var(--rx-fs-xs); color: var(--rx-text-3); white-space: nowrap; }
.os-conn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rx-text-3); }
.os-conn.is-on::before { background: var(--rx-success); }
.os-conn.is-off::before { background: var(--rx-danger); }
.os-me { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--rx-fs-sm); color: var(--rx-text-2); padding: 4px 8px; border-radius: var(--rx-radius); white-space: nowrap; }
.os-me:hover { background: var(--rx-surface-2); text-decoration: none; color: var(--rx-text); }
.os-me small { font-size: var(--rx-fs-xs); }
.os-banner:not(:empty) { margin-bottom: var(--rx-s3); }
@media (max-width: 640px) { .os-me small, .os-me span { display: none; } .os-branch { max-width: 140px; } }

