:root {
  --tblr-primary: #38bdf8;
  --tblr-primary-rgb: 56, 189, 248;
  --tblr-body-bg: #0b0f17;
  --tblr-bg-surface: #111827;
  --tblr-border-color: rgba(255, 255, 255, 0.05);
  --tblr-border-radius: 14px;
  --tblr-card-bg: #111827;
  --tblr-card-cap-bg: transparent;

  --ps-bg: #0b0f17;
  --ps-sidebar: #080c14;
  --ps-card: #111827;
  --ps-input: rgba(15, 23, 42, 0.6);
  --ps-accent: #38bdf8;
  --ps-accent-strong: #0ea5e9;
  --ps-online: #34d399;
  --ps-attention: #fbbf24;
  --ps-offline: #f87171;
  --ps-text: #f1f5f9;
  --ps-muted: #94a3b8;
  --ps-faint: #7d8da3;
  --ps-radius: 14px;
  --ps-radius-sm: 10px;
  --ps-space-1: 4px;
  --ps-space-2: 8px;
  --ps-space-3: 12px;
  --ps-space-4: 16px;
  --ps-space-5: 24px;
  --ps-space-6: 32px;
  --ps-space-7: 48px;
  --ps-shadow: none;
  --ps-sidebar-border: #1e293b;
  --ps-surface-border: rgba(255, 255, 255, 0.05);
  --ps-focus: rgba(56, 189, 248, 0.55);
  --ps-sidebar-width: 16.5rem;
}

[data-bs-theme="dark"] {
  --tblr-primary: #38bdf8;
  --tblr-primary-rgb: 56, 189, 248;
  --tblr-body-bg: #0b0f17;
  --tblr-bg-surface: #111827;
  --tblr-card-bg: #111827;
  --tblr-border-color: rgba(255, 255, 255, 0.05);
  --tblr-body-color: #f1f5f9;
  --tblr-secondary: #94a3b8;
}

html,
body,
.page {
  background: var(--ps-bg) !important;
  color: var(--ps-text);
}

/* ---------- Brand ---------- */
.navbar-vertical .navbar-brand a {
  text-decoration: none;
  display: inline-flex;
}
.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}
.brand-logo-icon {
  display: block;
  height: 28px;
  width: auto;
  flex: none;
  /* Wordmark canvas includes the tagline; nudge the hex up to the LockBox cap-height. */
  transform: translateY(-4px);
}
.brand-logo-login {
  margin: 0;
  height: 32px;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.brand-lockup .brand-logo-icon {
  height: 32px;
  transform: translateY(-5px);
}
.powered-by {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ps-faint);
  text-align: center;
}
.powered-by a {
  color: var(--ps-accent);
  font-weight: 600;
  text-decoration: none;
}
.powered-by a:hover,
.powered-by a:focus-visible {
  color: #0860df;
  text-decoration: underline;
}
.sidebar-foot .powered-by {
  margin: 8px 0 0;
  text-align: center;
}

/* ---------- App sidebar ---------- */
.app-shell.page {
  --tblr-navbar-bg: var(--ps-sidebar);
}

.sidebar-resizer {
  display: none;
}

@media (min-width: 992px) {
  .navbar-vertical.navbar-expand-lg .navbar-collapse {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  .app-sidebar.navbar-vertical.navbar-expand-lg {
    width: var(--ps-sidebar-width) !important;
  }
  .navbar-expand-lg.navbar-vertical ~ .page-wrapper {
    margin-left: var(--ps-sidebar-width) !important;
  }
  .app-sidebar .sidebar-inner {
    min-height: 100vh;
    height: 100vh;
  }
  .sidebar-resizer {
    display: block;
    position: fixed;
    top: 0;
    left: calc(var(--ps-sidebar-width) - 4px);
    width: 8px;
    height: 100vh;
    z-index: 1040;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
  }
  .sidebar-resizer::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.12s ease;
  }
  .sidebar-resizer:hover::after,
  .sidebar-resizer:focus-visible::after,
  body.is-sidebar-resizing .sidebar-resizer::after {
    background: #38bdf8;
  }
  .sidebar-resizer:focus-visible {
    outline: none;
  }
}

body.is-sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

body.is-sidebar-resizing iframe,
body.is-sidebar-resizing img {
  pointer-events: none;
}

.navbar-vertical .navbar-collapse.show {
  display: flex;
  flex-direction: column;
}

.app-sidebar.navbar-vertical {
  background: var(--ps-sidebar) !important;
  border-right: 1px solid var(--ps-sidebar-border) !important;
  box-shadow: none;
}

.app-sidebar .sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--ps-space-3);
  padding: var(--ps-space-5) var(--ps-space-4) var(--ps-space-4);
}

.sidebar-header .navbar-toggler {
  margin: 0;
  border: 0;
  padding: var(--ps-space-2);
  border-radius: 8px;
}

.sidebar-header .navbar-toggler:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none !important;
  color: inherit;
  border-radius: 10px;
  padding: 2px;
}

.sidebar-brand:hover {
  color: inherit;
}

.sidebar-brand:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.sidebar-nav {
  flex: 1 1 auto;
  padding: 0 var(--ps-space-3) var(--ps-space-4);
  overflow-y: auto;
}

.app-sidebar .navbar-nav {
  padding: 0;
  gap: 2px;
}

.app-sidebar .nav-item {
  margin: 0;
}

.app-sidebar .nav-link-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: var(--ps-space-3) !important;
  opacity: 1 !important;
  color: inherit;
}

.app-sidebar .nav-link-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.app-sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 !important;
  min-height: 44px;
  padding: 8px 12px 8px 14px !important;
  border-radius: 10px !important;
  border: 0 !important;
  border-left: none !important;
  color: var(--ps-muted) !important;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  background: transparent;
  box-shadow: none !important;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.app-sidebar .nav-link .nav-link-title {
  font-size: inherit;
  font-weight: inherit;
}

.app-sidebar .nav-link:hover {
  color: var(--ps-text) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.app-sidebar .nav-link.active {
  color: #38bdf8 !important;
  font-weight: 500;
  background: rgba(14, 165, 233, 0.1) !important;
}

.app-sidebar .nav-link.active .nav-link-icon {
  color: #38bdf8;
}

.app-sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 999px;
  background: #38bdf8;
}

.app-sidebar .nav-link:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
  color: var(--ps-text) !important;
}

.nav-section-label {
  list-style: none;
  padding: 0 var(--ps-space-3) var(--ps-space-2);
  margin: var(--ps-space-5) 0 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-faint);
}

.sidebar-nav > .nav-section-label:first-child {
  margin-top: var(--ps-space-2);
}

/* Ops console nav. Scoped so the partner portal keeps its own sidebar. */
.admin-console .app-sidebar.navbar-vertical {
  background: #0b0f17 !important;
  border-right: 1px solid #1e293b !important;
}

.admin-console .nav-section-label {
  margin: 0;
  padding: 16px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b9cb3;
}

.admin-console .sidebar-nav > .nav-section-label:first-child {
  margin-top: 0;
  padding-top: 8px;
}

.admin-console .app-sidebar .navbar-nav {
  gap: 2px;
}

.admin-console .app-sidebar .nav-link-icon {
  width: 16px;
  height: 16px;
  margin-right: 10px !important;
  color: #94a3b8;
}

.admin-console .app-sidebar .nav-link-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.admin-console .app-sidebar .nav-link {
  min-height: 0;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  border-left: 2px solid transparent !important;
  color: #94a3b8 !important;
  font-size: 0.875rem;
  font-weight: 400;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.admin-console .app-sidebar .nav-link:hover {
  color: #f1f5f9 !important;
  background: rgba(30, 41, 59, 0.6) !important;
}

.admin-console .app-sidebar .nav-link:hover .nav-link-icon {
  color: #f1f5f9;
}

.admin-console .app-sidebar .nav-link.active {
  color: #f1f5f9 !important;
  font-weight: 500;
  background: rgba(14, 165, 233, 0.1) !important;
  border-left-color: #38bdf8 !important;
}

.admin-console .app-sidebar .nav-link.active::before {
  content: none;
}

.admin-console .app-sidebar .nav-link.active .nav-link-icon {
  color: #38bdf8;
}

.admin-console .nav-external {
  margin-left: auto;
  display: inline-flex;
  color: #8b9cb3;
}

.admin-console .nav-external svg {
  width: 12px;
  height: 12px;
}

.admin-console .sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(30, 41, 59, 0.6);
}

.admin-console .account-card {
  background: #111827;
  border: 1px solid #1e293b;
}

.sidebar-foot {
  margin-top: auto;
  padding: var(--ps-space-3) var(--ps-space-3) var(--ps-space-4);
}

.account-card {
  display: flex;
  align-items: center;
  gap: var(--ps-space-3);
  padding: var(--ps-space-2) var(--ps-space-2) var(--ps-space-2)
    var(--ps-space-3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.sidebar-avatar svg {
  width: 18px;
  height: 18px;
}

.account-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.account-card .name {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--ps-text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card .meta {
  font-size: 0.72rem;
  color: var(--ps-muted);
  text-transform: capitalize;
}

.account-logout {
  appearance: none;
  flex: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ps-muted);
  cursor: pointer;
}

.account-logout:hover {
  color: var(--ps-text);
  background: rgba(255, 255, 255, 0.08);
}

.account-logout:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.account-logout.is-label {
  width: auto;
  height: auto;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .app-shell.page {
    display: flex;
    flex-direction: column;
  }
  .app-sidebar.navbar-vertical,
  .app-sidebar.navbar-vertical.navbar-expand-lg {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--ps-sidebar-border);
  }
  .app-sidebar .sidebar-inner {
    min-height: 0 !important;
    height: auto !important;
  }
  .navbar-expand-lg.navbar-vertical ~ .page-wrapper {
    margin-left: 0 !important;
    min-width: 0;
  }
  .sidebar-header {
    padding: var(--ps-space-3) var(--ps-space-4);
  }
  .navbar-vertical .navbar-collapse.show {
    max-height: min(70vh, calc(100dvh - 3.5rem));
    overflow-y: auto;
  }
}

/* ---------- Page chrome ---------- */
.page-wrapper,
.page-body,
.page-header {
  background: var(--ps-bg) !important;
}

.page-header {
  border-bottom: none;
  padding: var(--ps-space-6) 0 var(--ps-space-4);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ps-space-4);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ps-text);
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}

.page-title-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.page-lead {
  margin: var(--ps-space-2) 0 0;
  color: var(--ps-muted);
  font-size: 0.9rem;
  font-weight: 400;
  max-width: 36rem;
  line-height: 1.45;
}

.page-header-row > div {
  min-width: 0;
}
.page-header-actions {
  padding-top: var(--ps-space-1);
  flex: none;
}
.admin-console .issue-summary,
.admin-console .data-title,
.admin-console td,
.admin-console .fleet-reason {
  overflow-wrap: anywhere;
}
@media (max-width: 991.98px) {
  .admin-console .form-control,
  .admin-console .form-select {
    font-size: 16px;
  }
}

.container-xl {
  max-width: 1080px;
}

.page-body {
  padding-top: var(--ps-space-5);
  padding-bottom: var(--ps-space-7);
}

@media (max-width: 991.98px) {
  .page-header {
    padding: var(--ps-space-4) 0 var(--ps-space-3);
  }
  .page-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .page-body {
    padding-top: var(--ps-space-4);
    padding-bottom: var(--ps-space-6);
  }
}

.page-body .container-xl > .card {
  margin-bottom: var(--ps-space-6);
}
.page-body .container-xl > .card:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-muted);
  margin: 0 0 var(--ps-space-3);
}

.section-meta {
  margin: 0;
  color: var(--ps-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--ps-space-2) var(--ps-space-4);
  margin-bottom: var(--ps-space-5);
}

.section-head .section-title {
  margin: 0;
}

.metric {
  color: var(--ps-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Cards / inputs / buttons ---------- */
.card,
.login-card,
.panel {
  background: var(--ps-card) !important;
  border: 1px solid var(--ps-surface-border) !important;
  border-radius: var(--ps-radius) !important;
  box-shadow: none;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-3);
  background: transparent !important;
  border-bottom: 0;
  padding: var(--ps-space-5) var(--ps-space-5) var(--ps-space-4);
}

.card-header .card-title {
  margin: 0;
}
.card-header .card-actions {
  margin-left: auto;
}

.card-title {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ps-text);
}

.card-body,
.card-footer {
  padding: var(--ps-space-5);
}

.card-footer {
  background: transparent !important;
  border-top: 0;
  padding-top: 0;
}

.panel {
  padding: var(--ps-space-5);
}

.panel .inline-form {
  margin: 0;
}

.panel .section-head {
  margin-bottom: var(--ps-space-3);
}

.panel .data-row {
  border-color: var(--ps-surface-border);
  background: rgba(255, 255, 255, 0.03);
}

.panel .data-row.is-static:hover {
  background: rgba(255, 255, 255, 0.03);
}

.form-control,
.form-select {
  background: var(--ps-input) !important;
  border: 1px solid rgba(51, 65, 85, 0.5) !important;
  border-radius: 0.5rem !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
  min-height: 2.5rem;
}

.form-control:focus,
.form-select:focus,
.btn:focus-visible,
.form-check-input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12) !important;
}

.form-control::placeholder {
  color: var(--ps-muted);
}

.form-label,
.form-hint,
.subheader,
.field-label {
  color: var(--ps-muted);
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--ps-space-2);
}

.field {
  margin: 0;
}

.place-form {
  display: grid;
  gap: var(--ps-space-4);
  max-width: 36rem;
  margin-top: var(--ps-space-4);
}

.place-form .form-control {
  width: 100%;
}

.place-coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ps-space-4);
}

.btn {
  border-radius: var(--ps-radius-sm) !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  box-shadow: none !important;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease,
    opacity 0.12s ease;
}

.btn:not(.btn-primary):not(.btn-danger):not(.btn-outline-danger):not(
    .btn-outline-secondary
  ):not(.btn-ghost) {
  background: var(--ps-input) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e5e7eb !important;
}

.btn:not(.btn-primary):not(.btn-danger):not(.btn-outline-danger):not(
    .btn-outline-secondary
  ):not(.btn-ghost):hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.btn-primary {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #0b0f17 !important;
}

.btn-primary:hover {
  background: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

.btn-primary:active {
  background: #0284c7 !important;
}

.btn-danger {
  background: #be123c !important;
  border-color: #be123c !important;
}

.btn-outline-secondary {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e5e7eb !important;
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

.btn-outline-danger {
  background: transparent !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #f87171 !important;
}

.btn-outline-danger:hover {
  background: rgba(244, 63, 94, 0.12) !important;
  color: #fecdd3 !important;
}

.btn-ghost {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--ps-muted) !important;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ps-text) !important;
}

.btn:active {
  opacity: 0.88;
}

.alert {
  border-radius: var(--ps-radius-sm);
  border: 0;
  padding: var(--ps-space-3) var(--ps-space-4);
  margin-bottom: var(--ps-space-5);
}
.alert-success {
  background: rgba(34, 197, 94, 0.12) !important;
  color: #86efac !important;
}
.alert-danger {
  background: rgba(244, 63, 94, 0.12) !important;
  color: #fecdd3 !important;
}

/* ---------- KPI cards (separate, like Dashdark Users) ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ps-space-4);
  margin-bottom: var(--ps-space-6);
}

@media (max-width: 991.98px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 575.98px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  display: flex;
  gap: var(--ps-space-4);
  align-items: center;
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  padding: var(--ps-space-5);
  box-shadow: none;
  text-decoration: none;
  color: inherit;
}

a.kpi-card:hover {
  background: #161f30;
  color: inherit;
}

a.kpi-card.is-active {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: inset 4px 0 0 #38bdf8;
}

a.kpi-card:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}
.kpi-icon-muted {
  background: rgba(14, 165, 233, 0.1);
  color: #38bdf8;
}
.kpi-icon-online {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}
.kpi-icon-offline {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
}
.kpi-icon-attention {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-muted);
  margin-bottom: var(--ps-space-2);
}

.kpi-value,
.kpi-value.c-online,
.kpi-value.c-offline,
.kpi-value.c-attention {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  color: #f1f5f9;
}

.kpi-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: #e5e7eb;
  overflow-wrap: anywhere;
}

.health-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ps-space-5) var(--ps-space-5);
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-6);
  box-shadow: none;
}

@media (max-width: 991.98px) {
  .health-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .health-bar {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tables ---------- */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  align-items: center;
}

.storage-fee {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-3);
  align-items: flex-end;
  padding: var(--ps-space-4) var(--ps-space-5) 0;
}

.storage-fee-label {
  flex: 1 1 12rem;
  margin: 0 0 var(--ps-space-2);
  color: var(--ps-text-muted, rgba(255, 255, 255, .62));
  font-size: .875rem;
}

.storage-fee .field {
  flex: 0 1 8rem;
  margin: 0;
}

.storage-fee .btn {
  margin-bottom: 1px;
}

.order-filters {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-4);
  padding: var(--ps-space-4) var(--ps-space-5);
  border-bottom: 1px solid var(--ps-surface-border);
}

.order-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-3);
  align-items: flex-end;
}

.order-filter-row .field {
  flex: 1 1 9rem;
  min-width: 8rem;
  margin: 0;
}
.order-filter-row .field-search {
  flex: 2 1 16rem;
}

.order-filter-actions {
  display: flex;
  gap: var(--ps-space-2);
  align-items: center;
  padding-bottom: 1px;
}

.order-filters input[type="date"] {
  color-scheme: dark;
}

.order-scope,
.order-date-error {
  margin: 0;
  padding: var(--ps-space-3) var(--ps-space-5) 0;
}

.order-date-error {
  color: #f87171;
}

@media (max-width: 767.98px) {
  .order-filter-row .field,
  .order-filter-actions {
    flex: 1 1 100%;
  }
}

.table-note {
  color: var(--ps-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.table-note:hover,
.table-note.is-active {
  color: #38bdf8;
}

@media (max-width: 767.98px) {
  .card-header .card-actions {
    margin-left: 0;
    width: 100%;
  }
  .table-toolbar {
    width: 100%;
  }
  .table-toolbar .form-control,
  .table-toolbar .form-select {
    flex: 1 1 10rem;
  }
}

.table-toolbar input.form-control:not([type="file"]),
.user-toolbar input.form-control[name="q"] {
  min-height: 0;
  padding: 0.375rem 0.75rem;
}

.table thead th {
  color: #94a3b8 !important;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom-color: var(--tblr-border-color) !important;
  background: transparent !important;
  padding-top: 0.9rem !important;
  padding-bottom: 0.9rem !important;
}

.table tbody td {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
  border-color: transparent !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.table-hover > tbody > tr:hover > * {
  background: rgba(255, 255, 255, 0.03) !important;
}

.table-devices .device-id,
.table-devices .last-seen,
.last-seen,
.table-log .col-when,
.table-log .col-ip,
.table-log .col-device,
.input-mono {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.col-flag {
  width: 3.25rem;
  white-space: nowrap;
}
.th-icon {
  display: inline-flex;
  color: var(--ps-muted);
}
.fleet-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 1.5rem;
  color: inherit;
  text-decoration: none;
}
.fleet-flag svg {
  display: block;
}
.fleet-flag.is-empty {
  color: var(--ps-faint);
}
.fleet-bug {
  color: #7dd3fc;
}
.fleet-bug:hover {
  color: #38bdf8;
}
.fleet-flag-n {
  font-size: 0.7rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.fleet-flag.is-danger {
  color: #f87171;
}
.fleet-flag.is-warn {
  color: #fbbf24;
}

.issue-head .form-select {
  width: auto;
  min-width: 8.75rem;
}
.issue-tabs {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.issue-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ps-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 550;
}
.issue-tab:hover {
  color: #f1f5f9;
}
.issue-tab.is-active {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}
.issue-tab-n {
  font-variant-numeric: tabular-nums;
  color: var(--ps-faint);
}
.issue-head .table-note {
  white-space: nowrap;
}
.issue-tab.is-active .issue-tab-n {
  color: #7dd3fc;
}
.kind-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.kind-pill.level-critical {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}
.kind-pill.level-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}
.kind-pill.level-info {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
}
.kind-level {
  margin-left: 6px;
  font-weight: 550;
  text-transform: capitalize;
}
.issue-summary {
  color: #e2e8f0;
  font-size: 0.8125rem;
  line-height: 1.4;
  max-width: 36rem;
}
.issue-purge {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--ps-faint);
}
.issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.issue-actions form {
  display: inline;
}
.admin-console .btn-sm {
  min-height: 44px;
}

.device-id {
  color: #f1f5f9 !important;
  text-decoration: none;
}
.device-id:hover {
  color: #38bdf8 !important;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--ps-input) !important;
  border: 1px solid rgba(51, 65, 85, 0.5) !important;
  border-radius: 0.5rem !important;
  color: #f1f5f9 !important;
  margin-left: 0.35rem;
}

.pagination .page-item.active .page-link {
  background: rgba(14, 165, 233, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

/* ---------- Status badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  font-size: 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.125rem 0.625rem;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-badge.bg-green-lt {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}
.status-badge.bg-yellow-lt {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}
.status-badge.bg-secondary-lt {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.25);
}
.status-badge.bg-red-lt {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ps-muted);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ---------- Login ---------- */
.login-mark {
  display: flex;
  justify-content: center;
  color: #38bdf8;
  margin-bottom: 0.75rem;
}

.login-card {
  padding: 0.5rem;
}
.login-card .card-body {
  padding: 1.5rem 1.4rem;
}

/* ---------- Commands / locker ---------- */
.cmd-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
}

.cmd-divider {
  border-top: 0;
  margin-top: var(--ps-space-6);
  padding-top: var(--ps-space-5);
}

.card-body.cmd-divider {
  margin-top: 0;
}

.diag-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ps-space-5);
  margin-top: var(--ps-space-5);
}

@media (max-width: 575.98px) {
  .diag-stats {
    grid-template-columns: 1fr;
  }
}

.diag-stats .kpi-value {
  font-size: 1.35rem;
}

.sparkline {
  width: 100%;
  height: 48px;
}
.sparkline svg,
svg.sparkline {
  width: 100%;
  height: 48px;
  display: block;
}

pre.payload {
  margin: 0;
  max-width: 42rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  background: transparent;
  color: var(--ps-muted);
}

.payload-fold summary,
.file-rules summary,
.pw-fold summary {
  cursor: pointer;
  color: var(--ps-muted);
  font-size: 0.85rem;
}

.pw-fold {
  min-width: 11rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: var(--ps-space-1) var(--ps-space-3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ps-muted);
}
.role-pill.role-owner {
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.16);
}
.role-pill.role-superuser {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.16);
}
.role-pill.role-operator {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
}
.role-pill.role-viewer {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.preview-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-3);
  padding: var(--ps-space-3) 0;
}
.preview-copy {
  font-weight: 500;
  color: #fde68a;
}
.preview-kicker {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ps-muted);
  margin-right: var(--ps-space-3);
}
.preview-role {
  color: var(--ps-muted);
  font-weight: 400;
  text-transform: capitalize;
  margin-left: var(--ps-space-2);
}

body.is-preview .page-body form:not(.preview-exit) button,
body.is-preview .page-body form:not(.preview-exit) input[type="submit"] {
  pointer-events: none;
  opacity: 0.55;
}

.add-user-panel {
  margin-bottom: var(--ps-space-6);
}

.add-user-form {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(
      8rem,
      0.6fr
    ) auto;
  gap: var(--ps-space-4);
  align-items: end;
}

.add-company-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ps-space-4);
  align-items: end;
}

.add-company-form .field-submit {
  grid-column: 1 / -1;
}

.field-submit {
  padding-bottom: 1px;
}

@media (max-width: 767.98px) {
  .add-user-form,
  .add-company-form {
    grid-template-columns: 1fr;
  }
  .add-company-form .field-submit {
    grid-column: auto;
  }
}

.cloud-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-3) var(--ps-space-5);
  padding: var(--ps-space-4) var(--ps-space-5);
  margin-bottom: var(--ps-space-5);
  border-radius: var(--ps-radius);
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid var(--ps-surface-border);
  box-shadow: none;
}

.user-toolbar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto auto;
  gap: var(--ps-space-4);
  align-items: end;
  margin-bottom: var(--ps-space-4);
}

.user-count {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--ps-space-2);
  padding-bottom: 2px;
}
.user-count .metric {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f1f5f9;
}

@media (max-width: 767.98px) {
  .user-toolbar {
    grid-template-columns: 1fr;
  }
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-2);
}

.user-item {
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  box-shadow: none;
  overflow: hidden;
}

.user-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--ps-space-3);
  padding: var(--ps-space-4);
  cursor: pointer;
  border-radius: var(--ps-radius);
}

.user-item-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2) var(--ps-space-3);
  min-width: 0;
  flex: 1 1 auto;
}

.user-item-actions {
  display: flex;
  align-items: center;
  gap: var(--ps-space-2);
  flex: none;
  cursor: default;
}

.user-item-actions form {
  margin: 0;
}

.user-action {
  appearance: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ps-muted);
  cursor: pointer;
}

.user-action:hover {
  color: var(--ps-text);
  background: rgba(255, 255, 255, 0.08);
}

.user-action:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.user-details summary::-webkit-details-marker {
  display: none;
}

.user-details summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.user-details summary:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: -2px;
}

.user-chevron {
  display: inline-flex;
  flex: none;
  color: var(--ps-muted);
  transition: transform 0.15s ease;
}

.user-details[open] .user-chevron {
  transform: rotate(90deg);
}

.user-details .user-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ps-text);
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-extra-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
}

.user-item-body {
  padding: 0 var(--ps-space-5) var(--ps-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-5);
}

.user-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2) var(--ps-space-3);
}

.user-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ps-text);
  line-height: 1.2;
}

.access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
}

.access-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: var(--ps-space-1) var(--ps-space-3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ps-muted);
}

.access-chip-extra {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
}

.grant-form,
.account-form {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-4);
}

.grant-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ps-space-6);
}

@media (max-width: 767.98px) {
  .grant-board {
    grid-template-columns: 1fr;
  }
  .user-details summary {
    flex-wrap: wrap;
  }
  .user-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.grant-group {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-1);
}

.grant-item {
  display: flex;
  align-items: center;
  gap: var(--ps-space-3);
  margin: 0;
  padding: var(--ps-space-2) var(--ps-space-3);
  border-radius: var(--ps-radius-sm);
  font-size: 0.9rem;
  color: var(--ps-text);
  cursor: pointer;
}

.grant-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.grant-item.is-locked {
  opacity: 0.7;
  cursor: default;
}

.grant-item .form-check-input {
  margin-top: 0;
  flex: none;
  width: 1rem;
  height: 1rem;
  border-radius: 4px !important;
}

.add-user-form .form-select,
.account-form .form-select {
  text-transform: capitalize;
}

.login-card .page-lead {
  margin: var(--ps-space-2) auto var(--ps-space-5);
}

.grant-lock {
  color: var(--ps-faint);
  font-size: 0.75rem;
}

.grant-submit {
  display: flex;
  justify-content: flex-end;
}

.account-form .field-role {
  max-width: 12rem;
}

.pw-fold summary {
  cursor: pointer;
  color: var(--ps-muted);
  font-size: 0.85rem;
}

.pw-fold .form-control {
  margin-top: var(--ps-space-3);
}

.pw-gen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2);
}

.pw-gen .form-control {
  flex: 1 1 10rem;
  min-width: 0;
}

.secret-once {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-4);
}

.secret-once .btn {
  flex: 0 0 auto;
}

.secret-once [data-copy-source] {
  display: inline-block;
  margin-top: var(--ps-space-2);
  word-break: break-all;
}

.user-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-4);
  margin-top: var(--ps-space-6);
}

.admin-console .user-item {
  background: #111827;
  border-color: #1e293b;
}

.staff-add {
  margin-bottom: var(--ps-space-5);
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
}

.staff-add-summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 600;
  color: #f1f5f9;
}

.staff-add-summary::-webkit-details-marker {
  display: none;
}

.staff-add-body {
  padding: 0 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.staff-create {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 36rem;
}

.role-choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-choice,
.scope-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #1e293b;
  border-radius: 10px;
  background: #0b0f17;
  cursor: pointer;
}

.role-choice-name {
  display: block;
  font-weight: 600;
  text-transform: capitalize;
  color: #f1f5f9;
}

.role-choice-desc {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
}

.cloud-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #111827;
  color: #94a3b8;
}

.cloud-banner strong {
  color: #cbd5e1;
  font-weight: 600;
}

.cloud-banner-lock {
  display: inline-flex;
  margin-top: 2px;
  color: #94a3b8;
}

.staff-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.staff-search {
  display: flex;
  align-items: end;
  gap: 8px;
  flex: 1 1 16rem;
}

.staff-search .field {
  flex: 1 1 auto;
  margin: 0;
}

.staff-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.staff-filter {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #1e293b;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.staff-filter:hover {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.6);
}

.staff-filter.is-active {
  color: #f1f5f9;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
}

.staff-count {
  margin: 0 0 4px auto;
  color: #94a3b8;
}

.staff-count .metric {
  color: #f1f5f9;
  font-weight: 600;
}

.user-action.staff-ghost,
.user-action.staff-danger {
  width: auto;
  height: 36px;
  padding: 0 10px;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.user-action.staff-danger {
  color: #fca5a5;
}

.user-action.staff-danger:hover {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
}

.staff-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.staff-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.staff-tab-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.staff-tab:has(:focus-visible) {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.staff-tabs .staff-panel {
  display: none;
}

.staff-tabs:has(.staff-tab-role:checked) .staff-tab:has(.staff-tab-role),
.staff-tabs:has(.staff-tab-grants:checked) .staff-tab:has(.staff-tab-grants),
.staff-tabs:has(.staff-tab-scope:checked) .staff-tab:has(.staff-tab-scope),
.staff-tabs:has(.staff-tab-settings:checked)
  .staff-tab:has(.staff-tab-settings) {
  color: #f1f5f9;
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(56, 189, 248, 0.45);
}

.staff-tabs:has(.staff-tab-role:checked) .staff-panel-role,
.staff-tabs:has(.staff-tab-grants:checked) .staff-panel-grants,
.staff-tabs:has(.staff-tab-scope:checked) .staff-panel-scope,
.staff-tabs:has(.staff-tab-settings:checked) .staff-panel-settings {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.access-chip.is-default {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}

.grant-lock-icon {
  flex: none;
  color: #94a3b8;
}

.role-hints {
  margin: 0;
  padding-left: 1.1rem;
  color: #94a3b8;
  font-size: 0.82rem;
}

.role-hints li {
  margin: 4px 0;
}

.scope-callout,
.scope-bypass {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #0b0f17;
  color: #cbd5e1;
}

.scope-bypass {
  display: none;
}

.scope-masters,
.scope-companies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.scope-form:has([name="orders_all_shipment"]:checked) .scope-companies {
  opacity: 0.45;
}

.scope-form:has([name="orders_all_shipment"]:checked) .scope-bypass {
  display: block;
}

.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.pw-strength-bar {
  flex: 0 0 72px;
  height: 4px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.pw-strength-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #f87171;
}

.pw-strength.is-ok {
  color: #fbbf24;
}
.pw-strength.is-ok .pw-strength-bar i {
  background: #fbbf24;
}
.pw-strength.is-strong {
  color: #34d399;
}
.pw-strength.is-strong .pw-strength-bar i {
  background: #34d399;
}

.admin-console .secret-once {
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: #111827;
}

@media (max-width: 767.98px) {
  .scope-masters,
  .scope-companies {
    grid-template-columns: 1fr;
  }
  .staff-count {
    margin-left: 0;
  }
}

.empty-hint {
  color: var(--ps-muted);
  margin: 0;
}

@media (min-width: 992px) {
  .branding-now {
    position: sticky;
    top: 1.25rem;
  }
}

.attract-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--ps-space-6);
  align-items: start;
}

.attract-editor {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-6);
}

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

.attract-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.attract-upload .form-control[type="file"] {
  flex: 1 1 12rem;
}

.branding-preview {
  background: #080c14;
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius-sm);
  padding: var(--ps-space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.branding-preview img,
.branding-preview-video {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
}

.branding-preview-video {
  width: 100%;
  background: #000;
}

.console-logo-preview {
  min-height: 72px;
  justify-content: flex-start;
  background: #080c14;
}

.console-logo-preview img {
  max-height: 48px;
  max-width: 220px;
  width: auto;
}

.mode-list .form-check {
  padding: var(--ps-space-3) var(--ps-space-4) var(--ps-space-3) 2.2rem;
  margin: 0 0 var(--ps-space-2);
  border: 0;
  border-radius: var(--ps-radius-sm);
  background: var(--ps-input);
}

.mode-list .form-check:hover {
  background: #161f30;
}

.form-check-input:checked {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
}

/* ---------- Locker cabinet / connect ---------- */
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-1);
  margin-top: var(--ps-space-4);
}

.page-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--ps-space-2) var(--ps-space-4);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ps-muted);
  text-decoration: none;
}

.page-tab:hover {
  color: var(--ps-text);
  background: rgba(255, 255, 255, 0.06);
}

.page-tab.is-active {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.12);
}

.page-tab:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.identity-note {
  padding: var(--ps-space-4) var(--ps-space-5);
  margin-bottom: var(--ps-space-5);
  border-radius: var(--ps-radius);
  border: 1px solid rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
}
.identity-note .section-meta {
  color: #fde68a;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  margin: 0 0 var(--ps-space-5);
}

.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-4);
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-6);
  border-radius: var(--ps-radius);
  background: rgba(14, 165, 233, 0.08);
}

.next-step .section-title {
  margin-bottom: var(--ps-space-2);
}

.stack-block {
  margin-bottom: var(--ps-space-6);
}

.stack-block .section-head {
  margin-bottom: var(--ps-space-3);
}

.occ-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ps-space-4);
  margin: var(--ps-space-4) 0 var(--ps-space-5);
}

.connect-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-6);
  border-radius: var(--ps-radius);
  background: var(--ps-card);
}

.occ-stats .kpi-value {
  font-size: 1.35rem;
}

.kpi-over {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ps-muted);
  letter-spacing: 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ps-space-3) var(--ps-space-4);
  margin: var(--ps-space-4) 0;
}

.layout-form .table-responsive {
  margin-top: var(--ps-space-4);
}

.parcel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-3);
  margin: 0 0 var(--ps-space-3);
  color: var(--ps-text);
}

details.fold {
  margin-bottom: var(--ps-space-6);
  padding: var(--ps-space-4) var(--ps-space-5);
  border-radius: var(--ps-radius);
  background: rgba(255, 255, 255, 0.03);
}

details.fold > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ps-text);
  padding: var(--ps-space-2) 0;
}

details.fold > summary::-webkit-details-marker {
  display: none;
}

details.fold > summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: var(--ps-space-3);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid var(--ps-muted);
}

details.fold[open] > summary::before {
  transform: rotate(90deg);
}

details.fold > summary:hover {
  color: #38bdf8;
}

details.fold > summary:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 4px;
}

.payload-block {
  margin-bottom: var(--ps-space-5);
  padding: var(--ps-space-4);
  border-radius: var(--ps-radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.page-foot-meta {
  margin: var(--ps-space-6) 0 0;
  color: var(--ps-muted);
  font-size: 0.85rem;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #fde68a !important;
}

@media (max-width: 991.98px) {
  .occ-stats,
  .connect-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .occ-stats,
  .connect-stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- Locker IoT console ---------- */
.locker-masthead {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: var(--ps-space-5);
  align-items: start;
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-4);
}

.mast-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-3);
}

.sig {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.sig i {
  display: block;
  width: 3px;
  background: #334155;
  border-radius: 1px;
}
.sig i:nth-child(1) {
  height: 4px;
}
.sig i:nth-child(2) {
  height: 7px;
}
.sig i:nth-child(3) {
  height: 10px;
}
.sig i:nth-child(4) {
  height: 14px;
}
.sig.sig-1 i:nth-child(1),
.sig.sig-2 i:nth-child(-n + 2),
.sig.sig-3 i:nth-child(-n + 3),
.sig.sig-4 i {
  background: #34d399;
}

.page-tabs {
  margin-top: 0;
  margin-bottom: var(--ps-space-5);
  padding: var(--ps-space-1);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ps-surface-border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}

.cap-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  margin: 0 0 var(--ps-space-5);
}

.cap-chip {
  display: flex;
  align-items: baseline;
  gap: var(--ps-space-2);
  padding: var(--ps-space-2) var(--ps-space-3);
  border-radius: var(--ps-radius-sm);
  border: 1px solid transparent;
  min-width: 6.5rem;
}
.cap-chip span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.85;
}
.cap-chip strong {
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.cap-chip.is-free {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.18);
}
.cap-chip.is-reserved {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}
.cap-chip.is-occupied {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.22);
}
.cap-chip.is-ops {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.22);
}

.io-card {
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  padding: var(--ps-space-5);
  margin-bottom: var(--ps-space-5);
}

.io-card .section-head {
  margin-bottom: var(--ps-space-3);
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--ps-space-2);
}

.door-tile {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-2);
  min-height: 96px;
  padding: var(--ps-space-3);
  border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-surface-border);
  background: rgba(15, 23, 42, 0.55);
}
.door-tile.is-free {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.16);
}
.door-tile.is-reserved {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
}
.door-tile.is-occupied {
  background: rgba(148, 163, 184, 0.1);
}
.door-tile.is-ops {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.18);
}
.door-tile.is-stuck {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.55);
}
.order-door-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.55);
  background: rgba(244, 63, 94, 0.16);
  color: #fecdd3;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
  vertical-align: middle;
  animation: order-door-pulse 1.8s ease-out infinite;
}
@keyframes order-door-pulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(251, 113, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .order-door-badge { animation: none; }
}

.door-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ps-text);
}

.size-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ps-muted);
}
.status-pill.is-free {
  color: #34d399;
}
.status-pill.is-reserved {
  color: #fbbf24;
}
.status-pill.is-occupied {
  color: #94a3b8;
}
.status-pill.is-ops {
  color: #fb7185;
}
.status-pill.is-blocked {
  color: var(--ps-faint);
}

.update-list {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-2);
  margin: var(--ps-space-4) 0;
}
.update-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--ps-space-3);
  align-items: center;
  padding: var(--ps-space-3);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius-sm);
  cursor: pointer;
}
.update-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.update-row:focus-within {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}
.update-row.is-disabled {
  opacity: 0.55;
}
.update-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.update-name {
  font-weight: 650;
}
.update-meta,
.update-ver {
  color: var(--ps-muted);
  font-size: 0.85rem;
}
.update-ver {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.update-extra {
  display: flex;
  align-items: center;
  gap: var(--ps-space-2);
  margin-bottom: var(--ps-space-4);
  color: var(--ps-muted);
}
.update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  margin-top: var(--ps-space-4);
}
@media (max-width: 720px) {
  .update-row {
    grid-template-columns: auto 1fr;
  }
  .update-ver,
  .update-row .status-pill {
    grid-column: 2;
    text-align: left;
    justify-content: flex-start;
  }
}

.ota {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-6);
  color-scheme: dark;
  caret-color: var(--ps-accent);
}
.ota ::selection {
  background: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
}
.ota-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ps-space-4);
}
.ota-boot,
.ota-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius);
}
.ota-boot {
  padding: var(--ps-space-5);
}
.ota-k {
  margin: 0 0 var(--ps-space-3);
  font-size: 0.95rem;
  font-weight: 650;
  color: #e2e8f0;
}
.ota-boot-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.ota-boot-code,
.ota-card .section-meta {
  color: #cbd5e1;
}
.ota-boot-code {
  margin: var(--ps-space-2) 0 0;
}
.ota-sha {
  margin: var(--ps-space-3) 0 0;
  padding: var(--ps-space-2) var(--ps-space-3);
  border-radius: var(--ps-radius-sm);
  background: #0b0f17;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ota-sha span {
  display: block;
  margin-bottom: 2px;
  color: #7dd3fc;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ota-pending {
  margin: 0;
  padding: var(--ps-space-4) var(--ps-space-5);
  border-radius: var(--ps-radius);
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #e0f2fe;
  font-weight: 650;
}
.ota-card {
  padding: var(--ps-space-5);
}
.ota-card .section-head {
  margin-bottom: var(--ps-space-5);
}
.ota-step + .ota-step,
.ota-block {
  margin-top: var(--ps-space-6);
  padding-top: var(--ps-space-5);
  border-top: 1px solid #1e293b;
}
.ota-step-title {
  margin: 0 0 var(--ps-space-3);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}
.ota-picks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  margin-bottom: var(--ps-space-3);
}
.ota-list {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-2);
  max-height: 28rem;
  margin: var(--ps-space-3) 0 var(--ps-space-4);
  overflow: auto;
  scrollbar-color: #334155 #0b0f17;
}
.ota-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.4fr) auto auto;
  gap: var(--ps-space-3);
  align-items: center;
  padding: var(--ps-space-3);
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius-sm);
  background: #0b0f17;
  cursor: pointer;
}
.ota-row:hover {
  background: #101828;
}
.ota-row:focus-within {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}
.ota-row.is-disabled {
  background: #0d131f;
}
.ota-row.is-outdated {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(251, 191, 36, 0.28);
}
.ota-row.is-current {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
}
.ota-row.is-newer {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(125, 211, 252, 0.28);
}
.ota-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ota-name {
  font-weight: 650;
  color: #f8fafc;
}
.ota-id,
.ota-ver,
.ota-job-id {
  color: #cbd5e1;
  font-size: 0.85rem;
}
.ota-id,
.ota-job-id,
.ota-ver,
.ota-sha {
  font-variant-numeric: tabular-nums;
}
.ota-ver {
  text-align: right;
  font-weight: 650;
  color: #f8fafc;
}
.ota-cmp {
  justify-self: end;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}
.ota-cmp:empty {
  display: none;
}
.ota-cmp.is-outdated {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
}
.ota-cmp.is-current {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.2);
}
.ota-cmp.is-newer {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.2);
}
.ota-when {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-3);
}
.ota-radio {
  display: flex;
  align-items: center;
  gap: var(--ps-space-2);
  color: #f1f5f9;
}
.ota-form-error {
  margin: var(--ps-space-3) 0 0;
  color: #fecdd3;
  font-weight: 650;
}
.ota .btn.ota-accent {
  background: transparent !important;
  border: 1px solid rgba(56, 189, 248, 0.55) !important;
  color: #e0f2fe !important;
}
.ota .btn.ota-accent:hover {
  background: rgba(14, 165, 233, 0.16) !important;
  color: #f0f9ff !important;
}
.ota .btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.ota-callout {
  display: flex;
  gap: var(--ps-space-3);
  align-items: flex-start;
  margin-bottom: var(--ps-space-4);
  padding: var(--ps-space-4);
  border-radius: var(--ps-radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
}
.ota-callout svg {
  flex: none;
  margin-top: 2px;
}
.ota-callout p {
  margin: 0;
}
.ota-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ps-space-3);
  margin-bottom: var(--ps-space-5);
}
.ota-kpi {
  padding: var(--ps-space-4);
  border-radius: var(--ps-radius-sm);
  background: #0b0f17;
  border: 1px solid #1e293b;
}
.ota-kpi-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #f8fafc;
}
.ota-kpi-value.is-ok { color: #6ee7b7; }
.ota-kpi-value.is-bad { color: #fda4af; }
.ota-kpi-label {
  margin: var(--ps-space-1) 0 0;
  color: #cbd5e1;
  font-size: 0.85rem;
}
.ota-job-name,
.ota-job-id {
  display: block;
}
.ota-job-name {
  font-weight: 650;
  color: #f8fafc;
}
.ota-badge,
.ota-sub {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.ota-badge.is-active,
.ota-badge.is-scheduled {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.18);
}
.ota-badge.is-sent {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.18);
}
.ota-badge.is-installed {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.22);
}
.ota-badge.is-failed {
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.16);
}
.ota-sub {
  color: #cbd5e1;
  background: transparent;
  padding-left: 0;
  font-weight: 600;
}
.ota-badge.is-live.is-active {
  animation: ota-pulse-amber 1.8s ease-out infinite;
}
.ota-badge.is-live.is-sent {
  animation: ota-pulse-sky 1.8s ease-out infinite;
}
@keyframes ota-pulse-amber {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}
@keyframes ota-pulse-sky {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ota-badge.is-live { animation: none; }
}
.ota-dialog {
  width: min(32rem, calc(100vw - 2rem));
  padding: var(--ps-space-5);
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius);
  background: #111827;
  color: #f8fafc;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.ota-dialog::backdrop {
  background: rgba(8, 12, 20, 0.72);
}
.ota-dialog p {
  margin: var(--ps-space-3) 0 var(--ps-space-5);
  color: #e2e8f0;
}
.ota-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--ps-space-2);
}
@media (max-width: 720px) {
  .ota-banner,
  .ota-kpis {
    grid-template-columns: 1fr;
  }
  .ota-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ota-ver,
  .ota-cmp {
    justify-self: start;
    text-align: left;
  }
}

.cal-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-3);
  margin: calc(var(--ps-space-5) * -1) calc(var(--ps-space-5) * -1)
    var(--ps-space-4);
  padding: var(--ps-space-4) var(--ps-space-5);
  background: #111827;
  border-bottom: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius) var(--ps-radius) 0 0;
}

.pulse-row {
  margin-top: 0;
}

.port-table td {
  padding-top: 0.55rem !important;
  padding-bottom: 0.55rem !important;
}
.port-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.diag-console {
  max-height: 22rem;
  overflow: auto;
  font-size: 0.8rem;
}

.danger-zone {
  margin-bottom: var(--ps-space-5);
  padding: var(--ps-space-5);
  border-radius: var(--ps-radius);
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.06);
}
.danger-zone .card-title {
  color: #fda4af;
}

details.fold {
  border: 1px solid var(--ps-surface-border);
}

.payload-block {
  border: 1px solid var(--ps-surface-border);
}

@media (max-width: 991.98px) {
  .locker-masthead {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .door-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .page-tabs {
    width: 100%;
    border-radius: var(--ps-radius);
  }
}
@media (max-width: 575.98px) {
  .locker-masthead {
    grid-template-columns: 1fr;
  }
  .door-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Partner jobs / companies ---------- */
.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-6);
}
.page-stack > .stack-block,
.page-stack > .panel {
  margin-bottom: 0;
}

.pin-value {
  display: inline-block;
  margin-top: var(--ps-space-2);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ps-text);
}
.pin-box {
  font-variant-numeric: tabular-nums;
  color: var(--ps-text);
}
.pin-ttl {
  margin: 0 0 var(--ps-space-2);
  font-size: 0.85rem;
  font-weight: 650;
  color: #fde68a;
}

.status-badge.bg-sky-lt {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.22);
}
.status-badge.bg-cyan-lt {
  background: rgba(34, 211, 238, 0.12);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.22);
}

.partner-wrap {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding-left: var(--ps-space-4);
  padding-right: var(--ps-space-4);
}

.partner-ident {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2) var(--ps-space-3);
  margin-top: var(--ps-space-4);
}
.partner-ident-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--ps-muted);
}
.partner-ident-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ps-text);
}
@media (min-width: 992px) {
  .partner-ident {
    display: none;
  }
}

.partner-desk {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ps-space-6);
  align-items: start;
}
@media (min-width: 992px) {
  .partner-desk {
    grid-template-columns: minmax(16rem, 4fr) minmax(0, 8fr);
  }
  .partner-desk-side {
    position: sticky;
    top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: var(--ps-space-6);
  }
}

.partner-feed {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-6);
}

.partner-card {
  background: var(--ps-card);
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius);
  padding: var(--ps-space-5);
}

.job-create-form {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-4);
}
.job-create-form .form-select {
  text-transform: none;
}
.field-hint {
  display: block;
  margin-top: var(--ps-space-2);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ps-muted);
}

.stock-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
}
.stock-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--ps-space-1) var(--ps-space-3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.stock-badge.is-open {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}
.stock-badge.is-full {
  background: rgba(100, 116, 139, 0.12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.22);
}

.job-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
  margin: 0 0 var(--ps-space-5);
}
.job-filter {
  appearance: none;
  border: 1px solid #1e293b;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ps-muted);
  font-size: 0.8rem;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.job-filter:hover {
  color: var(--ps-text);
  background: rgba(255, 255, 255, 0.06);
}
.job-filter:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}
.job-filter.is-active {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.28);
}

.job-list,
.data-list {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-3);
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-4);
  padding: var(--ps-space-4);
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius-sm);
  background: rgba(15, 23, 42, 0.45);
}
.job-list .job-card:first-child {
  padding-top: var(--ps-space-4);
  border-top: 1px solid #1e293b;
}
.job-card.is-hot {
  margin: 0;
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(56, 189, 248, 0.22);
}

.job-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ps-space-3);
}
.job-card-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2);
}
.job-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ps-space-2);
}

.job-box-block .job-box {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--ps-text);
  line-height: 1.1;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ps-space-4);
  align-items: center;
  padding: var(--ps-space-4) var(--ps-space-5);
  border-radius: var(--ps-radius);
  background: var(--ps-card);
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
}

.data-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.data-row:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.data-row.is-static {
  cursor: default;
}

.data-row.is-static:hover {
  background: var(--ps-card);
}

.company-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ps-space-2) var(--ps-space-3);
  padding: var(--ps-space-4) var(--ps-space-5);
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.company-main,
.company-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.company-side {
  margin-left: auto;
}
.company-go {
  color: #94a3b8;
  flex: none;
}
.kind-badge,
.partner-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.kind-badge.is-shipment {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
}
.kind-badge.is-courier {
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.16);
}
.partner-status.is-on {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
}
.partner-status.is-off {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.14);
}
.partner-status.is-warn {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
}
.danger-card {
  border-color: rgba(244, 63, 94, 0.55) !important;
}
.company-locker .device-id {
  color: #94a3b8;
}
.company-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.company-item:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}
.company-item .user-chevron {
  color: var(--ps-muted);
}
.company-item .status-badge {
  margin-left: auto;
}

.job-title,
.data-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ps-text);
  line-height: 1.2;
}

.job-meta,
.job-next {
  margin: var(--ps-space-1) 0 0;
  color: var(--ps-muted);
  font-size: 0.85rem;
}

.job-actions,
.row-actions,
.people-reset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ps-space-2);
}

.row-actions {
  justify-content: flex-start;
}

.job-actions .btn-outline-danger {
  margin-left: 0;
}

.cap-board {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-4);
}

.cap-locker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ps-space-3) var(--ps-space-4);
  padding: var(--ps-space-3) 0;
  border-top: 1px solid #1e293b;
}
.cap-board .cap-locker:first-child {
  padding-top: 0;
  border-top: 0;
}

.cap-locker.is-off {
  opacity: 0.55;
}

@media (max-width: 767.98px) {
  .data-row {
    grid-template-columns: 1fr;
  }
  .people-reset {
    justify-content: flex-start;
  }
  .job-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .job-actions form {
    width: 100%;
  }
  .job-touch {
    width: 100%;
    min-height: 2.75rem;
  }
  .job-box-block .job-box {
    font-size: 2rem;
  }
}

/* ---------- Try the APIs ---------- */
.walk-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ps-space-5);
}
.walk-side .field {
  margin-top: var(--ps-space-4);
}
.walk-kicker {
  margin: 0 0 var(--ps-space-2);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-muted);
}
.walk-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--ps-space-4);
}
.walk-tools .field {
  min-width: 8rem;
}
.walk-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2) var(--ps-space-3);
  padding: var(--ps-space-4) var(--ps-space-5);
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
}
.walk-board {
  padding-bottom: var(--ps-space-4);
}
.walk-steps {
  list-style: none;
  margin: var(--ps-space-3) 0 0;
  padding: 0;
}
.walk-step {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: var(--ps-space-3) var(--ps-space-4);
  padding: var(--ps-space-3) 0;
  border-top: 1px solid var(--ps-surface-border);
  opacity: 0.42;
}
.walk-step:first-child {
  border-top: 0;
  padding-top: 0;
}
.walk-step.is-done {
  opacity: 0.72;
}
.walk-step.is-current,
.walk-step.is-wait {
  opacity: 1;
  margin: var(--ps-space-2) calc(var(--ps-space-5) * -1);
  padding: var(--ps-space-4) var(--ps-space-5);
  border-top: 0;
  border-radius: var(--ps-radius-sm);
  background: rgba(14, 165, 233, 0.07);
}
.walk-n {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--ps-input);
  color: var(--ps-muted);
}
.walk-step.is-current .walk-n,
.walk-step.is-wait .walk-n {
  background: #0ea5e9;
  color: #0b0f17;
}
.walk-step.is-done .walk-n {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
}
.walk-who {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-muted);
}
.walk-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.walk-call {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ps-muted);
}
.walk-call code {
  font-size: 0.78rem;
  word-break: break-all;
}
.walk-lead {
  margin: var(--ps-space-1) 0 var(--ps-space-3);
  color: var(--ps-muted);
  font-size: 0.9rem;
}
.walk-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ps-space-4);
  align-items: end;
  max-width: 36rem;
}
.walk-form-sub {
  margin-top: var(--ps-space-2);
  max-width: 36rem;
}
.walk-wait {
  margin: 0 0 var(--ps-space-3);
  color: #fde68a;
  font-size: 0.9rem;
  font-weight: 650;
}
.walk-board .row-actions {
  margin-top: var(--ps-space-4);
}
.panel details.fold {
  margin: var(--ps-space-4) 0 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.panel details.fold > summary {
  font-size: 0.85rem;
  color: var(--ps-muted);
}
.company-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ps-space-2) var(--ps-space-3);
  margin: 0 0 var(--ps-space-4);
}
.company-lockers {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-1);
}
.company-locker-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.company-locker-copy .data-title {
  font-size: 0.95rem;
  font-weight: 650;
}
@media (max-width: 767.98px) {
  .walk-sides,
  .walk-form {
    grid-template-columns: 1fr;
  }
  .walk-form .field-submit {
    grid-column: auto;
  }
}

.title-id {
  display: inline-block;
  margin-left: 0.45rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ps-muted);
  vertical-align: middle;
}
.order-subid {
  display: block;
  margin-top: 0.15rem;
  font-size: 12px;
  line-height: 1.2;
}
.order-shipper {
  color: var(--ps-muted);
}
.order-id {
  color: var(--ps-faint);
}
.order-track {
  color: var(--ps-text);
  font-weight: 650;
  text-decoration: none;
}
.order-track:hover {
  color: #38bdf8;
}
.order-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.order-price-fact {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.order-sms {
  color: var(--ps-muted);
}
.order-warehouse {
  margin-top: var(--ps-space-4);
}
.order-warehouse p {
  margin: 0.2rem 0 0;
}
.order-holds {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}
.cell-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ps-muted);
  font-size: 0.8125rem;
}
.cell-mark::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  flex: none;
}
.cell-mark.is-reserved::before {
  background: transparent;
  border-style: dashed;
}
.cell-mark.is-loaded::before {
  background: currentColor;
}
.cell-mark.is-return {
  color: #fbbf24;
}
.cell-mark.is-return::before {
  background: transparent;
  border-style: solid;
}
.cell-mark.is-done {
  color: #34d399;
}
.cell-mark.is-cancelled {
  color: var(--ps-faint);
}

.order-lock {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: var(--ps-radius);
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.08);
  color: #e2e8f0;
}
.order-lock-ico {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  margin-top: 0.15rem;
  color: #7dd3fc;
}
.order-lock strong {
  display: block;
  font-size: 0.95rem;
}
.order-lock p {
  margin: 0.2rem 0 0;
  color: var(--ps-muted);
  font-size: 0.875rem;
}
.lock-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.order-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--ps-space-6);
  align-items: start;
}
.order-col {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-6);
}
.order-steps {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.15rem;
  overflow-x: auto;
  scrollbar-color: #1e293b transparent;
}
.order-step {
  position: relative;
  flex: 1 0 6.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  min-height: 4.4rem;
  padding-right: 0.6rem;
  color: var(--ps-faint);
}
.order-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  right: 0;
  top: 0.4rem;
  height: 1px;
  background: #1e293b;
}
.order-step-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: #111827;
  position: relative;
  z-index: 1;
}
.order-step-label {
  font-size: 0.75rem;
  line-height: 1.25;
  max-width: 6.2rem;
}
.order-step.is-done {
  color: #bae6fd;
}
.order-step.is-done .order-step-dot {
  background: #38bdf8;
  border-color: #38bdf8;
}
.order-step.is-done:not(:last-child)::before {
  background: rgba(56, 189, 248, 0.45);
}
.order-step.is-skipped {
  color: #fbbf24;
}
.order-step.is-skipped .order-step-dot {
  background: transparent;
  border-style: dashed;
  border-color: #fbbf24;
}
.order-step.is-skipped .order-step-label {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.order-step.is-unrecorded {
  color: #94a3b8;
}
.order-step.is-unrecorded .order-step-dot {
  background: transparent;
  border-style: dotted;
}
.order-step.is-current {
  color: #f1f5f9;
  font-weight: 650;
}
.order-step.is-current .order-step-dot {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}
.order-step.is-wait {
  color: #94a3b8;
}
.order-ended {
  margin: 0 0 var(--ps-space-3);
  color: #fecdd3;
  font-size: 0.875rem;
  font-weight: 650;
}
.order-return {
  margin: 0 0 var(--ps-space-3);
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--ps-radius-sm);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  font-size: 0.875rem;
  font-weight: 650;
}
.drop-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drop-timeline li {
  position: relative;
  padding: 0 0 0.85rem 1.15rem;
  color: #cbd5e1;
  font-size: 0.8125rem;
}
.drop-timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.4rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #38bdf8;
}
.drop-timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.85rem;
  bottom: 0;
  width: 1px;
  background: #1e293b;
}
.order-facts {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.55rem 0.75rem;
  margin: 0;
}
.order-facts dt {
  margin: 0;
  color: var(--ps-muted);
  font-size: 0.8125rem;
}
.order-facts dd {
  margin: 0;
}
.add-user-form.is-locked .form-control,
.add-user-form.is-locked .form-select {
  opacity: 0.72;
}
@media (max-width: 860px) {
  .order-split {
    grid-template-columns: 1fr;
  }
}

.fleet-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--ps-space-2);
  padding: 0 var(--ps-space-5) var(--ps-space-4);
}
.fleet-filters .form-control {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.fleet-filters .form-select {
  flex: 0 0 11rem;
  width: 11rem;
}
@media (max-width: 767.98px) {
  .fleet-filters {
    flex-wrap: wrap;
  }
  .fleet-filters .form-select {
    flex: 1 1 11rem;
    width: auto;
  }
}

.company-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--ps-space-4);
}
.company-head .company-flags {
  margin: 0;
}
.company-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ps-space-2);
  margin-left: auto;
}
.company-actions .fold {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.company-page .section-head {
  flex-direction: column;
  align-items: flex-start;
}
.inline-pair {
  flex-wrap: nowrap;
  align-items: center;
  max-width: 28rem;
}
.inline-pair .form-select {
  width: auto;
  flex: 1 1 12rem;
}

.price-row,
.place-names {
  display: grid;
  gap: var(--ps-space-3);
  align-items: end;
}
.price-row {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}
.place-names {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}
.stack-form {
  display: grid;
  gap: var(--ps-space-4);
  max-width: 40rem;
}
.place-sub {
  margin: var(--ps-space-5) 0 var(--ps-space-3);
  font-size: 0.95rem;
  font-weight: 650;
}
.place-delete {
  margin-top: var(--ps-space-3);
}
@media (max-width: 767.98px) {
  .price-row,
  .place-names {
    grid-template-columns: 1fr;
  }
}

.places-split {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: var(--ps-space-5);
  align-items: start;
}
.places-split > .panel:first-child .place-names {
  grid-template-columns: 1fr;
}
@media (max-width: 900px) {
  .places-split {
    grid-template-columns: 1fr;
  }
}
.place-city-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--ps-space-4);
}
.place-city {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ps-space-3);
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--ps-radius);
  color: inherit;
  text-decoration: none;
}
.place-city:hover {
  background: rgba(30, 41, 59, 0.6);
  color: #f1f5f9;
}
.place-city.is-active {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.1);
  box-shadow: inset 2px 0 0 #38bdf8;
  font-weight: 500;
}
.place-table {
  min-width: 40rem;
}
.place-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
  gap: var(--ps-space-2);
  align-items: center;
  margin-bottom: var(--ps-space-2);
}
.place-line-form {
  display: contents;
}
.place-line-head {
  color: var(--ps-muted);
  font-size: 0.75rem;
  margin-bottom: var(--ps-space-2);
}
.place-lang {
  display: contents;
}
.place-lang-k {
  display: none;
}
.allowlist-field {
  flex: 1 1 16rem;
  min-width: 0;
}
.allowlist-field .form-control {
  width: 100%;
}

@media (max-width: 767.98px) {
  .place-table {
    min-width: 0;
  }
  .place-line-head {
    display: none;
  }
  .place-line {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--ps-space-2);
    margin-bottom: var(--ps-space-4);
    padding-bottom: var(--ps-space-4);
    border-bottom: 1px solid var(--ps-surface-border);
  }
  .place-line-form {
    display: flex;
    flex-direction: column;
    gap: var(--ps-space-3);
  }
  .place-lang {
    display: flex;
    flex-direction: column;
    gap: var(--ps-space-1);
  }
  .place-lang-k {
    display: block;
    color: var(--ps-muted);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .place-line-new {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 12px;
  }
}

.place-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #1e293b;
  background: #111827;
}
.place-alert.is-warn {
  border-color: rgba(251, 191, 36, 0.5);
  color: #fcd34d;
}
.place-alert.is-bad {
  border-color: rgba(244, 63, 94, 0.55);
  color: #fda4af;
}
.place-alert.is-ok {
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}
.place-preview-note {
  margin: 0 0 16px;
  color: #94a3b8;
  font-size: 0.85rem;
}
.lang-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.place-count {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
}
.place-city.is-active .place-count {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.16);
}
.place-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.place-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.place-line-new {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed #1e293b;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.06);
}
.place-add-kicker {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7dd3fc;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  left: var(--ps-space-4);
  top: var(--ps-space-4);
  z-index: 2000;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  padding: var(--ps-space-2) var(--ps-space-4);
  background: var(--ps-card);
  color: var(--ps-text);
  border-radius: var(--ps-radius-sm);
  font-weight: 650;
  text-decoration: none;
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .btn,
  .sidebar-resizer::after,
  .user-chevron {
    transition: none;
  }
}

/* ---------- Fleet home (/admin only) ---------- */
.fleet-home .fleet-count {
  margin: 0;
  color: var(--ps-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.fleet-home .fleet-disabled {
  margin-left: auto;
  border-radius: 999px;
  padding: 4px 8px;
}

.fleet-home .fleet-disabled.is-active {
  color: var(--ps-text);
  background: rgba(255, 255, 255, 0.06);
}

.fleet-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ps-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fleet-size-k {
  color: var(--ps-muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.fleet-free-meta,
.fleet-home .fleet-reason {
  margin-top: 4px;
  color: var(--ps-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.fleet-home .fleet-reason {
  max-width: 28rem;
}

.fleet-home .col-flag {
  width: 6.5rem;
}

.fleet-home a.fleet-flag {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: 8px;
}

.fleet-home a.fleet-flag:focus-visible,
.fleet-home .fleet-disabled:focus-visible,
.fleet-home .fleet-filters .btn:focus-visible,
.fleet-home .page-link:focus-visible,
.fleet-home .fleet-ota .btn:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

.fleet-home .fleet-ota {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.fleet-home .fleet-ota-copy {
  margin: 0;
  color: var(--ps-muted);
}

.admin-console ::selection {
  background: rgba(56, 189, 248, 0.28);
  color: var(--ps-text);
}

.admin-console {
  caret-color: #38bdf8;
}

.admin-console .form-control::placeholder {
  color: var(--ps-muted);
}

.admin-console .table-responsive,
.admin-console .page-wrapper {
  scrollbar-color: #334155 transparent;
}

.admin-console .payload-fold summary:focus-visible,
.admin-console .file-rules summary:focus-visible,
.admin-console .pw-fold summary:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

@media (max-width: 575.98px) {
  .parcel-row {
    align-items: stretch;
  }
  .parcel-row form {
    flex: 1 1 8rem;
  }
  .parcel-row .btn {
    width: 100%;
  }
}

.orders-desk {
  display: flex;
  flex-direction: column;
  gap: var(--ps-space-5);
}
.orders-policy,
.order-drawer {
  border: 1px solid #1e293b;
  border-radius: var(--ps-radius-sm);
  background: #111827;
}
.orders-policy > summary,
.order-drawer > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  list-style: none;
  color: #f1f5f9;
  font-weight: 650;
}
.orders-policy > summary::-webkit-details-marker,
.order-drawer > summary::-webkit-details-marker {
  display: none;
}
.orders-policy > summary:focus-visible,
.order-drawer > summary:focus-visible,
.order-chip:focus-visible,
.order-open:focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}
.orders-policy-ico {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  color: #7dd3fc;
}
.orders-policy-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
  font-weight: 550;
}
.orders-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.75rem;
}
.orders-policy-body {
  padding: 0 0.9rem 0.9rem;
}
.orders-policy .storage-fee,
.panel .storage-fee {
  padding: 0;
}
.panel .orders-policy-badges {
  margin: 0 0 0.75rem;
}
.orders-policy-note {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.875rem;
}
.order-filters .order-drawer {
  background: transparent;
}
.orders-pin-note {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.8125rem;
}
.order-drawer-on {
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.order-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ps-space-3);
  padding-top: var(--ps-space-3);
}
.order-filter-grid .field {
  margin: 0;
}
.order-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0 var(--ps-space-5) var(--ps-space-4);
}
.order-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #1e293b;
  background: rgba(56, 189, 248, 0.08);
  color: #e2e8f0;
  font-size: 0.78rem;
  text-decoration: none;
}
.order-chip:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
}
.order-track-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.order-hardware {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.order-door-num {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.order-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.order-unassigned {
  display: inline-flex;
  align-items: center;
  margin-top: 0.15rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 650;
}
.order-open-cell {
  width: 3rem;
  text-align: right;
}
.order-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid #1e293b;
  color: #e2e8f0;
  text-decoration: none;
}
.order-open svg {
  width: 1.05rem;
  height: 1.05rem;
}
.order-open:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}
.orders-pager .page-link {
  background: transparent !important;
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}
.orders-pager .page-link:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f8fafc !important;
}
.order-alarm {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: var(--ps-radius);
  border: 1px solid rgba(251, 113, 133, 0.55);
  background: rgba(244, 63, 94, 0.12);
  color: #ffe4e6;
}
.order-alarm-ico {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
  margin-top: 0.1rem;
  color: #fda4af;
}
.order-alarm strong {
  display: block;
}
.order-alarm p {
  margin: 0.2rem 0 0;
  color: #fecdd3;
}
.order-alarm-live {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
}
.order-alarm-live p,
.order-alarm-live .order-alarm-ico {
  color: #fde68a;
}
.order-danger {
  border-color: rgba(251, 113, 133, 0.55) !important;
  background: rgba(244, 63, 94, 0.06) !important;
}
.order-confirm {
  width: min(28rem, calc(100vw - 2rem));
  margin: auto;
  padding: var(--ps-space-5);
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: var(--ps-radius);
  background: #111827;
  color: #f1f5f9;
}
.order-confirm::backdrop {
  background: rgba(11, 15, 23, 0.72);
}
.order-confirm p {
  margin: 0.6rem 0 0;
  color: #fecdd3;
}
.order-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--ps-space-2);
  margin-top: var(--ps-space-4);
}
@media (max-width: 1100px) {
  .order-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .order-filter-grid {
    grid-template-columns: 1fr;
  }
  .orders-policy-badges {
    margin-left: 0;
  }
}
