/* Client portal — login + dashboard (uses :root tokens from style.css) */

body.portal,
body.portal * {
  cursor: auto !important;
}

body.portal {
  min-height: 100vh;
  background: var(--bg-2);
}

/* ─── Login ───────────────────────────────────────────────────────────── */
.portal-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--pad);
}

.portal-login__brand {
  margin-bottom: 2rem;
  text-align: center;
}

.portal-login__brand a {
  font-family: var(--f-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: 0.02em;
  color: var(--cream);
}

.portal-login__brand a em {
  color: var(--gold);
  font-style: normal;
}

.portal-login__card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.75rem 2.25rem;
  box-shadow: 0 24px 60px rgba(10, 37, 64, 0.08);
}

.portal-login__card h1 {
  font-family: var(--f-body);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.portal-login__card > p.sub {
  font-size: 0.9rem;
  color: var(--cream-dim);
  margin-bottom: 1.5rem;
}

.portal-field {
  margin-bottom: 1rem;
}

.portal-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 0.35rem;
}

.portal-field input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-soft);
  color: var(--cream);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.portal-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.portal-msg {
  font-size: 0.875rem;
  color: var(--red);
  margin-bottom: 0.75rem;
  min-height: 1.25em;
}

.portal-msg:empty {
  display: none;
}

.portal-login__card .btn-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  background: var(--gold);
  color: #fff;
  border: none;
  transition: background var(--t-fast), transform var(--t-fast);
}

.portal-login__card .btn-submit:hover {
  background: var(--gold-deep);
}

.portal-login__hint {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--cream-faint);
  line-height: 1.5;
}

.portal-back {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--cream-dim);
}

.portal-back a {
  color: var(--gold);
}

/* ─── Dashboard app shell ─────────────────────────────────────────────── */
.dash-app {
  display: flex;
  min-height: 100vh;
}

.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--cream);
  color: #fff;
  padding: 1.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
}

.dash-sidebar__brand {
  padding: 0 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-sidebar__logo {
  font-family: var(--f-display);
  font-size: 1.65rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.dash-sidebar__logo em {
  color: var(--gold-light);
  font-style: normal;
}

.dash-sidebar__tag {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

.dash-menu-label {
  margin: 1.25rem 0.75rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.dash-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.dash-side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.68);
  border: none;
  background: transparent;
  transition: background var(--t-fast), color var(--t-fast), padding-left var(--t-fast);
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
}

.dash-side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.dash-side-link.is-active {
  color: #fff;
  background: rgba(30, 91, 219, 0.38);
  border-left: 3px solid var(--accent-warm);
  padding-left: calc(0.85rem - 3px);
}

.dash-side-ico {
  flex-shrink: 0;
  opacity: 0.95;
}

.dash-side-link--ghost {
  color: rgba(255, 255, 255, 0.5);
}

.dash-side-link--ghost:hover {
  color: #fff;
}

.dash-menu-label--developer {
  margin-top: 1.35rem;
}

.dash-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dash-nav-toggle {
  justify-content: flex-start;
}

.dash-nav-toggle__text {
  flex: 1;
  text-align: left;
}

.dash-nav-chevron {
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.dash-nav-group.is-open .dash-nav-chevron {
  transform: rotate(90deg);
}

.dash-nav-sub {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.15rem 0 0.35rem 0.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  margin-left: 1.1rem;
}

.dash-nav-group.is-open > .dash-nav-sub {
  display: flex;
}

.dash-side-link--sub {
  font-size: 0.82rem;
  padding: 0.5rem 0.75rem;
  color: rgba(255, 255, 255, 0.58);
}

.dash-side-link--sub:hover {
  color: #fff;
}

.dash-side-link--sub.is-active {
  color: #fff;
  background: rgba(30, 91, 219, 0.28);
  border-left: none;
  padding-left: 0.75rem;
}

.dash-sidebar__logout {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
}

.dash-main-wrap.dash-main--dashboard {
  background: #f1f5f9;
}

/* Mobile bar */
.dash-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--cream);
  color: #fff;
  gap: 1rem;
}

.dash-mobile-bar__title {
  font-family: var(--f-display);
  font-size: 1.25rem;
}

.dash-mobile-bar__title em {
  color: var(--gold-light);
  font-style: normal;
}

.dash-mobile-bar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: flex-end;
}

.dash-mobile-bar__links--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(72vw, 520px);
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  gap: 0.5rem 0.75rem;
}

.dash-mobile-bar__links--scroll button.is-active,
.dash-mobile-bar__links--scroll a.is-active {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dash-mobile-bar__links button,
.dash-mobile-bar__links a {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: none;
  border: none;
  padding: 0.25rem 0;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.dash-mobile-bar__links button:hover,
.dash-mobile-bar__links a:hover {
  color: #fff;
}

/* Toolbar — gateway-style top bar */
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e8ecf1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.dash-main--dashboard .dash-toolbar {
  background: #fff;
}

.dash-toolbar__search-block {
  flex: 1;
  min-width: 200px;
  max-width: 520px;
}

.dash-toolbar__search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem 0.45rem 0.85rem;
  background: #f4f6f9;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
}

.dash-toolbar__search:focus-within {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.dash-toolbar__search-ico {
  flex-shrink: 0;
  color: #94a3b8;
}

.dash-toolbar__search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  color: #0f172a;
  outline: none;
  font-family: inherit;
}

.dash-toolbar__search input::placeholder {
  color: #94a3b8;
}

.dash-toolbar__kbd {
  display: none;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  color: #94a3b8;
}

@media (min-width: 768px) {
  .dash-toolbar__kbd {
    display: inline-flex;
  }
}

.dash-toolbar__kbd kbd {
  font-family: ui-monospace, monospace;
  padding: 0.12rem 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.62rem;
}

.dash-toolbar__page {
  flex: 1;
  min-width: 0;
}

.dash-toolbar__page .dash-toolbar__title {
  color: #0f172a;
}

.dash-toolbar__page .dash-toolbar__sub {
  color: #64748b;
}

.dash-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.dash-toolbar__icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dash-toolbar__icon-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dash-toolbar__icon-btn--notify {
  position: relative;
}

.dash-toolbar__avatar-wrap {
  position: relative;
  margin-left: 0.25rem;
}

.dash-avatar--toolbar {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}

.dash-toolbar__online {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #fff;
  border-radius: 50%;
}

.dash-user-name--toolbar {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dash-toolbar__title {
  font-family: var(--f-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.02em;
}

.dash-toolbar__sub {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--cream-dim);
}

.dash-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-deep);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cream);
}

/* Sections */
.dash-section {
  padding: 1.5rem 1.75rem 2.5rem;
  flex: 1;
}

/* Generic panels (Profile, Report, forms, API docs) */
.dash-panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem 1.5rem 1.5rem;
  max-width: 720px;
  box-shadow: 0 2px 12px rgba(10, 37, 64, 0.04);
}

.dash-panel__title {
  font-family: var(--f-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cream);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.dash-panel__lead {
  font-size: 0.9rem;
  color: var(--cream-dim);
  line-height: 1.6;
  margin: 0 0 1.1rem;
}

.dash-panel__hint {
  font-size: 0.82rem;
  color: var(--dim);
  margin: 0 0 1rem;
}

.dash-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.65rem 1rem;
  font-size: 0.9rem;
}

.dash-dl dt {
  color: var(--dim);
  font-weight: 600;
}

.dash-dl dd {
  margin: 0;
  color: var(--cream);
}

.dash-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-field {
  margin-bottom: 1rem;
}

.dash-field label,
.dash-fieldset legend {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-bottom: 0.35rem;
}

.dash-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
}

.dash-fieldset legend {
  padding: 0 0.35rem;
}

.dash-field input[type='text'],
.dash-field input[type='url'],
.dash-field input[type='password'],
.dash-field input[type='tel'],
.dash-field input[type='email'],
.dash-field input[type='number'],
.dash-field input[type='date'],
.dash-field select,
.dash-field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--bg-soft);
  color: var(--cream);
}

.dash-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.dash-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.dash-input-row input {
  flex: 1;
  min-width: 0;
}

.dash-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--cream);
  margin: 0.35rem 0;
  cursor: pointer;
}

.dash-form-msg {
  font-size: 0.85rem;
  color: var(--teal);
  min-height: 1.25em;
  margin: 0 0 0.75rem;
}

.dash-form-msg:empty {
  display: none;
}

.dash-btn-primary,
.dash-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.dash-btn-primary {
  background: var(--gold);
  color: #fff;
  width: fit-content;
}

.dash-btn-primary:hover {
  background: var(--gold-deep);
}

.dash-btn-secondary {
  background: var(--bg-3);
  color: var(--cream);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}

.dash-btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.dash-docs-list {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--cream-dim);
  line-height: 1.65;
  font-size: 0.9rem;
}

.dash-docs-list code {
  font-size: 0.82rem;
}

.dash-link {
  font-weight: 600;
  color: var(--gold);
}

.dash-link:hover {
  text-decoration: underline;
}

.text-center {
  text-align: center;
}

.dash-panel--wide {
  max-width: none;
}

.dash-panel--stack {
  margin-bottom: 1rem;
}

.dash-panel__headrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.dash-panel__muted {
  font-size: 0.8rem;
  color: var(--dim);
}

.dash-subpanel-title {
  font-family: var(--f-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cream);
  margin: 0 0 0.75rem;
}

.dash-report-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-report-head__title {
  margin-bottom: 0.25rem;
}

.dash-report-head__sub {
  margin: 0;
  max-width: 36rem;
}

.dash-report-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.dash-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--dim);
}

.dash-select-sm {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--cream);
  font-size: 0.8rem;
}

.dash-btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
}

.dash-report-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--bg-3);
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

.dash-report-tab {
  border: none;
  background: transparent;
  color: var(--cream-dim);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
  box-sizing: border-box;
}

.dash-report-tab:hover {
  color: var(--cream);
}

.dash-report-tab.is-active {
  background: var(--bg);
  color: var(--cream);
  box-shadow: 0 1px 3px rgba(10, 37, 64, 0.08);
}

.dash-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.dash-field--span {
  grid-column: 1 / -1;
}

.dash-select-full {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--cream);
  font-size: 0.9rem;
}

.dash-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dash-table-scroll--mt {
  margin-top: 0.75rem;
}

.dash-profile-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dash-profile-top {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .dash-profile-top {
    grid-template-columns: 1fr;
  }
}

.dash-profile-card {
  padding: 1.5rem 1.25rem;
}

.dash-profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: var(--gold-soft);
  color: var(--gold-deep);
  border: 2px solid var(--line);
}

.dash-profile-card-name {
  margin: 0;
  font-size: 1.15rem;
  color: var(--cream);
}

.dash-profile-card-role {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.82rem;
  color: var(--dim);
}

.dash-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .dash-profile-stats {
    grid-template-columns: 1fr;
  }
}

.dash-stat-mini {
  padding: 1rem;
  text-align: center;
}

.dash-stat-mini h6 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.dash-stat-mini__val {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cream);
}

.dash-stat-mini__val--ok {
  color: var(--teal);
}

.dash-profile-row {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .dash-profile-row {
    grid-template-columns: 1fr;
  }
}

.dash-panel--grow {
  max-width: none;
}

.dash-profile-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-security-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dash-btn-outline:hover {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.dash-btn-outline--warn {
  border-color: #f59e0b;
  color: #d97706;
}

.dash-btn-outline--warn:hover {
  background: rgba(245, 158, 11, 0.12);
}

.dash-btn-outline--danger {
  border-color: #ef4444;
  color: #dc2626;
}

.dash-btn-outline--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.dash-btn-wide {
  width: 100%;
}

.dash-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  color: var(--cream-dim);
  line-height: 1.45;
}

.dash-activity-list li {
  margin-bottom: 0.85rem;
}

.dash-activity-list li:last-child {
  margin-bottom: 0;
}

.dash-act-label {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.65rem;
}

.dash-field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--bg-soft);
  color: var(--cream);
  resize: vertical;
  min-height: 72px;
}

/* Stats */
.dash-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.dash-stat-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: 0 2px 12px rgba(10, 37, 64, 0.04);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.dash-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(10, 37, 64, 0.08);
}

.dash-stat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dash-stat-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-stat-card__icon--blue {
  background: rgba(30, 91, 219, 0.1);
  color: var(--gold);
}
.dash-stat-card__icon--purple {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}
.dash-stat-card__icon--teal {
  background: rgba(15, 185, 138, 0.12);
  color: var(--teal);
}
.dash-stat-card__icon--amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
}

.dash-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.dash-pill--ok {
  background: rgba(15, 185, 138, 0.15);
  color: var(--teal);
}
.dash-pill--muted {
  background: var(--bg-3);
  color: var(--dim);
}
.dash-pill--warn {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.dash-stat-card__label {
  font-size: 0.78rem;
  color: var(--dim);
  margin-bottom: 0.25rem;
}

.dash-stat-card__value {
  font-family: var(--f-body);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--cream);
  letter-spacing: -0.02em;
}

/* Charts */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  .dash-charts-row {
    grid-template-columns: 1fr;
  }
}

.dash-chart-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: 0 2px 12px rgba(10, 37, 64, 0.04);
}

.dash-chart-card--wide {
  min-width: 0;
}

.dash-chart-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dash-chart-card__head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cream);
}

.dash-chart-card__hint {
  font-size: 0.75rem;
  color: var(--cream-faint);
}

.dash-chart-box {
  position: relative;
  height: 260px;
}

.dash-chart-box--donut {
  height: 220px;
}

.dash-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--dim);
}

.dash-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dash-dot--ok {
  background: #10b981;
}
.dash-dot--pending {
  background: #f59e0b;
}
.dash-dot--fail {
  background: #ef4444;
}

/* Table */
.dash-table-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(10, 37, 64, 0.04);
  margin-bottom: 1.5rem;
}

.dash-table-card__head {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.dash-table-card__head h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-table-scroll {
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-table thead tr {
  background: var(--bg-soft);
  text-align: left;
}

.dash-table th {
  padding: 0.65rem 1.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.dash-table td {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--cream-dim);
}

.dash-table td.mono {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--cream);
}

.dash-table tbody tr:hover {
  background: var(--bg-soft);
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.dash-badge--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.dash-badge--pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.dash-badge--fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dash-footer-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--cream-faint);
  padding: 0.5rem 0 0;
}

/* ─── Report pagination ───────────────────────────────────────────────── */
.dash-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line, #eef0f5);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dash-pager__info {
  font-size: 0.78rem;
  color: #6b7280;
  font-family: var(--f-body), system-ui, sans-serif;
}

.dash-pager__info strong {
  color: #111827;
  font-weight: 600;
}

.dash-pager__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.dash-pager__nav-btn,
.dash-pager__page {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--f-body), system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dash-pager__nav-btn:hover:not(:disabled),
.dash-pager__page:hover:not(.is-active) {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.dash-pager__nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dash-pager__page.is-active {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.dash-pager__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 2.25rem;
  color: #9ca3af;
  font-size: 0.85rem;
  user-select: none;
}

@media (max-width: 640px) {
  .dash-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-pager__info {
    text-align: center;
  }

  .dash-pager__nav {
    justify-content: center;
  }
}

/* Services grid */
.dash-services-intro {
  margin-bottom: 1.25rem;
  color: var(--cream-dim);
  font-size: 0.9rem;
  max-width: 40rem;
}

.dash-services-intro a {
  color: var(--gold);
  font-weight: 600;
}

.dash-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.dash-svc-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1.25rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.dash-svc-card:hover {
  border-color: var(--line-bright);
  box-shadow: 0 10px 28px rgba(30, 91, 219, 0.12);
  transform: translateY(-3px);
}

.dash-svc-card:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.dash-svc-card:focus:not(:focus-visible) {
  box-shadow: none;
}

.dash-svc-card:focus-visible {
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.dash-svc-card__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.dash-svc-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}

.dash-svc-icon--blue {
  background: rgba(30, 91, 219, 0.1);
}
.dash-svc-icon--purple {
  background: rgba(124, 58, 237, 0.1);
}
.dash-svc-icon--teal {
  background: rgba(15, 185, 138, 0.12);
}
.dash-svc-icon--amber {
  background: rgba(245, 158, 11, 0.12);
}
.dash-svc-icon--rose {
  background: rgba(244, 63, 94, 0.1);
}
.dash-svc-icon--cyan {
  background: rgba(6, 182, 212, 0.12);
}
.dash-svc-icon--indigo {
  background: rgba(79, 70, 229, 0.1);
}
.dash-svc-icon--emerald {
  background: rgba(16, 185, 129, 0.12);
}

.dash-svc-name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cream);
}

.dash-svc-cat {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.dash-svc-desc {
  font-size: 0.8rem;
  color: var(--cream-dim);
  line-height: 1.45;
}

/* Detail panel */
.dash-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.dash-detail__back:hover {
  text-decoration: underline;
}

.dash-detail__card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(10, 37, 64, 0.08);
}

.dash-detail__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.dash-detail__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.dash-detail__cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.15rem;
}

.dash-detail__title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.25;
}

.dash-detail__body {
  padding: 1.35rem 1.5rem 1.5rem;
}

.dash-detail__body p {
  font-size: 0.9rem;
  color: var(--cream-dim);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.dash-detail__body ul {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.dash-detail__body li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--cream-dim);
  margin-bottom: 0.5rem;
}

.dash-detail__body li svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--teal);
}

.dash-detail__intro {
  font-size: 0.9rem;
  color: var(--cream-dim);
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

.dash-svc-form {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.15rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dash-svc-form .dash-field:last-of-type {
  margin-bottom: 0.75rem;
}

.dash-svc-form-msg {
  font-size: 0.82rem;
  color: var(--teal);
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.dash-svc-form-msg[hidden] {
  display: none !important;
}

.dash-svc-form__submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

.dash-detail__extras {
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.dash-detail__extras-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin: 0 0 0.5rem;
}

.dash-detail__extras-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-detail__extras-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--cream-dim);
  margin-bottom: 0.45rem;
}

.dash-detail__extras-list li:last-child {
  margin-bottom: 0;
}

.dash-detail__foot {
  padding: 0 1.5rem 1.5rem;
}

.dash-detail__cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
}

@media (max-width: 900px) {
  .dash-sidebar {
    display: none;
  }

  .dash-mobile-bar {
    display: flex;
  }

  .dash-toolbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dash-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dash-user-name {
    display: none;
  }
}

/* ─── Dashboard home (gateway-style) ─────────────────────────────────── */
.dash-section--home {
  padding-top: 0.5rem;
}

.dash-home {
  max-width: 1200px;
  margin: 0 auto;
}

.dash-home-hero {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  padding: 1.35rem 1.5rem 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.dash-home-hero__title {
  margin: 0;
  font-family: var(--f-body), system-ui, sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.dash-home-hero__sub {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  color: #64748b;
}

.dash-home-balances {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

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

@media (max-width: 640px) {
  .dash-home-balances {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-home-balance {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dash-home-balance__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.dash-home-balance--payin .dash-home-balance__icon {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.dash-home-balance--payout .dash-home-balance__icon {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.dash-home-balance--settle .dash-home-balance__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.dash-home-balance--risk .dash-home-balance__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.dash-home-balance__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.dash-home-balance__value {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.dash-home-reports {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 900px) {
  .dash-home-reports {
    grid-template-columns: 1fr;
  }
}

.dash-home-report {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  padding: 1.15rem 1.25rem 1.35rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.dash-home-report__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.dash-home-report__sub {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.dash-home-report__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.1rem;
}

.dash-home-chip {
  min-width: 2.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.dash-home-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.dash-home-chip.is-active {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.dash-home-report__body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 520px) {
  .dash-home-report__body {
    grid-template-columns: 1fr;
  }
}

.dash-home-report__total {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.dash-home-report__count {
  font-weight: 600;
  color: #64748b;
  font-size: 0.95rem;
}

.dash-home-report__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: #475569;
}

.dash-home-report__list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.dash-home-report__list li:last-child {
  margin-bottom: 0;
}

.dash-home-report__list strong {
  margin-left: auto;
  font-weight: 700;
  color: #0f172a;
}

.dash-home-report__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-home-report__dot--ok {
  background: #22c55e;
}

.dash-home-report__dot--pending {
  background: #3b82f6;
}

.dash-home-report__dot--fail {
  background: #ef4444;
}

.dash-home-report__gauge-wrap {
  text-align: center;
  min-width: 120px;
}

.dash-home-report__ratio-label {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-home-gauge {
  position: relative;
  width: 140px;
  margin: 0 auto;
}

.dash-home-gauge__svg {
  width: 100%;
  height: auto;
  display: block;
}

.dash-home-gauge__track {
  stroke: #e8ecf1;
}

.dash-home-gauge__arc {
  stroke: #22c55e;
  transition: stroke-dashoffset 0.35s ease;
}

.dash-home-gauge__arc--payout {
  stroke: #22c55e;
}

.dash-home-gauge__value {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.dash-home-txn {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.dash-home-txn__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8ecf1;
}

.dash-home-txn__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.dash-home-txn__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.dash-home-txn__tabs button {
  padding: 0.35rem 0.15rem;
  border: none;
  background: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.dash-home-txn__tabs button:hover {
  color: #0f172a;
}

.dash-home-txn__tabs button.is-active {
  color: #b91c1c;
  border-bottom-color: #dc2626;
}

.dash-home-txn__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-home-txn__pane {
  display: none;
  padding: 0.5rem 0 0;
}

.dash-home-txn__pane.is-active {
  display: block;
}

.dash-home-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dash-home-table th,
.dash-home-table td {
  text-align: left;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.dash-home-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #94a3b8;
  background: #fafbfc;
}

.dash-home-table__empty {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem !important;
}

.dash-home-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dash-home-badge--ok {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.dash-home-badge--pending {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.dash-home-badge--fail {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* ─── Developer sections (API credentials, webhooks, docs) ───────────── */
body.portal .dash-dev-root {
  --dash-dev-bg: #f5f8ff;
  --dash-dev-line: #eef0f5;
  --dash-dev-ink: #111827;
  --dash-dev-muted: #6b7280;
  --dash-dev-blue: #1e40af;
  --dash-dev-blue-soft: rgba(30, 64, 175, 0.12);
  font-family: var(--f-body), system-ui, sans-serif;
  background: var(--dash-dev-bg);
  margin: 0 calc(-1 * var(--pad, 1.25rem)) 0;
  padding: 0 var(--pad, 1.25rem) 1.5rem;
  border-radius: 0;
}

body.portal .dash-dev-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 0 0.5rem;
}

body.portal .dash-dev-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

body.portal .dash-dev-toolbar__left,
body.portal .dash-dev-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

body.portal .dash-dev-mode-toggle {
  display: inline-flex;
  padding: 4px;
  background: #f3f6ff;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

body.portal .dash-dev-mode-toggle button {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dash-dev-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}

body.portal .dash-dev-mode-toggle button.is-active {
  background: var(--dash-dev-blue);
  color: #fff;
}

body.portal .dash-dev-mode-toggle button[data-dev-mode="live"].is-active {
  background: #047857;
  color: #fff;
}

body.portal .dash-dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

body.portal .dash-dev-pill--test {
  background: #eff6ff;
  color: #1d4ed8;
}

body.portal .dash-dev-pill--live {
  background: #ecfdf5;
  color: #047857;
}

body.portal .dash-dev-pill--ok {
  background: #ecfdf5;
  color: #047857;
}

body.portal .dash-dev-pill--warn {
  background: #fffbeb;
  color: #b45309;
}

body.portal .dash-dev-pill--bad {
  background: #fef2f2;
  color: #b91c1c;
}

body.portal .dash-dev-pill--info {
  background: #eff6ff;
  color: #1d4ed8;
}

body.portal .dash-dev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

body.portal .dash-dev-btn--sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

body.portal .dash-dev-btn--primary {
  background: var(--dash-dev-blue);
  border-color: var(--dash-dev-blue);
  color: #fff;
}

body.portal .dash-dev-btn--primary:hover {
  background: #172554;
  border-color: #172554;
}

body.portal .dash-dev-btn--soft {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #374151;
}

body.portal .dash-dev-btn--soft:hover {
  background: #e5e7eb;
}

body.portal .dash-dev-btn--danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

body.portal .dash-dev-btn--danger:hover {
  background: #fecaca;
}

body.portal .dash-dev-panel {
  background: #fff;
  border: 1px solid var(--dash-dev-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  margin-bottom: 1.1rem;
}

body.portal .dash-dev-panel--danger {
  border-color: #fecaca;
}

body.portal .dash-dev-panel__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--dash-dev-line);
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f2937;
}

body.portal .dash-dev-panel__head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

body.portal .dash-dev-panel__head--danger {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  color: #b91c1c;
}

body.portal .dash-dev-panel__head small {
  display: block;
  margin-top: 0.2rem;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--dash-dev-muted);
}

body.portal .dash-dev-panel__head--danger small {
  color: #9b1c1c;
}

body.portal .dash-dev-panel__body {
  padding: 1.25rem 1.35rem 1.35rem;
}

body.portal .dash-dev-panel__body--row-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

body.portal .dash-dev-panel__body p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #374151;
  margin: 0 0 0.75rem;
}

body.portal .dash-dev-cred {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: #f9fafb;
  border: 1px solid var(--dash-dev-line);
  border-radius: 12px;
}

body.portal .dash-dev-cred + .dash-dev-cred {
  margin-top: 0.65rem;
}

body.portal .dash-dev-cred__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #1d4ed8;
}

body.portal .dash-dev-cred__icon--amber {
  background: #fef3c7;
  color: #b45309;
}

body.portal .dash-dev-cred__icon--green {
  background: #ecfdf5;
  color: #047857;
}

body.portal .dash-dev-cred__icon--violet {
  background: #f3e8ff;
  color: #7c3aed;
}

body.portal .dash-dev-cred__info {
  flex: 1;
  min-width: 0;
}

body.portal .dash-dev-cred__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--dash-dev-muted);
}

body.portal .dash-dev-cred__value {
  display: block;
  margin-top: 0.25rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--dash-dev-ink);
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.portal .dash-dev-cred__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

body.portal .dash-dev-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

body.portal .dash-dev-icon-btn--sm {
  width: 32px;
  height: 32px;
}

body.portal .dash-dev-icon-btn:hover {
  background: #f3f6ff;
  color: var(--dash-dev-blue);
  border-color: #c7d2fe;
}

body.portal .dash-dev-icon-btn--danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

body.portal .dash-dev-ip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

body.portal .dash-dev-ip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 6px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
}

body.portal .dash-dev-ip-tag button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0 0 2px;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
}

body.portal .dash-dev-ip-tag button:hover {
  opacity: 1;
}

body.portal .dash-dev-hint {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--dash-dev-muted);
}

body.portal .dash-dev-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85em;
}

body.portal .dash-dev-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

body.portal .dash-dev-modal-overlay[hidden] {
  display: none !important;
}

body.portal .dash-dev-modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.22);
}

body.portal .dash-dev-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--dash-dev-line);
}

body.portal .dash-dev-modal__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dash-dev-ink);
}

body.portal .dash-dev-modal__close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--dash-dev-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

body.portal .dash-dev-modal__body {
  padding: 1.25rem;
}

body.portal .dash-dev-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid var(--dash-dev-line);
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
}

body.portal .dash-dev-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dash-dev-muted);
  margin-bottom: 0.35rem;
}

body.portal .dash-dev-input,
body.portal .dash-dev-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  font-size: 0.88rem;
  font-family: inherit;
  box-sizing: border-box;
}

body.portal .dash-dev-input:focus,
body.portal .dash-dev-select:focus {
  outline: none;
  border-color: var(--dash-dev-blue);
  box-shadow: 0 0 0 3px var(--dash-dev-blue-soft);
}

body.portal .dash-dev-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

body.portal .dash-dev-field--full {
  grid-column: 1 / -1;
}

body.portal .dash-dev-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

body.portal .dash-dev-form-actions--solo {
  margin-top: 0.75rem;
}

body.portal .dash-dev-form-msg {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: #047857;
}

body.portal .dash-dev-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

body.portal .dash-dev-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

body.portal .dash-dev-switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #e5e7eb;
  border-radius: 999px;
  transition: 0.25s;
}

body.portal .dash-dev-switch__slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}

body.portal .dash-dev-switch input:checked + .dash-dev-switch__slider {
  background: var(--dash-dev-blue);
}

body.portal .dash-dev-switch input:checked + .dash-dev-switch__slider::before {
  transform: translateX(20px);
}

body.portal .dash-dev-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.65rem;
}

body.portal .dash-dev-event {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

body.portal .dash-dev-event:hover {
  border-color: #c7d2fe;
  background: #f8faff;
}

body.portal .dash-dev-event.is-checked {
  border-color: var(--dash-dev-blue);
  background: #eff6ff;
}

body.portal .dash-dev-event input {
  margin-top: 3px;
  accent-color: var(--dash-dev-blue);
}

body.portal .dash-dev-event b {
  display: block;
  font-size: 0.8rem;
  color: #1f2937;
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

body.portal .dash-dev-event small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--dash-dev-muted);
}

body.portal .dash-dev-code-label {
  font-size: 0.78rem;
  color: var(--dash-dev-muted);
  margin: 0 0 0.35rem;
}

body.portal .dash-dev-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  margin: 0 0 0.65rem;
  white-space: pre-wrap;
  word-break: break-word;
}

body.portal .dash-dev-code-k {
  color: #93c5fd;
}

body.portal .dash-dev-code-s {
  color: #86efac;
}

body.portal .dash-dev-code-n {
  color: #fbbf24;
}

body.portal .dash-dev-deliveries {
  border-top: 1px solid var(--dash-dev-line);
}

body.portal .dash-dev-delivery {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f1f3f7;
}

body.portal .dash-dev-delivery:last-child {
  border-bottom: none;
}

body.portal .dash-dev-delivery__main {
  flex: 1;
  min-width: 0;
}

body.portal .dash-dev-delivery__event {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: #1f2937;
  display: block;
}

body.portal .dash-dev-delivery__meta {
  font-size: 0.72rem;
  color: var(--dash-dev-muted);
}

body.portal .dash-dev-delivery__code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--dash-dev-muted);
  display: none;
}

@media (min-width: 640px) {
  body.portal .dash-dev-delivery__code {
    display: block;
  }
}

body.portal .dash-dev-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  background: #111827;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.82rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: min(360px, calc(100vw - 2rem));
}

body.portal .dash-dev-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.portal .dash-dev-doc-shell {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 0 0.5rem;
}

body.portal .dash-dev-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 0.75rem;
  background: #fff;
  border: 1px solid var(--dash-dev-line);
  border-radius: 14px;
  padding: 0.65rem 0.35rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

body.portal .dash-dev-toc__title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dash-dev-muted);
  padding: 0.25rem 0.65rem 0.5rem;
  font-weight: 700;
}

body.portal .dash-dev-toc a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 0.82rem;
  transition: background 0.15s, color 0.15s;
}

body.portal .dash-dev-toc a:hover {
  background: #f3f6ff;
  color: var(--dash-dev-blue);
}

body.portal .dash-dev-toc a.is-active {
  background: var(--dash-dev-blue);
  color: #fff;
}

body.portal .dash-dev-doc-main {
  flex: 1;
  min-width: 0;
}

body.portal .dash-dev-endpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 0.65rem;
}

body.portal .dash-dev-endpoint code {
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--dash-dev-ink);
  word-break: break-all;
}

body.portal .dash-dev-method {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

body.portal .dash-dev-method--get {
  background: #ecfdf5;
  color: #047857;
}

body.portal .dash-dev-method--post {
  background: #eff6ff;
  color: #1d4ed8;
}

body.portal .dash-dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

body.portal .dash-dev-table th,
body.portal .dash-dev-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #f1f3f7;
  vertical-align: top;
}

body.portal .dash-dev-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dash-dev-muted);
  font-weight: 600;
  background: #f9fafb;
}

body.portal .dash-dev-table code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: #1e40af;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 6px;
}

body.portal .dash-dev-req {
  color: #b91c1c;
  font-size: 0.65rem;
  font-weight: 700;
}

body.portal .dash-dev-opt {
  color: var(--dash-dev-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

body.portal .dash-dev-code-tabs {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: #f3f6ff;
  border: 1px solid var(--dash-dev-line);
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 0.35rem;
}

body.portal .dash-dev-code-tabs button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dash-dev-muted);
  cursor: pointer;
  font-family: inherit;
}

body.portal .dash-dev-code-tabs button.is-active {
  background: var(--dash-dev-blue);
  color: #fff;
}

body.portal .dash-dev-inline-pill {
  margin: 0;
}

@media (max-width: 900px) {
  body.portal .dash-dev-doc-shell {
    flex-direction: column;
  }

  body.portal .dash-dev-toc {
    position: static;
    width: 100%;
    max-height: none;
  }

  body.portal .dash-dev-form-grid {
    grid-template-columns: 1fr;
  }
}
