: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, .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, .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: #64748b;
  --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, .05);
  --ps-focus: rgba(56, 189, 248, .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, .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-login { margin: 0 auto; height: 32px; }

/* ---------- 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 .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: var(--ps-space-3);
  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;
  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: .875rem;
  line-height: 1.25;
  background: transparent;
  box-shadow: none !important;
  transition: background .12s ease, color .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, .06) !important;
}

.app-sidebar .nav-link.active {
  color: #38bdf8 !important;
  font-weight: 500;
  background: rgba(14, 165, 233, .10) !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: .08em;
  text-transform: uppercase;
  color: var(--ps-faint);
}

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

.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, .04);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(14, 165, 233, .10);
  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: .84rem;
  color: var(--ps-text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.account-logout {
  appearance: none;
  flex: none;
  width: 32px;
  height: 32px;
  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, .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: .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: -.03em;
  color: var(--ps-text);
  line-height: 1.2;
  margin: 0;
}

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

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

.page-header-actions { padding-top: var(--ps-space-1); flex: none; }

.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: .72rem;
  font-weight: 650;
  letter-spacing: .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: .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: -.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, .03);
}

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

.form-control,
.form-select {
  background: var(--ps-input) !important;
  border: 1px solid rgba(51, 65, 85, .5) !important;
  border-radius: .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, .45) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12) !important;
}

.form-control::placeholder { color: #64748b; }

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

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

.field { margin: 0; }

.btn {
  border-radius: var(--ps-radius-sm) !important;
  font-weight: 600;
  padding: .5rem 1rem;
  box-shadow: none !important;
  transition: background .12s ease, border-color .12s ease, color .12s ease, opacity .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, .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, .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, .12) !important;
  color: #e5e7eb !important;
}

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

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

.btn-outline-danger:hover {
  background: rgba(244, 63, 94, .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, .05) !important;
  color: var(--ps-text) !important;
}

.btn:active { opacity: .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, .12) !important;
  color: #86efac !important;
}
.alert-danger {
  background: rgba(244, 63, 94, .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, .10);
  border-color: rgba(56, 189, 248, .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, .10); color: #38bdf8; }
.kpi-icon-online { background: rgba(16, 185, 129, .10); color: #34d399; }
.kpi-icon-offline { background: rgba(244, 63, 94, .10); color: #fb7185; }
.kpi-icon-attention { background: rgba(245, 158, 11, .10); color: #fbbf24; }

.kpi-label {
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .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: -.04em;
  color: #f1f5f9;
}

.kpi-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .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;
}

.table-note {
  color: var(--ps-muted);
  font-size: .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: .375rem .75rem;
}

.table thead th {
  color: #94a3b8 !important;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom-color: var(--tblr-border-color) !important;
  background: transparent !important;
  padding-top: .9rem !important;
  padding-bottom: .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, .04) !important;
}

.table-hover > tbody > tr:hover > * {
  background: rgba(255, 255, 255, .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: .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: .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: .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: .25rem;
  align-items: center;
}
.issue-tab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  color: var(--ps-muted);
  text-decoration: none;
  font-size: .8125rem;
  font-weight: 550;
}
.issue-tab:hover { color: #f1f5f9; }
.issue-tab.is-active {
  color: #f1f5f9;
  background: rgba(255, 255, 255, .06);
}
.issue-tab-n {
  font-variant-numeric: tabular-nums;
  color: var(--ps-faint);
}
.issue-tab.is-active .issue-tab-n { color: #7dd3fc; }
.kind-pill {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 650;
  padding: .12rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.kind-pill.level-critical {
  color: #fca5a5;
  background: rgba(248, 113, 113, .12);
}
.kind-pill.level-warning {
  color: #fbbf24;
  background: rgba(245, 158, 11, .12);
}
.kind-pill.level-info {
  color: #7dd3fc;
  background: rgba(14, 165, 233, .12);
}
.issue-summary {
  color: #e2e8f0;
  font-size: .8125rem;
  line-height: 1.4;
  max-width: 36rem;
}
.issue-purge {
  margin-top: .2rem;
  font-size: .7rem;
  color: var(--ps-faint);
}
.issue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-end;
}
.issue-actions form { display: inline; }

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

.pagination .page-link {
  background: var(--ps-input) !important;
  border: 1px solid rgba(51, 65, 85, .5) !important;
  border-radius: .5rem !important;
  color: #f1f5f9 !important;
  margin-left: .35rem;
}

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

/* ---------- Status badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-weight: 500;
  font-size: .75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .125rem .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, .10);
  color: #34d399;
  border-color: rgba(16, 185, 129, .20);
}
.status-badge.bg-yellow-lt {
  background: rgba(245, 158, 11, .10);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, .20);
}
.status-badge.bg-secondary-lt {
  background: rgba(100, 116, 139, .12);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, .25);
}
.status-badge.bg-red-lt {
  background: rgba(255, 255, 255, .04);
  color: var(--ps-muted);
  border-color: rgba(255, 255, 255, .06);
}

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

.login-card { padding: .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: .85rem;
}

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

.role-pill {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: var(--ps-space-1) var(--ps-space-3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ps-muted);
}
.role-pill.role-owner {
  color: #7dd3fc;
  background: rgba(14, 165, 233, .10);
}
.role-pill.role-superuser {
  color: #38bdf8;
  background: rgba(14, 165, 233, .16);
}
.role-pill.role-operator {
  color: #d7dee8;
  background: rgba(255, 255, 255, .08);
}
.role-pill.role-viewer {
  color: var(--ps-muted);
  background: rgba(255, 255, 255, .05);
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 158, 11, .10);
  border-bottom: 1px solid rgba(245, 158, 11, .20);
}
.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: .68rem;
  font-weight: 650;
  letter-spacing: .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: .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, .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, .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 {
  position: relative;
  background: var(--ps-card);
  border: 1px solid var(--ps-surface-border);
  border-radius: var(--ps-radius);
  box-shadow: none;
  overflow: hidden;
}

.user-item-actions {
  position: absolute;
  top: var(--ps-space-3);
  right: var(--ps-space-4);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-space-2);
}

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

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

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

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

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

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

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

.user-extra {
  margin-left: auto;
  color: var(--ps-muted);
  font-size: .85rem;
  display: inline-flex;
  align-items: baseline;
  gap: var(--ps-space-2);
}

.user-extra .metric { font-size: 1.15rem; }

.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: -.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: .72rem;
  font-weight: 600;
  padding: var(--ps-space-1) var(--ps-space-3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--ps-muted);
}

.access-chip-extra {
  color: #7dd3fc;
  background: rgba(14, 165, 233, .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 { padding-right: var(--ps-space-4); padding-top: 3.25rem; }
}

.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: .9rem;
  color: var(--ps-text);
  cursor: pointer;
}

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

.grant-item.is-locked {
  opacity: .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: .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: .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);
}

.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: .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;
  padding: var(--ps-space-2) var(--ps-space-4);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ps-muted);
  text-decoration: none;
}

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

.page-tab.is-active {
  color: #38bdf8;
  background: rgba(14, 165, 233, .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, .22);
  background: rgba(245, 158, 11, .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, .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, .03);
}

details.fold > summary {
  list-style: none;
  cursor: pointer;
  font-size: .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, .25);
}

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

.alert-warning {
  background: rgba(245, 158, 11, .10) !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, .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: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: inherit;
  opacity: .85;
}
.cap-chip strong {
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}
.cap-chip.is-free {
  background: rgba(16, 185, 129, .10);
  color: #34d399;
  border-color: rgba(16, 185, 129, .18);
}
.cap-chip.is-reserved {
  background: rgba(245, 158, 11, .10);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, .20);
}
.cap-chip.is-occupied {
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, .22);
}
.cap-chip.is-ops {
  background: rgba(244, 63, 94, .10);
  color: #fb7185;
  border-color: rgba(244, 63, 94, .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, .55);
}
.door-tile.is-free { background: rgba(16, 185, 129, .08); border-color: rgba(16, 185, 129, .16); }
.door-tile.is-reserved { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .18); }
.door-tile.is-occupied { background: rgba(148, 163, 184, .10); }
.door-tile.is-ops { background: rgba(244, 63, 94, .10); border-color: rgba(244, 63, 94, .18); }
.door-tile.is-blocked { background: rgba(255, 255, 255, .03); }

.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: .72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .06);
  color: #e2e8f0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .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: #64748b; }

.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: .55rem !important; padding-bottom: .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: .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, .35);
  background: rgba(244, 63, 94, .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: .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: .85rem;
  font-weight: 650;
  color: #fde68a;
}

.status-badge.bg-sky-lt {
  background: rgba(56, 189, 248, .12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, .22);
}
.status-badge.bg-cyan-lt {
  background: rgba(34, 211, 238, .12);
  color: #67e8f9;
  border-color: rgba(34, 211, 238, .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: .8rem;
  color: var(--ps-muted);
}
.partner-ident-user {
  font-size: .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: .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: .75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}
.stock-badge.is-open {
  background: rgba(16, 185, 129, .10);
  color: #34d399;
  border-color: rgba(16, 185, 129, .20);
}
.stock-badge.is-full {
  background: rgba(100, 116, 139, .12);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, .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, .03);
  color: var(--ps-muted);
  font-size: .8rem;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.job-filter:hover {
  color: var(--ps-text);
  background: rgba(255, 255, 255, .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, .14);
  border-color: rgba(56, 189, 248, .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, .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, .08);
  border-color: rgba(56, 189, 248, .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: -.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, .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;
  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);
  color: inherit;
  text-decoration: none;
}
.company-item:hover { background: rgba(255, 255, 255, .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: -.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: .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: .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; }
}
