:root {
  --tblr-font-sans-serif: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --app-page-bg: #f3f5f9;
  --app-panel-bg: rgba(255, 255, 255, 0.82);
  --app-border: rgba(15, 23, 42, 0.08);
  --app-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --app-shadow-strong: 0 28px 60px rgba(15, 23, 42, 0.14);
  --app-sidebar-start: #0b1328;
  --app-sidebar-end: #121f3a;
  --app-brand-accent: #2563eb;
  --app-brand-ink: #0f172a;
  --app-muted: #667085;
  --app-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 22%),
    radial-gradient(circle at left center, rgba(14, 165, 233, 0.08), transparent 24%),
    var(--app-page-bg);
  color: var(--app-brand-ink);
}

.agent-app-body {
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 22%),
    linear-gradient(180deg, #eef4ff 0%, #f8fafc 35%, #eef2f7 100%);
}

.admin-page-shell {
  min-height: 100vh;
}

.page-shell {
  padding-bottom: 2rem;
  transition: opacity 0.24s var(--app-ease), transform 0.24s var(--app-ease);
}

.sidebar-shell {
  background: linear-gradient(180deg, var(--app-sidebar-start) 0%, var(--app-sidebar-end) 100%);
  border-right: 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.24s var(--app-ease), opacity 0.24s var(--app-ease);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-mark {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.28);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.73rem;
}

.sidebar-shell .navbar-nav {
  gap: 0.3rem;
}

.nav-section-label {
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 1rem 0.95rem 0.45rem;
  text-transform: uppercase;
}

.standalone-link,
.child-link,
.nav-group-title {
  border-radius: 0.95rem;
  margin-bottom: 0.3rem;
}

.standalone-link,
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  padding: 0.82rem 0.95rem;
  transition: background-color 0.2s var(--app-ease), color 0.2s var(--app-ease), transform 0.2s var(--app-ease), box-shadow 0.2s var(--app-ease);
}

.standalone-link:hover,
.child-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.standalone-link.active,
.nav-group-title.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(159, 208, 255, 0.08);
}

.nav-group {
  margin-bottom: 0.2rem;
}

.nav-group summary {
  list-style: none;
}

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

.nav-caret {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.52);
  transition: transform 0.2s ease;
}

.nav-group[open] .nav-caret {
  transform: rotate(180deg);
}

.child-link {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 2.5rem;
  padding: 0.62rem 0.85rem;
  transition: background-color 0.2s var(--app-ease), color 0.2s var(--app-ease), transform 0.2s var(--app-ease);
}

.child-link.active {
  background: rgba(37, 99, 235, 0.18);
  color: #fff;
}

.nav-group[open] .child-link {
  animation: navCascade 0.26s var(--app-ease) both;
}

.nav-group[open] .child-link:nth-of-type(2) {
  animation-delay: 0.03s;
}

.nav-group[open] .child-link:nth-of-type(3) {
  animation-delay: 0.06s;
}

.nav-group[open] .child-link:nth-of-type(4) {
  animation-delay: 0.09s;
}

.nav-icon,
.dropdown-icon,
.status-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-footer-card {
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  display: grid;
  gap: 0.35rem;
  transition: transform 0.25s var(--app-ease), background-color 0.25s var(--app-ease);
}

.sidebar-footer-tag {
  font-size: 0.72rem;
  color: #9fd0ff;
}

.top-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 0 0.8rem;
}

.top-user-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--app-border);
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: var(--app-brand-ink);
  transition: transform 0.22s var(--app-ease), box-shadow 0.22s var(--app-ease), background-color 0.22s var(--app-ease);
}

.avatar-soft {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1d4ed8;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-meta strong {
  font-size: 0.95rem;
}

.user-meta small {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.user-chevron {
  color: #94a3b8;
  font-size: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.18);
  font-weight: 600;
  font-size: 0.8rem;
  transition: transform 0.22s var(--app-ease), box-shadow 0.22s var(--app-ease), border-color 0.22s var(--app-ease);
}

.muted-pill {
  background: rgba(255, 255, 255, 0.85);
  color: #475569;
  border-color: var(--app-border);
}

.custom-page-header {
  margin-bottom: 1rem;
}

.page-pretitle {
  color: #2563eb;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-subtitle {
  color: var(--app-muted);
  margin-top: 0.35rem;
}

.glass-card {
  background: var(--app-panel-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  transition: transform 0.24s var(--app-ease), box-shadow 0.24s var(--app-ease), border-color 0.24s var(--app-ease), background-color 0.24s var(--app-ease);
}

.metric-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.metric-icon-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.18));
  color: #1d4ed8;
}

.section-card .card-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.section-card .card-title {
  font-size: 1rem;
  font-weight: 700;
}

.program-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #1d4ed8;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
}

.table-shell thead th {
  color: #475467;
  font-weight: 700;
  background: rgba(248, 250, 252, 0.92);
}

.list-shell-card {
  overflow: hidden;
}

.list-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.7));
}

.list-shell-meta {
  margin-top: 0.25rem;
  color: var(--app-muted);
  font-size: 0.8rem;
}

.table-shell {
  margin-bottom: 0;
}

.table-shell thead th,
.table-shell tbody td {
  padding: 0.95rem 1rem;
  vertical-align: middle;
}

.table-shell tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
  transform: translateX(2px);
}

.table-shell tbody tr {
  transition: background-color 0.2s var(--app-ease), transform 0.2s var(--app-ease);
}

.table-shell tbody tr + tr td {
  border-top-color: rgba(15, 23, 42, 0.06);
}

.table-shell code {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.8rem;
}

.table-identity {
  display: grid;
  gap: 0.18rem;
}

.table-identity strong {
  font-size: 0.92rem;
}

.table-identity .subtle-label {
  line-height: 1.45;
}

.table-summary-line {
  color: var(--app-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.action-cluster {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.empty-state-inline {
  padding: 1rem 0;
  color: var(--app-muted);
}

.subtle-label {
  color: var(--app-muted);
  font-size: 0.8rem;
}

.insight-list,
.quick-grid {
  display: grid;
  gap: 0.85rem;
}

.insight-item,
.quick-link,
.notice-block {
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.quick-link {
  display: block;
  text-decoration: none;
  color: var(--app-brand-ink);
}

.quick-link:hover {
  transform: translateY(-1px);
}

.quick-link strong {
  display: block;
  margin-bottom: 0.25rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 26%),
    #eef2f7;
}

.login-card {
  width: min(440px, 100%);
  border-radius: 1.4rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.3rem 0 0.2rem;
}

.login-subtitle {
  color: var(--app-muted);
  margin-bottom: 1.4rem;
}

.login-footer {
  text-align: center;
  color: var(--app-muted);
  font-size: 0.8rem;
  margin-top: 1rem;
}

.captcha-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.95rem;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.captcha-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.2rem;
  padding: 0.5rem 0.8rem;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.16));
  color: #1d4ed8;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.25em;
}

.captcha-refresh {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.captcha-refresh:hover {
  text-decoration: underline;
}

.form-hint {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.btn-primary-soft {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border: 0;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.25);
}

.btn {
  transition: transform 0.2s var(--app-ease), box-shadow 0.2s var(--app-ease), border-color 0.2s var(--app-ease), background-color 0.2s var(--app-ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.summary-hero {
  padding: 1.45rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.94));
  color: #fff;
  position: relative;
  overflow: hidden;
}

.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
}

.summary-strip h3 {
  margin: 0;
  font-size: 1.15rem;
}

.summary-strip p {
  margin: 0.25rem 0 0;
  color: var(--app-muted);
}

.summary-hero::after {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.24);
}

.summary-hero p,
.summary-hero .subtle-label {
  color: rgba(255, 255, 255, 0.72);
}

.agent-app-shell {
  min-height: 100vh;
  padding: 0.85rem 0.85rem 1.8rem;
}

.agent-app-shell.has-bottom-nav {
  padding-bottom: calc(6.9rem + env(safe-area-inset-bottom));
}

.agent-app-shell.no-bottom-nav {
  padding-bottom: 1.35rem;
}

.agent-app-frame {
  width: min(430px, 100%);
  margin: 0 auto;
}

.agent-app-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0 1rem;
}

.agent-app-top-start {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.agent-app-top.is-detail {
  padding-top: calc(0.1rem + env(safe-area-inset-top));
}

.agent-app-title-group h1 {
  margin: 0.2rem 0 0;
  font-size: 1.6rem;
}

.agent-app-title-group p {
  margin: 0.35rem 0 0;
  color: var(--app-muted);
  font-size: 0.88rem;
}

.agent-app-kicker {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.agent-app-avatar {
  text-decoration: none;
}

.agent-top-back {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  padding: 0.62rem 0.88rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
}

.agent-top-back .agent-back-icon {
  width: 1rem;
  height: 1rem;
}

.agent-top-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.6rem;
  min-height: 2.6rem;
  padding: 0.7rem 1rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #0f172a;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.agent-app-main {
  display: grid;
  gap: 0.95rem;
}

.agent-bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(0.8rem + env(safe-area-inset-bottom));
  z-index: 32;
  width: min(430px, calc(100vw - 1.7rem));
  transform: translateX(-50%);
}

.agent-bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.55rem;
  border-radius: 1.45rem;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.agent-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 3.6rem;
  border-radius: 1rem;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  transition: transform 0.22s var(--app-ease), background-color 0.22s var(--app-ease), color 0.22s var(--app-ease);
}

.agent-bottom-link.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.agent-bottom-link:hover {
  color: #fff;
  transform: translateY(-1px);
}

.agent-bottom-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.agent-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.6rem;
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  color: #fff;
}

.agent-hero-title {
  margin: 0.25rem 0 0;
  font-size: 1.6rem;
  color: #fff;
}

.agent-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.agent-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.agent-hero-chip.live {
  background: rgba(16, 185, 129, 0.16);
  color: #b7f7dc;
}

.agent-hero-chip.muted {
  color: rgba(255, 255, 255, 0.8);
}

.agent-hero-balance {
  min-width: 15rem;
  padding: 1rem 1.15rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}

.agent-hero-balance strong {
  display: block;
  margin: 0.3rem 0 0.45rem;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
}

.agent-hero-balance span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
}

.agent-program-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-program-card {
  padding: 1.05rem 1.1rem;
  border-radius: 1.1rem;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.agent-program-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.95rem;
}

.agent-program-head .badge {
  margin-left: auto;
}

.agent-program-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
}

.agent-program-price-row span {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
}

.agent-program-stock {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.agent-stock-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.agent-stock-chip.available {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.agent-stock-chip.used {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.agent-stock-chip.frozen {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.agent-summary-list {
  display: grid;
  gap: 0.8rem;
}

.agent-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.agent-summary-item span {
  color: var(--app-muted);
  font-size: 0.8rem;
}

.agent-summary-item strong {
  text-align: right;
  line-height: 1.45;
}

.agent-mini-metrics {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.agent-mini-metric {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.04);
}

.agent-mini-metric span {
  display: block;
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-mini-metric strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
}

.agent-shortcut-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-shortcut-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--app-brand-ink);
  text-decoration: none;
  box-shadow: var(--app-shadow);
}

.agent-shortcut-card strong {
  font-size: 0.95rem;
}

.agent-shortcut-card span {
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.agent-shortcut-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: #2563eb;
}

.agent-log-list {
  display: grid;
  gap: 0.8rem;
}

.agent-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.agent-log-item strong {
  display: block;
}

.agent-log-item span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-tab-strip {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.agent-tab-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #475467;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.agent-tab-pill.is-active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.agent-card-list {
  display: grid;
  gap: 0.85rem;
}

.agent-card-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.agent-card-item {
  padding: 1rem 1.05rem;
  border-radius: 1.08rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.agent-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.agent-card-top strong {
  display: block;
}

.agent-card-top span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-card-item code {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  overflow: auto;
}

.agent-card-meta {
  display: grid;
  gap: 0.3rem;
}

.agent-card-meta span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-card-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.agent-card-status {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.agent-card-status.used {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.agent-card-status.unused {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

.agent-card-status.frozen {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.agent-profile-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.agent-profile-head h3 {
  margin: 0 0 0.2rem;
}

.agent-profile-avatar {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1d4ed8;
  font-size: 1.35rem;
  font-weight: 800;
}

.agent-balance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
}

.agent-balance-panel span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
}

.agent-balance-panel strong {
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
}

.agent-balance-panel-compact {
  min-width: 10.25rem;
  margin-bottom: 0;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
}

.agent-mini-stock {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.agent-mini-stock span,
.agent-inline-badge,
.agent-inline-metrics span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 700;
}

.agent-make-list {
  display: grid;
  gap: 0.9rem;
}

.agent-make-item {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border-radius: 1.08rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.agent-make-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.agent-make-ident {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.agent-make-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.agent-make-price-row span {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.74rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.agent-make-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.agent-make-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
}

.agent-make-entry.is-disabled {
  background: rgba(148, 163, 184, 0.22);
  color: #64748b;
  box-shadow: none;
  pointer-events: none;
}

.agent-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.agent-back-icon {
  width: 1rem;
  height: 1rem;
}

.agent-make-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.agent-tab-strip-tight {
  padding-bottom: 0.1rem;
}

.agent-make-card .card-body {
  padding: 1rem;
}

.agent-make-screen {
  --tblr-gutter-y: 0.85rem;
}

.agent-make-shell {
  display: grid;
  gap: 0.85rem;
}

.agent-make-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.agent-make-title-block {
  min-width: 0;
}

.agent-make-title-block h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.agent-make-note {
  display: block;
  margin-top: 0.18rem;
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.agent-balance-chip {
  display: inline-grid;
  justify-items: end;
  gap: 0.14rem;
  padding: 0.62rem 0.85rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(239, 246, 255, 0.98));
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #0f172a;
  white-space: nowrap;
}

.agent-balance-chip span {
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 700;
}

.agent-balance-chip strong {
  font-size: 0.96rem;
  font-weight: 800;
}

.agent-inline-metrics-tight {
  margin-top: 0;
}

.agent-type-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.agent-type-compact {
  position: relative;
  display: block;
  cursor: pointer;
}

.agent-type-compact input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}

.agent-type-body {
  display: grid;
  gap: 0.16rem;
  padding: 0.82rem 0.72rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.22s var(--app-ease), border-color 0.22s var(--app-ease), box-shadow 0.22s var(--app-ease), background 0.22s var(--app-ease);
}

.agent-type-compact:hover .agent-type-body {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.07);
}

.agent-type-compact input:checked + .agent-type-body {
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(248, 250, 252, 0.96));
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.12);
}

.agent-type-compact.is-disabled {
  cursor: not-allowed;
}

.agent-type-compact.is-disabled .agent-type-body {
  opacity: 0.48;
  box-shadow: none;
}

.agent-type-name {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 800;
}

.agent-type-body strong {
  color: #2563eb;
  font-size: 0.84rem;
  font-weight: 800;
}

.agent-make-quantity-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-make-quantity-row label {
  min-width: 4.8rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
}

.agent-make-quantity-row .form-control {
  height: 2.7rem;
  border-radius: 0.92rem;
}

.agent-make-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.agent-make-footer .btn {
  min-height: 2.9rem;
  border-radius: 0.95rem;
  font-weight: 800;
}

.agent-result-card-compact {
  gap: 0.75rem;
  padding: 0.9rem 0.95rem;
}

.agent-make-screen .agent-result-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.agent-picker-grid {
  display: grid;
  gap: 0.85rem;
}

.agent-picker-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  padding: 1rem 1.05rem;
  border-radius: 1.08rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.22s var(--app-ease), border-color 0.22s var(--app-ease), box-shadow 0.22s var(--app-ease);
}

.agent-picker-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.agent-picker-card input {
  margin: 0;
}

.agent-picker-card.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.agent-picker-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.agent-picker-copy strong {
  font-size: 0.96rem;
}

.agent-picker-copy span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-picker-meta {
  display: grid;
  justify-items: end;
  gap: 0.22rem;
}

.agent-picker-meta em {
  font-style: normal;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 800;
}

.agent-picker-meta span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.agent-result-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border-radius: 1.08rem;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(248, 250, 252, 0.94));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.agent-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.agent-result-head strong {
  display: block;
  color: #0f172a;
}

.agent-result-head span {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.agent-result-list {
  display: grid;
  gap: 0.75rem;
}

.agent-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.agent-result-item code {
  display: block;
  flex: 1;
  margin: 0;
  overflow: auto;
}

.capsule-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.capsule {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
}

.capsule strong {
  display: block;
  font-size: 1.1rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-panel {
  height: 100%;
  padding: 1.2rem;
  border-radius: 1.15rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.editor-panel-title {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.filter-shell {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(248, 250, 252, 0.72);
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: #0f172a;
}

.generator-note {
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.generator-note strong {
  display: block;
  margin-bottom: 0.25rem;
}

.program-check-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.program-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

.program-check-item input {
  margin-top: 0.2rem;
}

.program-check-item span {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.program-check-item small {
  color: var(--app-muted);
}

.inline-form {
  margin: 0;
}

.system-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-span-full {
  grid-column: 1 / -1;
}

.config-value-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-value-card {
  padding: 1.1rem 1.15rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.config-value-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #0f172a;
  word-break: break-all;
}

.interface-doc-list {
  display: grid;
  gap: 1rem;
}

.interface-doc-card {
  padding: 1.15rem;
  border-radius: 1.1rem;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.endpoint-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 700;
}

.doc-block {
  height: 100%;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.doc-block-title {
  margin-bottom: 0.8rem;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 700;
}

.integration-snippet {
  margin: 0;
  padding: 1rem;
  border-radius: 0.95rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.return-field-list {
  display: grid;
  gap: 0.7rem;
}

.return-field-item {
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(37, 99, 235, 0.06);
  color: #1e293b;
  line-height: 1.55;
}

.cards-create-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border-radius: 1.35rem;
  margin-bottom: 0.15rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.8));
}

.cards-create-hero h3 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.3rem;
}

.cards-create-hero p {
  margin: 0;
  max-width: 42rem;
  color: var(--app-muted);
}

.cards-create-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.cards-create-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.52rem 0.88rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 0.8rem;
  font-weight: 700;
}

.cards-main-card .card-body,
.cards-side-card .card-body {
  display: grid;
  gap: 1.15rem;
}

.cards-flow-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-flow-item {
  min-height: 100%;
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.cards-flow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.18));
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.82rem;
}

.cards-flow-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.cards-side-stack {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
}

.cards-mini-stat-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards-mini-stat {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.cards-mini-stat strong {
  display: block;
  margin-bottom: 0.2rem;
}

.cards-mini-stat span {
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.motion-item {
  transition:
    opacity 0.42s var(--app-ease),
    transform 0.42s var(--app-ease),
    box-shadow 0.24s var(--app-ease),
    border-color 0.24s var(--app-ease);
  transition-delay: var(--motion-delay, 0ms);
  will-change: transform, opacity;
}

.page-motion:not(.page-ready) .motion-item {
  opacity: 0;
  transform: translateY(16px) scale(0.99);
}

.page-ready .motion-item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.page-ready .glass-card:hover,
.page-ready .summary-strip:hover,
.page-ready .section-card:hover,
.page-ready .metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--app-shadow-strong);
  border-color: rgba(37, 99, 235, 0.12);
}

.page-ready .user-switcher:hover,
.page-ready .status-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.page-leaving .page-shell {
  opacity: 0;
  transform: translateY(14px);
}

.page-leaving .sidebar-shell {
  opacity: 0.92;
  transform: translateX(-8px);
}

@keyframes navCascade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 991px) {
  .top-user-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .capsule-grid {
    grid-template-columns: 1fr;
  }

  .summary-strip,
  .system-grid,
  .config-value-grid,
  .filter-summary {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .program-check-grid,
  .cards-flow-grid,
  .cards-mini-stat-grid,
  .agent-program-grid,
  .agent-mini-metrics,
  .agent-shortcut-grid {
    grid-template-columns: 1fr;
  }

  .cards-create-hero {
    flex-direction: column;
  }

  .cards-create-pills {
    justify-content: flex-start;
  }

  .cards-side-stack {
    position: static;
  }

  .agent-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .agent-hero-balance {
    min-width: 100%;
    text-align: left;
  }

  .agent-make-head,
  .agent-make-actions,
  .agent-make-hero,
  .agent-picker-card,
  .agent-result-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .agent-make-topline {
    align-items: stretch;
  }

  .agent-balance-chip {
    justify-items: start;
  }

  .agent-make-quantity-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.45rem;
  }

  .agent-make-footer {
    grid-template-columns: 1fr 1fr;
  }

  .agent-picker-meta {
    justify-items: start;
  }

  .agent-card-search {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-app-top {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-app-top.is-detail .agent-app-title-group h1 {
    font-size: 1.45rem;
  }

  .agent-top-action {
    align-self: flex-end;
  }
}

@media (max-width: 420px) {
  .agent-top-back {
    padding: 0.58rem 0.76rem;
  }

  .agent-type-compact-grid {
    gap: 0.55rem;
  }

  .agent-type-body {
    padding: 0.74rem 0.6rem;
  }

  .agent-type-name,
  .agent-type-body strong {
    font-size: 0.8rem;
  }

  .agent-make-card .card-body {
    padding: 0.9rem;
  }
}
